diff --git a/.github/workflows/all_plugins.yaml b/.github/workflows/all_plugins.yaml index be0e43bed..e80bdc68f 100644 --- a/.github/workflows/all_plugins.yaml +++ b/.github/workflows/all_plugins.yaml @@ -76,7 +76,7 @@ jobs: name: integration test (iOS) needs: [analyze, test] timeout-minutes: 60 - runs-on: macos-14 + runs-on: macos-15 steps: - uses: actions/checkout@v2 - uses: subosito/flutter-action@v2 @@ -85,6 +85,11 @@ jobs: node-version: 16 cache: 'yarn' cache-dependency-path: example/server/yarn.lock + + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - name: "Install Tools" run: | ./.github/workflows/scripts/install-tools.sh @@ -111,7 +116,7 @@ jobs: - name: "Start iOS Simulator" run: | - xcrun simctl boot "iPhone 15" + xcrun simctl boot "iPhone 16" - name: "Run Flutter Driver tests on iOS" working-directory: example @@ -121,7 +126,7 @@ jobs: name: integration test (Android) needs: [analyze, test] timeout-minutes: 60 - runs-on: macos-13 + runs-on: macos-15 steps: - uses: actions/checkout@v2 - uses: subosito/flutter-action@v2 @@ -167,6 +172,7 @@ jobs: with: api-level: 34 arch: x86_64 + emulator-boot-timeout: 1400 working-directory: example script: | sleep 15; diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 3b13aabdd..86fcf9700 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -67,7 +67,7 @@ flutter { dependencies { implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.0' - implementation 'com.google.android.gms:play-services-wallet:19.1.0' + implementation 'com.google.android.gms:play-services-wallet:19.3.0' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 7c5696400..1dc6cf765 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 13.0 diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ee9916363..bb2e13d61 100644 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,76 @@ { - "originHash" : "aabbe446e7f19cda92d15011128301b59b1b4491e120aff419c0ff1045f1dac7", + "originHash" : "9e24ba2731649292c9d3daddfa9606bb4217ceb617f109e27572972b48d28ce3", "pins" : [ + { + "identity" : "app-check", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/app-check.git", + "state" : { + "revision" : "61b85103a1aeed8218f17c794687781505fbbef5", + "version" : "11.2.0" + } + }, + { + "identity" : "appauth-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/openid/AppAuth-iOS.git", + "state" : { + "revision" : "2781038865a80e2c425a1da12cc1327bcd56501f", + "version" : "1.7.6" + } + }, + { + "identity" : "googlesignin-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleSignIn-iOS.git", + "state" : { + "revision" : "65fb3f1aa6ffbfdc79c4e22178a55cd91561f5e9", + "version" : "8.0.0" + } + }, + { + "identity" : "googleutilities", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GoogleUtilities.git", + "state" : { + "revision" : "60da361632d0de02786f709bdc0c4df340f7613e", + "version" : "8.1.0" + } + }, + { + "identity" : "gtm-session-fetcher", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/gtm-session-fetcher.git", + "state" : { + "revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b", + "version" : "3.5.0" + } + }, + { + "identity" : "gtmappauth", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/GTMAppAuth.git", + "state" : { + "revision" : "5d7d66f647400952b1758b230e019b07c0b4b22a", + "version" : "4.1.1" + } + }, + { + "identity" : "promises", + "kind" : "remoteSourceControl", + "location" : "https://github.com/google/promises.git", + "state" : { + "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", + "version" : "2.4.0" + } + }, { "identity" : "stripe-ios-spm", "kind" : "remoteSourceControl", "location" : "https://github.com/stripe/stripe-ios-spm", "state" : { - "revision" : "f61cacd2da96a72cb0e454e58ed90b12182e5b98", - "version" : "24.7.0" + "revision" : "4f322eb59a7f49a239a36078357c4cac7dac07cd", + "version" : "24.16.1" } } ], diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 32f005fd4..d42c8f158 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -44,6 +44,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> CADisableMinimumFrameDurationOnPhone + CFBundleAllowMixedLocalizations + true CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -39,13 +41,13 @@ LSRequiresIPhoneOS - CFBundleAllowMixedLocalizations - true NSCameraUsageDescription Scan your card to add it automatically NSCameraUsageDescription <string>To scan cards</string> To scan cards + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -65,7 +67,5 @@ UIViewControllerBasedStatusBarAppearance - UIApplicationSupportsIndirectInputEvents - diff --git a/example/lib/screens/regional_payment_methods/sofort_screen.dart b/example/lib/screens/regional_payment_methods/sofort_screen.dart deleted file mode 100644 index 42b5b6d2e..000000000 --- a/example/lib/screens/regional_payment_methods/sofort_screen.dart +++ /dev/null @@ -1,92 +0,0 @@ -import 'dart:convert'; - -import 'package:flutter/material.dart'; -import 'package:flutter_stripe/flutter_stripe.dart'; -import 'package:http/http.dart' as http; -import 'package:stripe_example/widgets/example_scaffold.dart'; -import 'package:stripe_example/widgets/loading_button.dart'; - -import '../../config.dart'; - -class SofortScreen extends StatelessWidget { - const SofortScreen({super.key}); - - Future> _createPaymentIntent() async { - final url = Uri.parse('$kApiUrl/create-payment-intent'); - final response = await http.post( - url, - headers: { - 'Content-Type': 'application/json', - }, - body: json.encode({ - 'currency': 'eur', - 'payment_method_types': ['sofort'], - 'amount': 1099 - }), - ); - - return json.decode(response.body); - } - - Future _pay(BuildContext context) async { - // Precondition: - //Make sure to have set a custom URI scheme in your app and add it to Stripe SDK - // see file main.dart in this example app. - // 1. on the backend create a payment intent for payment method and save the - // client secret. - final scaffoldMessenger = ScaffoldMessenger.of(context); - final result = await _createPaymentIntent(); - final clientSecret = await result['clientSecret']; - - // 2. use the client secret to confirm the payment and handle the result. - try { - await Stripe.instance.confirmPayment( - paymentIntentClientSecret: clientSecret, - data: PaymentMethodParams.sofort( - paymentMethodData: PaymentMethodDataSofort(country: 'de'), - ), - ); - if (context.mounted) { - scaffoldMessenger.showSnackBar( - SnackBar( - content: Text('Payment successfully completed'), - ), - ); - } - } on Exception catch (e) { - if (e is StripeException && context.mounted) { - scaffoldMessenger.showSnackBar( - SnackBar( - content: Text( - 'Error from Stripe: ${e.error.localizedMessage ?? e.error.code}'), - ), - ); - } else { - if (context.mounted) { - scaffoldMessenger.showSnackBar( - SnackBar( - content: Text('Unforeseen error: $e'), - ), - ); - } - } - } - } - - @override - Widget build(BuildContext context) { - return ExampleScaffold( - title: 'Sofort', - tags: ['Payment method'], - padding: EdgeInsets.all(16), - children: [ - LoadingButton( - onPressed: () async { - await _pay(context); - }, - text: 'Pay', - ), - ], - ); - } -} diff --git a/example/lib/screens/screens.dart b/example/lib/screens/screens.dart index aad5d015c..df0bc3d29 100644 --- a/example/lib/screens/screens.dart +++ b/example/lib/screens/screens.dart @@ -17,7 +17,6 @@ import 'package:stripe_example/screens/regional_payment_methods/klarna_screen.da import 'package:stripe_example/screens/regional_payment_methods/p24_screen.dart'; import 'package:stripe_example/screens/regional_payment_methods/paypal_screen.dart'; import 'package:stripe_example/screens/regional_payment_methods/revolutpay_screen.dart'; -import 'package:stripe_example/screens/regional_payment_methods/sofort_screen.dart'; import 'package:stripe_example/screens/regional_payment_methods/us_bank_account_direct_debit_screen.dart'; import 'package:stripe_example/screens/regional_payment_methods/us_bank_account_screen.dart'; import 'package:stripe_example/screens/setup_future_payments/setup_future_payments_screen.dart'; @@ -291,12 +290,6 @@ class Example extends StatelessWidget { ), builder: (context) => IdealScreen(), ), - Example( - title: 'Sofort', - leading: SizedBox(), - builder: (context) => SofortScreen(), - platformsSupported: [DevicePlatform.android, DevicePlatform.ios], - ), Example( title: 'Aubecs', builder: (context) => AubecsExample(), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ea246ad31..c43c5339c 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 publish_to: "none" environment: - sdk: ">=3.3.0 <4.0.0" + sdk: ">=3.8.1 <4.0.0" flutter: ">=3.0.0" dependencies: @@ -12,7 +12,7 @@ dependencies: sdk: flutter flutter_stripe: ^10.2.0 flutter_stripe_web: ^5.1.0 - pay: ^2.0.0 + pay: ^3.2.1 http: ^1.1.0 font_awesome_flutter: ^10.6.0 platform: ^3.0.0 diff --git a/packages/stripe/lib/src/widgets/adress_sheet.dart b/packages/stripe/lib/src/widgets/adress_sheet.dart index 5583748d0..a30fff58a 100644 --- a/packages/stripe/lib/src/widgets/adress_sheet.dart +++ b/packages/stripe/lib/src/widgets/adress_sheet.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; @@ -55,16 +57,22 @@ class _AddressSheetState extends State<_AddressSheet> { _methodChannel = MethodChannel('flutter.stripe/address_sheet/$viewId'); _methodChannel?.setMethodCallHandler((call) async { if (call.method == 'onSubmitAction') { - final tmp = Map.from(call.arguments as Map); - final tmpAdress = Map.from(tmp['address'] as Map); + try { + final tmp = + Map.from(call.arguments as Map)['result']; + final tmpAdress = Map.from(tmp['address'] as Map); - widget.onSubmit( - CollectAddressResult( - address: Address.fromJson(tmpAdress), - name: tmp['name'] as String, - phoneNumber: tmp['phone'] as String?, - ), - ); + widget.onSubmit( + CollectAddressResult( + address: Address.fromJson(tmpAdress), + name: tmp['name'] as String, + phoneNumber: tmp['phone'] as String?, + ), + ); + } catch (e) { + log('An error ocurred while while parsing card arguments, this should not happen, please consider creating an issue at https://github.com/flutter-stripe/flutter_stripe/issues/new'); + rethrow; + } } else if (call.method == 'onErrorAction') { final tmp = Map.from(call.arguments as Map); final foo = Map.from(tmp['error'] as Map); diff --git a/packages/stripe/lib/src/widgets/card_field.dart b/packages/stripe/lib/src/widgets/card_field.dart index 967da18ad..05826ceb2 100644 --- a/packages/stripe/lib/src/widgets/card_field.dart +++ b/packages/stripe/lib/src/widgets/card_field.dart @@ -125,8 +125,10 @@ class CardField extends StatefulWidget { } class _CardFieldState extends State { - final FocusNode _node = - FocusNode(debugLabel: 'CardField', descendantsAreFocusable: false); + final FocusNode _node = FocusNode( + debugLabel: 'CardField', + descendantsAreFocusable: false, + ); CardEditController? _fallbackContoller; CardEditController get controller { @@ -219,10 +221,7 @@ class _CardFieldState extends State { baseStyle: widget.style, child: KeepVisibleOnFocus( focusNode: _node, - child: SizedBox( - height: cardHeight, - child: platform, - ), + child: SizedBox(height: cardHeight, child: platform), ), ); } @@ -234,7 +233,8 @@ class _CardFieldState extends State { } CardStyle effectiveCardStyle(InputDecoration decoration) { - final fontSize = widget.style?.fontSize?.toInt() ?? + final fontSize = + widget.style?.fontSize?.toInt() ?? Theme.of(context).textTheme.titleMedium?.fontSize?.toInt() ?? kCardFieldDefaultFontSize; @@ -302,11 +302,11 @@ class _MethodChannelCardField extends StatefulWidget { this.dangerouslyUpdateFullCardDetails = false, this.onBehalfOf, this.autofocus = false, - }) : assert(constraints == null || constraints.debugAssertIsValid()), - constraints = (width != null || height != null) - ? constraints?.tighten(width: width, height: height) ?? - BoxConstraints.tightFor(width: width, height: height) - : constraints; + }) : assert(constraints == null || constraints.debugAssertIsValid()), + constraints = (width != null || height != null) + ? constraints?.tighten(width: width, height: height) ?? + BoxConstraints.tightFor(width: width, height: height) + : constraints; final BoxConstraints? constraints; final CardFocusCallback? onFocus; @@ -352,12 +352,14 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> borderColor: Colors.transparent, borderRadius: 0, cursorColor: theme.textSelectionTheme.cursorColor ?? theme.primaryColor, - textColor: style?.textColor ?? + textColor: + style?.textColor ?? baseTextStyle?.color ?? kCardFieldDefaultTextColor, fontSize: baseTextStyle?.fontSize?.toInt() ?? kCardFieldDefaultFontSize, // fontFamily: baseTextStyle?.fontFamily ?? kCardFieldDefaultFontFamily, - textErrorColor: theme.inputDecorationTheme.errorStyle?.color ?? + textErrorColor: + theme.inputDecorationTheme.errorStyle?.color ?? theme.colorScheme.error, placeholderColor: theme.inputDecorationTheme.hintStyle?.color ?? theme.hintColor, @@ -381,8 +383,10 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> if (!widget.dangerouslyUpdateFullCardDetails) { if (kDebugMode && controller.details != const CardFieldInputDetails(complete: false)) { - dev.log('WARNING! Initial card data value has been ignored. \n' - '$kDebugPCIMessage'); + dev.log( + 'WARNING! Initial card data value has been ignored. \n' + '$kDebugPCIMessage', + ); } ambiguate(WidgetsBinding.instance)?.addPostFrameCallback((timeStamp) { updateCardDetails( @@ -414,8 +418,9 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> 'countryCode': widget.countryCode, if (widget.onBehalfOf != null) 'onBehalfOf': widget.onBehalfOf, if (widget.preferredNetworks != null) - 'preferredNetworks': - widget.preferredNetworks?.map((e) => e.brandValue).toList(), + 'preferredNetworks': widget.preferredNetworks + ?.map((e) => e.brandValue) + .toList(), 'dangerouslyGetFullCardDetails': widget.dangerouslyGetFullCardDetails, if (widget.dangerouslyUpdateFullCardDetails && controller.initalDetails != null) @@ -456,13 +461,11 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> } else { throw UnsupportedError('Unsupported platform view'); } - final constraints = widget.constraints ?? + final constraints = + widget.constraints ?? const BoxConstraints.expand(height: kCardFieldDefaultHeight); - return ConstrainedBox( - constraints: constraints, - child: platform, - ); + return ConstrainedBox(constraints: constraints, child: platform); } @override @@ -481,8 +484,10 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> @override void didUpdateWidget(covariant _MethodChannelCardField oldWidget) { if (widget.controller != oldWidget.controller) { - assert(!controller.hasCardField, - 'CardEditController is already attached to a CardView'); + assert( + !controller.hasCardField, + 'CardEditController is already attached to a CardView', + ); detachController(oldWidget.controller); attachController(oldWidget.controller); } @@ -533,22 +538,25 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> }); } - void _handleCardChanged(arguments) { + void _handleCardChanged(dynamic arguments) { try { final map = Map.from(arguments); - final details = CardFieldInputDetails.fromJson(map); - updateCardDetails(details, controller); - widget.onCardChanged?.call(details); + final update = CardFieldInputDetails.fromJson( + Map.from(map['card']), + ); + updateCardDetails(update, controller); + widget.onCardChanged?.call(update); // ignore: avoid_catches_without_on_clauses } catch (e) { dev.log( - 'An error ocurred while while parsing card arguments, this should not happen, please consider creating an issue at https://github.com/flutter-stripe/flutter_stripe/issues/new'); + 'An error ocurred while while parsing card arguments, this should not happen, please consider creating an issue at https://github.com/flutter-stripe/flutter_stripe/issues/new', + ); rethrow; } } /// Handler called when a field from the platform card field has been focused - void _handlePlatformFocusChanged(arguments) { + void _handlePlatformFocusChanged(dynamic arguments) { try { final map = Map.from(arguments); final field = CardFieldFocusName.fromJson(map); @@ -563,7 +571,8 @@ class _MethodChannelCardFieldState extends State<_MethodChannelCardField> // ignore: avoid_catches_without_on_clauses } catch (e) { dev.log( - 'An error ocurred while while parsing card arguments, this should not happen, please consider creating an issue at https://github.com/flutter-stripe/flutter_stripe/issues/new'); + 'An error ocurred while while parsing card arguments, this should not happen, please consider creating an issue at https://github.com/flutter-stripe/flutter_stripe/issues/new', + ); rethrow; } } @@ -636,9 +645,10 @@ class _AndroidCardField extends StatelessWidget { return PlatformViewLink( viewType: viewType, surfaceFactory: (context, controller) => AndroidViewSurface( - controller: controller - // ignore: avoid_as - as AndroidViewController, + controller: + controller + // ignore: avoid_as + as AndroidViewController, gestureRecognizers: const >{}, hitTestBehavior: PlatformViewHitTestBehavior.opaque, ), @@ -647,28 +657,28 @@ class _AndroidCardField extends StatelessWidget { switch (androidPlatformViewRenderType) { case AndroidPlatformViewRenderType.expensiveAndroidView: return PlatformViewsService.initExpensiveAndroidView( - id: params.id, - viewType: viewType, - layoutDirection: Directionality.of(context), - creationParams: creationParams, - creationParamsCodec: const StandardMessageCodec(), - onFocus: () { - params.onFocusChanged(true); - }, - ) + id: params.id, + viewType: viewType, + layoutDirection: Directionality.of(context), + creationParams: creationParams, + creationParamsCodec: const StandardMessageCodec(), + onFocus: () { + params.onFocusChanged(true); + }, + ) ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated) ..create(); case AndroidPlatformViewRenderType.androidView: return PlatformViewsService.initAndroidView( - id: params.id, - viewType: viewType, - layoutDirection: Directionality.of(context), - creationParams: creationParams, - creationParamsCodec: const StandardMessageCodec(), - onFocus: () { - params.onFocusChanged(true); - }, - ) + id: params.id, + viewType: viewType, + layoutDirection: Directionality.of(context), + creationParams: creationParams, + creationParamsCodec: const StandardMessageCodec(), + onFocus: () { + params.onFocusChanged(true); + }, + ) ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated) ..create(); } diff --git a/packages/stripe/lib/src/widgets/card_form_field.dart b/packages/stripe/lib/src/widgets/card_form_field.dart index f04660b40..f543add87 100644 --- a/packages/stripe/lib/src/widgets/card_form_field.dart +++ b/packages/stripe/lib/src/widgets/card_form_field.dart @@ -437,7 +437,7 @@ class _MethodChannelCardFormFieldState }); } - void _handleCardChanged(arguments) { + void _handleCardChanged(dynamic arguments) { try { final map = Map.from(arguments); if (map.isEmpty) { @@ -445,7 +445,8 @@ class _MethodChannelCardFormFieldState controller._updateDetails(details); widget.onCardChanged?.call(details); } else { - final details = CardFieldInputDetails.fromJson(map); + final details = CardFieldInputDetails.fromJson( + Map.from(map['card'])); controller._updateDetails(details); widget.onCardChanged?.call(details); } @@ -457,7 +458,7 @@ class _MethodChannelCardFormFieldState } /// Handler called when a field from the platform card field has been focused - void _handlePlatformFocusChanged(arguments) { + void _handlePlatformFocusChanged(dynamic arguments) { try { final map = Map.from(arguments); final field = CardFieldFocusName.fromJson(map); diff --git a/packages/stripe/pubspec.yaml b/packages/stripe/pubspec.yaml index 913f62032..659598d49 100644 --- a/packages/stripe/pubspec.yaml +++ b/packages/stripe/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/flutter-stripe/flutter_stripe repository: https://github.com/flutter-stripe/flutter_stripe environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.8.1 <4.0.0" flutter: ">=3.0.0" flutter: @@ -28,4 +28,4 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ^6.0.0 diff --git a/packages/stripe_android/.gitignore b/packages/stripe_android/.gitignore index e9dc58d3d..8a6b3c6f4 100644 --- a/packages/stripe_android/.gitignore +++ b/packages/stripe_android/.gitignore @@ -5,3 +5,5 @@ .pub/ build/ +# Exception: Allow specific ReactBuildConfig.java file +!android/src/main/kotlin/com/facebook/react/common/build/ReactBuildConfig.java diff --git a/packages/stripe_android/android/.gitignore b/packages/stripe_android/android/.gitignore index 7921cd4d1..73a12dc8c 100644 --- a/packages/stripe_android/android/.gitignore +++ b/packages/stripe_android/android/.gitignore @@ -1,2 +1,5 @@ local.properties .idea + +# Ignore all files in build directory except ReactBuildConfig.java +!src/main/kotlin/com/facebook/react/common/build/ReactBuildConfig.java diff --git a/packages/stripe_android/android/build.gradle b/packages/stripe_android/android/build.gradle index aa8895434..625babc3c 100644 --- a/packages/stripe_android/android/build.gradle +++ b/packages/stripe_android/android/build.gradle @@ -3,7 +3,7 @@ version '1.0-SNAPSHOT' buildscript { ext.kotlin_version = '1.8.0' - ext.stripe_version = '21.6.+' + ext.stripe_version = '21.19.+' repositories { google() diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/proguard/annotations/DoNotStrip.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/proguard/annotations/DoNotStrip.java new file mode 100644 index 000000000..25992936e --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/proguard/annotations/DoNotStrip.java @@ -0,0 +1,4 @@ +package com.facebook.proguard.annotations; + +public @interface DoNotStrip { +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/ReactActivity.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/ReactActivity.kt new file mode 100644 index 000000000..498b26772 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/ReactActivity.kt @@ -0,0 +1,10 @@ +package com.facebook.react + +import android.app.Activity + +open class ReactActivity: Activity() { + + open fun getMainComponentName(): String? { + TODO("Not yet implemented") + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/Dynamic.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/Dynamic.java new file mode 100644 index 000000000..f913a63cb --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/Dynamic.java @@ -0,0 +1,15 @@ +package com.facebook.react.bridge; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; + +public class Dynamic extends HashMap { + + public final ReadableType type = ReadableType.Map; + + public ReadableMap asMap() { + return new ReadableMap(this); + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/DynamicFromObject.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/DynamicFromObject.kt new file mode 100644 index 000000000..0d312c791 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/DynamicFromObject.kt @@ -0,0 +1,47 @@ +package com.facebook.react.bridge + +class DynamicFromObject(val value: Any?): Dynamic() { + + fun recycle() { + } + + fun isNull(): Boolean { + return this.value == null + } + + fun asBoolean(): Boolean { + return value as Boolean + } + + fun asDouble(): Double { + return value as Double + } + + fun asInt(): Int { + return (value as Double).toInt() + } + + fun asString(): String? { + return value as String? + } + + fun asArray(): ReadableArray? { + return value as ReadableArray? + } + + override fun asMap(): ReadableMap? { + return value as ReadableMap? + } + + fun getType(): ReadableType { + return when { + this.isNull() -> ReadableType.Null + value is Boolean -> ReadableType.Boolean + value is Number -> ReadableType.Number + value is String -> ReadableType.String + value is ReadableMap -> ReadableType.Map + value is ReadableArray -> ReadableType.Array + else -> ReadableType.Null + } + } +} \ No newline at end of file diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableArray.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableArray.java index 4d97f3336..026e1fd7c 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableArray.java +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableArray.java @@ -8,6 +8,7 @@ import java.lang.reflect.Array; import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * Created by FFuF, Jonas Bark on 2019-10-02. @@ -47,4 +48,29 @@ public ArrayList toArrayList() { } return arrayList; } + + @Override + public int size() { + return super.size(); + } + + @NotNull + public ReadableType getType(int i) { + final Object value = get(i); + if (value instanceof Boolean) { + return ReadableType.Boolean; + } else if (value instanceof Iterable) { + return ReadableType.Array; + } else if (value instanceof JSONArray) { + return ReadableType.Array; + } else if (value instanceof Number) { + return ReadableType.Number; + } else if (value instanceof Map || (value instanceof JSONObject)) { + return ReadableType.Map; + } else if (value instanceof String) { + return ReadableType.String; + } else { + return ReadableType.Null; + } + } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java index 8d7e308e8..94344574f 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/bridge/ReadableMap.java @@ -18,7 +18,7 @@ /** * Created by FFuF, Jonas Bark on 2019-10-02. */ -public class ReadableMap extends HashMap implements Map { +public class ReadableMap extends Dynamic implements Map { private JSONObject map; @@ -34,6 +34,12 @@ public ReadableMap(Map map) { } + @Override + public String toString() { + return "ReadableMap{" + + "map=" + map + + '}'; + } public boolean hasKey(String key) { return map.opt(key) != null && !map.isNull(key); diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/common/build/ReactBuildConfig.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/common/build/ReactBuildConfig.java new file mode 100644 index 000000000..e2a75b21f --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/common/build/ReactBuildConfig.java @@ -0,0 +1,21 @@ +package com.facebook.react.common.build; + +//import com.stripe.android.BuildConfig; + +import com.stripe.android.BuildConfig; + +/* + * FalconMetrics SDK + * + * © 2025 FalconMetrics LLC. All rights reserved. + * + * This file is part of the FalconMetrics SDK and is licensed under the + * FalconMetrics SDK License Addendum. + * + * Use of this file is subject to the FalconMetrics Terms of Use and SDK License, + * available at: https://www.falconmetrics.io/terms + */ +public class ReactBuildConfig { + public static final boolean DEBUG = BuildConfig.DEBUG; + public static final boolean IS_INTERNAL_BUILD = false; +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/modules/core/DeviceEventManagerModule.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/modules/core/DeviceEventManagerModule.java index d86c5f732..71d900081 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/modules/core/DeviceEventManagerModule.java +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/modules/core/DeviceEventManagerModule.java @@ -3,6 +3,7 @@ import android.os.Handler; import android.os.Looper; +import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableMap; import io.flutter.plugin.common.MethodChannel; @@ -17,7 +18,7 @@ public RCTDeviceEventEmitter(MethodChannel channel) { this.channel = channel; } - public void emit(String eventName, WritableMap params) { + public void emit(String eventName, ReadableMap params) { uiThreadHandler.post(() -> channel.invokeMethod(eventName, params)); } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/turbomodule/core/interfaces/TurboModule.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/turbomodule/core/interfaces/TurboModule.java new file mode 100644 index 000000000..aa4803481 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/turbomodule/core/interfaces/TurboModule.java @@ -0,0 +1,4 @@ +package com.facebook.react.turbomodule.core.interfaces; + +public interface TurboModule { +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/BaseViewManager.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/BaseViewManager.kt new file mode 100644 index 000000000..ee24dde18 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/BaseViewManager.kt @@ -0,0 +1,9 @@ +package com.facebook.react.uimanager + +import android.view.View + +open class BaseViewManager { + open fun needsCustomLayoutForChildren(): Boolean { + TODO("Not yet implemented") + } +} \ No newline at end of file diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/BaseViewManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/BaseViewManagerDelegate.java new file mode 100644 index 000000000..e12a38db6 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/BaseViewManagerDelegate.java @@ -0,0 +1,22 @@ +package com.facebook.react.uimanager; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.viewmanagers.AuBECSDebitFormManagerInterface; + +public abstract class BaseViewManagerDelegate extends ViewManagerDelegate { + public final U mViewManager; + + public BaseViewManagerDelegate(U viewManager) { + this.mViewManager = viewManager; + } + + public void setProperty(T view, String propName, @Nullable Object value) {} + + public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) { + + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/LayoutShadowNode.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/LayoutShadowNode.kt new file mode 100644 index 000000000..230e93bbb --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/LayoutShadowNode.kt @@ -0,0 +1,4 @@ +package com.facebook.react.uimanager + +class LayoutShadowNode { +} \ No newline at end of file diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/SimpleViewManager.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/SimpleViewManager.java index 96cc08de6..b54456c54 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/SimpleViewManager.java +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/SimpleViewManager.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.Map; -public abstract class SimpleViewManager { +public abstract class SimpleViewManager extends BaseViewManager { public abstract String getName(); @@ -24,4 +24,8 @@ public Map getExportedCustomDirectEventTypeConstants() { public void receiveCommand(T root, String commandId, ReadableArray args) {} public void onAfterUpdateTransaction(@NonNull T view) {} + + public ViewManagerDelegate getDelegate() { + return null; + } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/UIManagerModule.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/UIManagerModule.kt index b1f961953..c49fb9540 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/UIManagerModule.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/UIManagerModule.kt @@ -1,5 +1,6 @@ package com.facebook.react.uimanager +import com.facebook.react.bridge.ReadableMap import com.facebook.react.uimanager.events.Event import com.facebook.react.uimanager.events.EventDispatcher import com.facebook.react.uimanager.events.RCTEventEmitter @@ -13,5 +14,13 @@ class UIManagerModule(channel: MethodChannel) { override fun dispatchEvent(event: Event<*>) { event.dispatch(rctInstance) } + + override fun invoke(name: String, value: ReadableMap) { + rctInstance.receiveEvent(name, name, value) + } + + override fun invoke(name: String) { + rctInstance.receiveEvent(name, name, null) + } } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewGroupManager.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewGroupManager.kt new file mode 100644 index 000000000..ed3a2ae38 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewGroupManager.kt @@ -0,0 +1,8 @@ +package com.facebook.react.uimanager + +import android.view.View +import com.reactnativestripesdk.StripeAbstractComposeView + +abstract class ViewGroupManager: SimpleViewManager() { + +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewManagerDelegate.java new file mode 100644 index 000000000..8a1849b02 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewManagerDelegate.java @@ -0,0 +1,6 @@ +package com.facebook.react.uimanager; + +import android.view.View; + +public class ViewManagerDelegate { +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewManagerWithGeneratedInterface.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewManagerWithGeneratedInterface.kt new file mode 100644 index 000000000..b7e2cae87 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/ViewManagerWithGeneratedInterface.kt @@ -0,0 +1,9 @@ +package com.facebook.react.uimanager + +import android.view.View +import com.facebook.react.viewmanagers.CardFormManagerDelegate +import com.reactnativestripesdk.CardFormView +import com.reactnativestripesdk.CardFormViewManager + +interface ViewManagerWithGeneratedInterface { +} \ No newline at end of file diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/EventDispatcher.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/EventDispatcher.kt index b11607b2b..ea8fc4e07 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/EventDispatcher.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/EventDispatcher.kt @@ -1,5 +1,9 @@ package com.facebook.react.uimanager.events +import com.facebook.react.bridge.ReadableMap + interface EventDispatcher { fun dispatchEvent(event: Event<*>) + fun invoke(name: String, value: ReadableMap) + fun invoke(name: String) } diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/RCTEventEmitter.kt b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/RCTEventEmitter.kt index f0e260a8b..f66738cc2 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/RCTEventEmitter.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/uimanager/events/RCTEventEmitter.kt @@ -1,11 +1,12 @@ package com.facebook.react.uimanager.events +import com.facebook.react.bridge.ReadableMap import com.facebook.react.bridge.WritableMap import io.flutter.plugin.common.MethodChannel class RCTEventEmitter(private val channel: MethodChannel) { - fun receiveEvent(viewTag: Any, eventName: String, serializeEventData: WritableMap?) { + fun receiveEvent(viewTag: Any, eventName: String, serializeEventData: ReadableMap?) { channel.invokeMethod(eventName, serializeEventData) } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddToWalletButtonManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddToWalletButtonManagerDelegate.java new file mode 100644 index 000000000..46e1e32c3 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddToWalletButtonManagerDelegate.java @@ -0,0 +1,51 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.DynamicFromObject; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class AddToWalletButtonManagerDelegate & AddToWalletButtonManagerInterface> extends BaseViewManagerDelegate { + public AddToWalletButtonManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "iOSButtonStyle": + mViewManager.setIOSButtonStyle(view, value == null ? "onDarkBackground" : (String) value); + break; + case "androidAssetSource": + mViewManager.setAndroidAssetSource(view, (ReadableMap) value); + break; + case "testEnv": + mViewManager.setTestEnv(view, value == null ? false : (boolean) value); + break; + case "cardDetails": + mViewManager.setCardDetails(view, new DynamicFromObject(value)); + break; + case "token": + mViewManager.setToken(view, new DynamicFromObject(value)); + break; + case "ephemeralKey": + mViewManager.setEphemeralKey(view, new DynamicFromObject(value)); + break; + default: + super.setProperty(view, propName, value); + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddToWalletButtonManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddToWalletButtonManagerInterface.java new file mode 100644 index 000000000..a23fafb26 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddToWalletButtonManagerInterface.java @@ -0,0 +1,27 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.Dynamic; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface AddToWalletButtonManagerInterface extends ViewManagerWithGeneratedInterface { + void setIOSButtonStyle(T view, @Nullable String value); + void setAndroidAssetSource(T view, @Nullable ReadableMap value); + void setTestEnv(T view, boolean value); + void setCardDetails(T view, Dynamic value); + void setToken(T view, Dynamic value); + void setEphemeralKey(T view, Dynamic value); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddressSheetViewManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddressSheetViewManagerDelegate.java new file mode 100644 index 000000000..cf95919d6 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddressSheetViewManagerDelegate.java @@ -0,0 +1,66 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.DynamicFromObject; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class AddressSheetViewManagerDelegate & AddressSheetViewManagerInterface> extends BaseViewManagerDelegate { + public AddressSheetViewManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "visible": + mViewManager.setVisible(view, value == null ? false : (boolean) value); + break; + case "presentationStyle": + mViewManager.setPresentationStyle(view, value == null ? "popover" : (String) value); + break; + case "animationStyle": + mViewManager.setAnimationStyle(view, value == null ? "slide" : (String) value); + break; + case "appearance": + mViewManager.setAppearance(view, new DynamicFromObject(value)); + break; + case "defaultValues": + mViewManager.setDefaultValues(view, new DynamicFromObject(value)); + break; + case "additionalFields": + mViewManager.setAdditionalFields(view, new DynamicFromObject(value)); + break; + case "allowedCountries": + mViewManager.setAllowedCountries(view, (ReadableArray) value); + break; + case "autocompleteCountries": + mViewManager.setAutocompleteCountries(view, (ReadableArray) value); + break; + case "primaryButtonTitle": + mViewManager.setPrimaryButtonTitle(view, value == null ? null : (String) value); + break; + case "sheetTitle": + mViewManager.setSheetTitle(view, value == null ? null : (String) value); + break; + case "googlePlacesApiKey": + mViewManager.setGooglePlacesApiKey(view, value == null ? null : (String) value); + break; + default: + super.setProperty(view, propName, value); + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddressSheetViewManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddressSheetViewManagerInterface.java new file mode 100644 index 000000000..605eb0e6a --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AddressSheetViewManagerInterface.java @@ -0,0 +1,32 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.Dynamic; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface AddressSheetViewManagerInterface extends ViewManagerWithGeneratedInterface { + void setVisible(T view, boolean value); + void setPresentationStyle(T view, @Nullable String value); + void setAnimationStyle(T view, @Nullable String value); + void setAppearance(T view, Dynamic value); + void setDefaultValues(T view, Dynamic value); + void setAdditionalFields(T view, Dynamic value); + void setAllowedCountries(T view, @Nullable ReadableArray value); + void setAutocompleteCountries(T view, @Nullable ReadableArray value); + void setPrimaryButtonTitle(T view, @Nullable String value); + void setSheetTitle(T view, @Nullable String value); + void setGooglePlacesApiKey(T view, @Nullable String value); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/ApplePayButtonManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/ApplePayButtonManagerDelegate.java new file mode 100644 index 000000000..f982369b0 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/ApplePayButtonManagerDelegate.java @@ -0,0 +1,43 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class ApplePayButtonManagerDelegate & ApplePayButtonManagerInterface> extends BaseViewManagerDelegate { + public ApplePayButtonManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "disabled": + mViewManager.setDisabled(view, value == null ? false : (boolean) value); + break; + case "type": + mViewManager.setType(view, value == null ? 0 : ((Double) value).intValue()); + break; + case "buttonStyle": + mViewManager.setButtonStyle(view, value == null ? 0 : ((Double) value).intValue()); + break; + case "borderRadius": + mViewManager.setBorderRadius(view, value == null ? 4 : ((Double) value).intValue()); + break; + default: + super.setProperty(view, propName, value); + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/ApplePayButtonManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/ApplePayButtonManagerInterface.java new file mode 100644 index 000000000..dd68d5f1e --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/ApplePayButtonManagerInterface.java @@ -0,0 +1,21 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface ApplePayButtonManagerInterface extends ViewManagerWithGeneratedInterface { + void setDisabled(T view, boolean value); + void setType(T view, int value); + void setButtonStyle(T view, int value); + void setBorderRadius(T view, int value); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AuBECSDebitFormManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AuBECSDebitFormManagerDelegate.java new file mode 100644 index 000000000..dfe67ba84 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AuBECSDebitFormManagerDelegate.java @@ -0,0 +1,38 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.DynamicFromObject; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class AuBECSDebitFormManagerDelegate & AuBECSDebitFormManagerInterface> extends BaseViewManagerDelegate { + public AuBECSDebitFormManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "companyName": + mViewManager.setCompanyName(view, value == null ? null : (String) value); + break; + case "formStyle": + mViewManager.setFormStyle(view, new DynamicFromObject(value)); + break; + default: + super.setProperty(view, propName, value); + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AuBECSDebitFormManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AuBECSDebitFormManagerInterface.java new file mode 100644 index 000000000..362ec06b2 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/AuBECSDebitFormManagerInterface.java @@ -0,0 +1,22 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.Dynamic; +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface AuBECSDebitFormManagerInterface extends ViewManagerWithGeneratedInterface { + void setCompanyName(T view, @Nullable String value); + void setFormStyle(T view, Dynamic value); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFieldManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFieldManagerDelegate.java new file mode 100644 index 000000000..44a7f1e99 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFieldManagerDelegate.java @@ -0,0 +1,76 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.DynamicFromObject; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; +import com.facebook.react.uimanager.SimpleViewManager; + +public class CardFieldManagerDelegate & CardFieldManagerInterface> extends BaseViewManagerDelegate { + public CardFieldManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "autofocus": + mViewManager.setAutofocus(view, value == null ? false : (boolean) value); + break; + case "cardStyle": + mViewManager.setCardStyle(view, new DynamicFromObject(value)); + break; + case "countryCode": + mViewManager.setCountryCode(view, value == null ? null : (String) value); + break; + case "dangerouslyGetFullCardDetails": + mViewManager.setDangerouslyGetFullCardDetails(view, value == null ? false : (boolean) value); + break; + case "disabled": + mViewManager.setDisabled(view, value == null ? false : (boolean) value); + break; + case "onBehalfOf": + mViewManager.setOnBehalfOf(view, value == null ? null : (String) value); + break; + case "placeholders": + mViewManager.setPlaceholders(view, new DynamicFromObject(value)); + break; + case "postalCodeEnabled": + mViewManager.setPostalCodeEnabled(view, value == null ? false : (boolean) value); + break; + case "preferredNetworks": + mViewManager.setPreferredNetworks(view, (ReadableArray) value); + break; + default: + super.setProperty(view, propName, value); + } + } + + @Override + public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) { + switch (commandName) { + case "blur": + mViewManager.blur(view); + break; + case "focus": + mViewManager.focus(view); + break; + case "clear": + mViewManager.clear(view); + break; + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFieldManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFieldManagerInterface.java new file mode 100644 index 000000000..467e024bb --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFieldManagerInterface.java @@ -0,0 +1,33 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.Dynamic; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface CardFieldManagerInterface extends ViewManagerWithGeneratedInterface { + void setAutofocus(T view, boolean value); + void setCardStyle(T view, Dynamic value); + void setCountryCode(T view, @Nullable String value); + void setDangerouslyGetFullCardDetails(T view, boolean value); + void setDisabled(T view, boolean value); + void setOnBehalfOf(T view, @Nullable String value); + void setPlaceholders(T view, Dynamic value); + void setPostalCodeEnabled(T view, boolean value); + void setPreferredNetworks(T view, @Nullable ReadableArray value); + void blur(T view); + void focus(T view); + void clear(T view); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFormManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFormManagerDelegate.java new file mode 100644 index 000000000..0b0e161a3 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFormManagerDelegate.java @@ -0,0 +1,69 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.DynamicFromObject; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class CardFormManagerDelegate & CardFormManagerInterface> extends BaseViewManagerDelegate { + public CardFormManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "autofocus": + mViewManager.setAutofocus(view, value == null ? false : (boolean) value); + break; + case "cardStyle": + mViewManager.setCardStyle(view, new DynamicFromObject(value)); + break; + case "dangerouslyGetFullCardDetails": + mViewManager.setDangerouslyGetFullCardDetails(view, value == null ? false : (boolean) value); + break; + case "defaultValues": + mViewManager.setDefaultValues(view, new DynamicFromObject(value)); + break; + case "disabled": + mViewManager.setDisabled(view, value == null ? false : (boolean) value); + break; + case "placeholders": + mViewManager.setPlaceholders(view, new DynamicFromObject(value)); + break; + case "postalCodeEnabled": + mViewManager.setPostalCodeEnabled(view, value == null ? false : (boolean) value); + break; + case "preferredNetworks": + mViewManager.setPreferredNetworks(view, (ReadableArray) value); + break; + default: + super.setProperty(view, propName, value); + } + } + + @Override + public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) { + switch (commandName) { + case "blur": + mViewManager.blur(view); + break; + case "focus": + mViewManager.focus(view); + break; + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFormManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFormManagerInterface.java new file mode 100644 index 000000000..d841f1803 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/CardFormManagerInterface.java @@ -0,0 +1,31 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.Dynamic; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface CardFormManagerInterface extends ViewManagerWithGeneratedInterface { + void setAutofocus(T view, boolean value); + void setCardStyle(T view, Dynamic value); + void setDangerouslyGetFullCardDetails(T view, boolean value); + void setDefaultValues(T view, Dynamic value); + void setDisabled(T view, boolean value); + void setPlaceholders(T view, Dynamic value); + void setPostalCodeEnabled(T view, boolean value); + void setPreferredNetworks(T view, @Nullable ReadableArray value); + void blur(T view); + void focus(T view); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java new file mode 100644 index 000000000..142c7c1eb --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java @@ -0,0 +1,51 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.bridge.DynamicFromObject; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class EmbeddedPaymentElementViewManagerDelegate & EmbeddedPaymentElementViewManagerInterface> extends BaseViewManagerDelegate { + public EmbeddedPaymentElementViewManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "configuration": + mViewManager.setConfiguration(view, new DynamicFromObject(value)); + break; + case "intentConfiguration": + mViewManager.setIntentConfiguration(view, new DynamicFromObject(value)); + break; + default: + super.setProperty(view, propName, value); + } + } + + @Override + public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) { + switch (commandName) { + case "confirm": + mViewManager.confirm(view); + break; + case "clearPaymentOption": + mViewManager.clearPaymentOption(view); + break; + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java new file mode 100644 index 000000000..d29f8fa29 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java @@ -0,0 +1,22 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import com.facebook.react.bridge.Dynamic; +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface EmbeddedPaymentElementViewManagerInterface extends ViewManagerWithGeneratedInterface { + void setConfiguration(T view, Dynamic value); + void setIntentConfiguration(T view, Dynamic value); + void confirm(T view); + void clearPaymentOption(T view); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/GooglePayButtonManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/GooglePayButtonManagerDelegate.java new file mode 100644 index 000000000..96f7de580 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/GooglePayButtonManagerDelegate.java @@ -0,0 +1,40 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class GooglePayButtonManagerDelegate & GooglePayButtonManagerInterface> extends BaseViewManagerDelegate { + public GooglePayButtonManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "type": + mViewManager.setType(view, value == null ? -1 : ((Double) value).intValue()); + break; + case "appearance": + mViewManager.setAppearance(view, value == null ? 0 : ((Double) value).intValue()); + break; + case "borderRadius": + mViewManager.setBorderRadius(view, value == null ? 0 : ((Double) value).intValue()); + break; + default: + super.setProperty(view, propName, value); + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/GooglePayButtonManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/GooglePayButtonManagerInterface.java new file mode 100644 index 000000000..783b55704 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/GooglePayButtonManagerInterface.java @@ -0,0 +1,20 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface GooglePayButtonManagerInterface extends ViewManagerWithGeneratedInterface { + void setType(T view, int value); + void setAppearance(T view, int value); + void setBorderRadius(T view, int value); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/StripeContainerManagerDelegate.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/StripeContainerManagerDelegate.java new file mode 100644 index 000000000..9585b287a --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/StripeContainerManagerDelegate.java @@ -0,0 +1,34 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaDelegate.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import androidx.annotation.Nullable; + +import com.facebook.react.uimanager.BaseViewManager; +import com.facebook.react.uimanager.BaseViewManagerDelegate; +import com.facebook.react.uimanager.LayoutShadowNode; + +public class StripeContainerManagerDelegate & StripeContainerManagerInterface> extends BaseViewManagerDelegate { + public StripeContainerManagerDelegate(U viewManager) { + super(viewManager); + } + @Override + public void setProperty(T view, String propName, @Nullable Object value) { + switch (propName) { + case "keyboardShouldPersistTaps": + mViewManager.setKeyboardShouldPersistTaps(view, value == null ? false : (boolean) value); + break; + default: + super.setProperty(view, propName, value); + } + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/StripeContainerManagerInterface.java b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/StripeContainerManagerInterface.java new file mode 100644 index 000000000..c517b7d8c --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/facebook/react/viewmanagers/StripeContainerManagerInterface.java @@ -0,0 +1,18 @@ +/** +* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). +* +* Do not edit this file as changes may cause incorrect behavior and will be lost +* once the code is regenerated. +* +* @generated by codegen project: GeneratePropsJavaInterface.js +*/ + +package com.facebook.react.viewmanagers; + +import android.view.View; + +import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface; + +public interface StripeContainerManagerInterface extends ViewManagerWithGeneratedInterface { + void setKeyboardShouldPersistTaps(T view, boolean value); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddToWalletPlatformView.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddToWalletPlatformView.kt index c38040f4c..aebab861c 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddToWalletPlatformView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddToWalletPlatformView.kt @@ -34,17 +34,11 @@ class StripeAddToWalletPlatformView( channel.setMethodCallHandler(this) - if (creationParams?.containsKey("androidAssetSource") == true) { - viewManager.source( + creationParams.convertToReadables()?.forEach { entry -> + viewManager.getDelegate().setProperty( nativeView, - ReadableMap(creationParams["androidAssetSource"] as Map) - ) - } - - if (creationParams?.containsKey("cardDetails") == true) { - viewManager.cardDetails( - nativeView, - ReadableMap(creationParams["cardDetails"] as Map) + entry.key, + entry.value, ) } diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddressSheetPlatformView.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddressSheetPlatformView.kt index d08a51e67..2efa59bb5 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddressSheetPlatformView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAddressSheetPlatformView.kt @@ -24,59 +24,21 @@ class StripeAddressSheetPlatformView( private val themedContext = ThemedReactContext(sdkAccessor().reactContext, channel, sdkAccessor) - lateinit var addressSheetView: AddressSheetView + var addressSheetView: AddressSheetView init { addressSheetView = addressSheetManager.createViewInstance(themedContext) channel.setMethodCallHandler(this) - if (creationParams?.containsKey("visible") == true) { - addressSheetManager.setVisible(addressSheetView, creationParams?.containsKey("visible") as Boolean) - } - - if (creationParams?.containsKey("appearance") == true) { - addressSheetManager.setAppearance( - addressSheetView, ReadableMap(creationParams["appearance"] as Map) - ) - } - - if (creationParams?.containsKey("defaultValues") == true) { - addressSheetManager.setDefaultValues( - addressSheetView, ReadableMap(creationParams["defaultValues"] as Map) - ) - } - - if (creationParams?.containsKey("additionalFields") == true) { - addressSheetManager.setAdditionalFields( - addressSheetView, ReadableMap(creationParams["additionalFields"] as Map) - ) - } - - if (creationParams?.containsKey("allowedCountries") == true) { - addressSheetManager.setAllowedCountries( - addressSheetView, ReadableArray(creationParams["allowedCountries"] as List) + creationParams?.convertToReadables()?.forEach { entry -> + addressSheetManager.getDelegate().setProperty( + addressSheetView, + entry.key, + entry.value, ) } - if (creationParams?.containsKey("autocompleteCountries") == true) { - addressSheetManager.setAllowedCountries( - addressSheetView, ReadableArray(creationParams["autocompleteCountries"] as List) - ) - } - - if (creationParams?.containsKey("primaryButtonTitle") == true) { - addressSheetManager.setPrimaryButtonTitle(addressSheetView, creationParams?.containsKey("primaryButtonTitle") as String) - } - - if (creationParams?.containsKey("sheetTitle") == true) { - addressSheetManager.setPrimaryButtonTitle(addressSheetView, creationParams?.containsKey("sheetTitle") as String) - } - - if (creationParams?.containsKey("googlePlacesApiKey") == true) { - addressSheetManager.setPrimaryButtonTitle(addressSheetView, creationParams?.containsKey("googlePlacesApiKey") as String) - } - } override fun getView(): View? { diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAndroidPlugin.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAndroidPlugin.kt index 9fe3edf67..5d3f9fc8a 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAndroidPlugin.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAndroidPlugin.kt @@ -57,7 +57,7 @@ class StripeAndroidPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { AddressSheetViewManager() } - override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(flutterPluginBinding.applicationContext) channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter.stripe/payments", JSONMethodCodec.INSTANCE) @@ -80,7 +80,7 @@ class StripeAndroidPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { flutterPluginBinding.platformViewRegistry.registerViewFactory("flutter.stripe/address_sheet", StripeAddressSheetPlatformViewFactory(flutterPluginBinding, addressSheetFormViewManager ){stripeSdk}) } - override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { + override fun onMethodCall(call: MethodCall, result: Result) { if (initializationError != null || !this::stripeSdk.isInitialized) { result.error( "flutter_stripe initialization failed", @@ -116,10 +116,12 @@ If you continue to have trouble, follow this discussion to get some support http ) "handleNextAction" -> stripeSdk.handleNextAction( paymentIntentClientSecret = call.requiredArgument("paymentIntentClientSecret"), + returnUrl = call.optionalArgument("returnUrl"), promise = Promise(result) ) "handleNextActionForSetup" -> stripeSdk.handleNextActionForSetup( setupIntentClientSecret = call.requiredArgument("setupIntentClientSecret"), + returnUrl = call.optionalArgument("returnUrl"), promise = Promise(result) ) @@ -181,10 +183,12 @@ If you continue to have trouble, follow this discussion to get some support http ) "collectBankAccountToken" -> stripeSdk.collectBankAccountToken( clientSecret = call.requiredArgument("clientSecret"), + params = call.requiredArgument("params"), promise = Promise(result) ) "collectFinancialConnectionsAccounts" -> stripeSdk.collectFinancialConnectionsAccounts( clientSecret = call.requiredArgument("clientSecret"), + params = call.requiredArgument("params"), promise = Promise(result) ) "resetPaymentSheetCustomer" -> stripeSdk.resetPaymentSheetCustomer( @@ -194,6 +198,10 @@ If you continue to have trouble, follow this discussion to get some support http params = call.requiredArgument("params"), promise = Promise(result) ) + "onCustomPaymentMethodConfirmHandlerCallback"-> stripeSdk.customPaymentMethodResultCallback( + result = call.requiredArgument("result"), + promise = Promise(result) + ) "createPlatformPayPaymentMethod" -> stripeSdk.createPlatformPayPaymentMethod( params = call.requiredArgument("params"), usesDeprecatedTokenFlow = call.requiredArgument("usesDeprecatedTokenFlow"), @@ -210,11 +218,11 @@ If you continue to have trouble, follow this discussion to get some support http promise = Promise(result) ) "addListener" -> { - stripeSdk.addListener(eventName = call.requiredArgument("eventName")) + //stripeSdk.addListener(eventName = call.requiredArgument("eventName")) result.success("OK") } "removeListener" -> { - stripeSdk.removeListeners(count = call.requiredArgument("count")) + //stripeSdk.removeListeners(count = call.requiredArgument("count")) result.success("OK") } "initCustomerSheet" -> { diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAubecsDebitPlatformView.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAubecsDebitPlatformView.kt index cc2e6070d..d47af075e 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAubecsDebitPlatformView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeAubecsDebitPlatformView.kt @@ -34,20 +34,13 @@ class StripeAubecsDebitPlatformView( channel.setMethodCallHandler(this) - if (creationParams?.containsKey("formStyle") == true) { - aubecsFormViewManager.setFormStyle( + creationParams.convertToReadables()?.forEach { entry -> + aubecsFormViewManager.getDelegate().setProperty( aubecsView, - ReadableMap(creationParams["formStyle"] as Map) + entry.key, + entry.value, ) } - - if (creationParams?.containsKey("companyName") == true) { - aubecsFormViewManager.setCompanyName( - aubecsView, - creationParams["companyName"] as String - ) - } - } override fun getView(): View { @@ -63,17 +56,13 @@ class StripeAubecsDebitPlatformView( } override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { - when (call.method) { - "onStyleChanged" -> { - val arguments = ReadableMap(call.arguments as Map) - aubecsFormViewManager.setFormStyle( - aubecsView, - arguments.getMap("formStyle") as ReadableMap - ) - result.success(null) - } - } + aubecsFormViewManager.delegate.setProperty( + aubecsView, + call.method, + call.arguments.convertToReadable() + ) + result.success(null) } diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt index ad2773378..54f639e74 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardFormPlatformView.kt @@ -36,26 +36,12 @@ class StripeSdkCardFormPlatformView( init { channel.setMethodCallHandler(this) - if (creationParams?.containsKey("cardStyle") == true) { - cardFormViewManager.setCardStyle(cardView, ReadableMap(creationParams["cardStyle"] as Map)) - } - if (creationParams?.containsKey("defaultValues") == true) { - cardFormViewManager.setDefaultValues(cardView, ReadableMap(creationParams["defaultValues"] as Map)) - } - if (creationParams?.containsKey("postalCodeEnabled") == true) { - cardFormViewManager.setPostalCodeEnabled(cardView, creationParams["postalCodeEnabled"] as Boolean) - } - if (creationParams?.containsKey("dangerouslyGetFullCardDetails") == true) { - cardFormViewManager.setDangerouslyGetFullCardDetails(cardView, creationParams["dangerouslyGetFullCardDetails"] as Boolean) - } - if (creationParams?.containsKey("autofocus") == true) { - cardFormViewManager.setAutofocus(cardView, creationParams["autofocus"] as Boolean) - } - if (creationParams?.containsKey("disabled") == true) { - cardFormViewManager.setDisabled(cardView, creationParams["disabled"] as Boolean) - } - if (creationParams?.containsKey("preferredNetworks") == true) { - cardFormViewManager.setPreferredNetworks(cardView, ReadableArray(creationParams["preferredNetworks"] as List)) + creationParams.convertToReadables()?.forEach { entry -> + cardFormViewManager.getDelegate().setProperty( + cardView, + entry.key, + entry.value, + ) } if (creationParams?.containsKey("cardDetails") == true) { val value = ReadableMap(creationParams["cardDetails"] as Map) @@ -90,31 +76,6 @@ class StripeSdkCardFormPlatformView( override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: MethodChannel.Result) { when (call.method) { - "onStyleChanged" -> { - val arguments = ReadableMap(call.arguments as Map) - cardFormViewManager.setCardStyle(cardView, arguments.getMap("cardStyle") as ReadableMap) - result.success(null) - } - "onPostalCodeEnabledChanged" -> { - val arguments = ReadableMap(call.arguments as Map) - cardFormViewManager.setPostalCodeEnabled(cardView, arguments.getBoolean("postalCodeEnabled")) - result.success(null) - } - "dangerouslyGetFullCardDetails" -> { - val arguments = ReadableMap(call.arguments as Map) - cardFormViewManager.setDangerouslyGetFullCardDetails(cardView, arguments.getBoolean("dangerouslyGetFullCardDetails")) - result.success(null) - } - "autofocus" -> { - val arguments = ReadableMap(call.arguments as Map) - cardFormViewManager.setAutofocus(cardView, arguments.getBoolean("autofocus")) - result.success(null) - } - "disabled" -> { - val arguments = ReadableMap(call.arguments as Map) - cardFormViewManager.setDisabled(cardView, arguments.getBoolean("disabled")) - result.success(null) - } "requestFocus" -> { val binding = StripeCardMultilineWidgetBinding.bind(cardView.cardForm) binding.etCardNumber.requestFocus() @@ -131,6 +92,14 @@ class StripeSdkCardFormPlatformView( result.success(null) } "focus", "blur", "clear" -> cardFormViewManager.receiveCommand(cardView, call.method, null) + else -> { + cardFormViewManager.delegate.setProperty( + cardView, + call.method, + call.arguments.convertToReadable(), + ) + result.success(null) + } } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt index 20fb31cbe..dc9c5f03d 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformView.kt @@ -32,32 +32,13 @@ class StripeSdkCardPlatformView( init { channel.setMethodCallHandler(this) - if (creationParams?.containsKey("cardStyle") == true) { - stripeSdkCardViewManager.setCardStyle(cardView, ReadableMap(creationParams["cardStyle"] as Map)) - } - if (creationParams?.containsKey("postalCodeEnabled") == true) { - stripeSdkCardViewManager.setPostalCodeEnabled(cardView, creationParams["postalCodeEnabled"] as Boolean) - } - if (creationParams?.containsKey("onBehalfOf") == true){ - stripeSdkCardViewManager.setOnBehalfOf(cardView, creationParams["onBehalfOf"] as String) - } - if (creationParams?.containsKey("countryCode") == true) { - stripeSdkCardViewManager.setCountryCode(cardView, creationParams["countryCode"] as? String) - } - if (creationParams?.containsKey("placeholder") == true) { - stripeSdkCardViewManager.setPlaceHolders(cardView, ReadableMap(creationParams["placeholder"] as Map)) - } - if (creationParams?.containsKey("disabled") == true) { - stripeSdkCardViewManager.setDisabled(cardView, creationParams["disabled"] as Boolean) - } - if (creationParams?.containsKey("preferredNetworks") == true) { - stripeSdkCardViewManager.setPreferredNetworks(cardView, ReadableArray(creationParams["preferredNetworks"] as List)) - } - if (creationParams?.containsKey("dangerouslyGetFullCardDetails") == true) { - stripeSdkCardViewManager.setDangerouslyGetFullCardDetails(cardView, creationParams["dangerouslyGetFullCardDetails"] as Boolean) - } - if (creationParams?.containsKey("autofocus") == true) { - stripeSdkCardViewManager.setAutofocus(cardView, creationParams["autofocus"] as Boolean) + + creationParams?.convertToReadables()?.forEach { entry -> + stripeSdkCardViewManager.getDelegate().setProperty( + cardView, + entry.key, + entry.value, + ) } if (creationParams?.containsKey("cardDetails") == true) { val value = ReadableMap(creationParams["cardDetails"] as Map) @@ -95,44 +76,9 @@ class StripeSdkCardPlatformView( } } - override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: MethodChannel.Result) { + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { when (call.method) { - "onStyleChanged" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setCardStyle(cardView, arguments.getMap("cardStyle") as ReadableMap) - result.success(null) - } - "onPlaceholderChanged" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setPlaceHolders(cardView, arguments.getMap("placeholder") as ReadableMap ) - result.success(null) - } - "onPostalCodeEnabledChanged" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setPostalCodeEnabled(cardView, arguments.getBoolean("postalCodeEnabled")) - result.success(null) - } - "onCountryCodeChangedEvent" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setCountryCode(cardView, arguments.getString("countryCode")) - result.success(null) - } - "dangerouslyGetFullCardDetails" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setDangerouslyGetFullCardDetails(cardView, arguments.getBoolean("dangerouslyGetFullCardDetails")) - result.success(null) - } - "autofocus" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setAutofocus(cardView, arguments.getBoolean("autofocus")) - result.success(null) - } - "disabled" -> { - val arguments = ReadableMap(call.arguments as Map) - stripeSdkCardViewManager.setDisabled(cardView, arguments.getBoolean("disabled")) - result.success(null) - } "requestFocus" -> { val binding = StripeCardInputWidgetBinding.bind(cardView.mCardWidget) binding.cardNumberEditText.requestFocus() @@ -149,6 +95,13 @@ class StripeSdkCardPlatformView( result.success(null) } "focus", "blur", "clear" -> stripeSdkCardViewManager.receiveCommand(cardView, call.method, null) + else -> { + stripeSdkCardViewManager.delegate.setProperty( + cardView, + call.method, + call.arguments.convertToReadable() + ) + } } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformViewFactory.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformViewFactory.kt index 5ebd824cb..c8b8db060 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformViewFactory.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkCardPlatformViewFactory.kt @@ -1,6 +1,8 @@ package com.flutter.stripe import android.content.Context +import com.facebook.react.bridge.ReadableArray +import com.facebook.react.bridge.ReadableMap import com.reactnativestripesdk.CardFieldViewManager import com.reactnativestripesdk.StripeSdkModule import io.flutter.embedding.engine.plugins.FlutterPlugin @@ -23,4 +25,4 @@ class StripeSdkCardPlatformViewFactory( } return StripeSdkCardPlatformView(context, channel, viewId, creationParams, stripeSdkCardViewManager, sdkAccessor) } -} +} \ No newline at end of file diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkGooglePayButtonPlatformView.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkGooglePayButtonPlatformView.kt index b8d4c3e39..12122a5ce 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkGooglePayButtonPlatformView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkGooglePayButtonPlatformView.kt @@ -28,14 +28,12 @@ class StripeSdkGooglePayButtonPlatformView( ) init { - if (creationParams?.containsKey("type") == true) { - googlePayButtonManager.type(payButton, creationParams["type"] as Int) - } - if (creationParams?.containsKey("appearance") == true) { - googlePayButtonManager.appearance(payButton, creationParams["appearance"] as Int) - } - if (creationParams?.containsKey("borderRadius") == true) { - googlePayButtonManager.borderRadius(payButton, creationParams["borderRadius"] as Int) + creationParams.convertToReadables()?.forEach { + googlePayButtonManager.getDelegate().setProperty( + payButton, + it.key, + it.value, + ) } payButton.initialize() } diff --git a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkModuleExtensions.kt b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkModuleExtensions.kt index 2546b46b6..b0cae0f3b 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkModuleExtensions.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/flutter/stripe/StripeSdkModuleExtensions.kt @@ -3,6 +3,8 @@ package com.flutter.stripe import android.content.Intent import androidx.fragment.app.FragmentActivity import com.facebook.react.bridge.Promise +import com.facebook.react.bridge.ReadableArray +import com.facebook.react.bridge.ReadableMap import com.reactnativestripesdk.StripeSdkModule import com.reactnativestripesdk.utils.createMissingActivityError @@ -30,4 +32,26 @@ internal val FragmentActivity?.activityResultRegistry: Dispatcher internal class Dispatcher { fun dispatchResult(requestCode: Int, resultCode: Int, data: Intent?) {} -} \ No newline at end of file +} + + +fun Map?.convertToReadables(): Map? { + return this?.mapValues { + it.value?.convertToReadable() + }?.toMap() +} + +fun Any.convertToReadable(): Any { + return when (this) { + is Map<*, *> -> ReadableMap((this as Map).convertToReadables()) + is List<*> -> ReadableArray(this.map { item -> + when (item) { + is Map<*, *> -> ReadableMap((item as Map).convertToReadables()) + is List<*> -> ReadableArray(item.map { it }) + else -> item + } + }) + + else -> this + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt index b70ca6586..b4c704b1d 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt @@ -1,15 +1,24 @@ package com.reactnativestripesdk -import com.facebook.react.bridge.ReadableMap +import com.facebook.react.bridge.Dynamic import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.SimpleViewManager import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.AuBECSDebitFormManagerDelegate +import com.facebook.react.viewmanagers.AuBECSDebitFormManagerInterface +import com.reactnativestripesdk.utils.asMapOrNull @ReactModule(name = AuBECSDebitFormViewManager.REACT_CLASS) -class AuBECSDebitFormViewManager : SimpleViewManager() { +class AuBECSDebitFormViewManager : + SimpleViewManager(), + AuBECSDebitFormManagerInterface { + private val delegate = AuBECSDebitFormManagerDelegate(this) + override fun getName() = REACT_CLASS + override fun getDelegate() = delegate + override fun getExportedCustomDirectEventTypeConstants(): MutableMap = mutableMapOf( FormCompleteEvent.EVENT_NAME to @@ -17,7 +26,7 @@ class AuBECSDebitFormViewManager : SimpleViewManager() { ) @ReactProp(name = "companyName") - fun setCompanyName( + override fun setCompanyName( view: AuBECSDebitFormView, name: String?, ) { @@ -25,11 +34,11 @@ class AuBECSDebitFormViewManager : SimpleViewManager() { } @ReactProp(name = "formStyle") - fun setFormStyle( + override fun setFormStyle( view: AuBECSDebitFormView, - style: ReadableMap, + style: Dynamic, ) { - view.setFormStyle(style) + view.setFormStyle(style.asMapOrNull()) } override fun createViewInstance(reactContext: ThemedReactContext): AuBECSDebitFormView = AuBECSDebitFormView(reactContext) diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardChangeEvent.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardChangeEvent.kt new file mode 100644 index 000000000..2097a8c63 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardChangeEvent.kt @@ -0,0 +1,56 @@ +package com.reactnativestripesdk + +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.WritableMap +import com.facebook.react.uimanager.events.Event + +internal class CardChangeEvent( + surfaceId: Int, + viewTag: Int, + private val cardDetails: MutableMap, + private val postalCodeEnabled: Boolean, + private val complete: Boolean, + private val dangerouslyGetFullCardDetails: Boolean, +) : Event(surfaceId, viewTag) { + override fun getEventName(): String = EVENT_NAME + + override fun getEventData(): WritableMap? { + val cardData = Arguments.createMap() + cardData.putString("brand", cardDetails["brand"]?.toString()) + cardData.putString("last4", cardDetails["last4"]?.toString()) + + (cardDetails["expiryMonth"] as Int?)?.let { + cardData.putInt("expiryMonth", it) + } ?: run { + cardData.putNull("expiryMonth") + } + + (cardDetails["expiryYear"] as Int?)?.let { + cardData.putInt("expiryYear", it) + } ?: run { + cardData.putNull("expiryYear") + } + + cardData.putBoolean("complete", complete) + cardData.putString("validNumber", cardDetails["validNumber"]?.toString()) + cardData.putString("validCVC", cardDetails["validCVC"]?.toString()) + cardData.putString("validExpiryDate", cardDetails["validExpiryDate"]?.toString()) + + if (postalCodeEnabled) { + cardData.putString("postalCode", cardDetails["postalCode"]?.toString()) + } + + if (dangerouslyGetFullCardDetails) { + cardData.putString("number", cardDetails["number"]?.toString()?.replace(" ", "")) + cardData.putString("cvc", cardDetails["cvc"]?.toString()) + } + + return Arguments.createMap().apply { + putMap("card", cardData) + } + } + + companion object { + const val EVENT_NAME = "topCardChange" + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldView.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldView.kt index a9fd8b4ee..b185500da 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldView.kt @@ -39,7 +39,7 @@ import com.stripe.android.view.StripeEditText class CardFieldView( private val context: ThemedReactContext, ) : FrameLayout(context) { - internal var mCardWidget: CardInputWidget = CardInputWidget(context) + var mCardWidget: CardInputWidget = CardInputWidget(context) private val cardInputWidgetBinding = StripeCardInputWidgetBinding.bind(mCardWidget) val cardDetails: MutableMap = mutableMapOf( @@ -99,10 +99,10 @@ class CardFieldView( private fun onChangeFocus() { UIManagerHelper .getEventDispatcherForReactTag(context, id) - ?.dispatchEvent(CardFocusEvent(context.surfaceId, id, currentFocusedField)) + ?.dispatchEvent(CardFocusChangeEvent(context.surfaceId, id, currentFocusedField)) } - fun setCardStyle(value: ReadableMap) { + fun setCardStyle(value: ReadableMap?) { val borderWidth = getIntOrNull(value, "borderWidth") val backgroundColor = getValOr(value, "backgroundColor", null) val borderColor = getValOr(value, "borderColor", null) @@ -206,7 +206,7 @@ class CardFieldView( } } - fun setPlaceHolders(value: ReadableMap) { + fun setPlaceHolders(value: ReadableMap?) { val numberPlaceholder = getValOr(value, "number", null) val expirationPlaceholder = getValOr(value, "expiration", null) val cvcPlaceholder = getValOr(value, "cvc", null) @@ -295,7 +295,7 @@ class CardFieldView( UIManagerHelper .getEventDispatcherForReactTag(context, id) ?.dispatchEvent( - CardChangedEvent( + CardChangeEvent( context.surfaceId, id, cardDetails, diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt index 0e8cd39b7..aea0db2dd 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFieldViewManager.kt @@ -1,70 +1,86 @@ package com.reactnativestripesdk +import com.facebook.react.bridge.Dynamic import com.facebook.react.bridge.ReadableArray -import com.facebook.react.bridge.ReadableMap import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.SimpleViewManager import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.CardFieldManagerDelegate +import com.facebook.react.viewmanagers.CardFieldManagerInterface +import com.reactnativestripesdk.utils.asMapOrNull @ReactModule(name = CardFieldViewManager.REACT_CLASS) -class CardFieldViewManager : SimpleViewManager() { +class CardFieldViewManager : + SimpleViewManager(), + CardFieldManagerInterface { + private val delegate = CardFieldManagerDelegate(this) + var reactContextRef: ThemedReactContext? = null + override fun getName() = REACT_CLASS - internal var reactContextRef: ThemedReactContext? = null + override fun getDelegate() = delegate override fun getExportedCustomDirectEventTypeConstants() = mutableMapOf( - CardFocusEvent.EVENT_NAME to mutableMapOf("registrationName" to "onFocusChange"), - CardChangedEvent.EVENT_NAME to mutableMapOf("registrationName" to "onCardChange"), + CardFocusChangeEvent.EVENT_NAME to mutableMapOf("registrationName" to "onFocusChange"), + CardChangeEvent.EVENT_NAME to mutableMapOf("registrationName" to "onCardChange"), ) - override fun receiveCommand( - root: CardFieldView, - commandId: String?, - args: ReadableArray?, - ) { - when (commandId) { - "focus" -> root.requestFocusFromJS() - "blur" -> root.requestBlurFromJS() - "clear" -> root.requestClearFromJS() - } + override fun createViewInstance(reactContext: ThemedReactContext): CardFieldView { + val stripeSdkModule: StripeSdkModule? = + reactContext.getNativeModule(StripeSdkModule::class.java) + val view = CardFieldView(reactContext) + + reactContextRef = reactContext + + stripeSdkModule?.cardFieldView = view + return view + } + + override fun onDropViewInstance(view: CardFieldView) { + super.onDropViewInstance(view) + + val stripeSdkModule: StripeSdkModule? = + reactContextRef?.getNativeModule(StripeSdkModule::class.java) + stripeSdkModule?.cardFieldView = null + reactContextRef = null } @ReactProp(name = "dangerouslyGetFullCardDetails") - fun setDangerouslyGetFullCardDetails( + override fun setDangerouslyGetFullCardDetails( view: CardFieldView, - dangerouslyGetFullCardDetails: Boolean = false, + dangerouslyGetFullCardDetails: Boolean, ) { view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails) } @ReactProp(name = "postalCodeEnabled") - fun setPostalCodeEnabled( + override fun setPostalCodeEnabled( view: CardFieldView, - postalCodeEnabled: Boolean = true, + postalCodeEnabled: Boolean, ) { view.setPostalCodeEnabled(postalCodeEnabled) } @ReactProp(name = "autofocus") - fun setAutofocus( + override fun setAutofocus( view: CardFieldView, - autofocus: Boolean = false, + autofocus: Boolean, ) { view.setAutofocus(autofocus) } @ReactProp(name = "cardStyle") - fun setCardStyle( + override fun setCardStyle( view: CardFieldView, - cardStyle: ReadableMap, + cardStyle: Dynamic, ) { - view.setCardStyle(cardStyle) + view.setCardStyle(cardStyle.asMapOrNull()) } @ReactProp(name = "countryCode") - fun setCountryCode( + override fun setCountryCode( view: CardFieldView, countryCode: String?, ) { @@ -72,7 +88,7 @@ class CardFieldViewManager : SimpleViewManager() { } @ReactProp(name = "onBehalfOf") - fun setOnBehalfOf( + override fun setOnBehalfOf( view: CardFieldView, onBehalfOf: String?, ) { @@ -80,15 +96,15 @@ class CardFieldViewManager : SimpleViewManager() { } @ReactProp(name = "placeholders") - fun setPlaceHolders( + override fun setPlaceholders( view: CardFieldView, - placeholders: ReadableMap, + placeholders: Dynamic, ) { - view.setPlaceHolders(placeholders) + view.setPlaceHolders(placeholders.asMapOrNull()) } @ReactProp(name = "disabled") - fun setDisabled( + override fun setDisabled( view: CardFieldView, isDisabled: Boolean, ) { @@ -96,7 +112,7 @@ class CardFieldViewManager : SimpleViewManager() { } @ReactProp(name = "preferredNetworks") - fun setPreferredNetworks( + override fun setPreferredNetworks( view: CardFieldView, preferredNetworks: ReadableArray?, ) { @@ -104,24 +120,18 @@ class CardFieldViewManager : SimpleViewManager() { view.setPreferredNetworks(networks) } - override fun createViewInstance(reactContext: ThemedReactContext): CardFieldView { - val stripeSdkModule: StripeSdkModule? = - reactContext.getNativeModule(StripeSdkModule::class.java) - val view = CardFieldView(reactContext) - - reactContextRef = reactContext + // Native commands - stripeSdkModule?.cardFieldView = view - return view + override fun blur(view: CardFieldView) { + view.requestBlurFromJS() } - override fun onDropViewInstance(view: CardFieldView) { - super.onDropViewInstance(view) + override fun focus(view: CardFieldView) { + view.requestFocusFromJS() + } - val stripeSdkModule: StripeSdkModule? = - reactContextRef?.getNativeModule(StripeSdkModule::class.java) - stripeSdkModule?.cardFieldView = null - reactContextRef = null + override fun clear(view: CardFieldView) { + view.requestClearFromJS() } companion object { diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFocusChangeEvent.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFocusChangeEvent.kt new file mode 100644 index 000000000..bcafb1618 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFocusChangeEvent.kt @@ -0,0 +1,24 @@ +package com.reactnativestripesdk + +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.WritableMap +import com.facebook.react.uimanager.events.Event + +internal class CardFocusChangeEvent( + surfaceId: Int, + viewTag: Int, + private val focusField: String?, +) : Event(surfaceId, viewTag) { + override fun getEventName() = EVENT_NAME + + override fun getEventData(): WritableMap? { + val eventData = Arguments.createMap() + eventData.putString("focusedField", focusField) + + return eventData + } + + companion object { + const val EVENT_NAME = "topFocusChange" + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormCompleteEvent.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormCompleteEvent.kt index a0106f6d7..e55b1671e 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormCompleteEvent.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormCompleteEvent.kt @@ -10,29 +10,30 @@ internal class CardFormCompleteEvent( private val cardDetails: MutableMap?, private val complete: Boolean, private val dangerouslyGetFullCardDetails: Boolean, -) : Event(surfaceId, viewTag) { +) : Event(surfaceId, viewTag) { override fun getEventName() = EVENT_NAME override fun getEventData(): WritableMap? { - val eventData = Arguments.createMap() + val cardData = Arguments.createMap() - if (cardDetails == null) { - return eventData - } - eventData.putString("brand", cardDetails["brand"]?.toString()) - eventData.putString("last4", cardDetails["last4"]?.toString()) - eventData.putString("country", cardDetails["country"]?.toString()) - eventData.putInt("expiryMonth", cardDetails["expiryMonth"] as Int) - eventData.putInt("expiryYear", cardDetails["expiryYear"] as Int) - eventData.putBoolean("complete", complete) - eventData.putString("postalCode", cardDetails["postalCode"]?.toString()) + if (cardDetails != null) { + cardData.putString("brand", cardDetails["brand"]?.toString()) + cardData.putString("last4", cardDetails["last4"]?.toString()) + cardData.putString("country", cardDetails["country"]?.toString()) + cardData.putInt("expiryMonth", cardDetails["expiryMonth"] as Int) + cardData.putInt("expiryYear", cardDetails["expiryYear"] as Int) + cardData.putBoolean("complete", complete) + cardData.putString("postalCode", cardDetails["postalCode"]?.toString()) - if (dangerouslyGetFullCardDetails) { - eventData.putString("number", cardDetails["number"]?.toString()?.replace(" ", "")) - eventData.putString("cvc", cardDetails["cvc"]?.toString()) + if (dangerouslyGetFullCardDetails) { + cardData.putString("number", cardDetails["number"]?.toString()?.replace(" ", "")) + cardData.putString("cvc", cardDetails["cvc"]?.toString()) + } } - return eventData + return Arguments.createMap().apply { + putMap("card", cardData) + } } companion object { diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormView.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormView.kt index ba3e69e85..03a3efefb 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormView.kt @@ -36,7 +36,7 @@ import com.stripe.android.view.CardInputListener class CardFormView( private val context: ThemedReactContext, ) : FrameLayout(context) { - internal var cardForm: CardFormView = + var cardForm: CardFormView = CardFormView(context, null, com.stripe.android.R.style.StripeCardFormView_Borderless) private var dangerouslyGetFullCardDetails: Boolean = false private var currentFocusedField: String? = null @@ -65,8 +65,8 @@ class CardFormView( cardFormViewBinding.postalCodeContainer.visibility = visibility } - fun setDefaultValues(defaults: ReadableMap) { - setCountry(defaults.getString("countryCode")) + fun setDefaultValues(defaults: ReadableMap?) { + setCountry(defaults?.getString("countryCode")) } fun setDisabled(isDisabled: Boolean) { @@ -86,7 +86,7 @@ class CardFormView( setPostalCodeFilter() } - fun setPlaceHolders(value: ReadableMap) { + fun setPlaceHolders(value: ReadableMap?) { val numberPlaceholder = getValOr(value, "number", null) val expirationPlaceholder = getValOr(value, "expiration", null) val cvcPlaceholder = getValOr(value, "cvc", null) @@ -136,11 +136,11 @@ class CardFormView( private fun onChangeFocus() { UIManagerHelper .getEventDispatcherForReactTag(context, id) - ?.dispatchEvent(CardFocusEvent(context.surfaceId, id, currentFocusedField)) + ?.dispatchEvent(CardFocusChangeEvent(context.surfaceId, id, currentFocusedField)) } @SuppressLint("RestrictedApi") - fun setCardStyle(value: ReadableMap) { + fun setCardStyle(value: ReadableMap?) { val backgroundColor = getValOr(value, "backgroundColor", null) val textColor = getValOr(value, "textColor", null) val borderWidth = getIntOrNull(value, "borderWidth") diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormViewManager.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormViewManager.kt index c6d3c4305..72bc206af 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormViewManager.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormViewManager.kt @@ -1,86 +1,82 @@ package com.reactnativestripesdk +import com.facebook.react.bridge.Dynamic import com.facebook.react.bridge.ReadableArray -import com.facebook.react.bridge.ReadableMap import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.SimpleViewManager import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.CardFormManagerDelegate +import com.facebook.react.viewmanagers.CardFormManagerInterface +import com.reactnativestripesdk.utils.asMapOrNull @ReactModule(name = CardFormViewManager.REACT_CLASS) -class CardFormViewManager : SimpleViewManager() { +class CardFormViewManager : + SimpleViewManager(), + CardFormManagerInterface { + private val delegate = CardFormManagerDelegate(this) + var reactContextRef: ThemedReactContext? = null + override fun getName() = REACT_CLASS - internal var reactContextRef: ThemedReactContext? = null + override fun getDelegate() = delegate override fun getExportedCustomDirectEventTypeConstants() = mutableMapOf( - CardFocusEvent.EVENT_NAME to mutableMapOf("registrationName" to "onFocusChange"), + CardFocusChangeEvent.EVENT_NAME to mutableMapOf("registrationName" to "onFocusChange"), CardFormCompleteEvent.EVENT_NAME to mutableMapOf("registrationName" to "onFormComplete"), ) - override fun receiveCommand( - root: CardFormView, - commandId: String?, - args: ReadableArray?, - ) { - when (commandId) { - "focus" -> root.requestFocusFromJS() - "blur" -> root.requestBlurFromJS() - "clear" -> root.requestClearFromJS() - } - } - @ReactProp(name = "dangerouslyGetFullCardDetails") - fun setDangerouslyGetFullCardDetails( + override fun setDangerouslyGetFullCardDetails( view: CardFormView, - dangerouslyGetFullCardDetails: Boolean = false, + dangerouslyGetFullCardDetails: Boolean, ) { view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails) } @ReactProp(name = "postalCodeEnabled") - fun setPostalCodeEnabled( + override fun setPostalCodeEnabled( view: CardFormView, - postalCodeEnabled: Boolean = false, + postalCodeEnabled: Boolean, ) { view.setPostalCodeEnabled(postalCodeEnabled) } @ReactProp(name = "placeholders") - fun setPlaceHolders( + override fun setPlaceholders( view: CardFormView, - placeholders: ReadableMap, + placeholders: Dynamic, ) { - view.setPlaceHolders(placeholders) + view.setPlaceHolders(placeholders.asMapOrNull()) } @ReactProp(name = "autofocus") - fun setAutofocus( + override fun setAutofocus( view: CardFormView, - autofocus: Boolean = false, + autofocus: Boolean, ) { view.setAutofocus(autofocus) } @ReactProp(name = "cardStyle") - fun setCardStyle( + override fun setCardStyle( view: CardFormView, - cardStyle: ReadableMap, + cardStyle: Dynamic, ) { - view.setCardStyle(cardStyle) + view.setCardStyle(cardStyle.asMapOrNull()) } @ReactProp(name = "defaultValues") - fun setDefaultValues( + override fun setDefaultValues( view: CardFormView, - defaults: ReadableMap, + defaults: Dynamic, ) { - view.setDefaultValues(defaults) + view.setDefaultValues(defaults.asMapOrNull()) } @ReactProp(name = "disabled") - fun setDisabled( + override fun setDisabled( view: CardFormView, isDisabled: Boolean, ) { @@ -88,7 +84,7 @@ class CardFormViewManager : SimpleViewManager() { } @ReactProp(name = "preferredNetworks") - fun setPreferredNetworks( + override fun setPreferredNetworks( view: CardFormView, preferredNetworks: ReadableArray?, ) { @@ -116,6 +112,16 @@ class CardFormViewManager : SimpleViewManager() { reactContextRef = null } + // Native commands + + override fun blur(view: CardFormView) { + view.requestBlurFromJS() + } + + override fun focus(view: CardFormView) { + view.requestFocusFromJS() + } + companion object { const val REACT_CLASS = "CardForm" } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt index f1d3097cb..b09c46c25 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt @@ -1,14 +1,9 @@ package com.reactnativestripesdk -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import androidx.fragment.app.Fragment import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.reactnativestripesdk.utils.ErrorType +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.reactnativestripesdk.utils.createResult import com.reactnativestripesdk.utils.mapFromFinancialConnectionsEvent @@ -23,44 +18,26 @@ import com.stripe.android.payments.bankaccount.CollectBankAccountConfiguration import com.stripe.android.payments.bankaccount.CollectBankAccountLauncher import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountResult -class CollectBankAccountLauncherFragment( - private val context: ReactApplicationContext, - private val publishableKey: String, - private val stripeAccountId: String?, - private val clientSecret: String, - private val isPaymentIntent: Boolean, - private val collectParams: CollectBankAccountConfiguration.USBankAccount, - private val promise: Promise, -) : Fragment() { +class CollectBankAccountLauncherFragment : StripeFragment() { + private lateinit var context: ReactApplicationContext + private lateinit var publishableKey: String + private var stripeAccountId: String? = null + private lateinit var clientSecret: String + private var isPaymentIntent: Boolean = false + private lateinit var collectParams: CollectBankAccountConfiguration.USBankAccount + private lateinit var promise: Promise private lateinit var collectBankAccountLauncher: CollectBankAccountLauncher - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) + override fun prepare() { + collectBankAccountLauncher = createBankAccountLauncher() val stripeSdkModule: StripeSdkModule? = context.getNativeModule(StripeSdkModule::class.java) - if (stripeSdkModule != null && stripeSdkModule.eventListenerCount > 0) { + if (stripeSdkModule != null) { FinancialConnections.setEventListener { event -> val params = mapFromFinancialConnectionsEvent(event) - stripeSdkModule.sendEvent(context, "onFinancialConnectionsEvent", params) + stripeSdkModule.emitOnFinancialConnectionsEvent(params) } } - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View { - collectBankAccountLauncher = createBankAccountLauncher() - - return FrameLayout(requireActivity()).also { it.visibility = View.GONE } - } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle?, - ) { - super.onViewCreated(view, savedInstanceState) if (isPaymentIntent) { collectBankAccountLauncher.presentWithPaymentIntent( @@ -108,11 +85,13 @@ class CollectBankAccountLauncherFragment( ) } } + is CollectBankAccountResult.Cancelled -> { promise.resolve( createError(ErrorType.Canceled.toString(), "Bank account collection was canceled."), ) } + is CollectBankAccountResult.Failed -> { promise.resolve(createError(ErrorType.Failed.toString(), result.error)) } @@ -122,5 +101,25 @@ class CollectBankAccountLauncherFragment( companion object { internal const val TAG = "collect_bank_account_launcher_fragment" + + fun create( + context: ReactApplicationContext, + publishableKey: String, + stripeAccountId: String? = null, + clientSecret: String, + isPaymentIntent: Boolean, + collectParams: CollectBankAccountConfiguration.USBankAccount, + promise: Promise, + ): CollectBankAccountLauncherFragment { + val instance = CollectBankAccountLauncherFragment() + instance.context = context + instance.publishableKey = publishableKey + instance.stripeAccountId = stripeAccountId + instance.clientSecret = clientSecret + instance.isPaymentIntent = isPaymentIntent + instance.collectParams = collectParams + instance.promise = promise + return instance + } } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CustomPaymentMethodActivity.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CustomPaymentMethodActivity.kt new file mode 100644 index 000000000..6e663f07b --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CustomPaymentMethodActivity.kt @@ -0,0 +1,81 @@ +package com.reactnativestripesdk + +import android.os.Bundle +import android.view.MotionEvent +import com.facebook.react.ReactActivity +import java.lang.ref.WeakReference + +/** + * A transparent activity that is launched when the Payment Element requests the + * `confirmCustomPaymentMethodCallback`. + * + * Its only purpose is to bring the app back to the foreground (the Stripe + * SDK launches its own proxy activity which pauses the host React Native + * activity). Having a React (transparent) activity on top ensures that React + * Native can display UI elements such as `Alert` dialogs coming from + * JavaScript. + * + * The activity uses a translucent theme to minimize visibility and is excluded + * from recents, though it may still be briefly visible to the end-user during + * certain operations. + */ +class CustomPaymentMethodActivity : ReactActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + // Disable the transition animation to make it truly invisible + overridePendingTransition(0, 0) + super.onCreate(savedInstanceState) + } + + override fun getMainComponentName(): String? { + // We don't want to mount another React Native root – returning null is + // enough to make ReactActivity skip loading a JS component while still + // hooking into the lifecycle so that ReactContext is aware of this + // activity. + return null + } + + override fun onTouchEvent(event: MotionEvent?): Boolean { + // Ensure touch events are properly handled by React Native + return super.onTouchEvent(event) + } + + override fun dispatchTouchEvent(event: MotionEvent?): Boolean { + // Ensure touch events are properly dispatched to React Native + return super.dispatchTouchEvent(event) + } + + override fun onResume() { + super.onResume() + // Ensure the activity is properly focused for touch events + currentFocus?.requestFocus() + } + + override fun finish() { + super.finish() + // Disable the exit animation as well + overridePendingTransition(0, 0) + + // Clear the weak reference when finished + if (currentActivityRef?.get() == this) { + currentActivityRef = null + } + } + + companion object { + @Volatile + private var currentActivityRef: WeakReference? = null + + fun finishCurrent() { + currentActivityRef?.get()?.let { activity -> + activity.runOnUiThread { + activity.finish() + } + } + } + } + + override fun onStart() { + super.onStart() + currentActivityRef = WeakReference(this) + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt index aaafa1a95..af058a8ea 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt @@ -1,11 +1,5 @@ package com.reactnativestripesdk -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.Promise @@ -15,6 +9,7 @@ import com.facebook.react.bridge.WritableArray import com.facebook.react.bridge.WritableMap import com.facebook.react.bridge.WritableNativeMap import com.reactnativestripesdk.utils.ErrorType +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.reactnativestripesdk.utils.createMissingActivityError import com.reactnativestripesdk.utils.mapFromFinancialConnectionsEvent @@ -29,7 +24,7 @@ import com.stripe.android.financialconnections.model.FinancialConnectionsAccount import com.stripe.android.financialconnections.model.FinancialConnectionsAccountList import com.stripe.android.financialconnections.model.FinancialConnectionsSession -class FinancialConnectionsSheetFragment : Fragment() { +class FinancialConnectionsSheetFragment : StripeFragment() { enum class Mode { ForToken, ForSession, @@ -40,28 +35,13 @@ class FinancialConnectionsSheetFragment : Fragment() { private lateinit var configuration: FinancialConnectionsSheet.Configuration private lateinit var mode: Mode - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - + override fun prepare() { val stripeSdkModule: StripeSdkModule? = context.getNativeModule(StripeSdkModule::class.java) - if (stripeSdkModule != null && stripeSdkModule.eventListenerCount > 0) { - FinancialConnections.setEventListener { event -> - val params = mapFromFinancialConnectionsEvent(event) - stripeSdkModule.sendEvent(context, "onFinancialConnectionsEvent", params) - } + FinancialConnections.setEventListener { event -> + val params = mapFromFinancialConnectionsEvent(event) + stripeSdkModule?.emitOnFinancialConnectionsEvent(params) } - } - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View = FrameLayout(requireActivity()).also { it.visibility = View.GONE } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle?, - ) { when (mode) { Mode.ForToken -> { FinancialConnectionsSheet @@ -70,6 +50,7 @@ class FinancialConnectionsSheetFragment : Fragment() { ::onFinancialConnectionsSheetForTokenResult, ).present(configuration = configuration) } + Mode.ForSession -> { FinancialConnectionsSheet .create(this, ::onFinancialConnectionsSheetForDataResult) @@ -90,9 +71,11 @@ class FinancialConnectionsSheetFragment : Fragment() { is FinancialConnectionsSheetForTokenResult.Canceled -> { promise.resolve(createError(ErrorType.Canceled.toString(), "The flow has been canceled")) } + is FinancialConnectionsSheetForTokenResult.Failed -> { promise.resolve(createError(ErrorType.Failed.toString(), result.error)) } + is FinancialConnectionsSheetForTokenResult.Completed -> { promise.resolve(createTokenResult(result)) (context.currentActivity as? FragmentActivity) @@ -109,9 +92,11 @@ class FinancialConnectionsSheetFragment : Fragment() { is FinancialConnectionsSheetResult.Canceled -> { promise.resolve(createError(ErrorType.Canceled.toString(), "The flow has been canceled")) } + is FinancialConnectionsSheetResult.Failed -> { promise.resolve(createError(ErrorType.Failed.toString(), result.error)) } + is FinancialConnectionsSheetResult.Completed -> { promise.resolve( WritableNativeMap().also { diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayButtonManager.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayButtonManager.kt index 3c0a88083..0a6e1b04f 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayButtonManager.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayButtonManager.kt @@ -4,11 +4,21 @@ import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.SimpleViewManager import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.GooglePayButtonManagerDelegate +import com.facebook.react.viewmanagers.GooglePayButtonManagerInterface @ReactModule(name = GooglePayButtonManager.REACT_CLASS) -class GooglePayButtonManager : SimpleViewManager() { +class GooglePayButtonManager : + SimpleViewManager(), + GooglePayButtonManagerInterface { + private val delegate = GooglePayButtonManagerDelegate(this) + override fun getName() = REACT_CLASS + override fun getDelegate() = delegate + + override fun createViewInstance(reactContext: ThemedReactContext): GooglePayButtonView = GooglePayButtonView(reactContext) + override fun onAfterUpdateTransaction(view: GooglePayButtonView) { super.onAfterUpdateTransaction(view) @@ -16,7 +26,7 @@ class GooglePayButtonManager : SimpleViewManager() { } @ReactProp(name = "type") - fun type( + override fun setType( view: GooglePayButtonView, buttonType: Int, ) { @@ -24,7 +34,7 @@ class GooglePayButtonManager : SimpleViewManager() { } @ReactProp(name = "appearance") - fun appearance( + override fun setAppearance( view: GooglePayButtonView, appearance: Int, ) { @@ -32,15 +42,13 @@ class GooglePayButtonManager : SimpleViewManager() { } @ReactProp(name = "borderRadius") - fun borderRadius( + override fun setBorderRadius( view: GooglePayButtonView, borderRadius: Int, ) { view.setBorderRadius(borderRadius) } - override fun createViewInstance(reactContext: ThemedReactContext): GooglePayButtonView = GooglePayButtonView(reactContext) - companion object { const val REACT_CLASS = "GooglePayButton" } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayLauncherFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayLauncherFragment.kt index f5a46ea52..98d245b21 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayLauncherFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayLauncherFragment.kt @@ -1,17 +1,12 @@ package com.reactnativestripesdk -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReadableMap import com.facebook.react.bridge.WritableMap import com.reactnativestripesdk.utils.ErrorType import com.reactnativestripesdk.utils.GooglePayErrorType +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.reactnativestripesdk.utils.createMissingActivityError import com.reactnativestripesdk.utils.getBooleanOr @@ -19,7 +14,7 @@ import com.reactnativestripesdk.utils.getIntOrNull import com.stripe.android.googlepaylauncher.GooglePayEnvironment import com.stripe.android.googlepaylauncher.GooglePayLauncher -class GooglePayLauncherFragment : Fragment() { +class GooglePayLauncherFragment : StripeFragment() { enum class Mode { ForSetup, ForPayment, @@ -34,16 +29,7 @@ class GooglePayLauncherFragment : Fragment() { private var label: String? = null private lateinit var callback: (result: GooglePayLauncher.Result?, error: WritableMap?) -> Unit - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View = FrameLayout(requireActivity()).also { it.visibility = View.GONE } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle?, - ) { + override fun prepare() { launcher = GooglePayLauncher( fragment = this, diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt index 5eb0e75ee..882b0398b 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt @@ -12,12 +12,12 @@ import com.reactnativestripesdk.utils.removeFragment import com.stripe.android.googlepaylauncher.GooglePayEnvironment import com.stripe.android.googlepaylauncher.GooglePayPaymentMethodLauncher -class GooglePayPaymentMethodLauncherFragment( - private val context: ReactApplicationContext, - private val isTestEnv: Boolean, - private val paymentMethodRequired: Boolean, - private val promise: Promise, -) : Fragment() { +class GooglePayPaymentMethodLauncherFragment : Fragment() { + private lateinit var context: ReactApplicationContext + private var isTestEnv = false + private var paymentMethodRequired = false + private lateinit var promise: Promise + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -50,5 +50,19 @@ class GooglePayPaymentMethodLauncherFragment( companion object { const val TAG = "google_pay_support_fragment" + + fun create( + context: ReactApplicationContext, + isTestEnv: Boolean, + paymentMethodRequired: Boolean, + promise: Promise, + ): GooglePayPaymentMethodLauncherFragment { + val instance = GooglePayPaymentMethodLauncherFragment() + instance.context = context + instance.isTestEnv = isTestEnv + instance.paymentMethodRequired = paymentMethodRequired + instance.promise = promise + return instance + } } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java new file mode 100644 index 000000000..7751a38cf --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java @@ -0,0 +1,319 @@ +// This is a modified version of the codegen file. Since old arch does not support mEventEmitterCallback +// we implement event emitting with RCTDeviceEventEmitter. +// To update this file run ./scripts/old-arch-codegen-android + +/** + * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). + * + * Do not edit this file as changes may cause incorrect behavior and will be lost + * once the code is regenerated. + * + * @generated by codegen project: GenerateModuleJavaSpec.js + * + * @nolint + */ + +package com.reactnativestripesdk; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.facebook.proguard.annotations.DoNotStrip; +import com.facebook.react.bridge.Promise; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReactContextBaseJavaModule; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.common.build.ReactBuildConfig; +import com.facebook.react.modules.core.DeviceEventManagerModule; +import com.facebook.react.turbomodule.core.interfaces.TurboModule; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModule implements TurboModule { + public static final String NAME = "StripeSdk"; + + public NativeStripeSdkModuleSpec(ReactApplicationContext reactContext) { + super(reactContext); + } + + @Override + public @NonNull String getName() { + return NAME; + } + + private void invoke(String eventName, ReadableMap params) { + getReactApplicationContext() + .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) + .emit(eventName, params); + } + + private void invoke(String eventName) { + invoke(eventName, null); + } + + protected final void emitOnConfirmHandlerCallback(ReadableMap value) { + invoke("onConfirmHandlerCallback", value); + } + + protected final void emitOnFinancialConnectionsEvent(ReadableMap value) { + invoke("onFinancialConnectionsEvent", value); + } + + protected final void emitOnOrderTrackingCallback() { + invoke("onOrderTrackingCallback"); + } + + protected final void emitOnCustomerAdapterFetchPaymentMethodsCallback() { + invoke("onCustomerAdapterFetchPaymentMethodsCallback"); + } + + protected final void emitOnCustomerAdapterAttachPaymentMethodCallback(ReadableMap value) { + invoke("onCustomerAdapterAttachPaymentMethodCallback", value); + } + + protected final void emitOnCustomerAdapterDetachPaymentMethodCallback(ReadableMap value) { + invoke("onCustomerAdapterDetachPaymentMethodCallback", value); + } + + protected final void emitOnCustomerAdapterSetSelectedPaymentOptionCallback(ReadableMap value) { + invoke("onCustomerAdapterSetSelectedPaymentOptionCallback", value); + } + + protected final void emitOnCustomerAdapterFetchSelectedPaymentOptionCallback() { + invoke("onCustomerAdapterFetchSelectedPaymentOptionCallback"); + } + + protected final void emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback() { + invoke("onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback"); + } + + protected final void emitEmbeddedPaymentElementDidUpdateHeight(ReadableMap value) { + invoke("embeddedPaymentElementDidUpdateHeight", value); + } + + protected final void emitEmbeddedPaymentElementWillPresent() { + invoke("embeddedPaymentElementWillPresent"); + } + + protected final void emitEmbeddedPaymentElementDidUpdatePaymentOption(ReadableMap value) { + invoke("embeddedPaymentElementDidUpdatePaymentOption", value); + } + + protected final void emitEmbeddedPaymentElementFormSheetConfirmComplete(ReadableMap value) { + invoke("embeddedPaymentElementFormSheetConfirmComplete", value); + } + + protected final void emitEmbeddedPaymentElementRowSelectionImmediateAction() { + invoke("embeddedPaymentElementRowSelectionImmediateAction"); + } + + protected final void emitEmbeddedPaymentElementLoadingFailed(ReadableMap value) { + invoke("embeddedPaymentElementLoadingFailed", value); + } + + protected final void emitOnCustomPaymentMethodConfirmHandlerCallback(ReadableMap value) { + invoke("onCustomPaymentMethodConfirmHandlerCallback", value); + } + + @ReactMethod + @DoNotStrip + public abstract void initialise(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void createPaymentMethod(ReadableMap params, ReadableMap options, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void handleNextAction(String paymentIntentClientSecret, @Nullable String returnURL, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void handleNextActionForSetup(String setupIntentClientSecret, @Nullable String returnURL, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void confirmPayment(String paymentIntentClientSecret, @Nullable ReadableMap params, @Nullable ReadableMap options, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void confirmSetupIntent(String paymentIntentClientSecret, ReadableMap params, ReadableMap options, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void retrievePaymentIntent(String clientSecret, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void retrieveSetupIntent(String clientSecret, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void initPaymentSheet(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void intentCreationCallback(ReadableMap result, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customPaymentMethodResultCallback(ReadableMap result, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void presentPaymentSheet(ReadableMap options, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void confirmPaymentSheetPayment(Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void createTokenForCVCUpdate(String cvc, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void handleURLCallback(String url, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void createToken(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void openApplePaySetup(Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void verifyMicrodeposits(boolean isPaymentIntent, String clientSecret, ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void collectBankAccount(boolean isPaymentIntent, String clientSecret, ReadableMap params, Promise promise); + + protected abstract Map getTypedExportedConstants(); + + @Override + @DoNotStrip + public final @Nullable Map getConstants() { + Map constants = getTypedExportedConstants(); + if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) { + Set obligatoryFlowConstants = new HashSet<>(Arrays.asList( + "API_VERSIONS" + )); + Set optionalFlowConstants = new HashSet<>(); + Set undeclaredConstants = new HashSet<>(constants.keySet()); + undeclaredConstants.removeAll(obligatoryFlowConstants); + undeclaredConstants.removeAll(optionalFlowConstants); + if (!undeclaredConstants.isEmpty()) { + throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants)); + } + undeclaredConstants = obligatoryFlowConstants; + undeclaredConstants.removeAll(constants.keySet()); + if (!undeclaredConstants.isEmpty()) { + throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants)); + } + } + return constants; + } + + @ReactMethod + @DoNotStrip + public abstract void canAddCardToWallet(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void isCardInWallet(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void collectBankAccountToken(String clientSecret, ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void collectFinancialConnectionsAccounts(String clientSecret, ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void resetPaymentSheetCustomer(Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void isPlatformPaySupported(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void createPlatformPayPaymentMethod(ReadableMap params, boolean usesDeprecatedTokenFlow, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void dismissPlatformPay(Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void updatePlatformPaySheet(ReadableArray summaryItems, ReadableArray shippingMethods, ReadableArray errors, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void confirmPlatformPay(String clientSecret, ReadableMap params, boolean isPaymentIntent, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void configureOrderTracking(String orderTypeIdentifier, String orderIdentifier, String webServiceUrl, String authenticationToken, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void initCustomerSheet(ReadableMap params, ReadableMap customerAdapterOverrides, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void presentCustomerSheet(ReadableMap params, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void retrieveCustomerSheetPaymentOptionSelection(Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customerAdapterFetchPaymentMethodsCallback(ReadableArray paymentMethods, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customerAdapterAttachPaymentMethodCallback(ReadableMap paymentMethod, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customerAdapterDetachPaymentMethodCallback(ReadableMap paymentMethod, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customerAdapterSetSelectedPaymentOptionCallback(Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customerAdapterFetchSelectedPaymentOptionCallback(@Nullable String paymentOption, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void customerAdapterSetupIntentClientSecretForCustomerAttachCallback(String clientSecret, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void createEmbeddedPaymentElement(ReadableMap intentConfig, ReadableMap configuration, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void confirmEmbeddedPaymentElement(double viewTag, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void updateEmbeddedPaymentElement(ReadableMap intentConfig, Promise promise); + + @ReactMethod + @DoNotStrip + public abstract void clearEmbeddedPaymentOption(double viewTag, Promise promise); +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentLauncherFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentLauncherFragment.kt index dfbe72c42..f9a500763 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentLauncherFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentLauncherFragment.kt @@ -1,17 +1,12 @@ package com.reactnativestripesdk -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.reactnativestripesdk.utils.ConfirmPaymentErrorType import com.reactnativestripesdk.utils.ConfirmSetupIntentErrorType import com.reactnativestripesdk.utils.ErrorType +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.reactnativestripesdk.utils.createMissingActivityError import com.reactnativestripesdk.utils.createResult @@ -29,26 +24,57 @@ import com.stripe.android.payments.paymentlauncher.PaymentLauncher import com.stripe.android.payments.paymentlauncher.PaymentResult /** Instances of this class should only be initialized with the companion's helper methods. */ -class PaymentLauncherFragment( - private val context: ReactApplicationContext, - private val stripe: Stripe, - private val publishableKey: String, - private val stripeAccountId: String?, - private val promise: Promise, +class PaymentLauncherFragment : StripeFragment() { + private lateinit var context: ReactApplicationContext + private lateinit var stripe: Stripe + private lateinit var publishableKey: String + private var stripeAccountId: String? = null + private lateinit var promise: Promise + // Used when confirming a payment intent - private val paymentIntentClientSecret: String? = null, - private val confirmPaymentParams: ConfirmPaymentIntentParams? = null, + private var paymentIntentClientSecret: String? = null + private var confirmPaymentParams: ConfirmPaymentIntentParams? = null + // Used when confirming a setup intent - private val setupIntentClientSecret: String? = null, - private val confirmSetupParams: ConfirmSetupIntentParams? = null, + private var setupIntentClientSecret: String? = null + private var confirmSetupParams: ConfirmSetupIntentParams? = null + // Used when handling the next action on a payment intent - private val handleNextActionPaymentIntentClientSecret: String? = null, + private var handleNextActionPaymentIntentClientSecret: String? = null + // Used when handling the next action on a setup intent - private val handleNextActionSetupIntentClientSecret: String? = null, -) : Fragment() { + private var handleNextActionSetupIntentClientSecret: String? = null private lateinit var paymentLauncher: PaymentLauncher companion object { + private fun create( + context: ReactApplicationContext, + stripe: Stripe, + publishableKey: String, + stripeAccountId: String?, + promise: Promise, + paymentIntentClientSecret: String? = null, + confirmPaymentParams: ConfirmPaymentIntentParams? = null, + setupIntentClientSecret: String? = null, + confirmSetupParams: ConfirmSetupIntentParams? = null, + handleNextActionPaymentIntentClientSecret: String? = null, + handleNextActionSetupIntentClientSecret: String? = null, + ): PaymentLauncherFragment { + val instance = PaymentLauncherFragment() + instance.context = context + instance.stripe = stripe + instance.publishableKey = publishableKey + instance.stripeAccountId = stripeAccountId + instance.promise = promise + instance.paymentIntentClientSecret = paymentIntentClientSecret + instance.confirmPaymentParams = confirmPaymentParams + instance.setupIntentClientSecret = setupIntentClientSecret + instance.confirmSetupParams = confirmSetupParams + instance.handleNextActionPaymentIntentClientSecret = handleNextActionPaymentIntentClientSecret + instance.handleNextActionSetupIntentClientSecret = handleNextActionSetupIntentClientSecret + return instance + } + /** Helper-constructor used for confirming payment intents */ fun forPayment( context: ReactApplicationContext, @@ -60,7 +86,7 @@ class PaymentLauncherFragment( confirmPaymentParams: ConfirmPaymentIntentParams, ): PaymentLauncherFragment { val paymentLauncherFragment = - PaymentLauncherFragment( + create( context, stripe, publishableKey, @@ -84,7 +110,7 @@ class PaymentLauncherFragment( confirmSetupParams: ConfirmSetupIntentParams, ): PaymentLauncherFragment { val paymentLauncherFragment = - PaymentLauncherFragment( + create( context, stripe, publishableKey, @@ -107,7 +133,7 @@ class PaymentLauncherFragment( handleNextActionPaymentIntentClientSecret: String, ): PaymentLauncherFragment { val paymentLauncherFragment = - PaymentLauncherFragment( + create( context, stripe, publishableKey, @@ -129,7 +155,7 @@ class PaymentLauncherFragment( handleNextActionSetupIntentClientSecret: String, ): PaymentLauncherFragment { val paymentLauncherFragment = - PaymentLauncherFragment( + create( context, stripe, publishableKey, @@ -161,43 +187,36 @@ class PaymentLauncherFragment( internal const val TAG = "payment_launcher_fragment" } - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View { + override fun prepare() { paymentLauncher = createPaymentLauncher() if (paymentIntentClientSecret != null && confirmPaymentParams != null) { - paymentLauncher.confirm(confirmPaymentParams) + paymentLauncher.confirm(confirmPaymentParams!!) } else if (setupIntentClientSecret != null && confirmSetupParams != null) { - paymentLauncher.confirm(confirmSetupParams) + paymentLauncher.confirm(confirmSetupParams!!) } else if (handleNextActionPaymentIntentClientSecret != null) { - paymentLauncher.handleNextActionForPaymentIntent(handleNextActionPaymentIntentClientSecret) + paymentLauncher.handleNextActionForPaymentIntent(handleNextActionPaymentIntentClientSecret!!) } else if (handleNextActionSetupIntentClientSecret != null) { - paymentLauncher.handleNextActionForSetupIntent(handleNextActionSetupIntentClientSecret) + paymentLauncher.handleNextActionForSetupIntent(handleNextActionSetupIntentClientSecret!!) } else { throw Exception( "Invalid parameters provided to PaymentLauncher. Ensure that you are providing the correct client secret and setup params (if necessary).", ) } - return FrameLayout(requireActivity()).also { it.visibility = View.GONE } } private fun createPaymentLauncher(): PaymentLauncher = PaymentLauncher.create(this, publishableKey, stripeAccountId) { paymentResult -> when (paymentResult) { is PaymentResult.Completed -> { - if (paymentIntentClientSecret != null) { - retrievePaymentIntent(paymentIntentClientSecret, stripeAccountId) - } else if (handleNextActionPaymentIntentClientSecret != null) { - retrievePaymentIntent(handleNextActionPaymentIntentClientSecret, stripeAccountId) - } else if (setupIntentClientSecret != null) { - retrieveSetupIntent(setupIntentClientSecret, stripeAccountId) - } else if (handleNextActionSetupIntentClientSecret != null) { - retrieveSetupIntent(handleNextActionSetupIntentClientSecret, stripeAccountId) - } else { - throw Exception("Failed to create Payment Launcher. No client secret provided.") - } + paymentIntentClientSecret?.let { + retrievePaymentIntent(it, stripeAccountId) + } ?: handleNextActionPaymentIntentClientSecret?.let { + retrievePaymentIntent(it, stripeAccountId) + } ?: setupIntentClientSecret?.let { + retrieveSetupIntent(it, stripeAccountId) + } ?: handleNextActionSetupIntentClientSecret?.let { + retrieveSetupIntent(it, stripeAccountId) + } ?: throw Exception("Failed to create Payment Launcher. No client secret provided.") } is PaymentResult.Canceled -> { promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), message = null)) diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt index 443e0098f..54a80b847 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt @@ -19,7 +19,7 @@ import com.stripe.android.model.PaymentMethodOptionsParams class PaymentMethodCreateParamsFactory( private val paymentMethodData: ReadableMap?, - private val options: ReadableMap, + private val options: ReadableMap?, private val cardFieldView: CardFieldView?, private val cardFormView: CardFormView?, ) { @@ -38,7 +38,6 @@ class PaymentMethodCreateParamsFactory( PaymentMethod.Type.Card -> createCardPaymentMethodParams() PaymentMethod.Type.Ideal -> createIDEALParams() PaymentMethod.Type.Alipay -> createAlipayParams() - PaymentMethod.Type.Sofort -> createSofortParams() PaymentMethod.Type.Bancontact -> createBancontactParams() PaymentMethod.Type.SepaDebit -> createSepaParams() PaymentMethod.Type.Oxxo -> createOXXOParams() @@ -79,21 +78,6 @@ class PaymentMethodCreateParamsFactory( @Throws(PaymentMethodCreateParamsException::class) private fun createAlipayParams(): PaymentMethodCreateParams = PaymentMethodCreateParams.createAlipay() - @Throws(PaymentMethodCreateParamsException::class) - private fun createSofortParams(): PaymentMethodCreateParams { - val country = - getValOr(paymentMethodData, "country", null) - ?: run { - throw PaymentMethodCreateParamsException("You must provide bank account country") - } - - return PaymentMethodCreateParams.create( - PaymentMethodCreateParams.Sofort(country = country), - billingDetailsParams, - metadata = metadataParams, - ) - } - @Throws(PaymentMethodCreateParamsException::class) private fun createBancontactParams(): PaymentMethodCreateParams { billingDetailsParams?.let { @@ -267,10 +251,10 @@ class PaymentMethodCreateParamsFactory( PaymentMethod.Type.Card -> createCardStripeIntentParams(clientSecret, isPaymentIntent) PaymentMethod.Type.USBankAccount -> createUSBankAccountStripeIntentParams(clientSecret, isPaymentIntent) + PaymentMethod.Type.Affirm -> createAffirmStripeIntentParams(clientSecret, isPaymentIntent) PaymentMethod.Type.Ideal, PaymentMethod.Type.Alipay, - PaymentMethod.Type.Sofort, PaymentMethod.Type.Bancontact, PaymentMethod.Type.SepaDebit, PaymentMethod.Type.Oxxo, @@ -304,6 +288,7 @@ class PaymentMethodCreateParamsFactory( ) } } + null -> ConfirmPaymentIntentParams.create(clientSecret) else -> { throw Exception("This paymentMethodType is not supported yet") diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt new file mode 100644 index 000000000..81c8e3919 --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt @@ -0,0 +1,15 @@ +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.WritableMap +import com.reactnativestripesdk.utils.mapFromPaymentSheetBillingDetails +import com.stripe.android.paymentelement.EmbeddedPaymentElement + +/** + * Serialize Stripe's PaymentOptionDisplayData into a WritableMap + * that can be sent over the RN bridge. + */ +fun EmbeddedPaymentElement.PaymentOptionDisplayData.toWritableMap(): WritableMap = + Arguments.createMap().apply { + putString("label", label) + putString("paymentMethodType", paymentMethodType) + putMap("billingDetails", mapFromPaymentSheetBillingDetails(billingDetails)) + } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetAppearance.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetAppearance.kt index 7e983caca..593c01e66 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetAppearance.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetAppearance.kt @@ -1,11 +1,16 @@ package com.reactnativestripesdk +import android.annotation.SuppressLint import android.content.Context +import android.content.res.Configuration import android.graphics.Color import android.os.Bundle import com.reactnativestripesdk.utils.PaymentSheetAppearanceException +import com.stripe.android.paymentelement.AppearanceAPIAdditionsPreview import com.stripe.android.paymentsheet.PaymentSheet +import com.stripe.android.uicore.StripeThemeDefaults +@SuppressLint("RestrictedApi") fun buildPaymentSheetAppearance( userParams: Bundle?, context: Context, @@ -13,6 +18,30 @@ fun buildPaymentSheetAppearance( val colorParams = userParams?.getBundle(PaymentSheetAppearanceKeys.COLORS) val lightColorParams = colorParams?.getBundle(PaymentSheetAppearanceKeys.LIGHT) ?: colorParams val darkColorParams = colorParams?.getBundle(PaymentSheetAppearanceKeys.DARK) ?: colorParams + val insetParams = userParams?.getBundle(PaymentSheetAppearanceKeys.FORM_INSETS) + + val embeddedAppearance = + buildEmbeddedAppearance( + userParams?.getBundle(PaymentSheetAppearanceKeys.EMBEDDED_PAYMENT_ELEMENT), + lightColorParams, + context, + ) + + embeddedAppearance?.let { + return PaymentSheet.Appearance( + typography = buildTypography(userParams?.getBundle(PaymentSheetAppearanceKeys.FONT), context), + colorsLight = buildColors(lightColorParams, PaymentSheet.Colors.defaultLight), + colorsDark = buildColors(darkColorParams, PaymentSheet.Colors.defaultDark), + shapes = buildShapes(userParams?.getBundle(PaymentSheetAppearanceKeys.SHAPES)), + primaryButton = + buildPrimaryButton( + userParams?.getBundle(PaymentSheetAppearanceKeys.PRIMARY_BUTTON), + context, + ), + embeddedAppearance = embeddedAppearance, + formInsetValues = buildFormInsets(insetParams), + ) + } return PaymentSheet.Appearance( typography = buildTypography(userParams?.getBundle(PaymentSheetAppearanceKeys.FONT), context), @@ -24,9 +53,11 @@ fun buildPaymentSheetAppearance( userParams?.getBundle(PaymentSheetAppearanceKeys.PRIMARY_BUTTON), context, ), + formInsetValues = buildFormInsets(insetParams), ) } +@OptIn(AppearanceAPIAdditionsPreview::class) private fun buildTypography( fontParams: Bundle?, context: Context, @@ -172,6 +203,7 @@ private fun buildPrimaryButton( getFloatOrNull(shapeParams, PaymentSheetAppearanceKeys.BORDER_RADIUS), borderStrokeWidthDp = getFloatOrNull(shapeParams, PaymentSheetAppearanceKeys.BORDER_WIDTH), + heightDp = getFloatOrNull(shapeParams, PaymentSheetAppearanceKeys.HEIGHT), ), typography = PaymentSheet.PrimaryButtonTypography( @@ -213,6 +245,284 @@ private fun buildPrimaryButtonColors( ), ) +@SuppressLint("RestrictedApi") +@Throws(PaymentSheetAppearanceException::class) +private fun buildEmbeddedAppearance( + embeddedParams: Bundle?, + defaultColorsBundle: Bundle?, + context: Context, +): PaymentSheet.Appearance.Embedded? { + if (embeddedParams == null) { + return null + } + + val rowParams = + getBundleOrNull(embeddedParams, PaymentSheetAppearanceKeys.ROW) + ?: return null + + val defaultColors = buildColors(defaultColorsBundle, PaymentSheet.Colors.defaultLight) + + // Default style + val styleString = rowParams.getString(PaymentSheetAppearanceKeys.STYLE, "flatWithRadio") + + val defaultAdditionalInsetsDp = 6.0f + val defaultSeparatorThicknessDp = 1.0f + val defaultSpacingDp = 12.0f + val defaultCheckmarkInsetDp = 0f + + val additionalInsets = getFloatOr(rowParams, PaymentSheetAppearanceKeys.ADDITIONAL_INSETS, defaultAdditionalInsetsDp) + + val rowStyle: PaymentSheet.Appearance.Embedded.RowStyle = + when (styleString) { + "flatWithRadio" -> { + val flatParams = getBundleOrNull(rowParams, PaymentSheetAppearanceKeys.FLAT) + val radioParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.RADIO) + val separatorInsetsParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_INSETS) + + // Default separator insets specific to FlatWithRadio + val defaultSeparatorStartInsetDp = 30.0f + val defaultSeparatorEndInsetDp = 0.0f + + // Parse dimensions as Floats + val separatorThickness = getFloatOr(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_THICKNESS, defaultSeparatorThicknessDp) + val startSeparatorInset = getFloatOr(separatorInsetsParams, PaymentSheetAppearanceKeys.LEFT, defaultSeparatorStartInsetDp) + val endSeparatorInset = getFloatOr(separatorInsetsParams, PaymentSheetAppearanceKeys.RIGHT, defaultSeparatorEndInsetDp) + + // Parse booleans + val topEnabled = getBooleanOr(flatParams, PaymentSheetAppearanceKeys.TOP_SEPARATOR_ENABLED, true) + val bottomEnabled = getBooleanOr(flatParams, PaymentSheetAppearanceKeys.BOTTOM_SEPARATOR_ENABLED, true) + + // Parse individual colors using default colors + val parsedSeparatorColor = + dynamicColorFromParams( + context, + flatParams, + PaymentSheetAppearanceKeys.SEPARATOR_COLOR, + defaultColors.componentBorder, + ) + + val parsedSelectedColor = + dynamicColorFromParams( + context, + radioParams, + PaymentSheetAppearanceKeys.SELECTED_COLOR, + defaultColors.primary, + ) + + val parsedUnselectedColor = + dynamicColorFromParams( + context, + radioParams, + PaymentSheetAppearanceKeys.UNSELECTED_COLOR, + defaultColors.componentBorder, + ) + + val flatRadioColors = + PaymentSheet.Appearance.Embedded.RowStyle.FlatWithRadio.Colors( + separatorColor = parsedSeparatorColor, + unselectedColor = parsedUnselectedColor, + selectedColor = parsedSelectedColor, + ) + + PaymentSheet.Appearance.Embedded.RowStyle.FlatWithRadio( + separatorThicknessDp = separatorThickness, + startSeparatorInsetDp = startSeparatorInset, + endSeparatorInsetDp = endSeparatorInset, + topSeparatorEnabled = topEnabled, + bottomSeparatorEnabled = bottomEnabled, + additionalVerticalInsetsDp = additionalInsets, + horizontalInsetsDp = 0.0F, // We do not have an iOS equal for this API so it's not configurable in React Native + colorsLight = flatRadioColors, + colorsDark = flatRadioColors, + ) + } + "flatWithCheckmark" -> { + val flatParams = getBundleOrNull(rowParams, PaymentSheetAppearanceKeys.FLAT) + val checkmarkParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.CHECKMARK) + val separatorInsetsParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_INSETS) + + // Default separator insets specific to FlatWithCheckmark and FlatWithChevron + val defaultSeparatorStartInsetDp = 0.0f + val defaultSeparatorEndInsetDp = 0.0f + + // Parse dimensions as Floats + val separatorThickness = getFloatOr(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_THICKNESS, defaultSeparatorThicknessDp) + val startSeparatorInset = getFloatOr(separatorInsetsParams, PaymentSheetAppearanceKeys.LEFT, defaultSeparatorStartInsetDp) + val endSeparatorInset = getFloatOr(separatorInsetsParams, PaymentSheetAppearanceKeys.RIGHT, defaultSeparatorEndInsetDp) + val checkmarkInset = getFloatOr(checkmarkParams, PaymentSheetAppearanceKeys.CHECKMARK_INSET, defaultCheckmarkInsetDp) + + // Parse booleans + val topEnabled = getBooleanOr(flatParams, PaymentSheetAppearanceKeys.TOP_SEPARATOR_ENABLED, true) + val bottomEnabled = getBooleanOr(flatParams, PaymentSheetAppearanceKeys.BOTTOM_SEPARATOR_ENABLED, true) + + // Parse individual colors using root defaults + val parsedSeparatorColor = + dynamicColorFromParams( + context, + flatParams, + PaymentSheetAppearanceKeys.SEPARATOR_COLOR, + defaultColors.componentBorder, + ) + + val parsedCheckmarkColor = + dynamicColorFromParams( + context, + checkmarkParams, + PaymentSheetAppearanceKeys.COLOR, + defaultColors.primary, + ) + + // Create the required Colors object + val flatCheckmarkColors = + PaymentSheet.Appearance.Embedded.RowStyle.FlatWithCheckmark.Colors( + separatorColor = parsedSeparatorColor, + checkmarkColor = parsedCheckmarkColor, + ) + + PaymentSheet.Appearance.Embedded.RowStyle.FlatWithCheckmark( + separatorThicknessDp = separatorThickness, + startSeparatorInsetDp = startSeparatorInset, + endSeparatorInsetDp = endSeparatorInset, + topSeparatorEnabled = topEnabled, + bottomSeparatorEnabled = bottomEnabled, + checkmarkInsetDp = checkmarkInset, + additionalVerticalInsetsDp = additionalInsets, + horizontalInsetsDp = 0.0F, // We do not have an iOS equal for this API so it's not configurable in React Native + colorsLight = flatCheckmarkColors, + colorsDark = flatCheckmarkColors, + ) + } + "flatWithChevron" -> { + val flatParams = getBundleOrNull(rowParams, PaymentSheetAppearanceKeys.FLAT) + val chevronParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.CHEVRON) + val separatorInsetsParams = getBundleOrNull(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_INSETS) + + // Default separator insets specific to FlatWithCheckmark and FlatWithChevron + val defaultSeparatorStartInsetDp = 0.0f + val defaultSeparatorEndInsetDp = 0.0f + + // Parse dimensions as Floats + val separatorThickness = getFloatOr(flatParams, PaymentSheetAppearanceKeys.SEPARATOR_THICKNESS, defaultSeparatorThicknessDp) + val startSeparatorInset = getFloatOr(separatorInsetsParams, PaymentSheetAppearanceKeys.LEFT, defaultSeparatorStartInsetDp) + val endSeparatorInset = getFloatOr(separatorInsetsParams, PaymentSheetAppearanceKeys.RIGHT, defaultSeparatorEndInsetDp) + + // Parse booleans + val topEnabled = getBooleanOr(flatParams, PaymentSheetAppearanceKeys.TOP_SEPARATOR_ENABLED, true) + val bottomEnabled = getBooleanOr(flatParams, PaymentSheetAppearanceKeys.BOTTOM_SEPARATOR_ENABLED, true) + + val parsedSeparatorColor = + dynamicColorFromParams( + context, + flatParams, + PaymentSheetAppearanceKeys.SEPARATOR_COLOR, + Color.GRAY, + ) + + val parsedChevronColor = + dynamicColorFromParams( + context, + chevronParams, + PaymentSheetAppearanceKeys.COLOR, + defaultColors.componentBorder, // Default to component border color like other elements + ) + + // Create the required Colors object + val flatChevronColors = + PaymentSheet.Appearance.Embedded.RowStyle.FlatWithChevron.Colors( + separatorColor = parsedSeparatorColor, + chevronColor = parsedChevronColor, + ) + + PaymentSheet.Appearance.Embedded.RowStyle.FlatWithChevron( + separatorThicknessDp = separatorThickness, + startSeparatorInsetDp = startSeparatorInset, + endSeparatorInsetDp = endSeparatorInset, + topSeparatorEnabled = topEnabled, + bottomSeparatorEnabled = bottomEnabled, + additionalVerticalInsetsDp = additionalInsets, + horizontalInsetsDp = 0.0F, // We do not have an iOS equal for this API so it's not configurable in React Native + colorsLight = flatChevronColors, + colorsDark = flatChevronColors, + ) + } + "floatingButton" -> { + val floatingParams = getBundleOrNull(rowParams, PaymentSheetAppearanceKeys.FLOATING) + PaymentSheet.Appearance.Embedded.RowStyle.FloatingButton( + additionalInsetsDp = additionalInsets, + spacingDp = getFloatOr(floatingParams, PaymentSheetAppearanceKeys.SPACING, defaultSpacingDp), + ) + } + else -> { + System.err.println("WARN: Unsupported embedded payment element row style received: $styleString. Falling back to default.") + return null + } + } + + return PaymentSheet.Appearance.Embedded(style = rowStyle) +} + +@SuppressLint("RestrictedApi") +private fun buildFormInsets(insetParams: Bundle?): PaymentSheet.Insets { + val defaults = StripeThemeDefaults.formInsets + val left = getFloatOr(insetParams, PaymentSheetAppearanceKeys.LEFT, defaults.start) + val top = getFloatOr(insetParams, PaymentSheetAppearanceKeys.TOP, defaults.top) + val right = getFloatOr(insetParams, PaymentSheetAppearanceKeys.RIGHT, defaults.end) + val bottom = getFloatOr(insetParams, PaymentSheetAppearanceKeys.BOTTOM, defaults.bottom) + + return PaymentSheet.Insets( + startDp = left, + topDp = top, + endDp = right, + bottomDp = bottom, + ) +} + +/** + * Parses a ThemedColor from [params] at [key]. Supports both: + * - Single hex string: "#RRGGBB" + * - Light/dark object: { "light": "#RRGGBB", "dark": "#RRGGBB" } + * For light/dark objects, chooses the appropriate color based on current UI mode. + * Falls back to [defaultColor] if no color is provided. + */ +private fun dynamicColorFromParams( + context: Context, + params: Bundle?, + key: String, + defaultColor: Int, +): Int { + if (params == null) { + return defaultColor + } + + // First check if it's a nested Bundle { "light": "#RRGGBB", "dark": "#RRGGBB" } + val colorBundle = params.getBundle(key) + if (colorBundle != null) { + val isDark = + ( + context.resources.configuration.uiMode + and Configuration.UI_MODE_NIGHT_MASK + ) == Configuration.UI_MODE_NIGHT_YES + + // Pick the hex for current mode, or null + val hex = + if (isDark) { + colorBundle.getString(PaymentSheetAppearanceKeys.DARK) + } else { + colorBundle.getString(PaymentSheetAppearanceKeys.LIGHT) + } + + return colorFromHexOrDefault(hex, defaultColor) + } + + // Check if it's a single color string + params.getString(key)?.let { colorString -> + return colorFromHexOrDefault(colorString, defaultColor) + } + + // no override → just use default + return defaultColor +} + private fun getDoubleOrNull( bundle: Bundle?, key: String, @@ -250,6 +560,22 @@ private fun getFloatOr( return defaultValue } +private fun getBundleOrNull( + bundle: Bundle?, + key: String, +): Bundle? = bundle?.getBundle(key) + +private fun getBooleanOr( + bundle: Bundle?, + key: String, + defaultValue: Boolean, +): Boolean = + if (bundle?.containsKey(key) == true) { + bundle.getBoolean(key) + } else { + defaultValue + } + private fun getFloatOrNull( bundle: Bundle?, key: String, @@ -323,9 +649,40 @@ private class PaymentSheetAppearanceKeys { const val SHAPES = "shapes" const val BORDER_RADIUS = "borderRadius" const val BORDER_WIDTH = "borderWidth" + const val HEIGHT = "height" const val PRIMARY_BUTTON = "primaryButton" const val TEXT = "text" const val BORDER = "border" + + const val EMBEDDED_PAYMENT_ELEMENT = "embeddedPaymentElement" + const val ROW = "row" + const val STYLE = "style" + const val ADDITIONAL_INSETS = "additionalInsets" + + const val FLAT = "flat" + const val SEPARATOR_THICKNESS = "separatorThickness" + const val SEPARATOR_COLOR = "separatorColor" + const val SEPARATOR_INSETS = "separatorInsets" + const val TOP_SEPARATOR_ENABLED = "topSeparatorEnabled" + const val BOTTOM_SEPARATOR_ENABLED = "bottomSeparatorEnabled" + const val RADIO = "radio" + const val SELECTED_COLOR = "selectedColor" + const val UNSELECTED_COLOR = "unselectedColor" + const val CHECKMARK = "checkmark" + const val CHEVRON = "chevron" + const val COLOR = "color" + const val CHECKMARK_INSET = "inset" + + const val FLOATING = "floating" + const val SPACING = "spacing" + + // Keys for EdgeInsetsConfig + const val LEFT = "left" + const val RIGHT = "right" + const val TOP = "top" + const val BOTTOM = "bottom" + + const val FORM_INSETS = "formInsetValues" } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt index 52662c7ca..7b161b608 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt @@ -3,6 +3,7 @@ package com.reactnativestripesdk import android.app.Activity import android.app.Application import android.content.Context +import android.content.Intent import android.graphics.Bitmap import android.graphics.Canvas import android.graphics.Color @@ -11,13 +12,9 @@ import android.os.Bundle import android.os.Handler import android.os.Looper import android.util.Base64 -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout +import android.util.Log import androidx.appcompat.content.res.AppCompatResources import androidx.core.graphics.drawable.DrawableCompat -import androidx.fragment.app.Fragment import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext @@ -30,12 +27,21 @@ import com.reactnativestripesdk.utils.KeepJsAwakeTask import com.reactnativestripesdk.utils.PaymentSheetAppearanceException import com.reactnativestripesdk.utils.PaymentSheetErrorType import com.reactnativestripesdk.utils.PaymentSheetException +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.reactnativestripesdk.utils.createResult +import com.reactnativestripesdk.utils.mapFromCustomPaymentMethod import com.reactnativestripesdk.utils.mapFromPaymentMethod import com.reactnativestripesdk.utils.mapToPreferredNetworks +import com.reactnativestripesdk.utils.parseCustomPaymentMethods import com.reactnativestripesdk.utils.removeFragment import com.stripe.android.ExperimentalAllowsRemovalOfLastSavedPaymentMethodApi +import com.stripe.android.model.PaymentMethod +import com.stripe.android.paymentelement.ConfirmCustomPaymentMethodCallback +import com.stripe.android.paymentelement.CustomPaymentMethodResult +import com.stripe.android.paymentelement.CustomPaymentMethodResultHandler +import com.stripe.android.paymentelement.ExperimentalCustomPaymentMethodsApi +import com.stripe.android.paymentelement.PaymentMethodOptionsSetupFutureUsagePreview import com.stripe.android.paymentsheet.CreateIntentCallback import com.stripe.android.paymentsheet.CreateIntentResult import com.stripe.android.paymentsheet.ExperimentalCustomerSessionApi @@ -44,14 +50,19 @@ import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheetResult import com.stripe.android.paymentsheet.PaymentSheetResultCallback import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch import java.io.ByteArrayOutputStream import kotlin.Exception -@OptIn(ExperimentalAllowsRemovalOfLastSavedPaymentMethodApi::class) -class PaymentSheetFragment( - private val context: ReactApplicationContext, - private val initPromise: Promise, -) : Fragment() { +@OptIn(ExperimentalAllowsRemovalOfLastSavedPaymentMethodApi::class, ExperimentalCustomPaymentMethodsApi::class) +class PaymentSheetFragment : + StripeFragment(), + ConfirmCustomPaymentMethodCallback { + private lateinit var context: ReactApplicationContext + private lateinit var initPromise: Promise private var paymentSheet: PaymentSheet? = null private var flowController: PaymentSheet.FlowController? = null private var paymentIntentClientSecret: String? = null @@ -64,17 +75,8 @@ class PaymentSheetFragment( internal var paymentSheetIntentCreationCallback = CompletableDeferred() private var keepJsAwake: KeepJsAwakeTask? = null - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View = FrameLayout(requireActivity()).also { it.visibility = View.GONE } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle?, - ) { - super.onViewCreated(view, savedInstanceState) + @OptIn(ExperimentalCustomPaymentMethodsApi::class) + override fun prepare() { val merchantDisplayName = arguments?.getString("merchantDisplayName").orEmpty() if (merchantDisplayName.isEmpty()) { initPromise.resolve( @@ -84,6 +86,7 @@ class PaymentSheetFragment( } val primaryButtonLabel = arguments?.getString("primaryButtonLabel") val googlePayConfig = buildGooglePayConfig(arguments?.getBundle("googlePay")) + val linkConfig = buildLinkConfig(arguments?.getBundle("link")) val allowsDelayedPaymentMethods = arguments?.getBoolean("allowsDelayedPaymentMethods") val billingDetailsBundle = arguments?.getBundle("defaultBillingDetails") val billingConfigParams = arguments?.getBundle("billingDetailsCollectionConfiguration") @@ -162,11 +165,13 @@ class PaymentSheetFragment( ), ) } + is PaymentSheetResult.Failed -> { resolvePaymentResult( createError(PaymentSheetErrorType.Failed.toString(), paymentResult.error), ) } + is PaymentSheetResult.Completed -> { resolvePaymentResult(WritableNativeMap()) // Remove the fragment now, we can be sure it won't be needed again if an intent is @@ -182,22 +187,13 @@ class PaymentSheetFragment( val createIntentCallback = CreateIntentCallback { paymentMethod, shouldSavePaymentMethod -> val stripeSdkModule: StripeSdkModule? = context.getNativeModule(StripeSdkModule::class.java) - if (stripeSdkModule == null || stripeSdkModule.eventListenerCount == 0) { - return@CreateIntentCallback CreateIntentResult.Failure( - cause = - Exception( - "Tried to call confirmHandler, but no callback was found. Please file an issue: https://github.com/stripe/stripe-react-native/issues", - ), - displayMessage = "An unexpected error occurred", - ) - } val params = Arguments.createMap().apply { putMap("paymentMethod", mapFromPaymentMethod(paymentMethod)) putBoolean("shouldSavePaymentMethod", shouldSavePaymentMethod) } - stripeSdkModule.sendEvent(context, "onConfirmHandlerCallback", params) + stripeSdkModule?.emitOnConfirmHandlerCallback(params) val resultFromJavascript = paymentSheetIntentCreationCallback.await() // reset the completable @@ -222,7 +218,7 @@ class PaymentSheetFragment( email = mapToCollectionMode(billingConfigParams?.getString("email")), address = mapToAddressCollectionMode(billingConfigParams?.getString("address")), attachDefaultsToPaymentMethod = - billingConfigParams?.getBoolean("attachDefaultsToPaymentMethod") ?: false, + billingConfigParams?.getBoolean("attachDefaultsToPaymentMethod", false) ?: false, ) var defaultBillingDetails: PaymentSheet.BillingDetails? = null @@ -259,6 +255,7 @@ class PaymentSheetFragment( mapToPreferredNetworks(arguments?.getIntegerArrayList("preferredNetworks")), ).allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod) .cardBrandAcceptance(mapToCardBrandAcceptance(arguments)) + .customPaymentMethods(parseCustomPaymentMethods(arguments)) primaryButtonLabel?.let { configurationBuilder.primaryButtonLabel(it) } paymentMethodOrder?.let { configurationBuilder.paymentMethodOrder(it) } @@ -272,30 +269,35 @@ class PaymentSheetFragment( if (arguments?.getBoolean("customFlow") == true) { flowController = if (intentConfiguration != null) { - PaymentSheet.FlowController.create( - this, - paymentOptionCallback = paymentOptionCallback, - createIntentCallback = createIntentCallback, - paymentResultCallback = paymentResultCallback, - ) + PaymentSheet.FlowController + .Builder( + resultCallback = paymentResultCallback, + paymentOptionCallback = paymentOptionCallback, + ).createIntentCallback(createIntentCallback) + .confirmCustomPaymentMethodCallback(this) + .build(this) } else { - PaymentSheet.FlowController.create( - this, - paymentOptionCallback = paymentOptionCallback, - paymentResultCallback = paymentResultCallback, - ) + PaymentSheet.FlowController + .Builder( + resultCallback = paymentResultCallback, + paymentOptionCallback = paymentOptionCallback, + ).confirmCustomPaymentMethodCallback(this) + .build(this) } configureFlowController() } else { paymentSheet = if (intentConfiguration != null) { - PaymentSheet( - this, - createIntentCallback = createIntentCallback, - paymentResultCallback = paymentResultCallback, - ) + PaymentSheet + .Builder(paymentResultCallback) + .createIntentCallback(createIntentCallback) + .confirmCustomPaymentMethodCallback(this) + .build(this) } else { - PaymentSheet(this, callback = paymentResultCallback) + PaymentSheet + .Builder(paymentResultCallback) + .confirmCustomPaymentMethodCallback(this) + .build(this) } initPromise.resolve(WritableNativeMap()) } @@ -351,7 +353,8 @@ class PaymentSheetFragment( override fun onActivitySaveInstanceState( activity: Activity, outState: Bundle, - ) {} + ) { + } override fun onActivityDestroyed(activity: Activity) { paymentSheetActivity = null @@ -438,9 +441,96 @@ class PaymentSheetFragment( } ?: run { resolvePresentPromise(map) } } + @OptIn(ExperimentalCustomPaymentMethodsApi::class) + override fun onConfirmCustomPaymentMethod( + customPaymentMethod: PaymentSheet.CustomPaymentMethod, + billingDetails: PaymentMethod.BillingDetails, + ) { + // Launch a transparent Activity to ensure React Native UI can appear on top of the Stripe proxy activity. + try { + val intent = + Intent(context, CustomPaymentMethodActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION) + } + context.startActivity(intent) + } catch (e: Exception) { + Log.e("StripeReactNative", "Failed to start CustomPaymentMethodActivity", e) + } + + val stripeSdkModule = + try { + context.getNativeModule(StripeSdkModule::class.java) + ?: throw IllegalArgumentException("StripeSdkModule not found") + } catch (ex: IllegalArgumentException) { + Log.e("StripeReactNative", "StripeSdkModule not found for CPM callback", ex) + CustomPaymentMethodActivity.finishCurrent() + return + } + + // Keep JS awake while React Native is backgrounded by Stripe SDK. + val keepJsAwakeTask = + KeepJsAwakeTask(context).apply { start() } + + // Run on main coroutine scope. + CoroutineScope(Dispatchers.Main).launch { + try { + // Give the CustomPaymentMethodActivity a moment to fully initialize + delay(100) + + // Emit event so JS can show the Alert and eventually respond via `customPaymentMethodResultCallback`. + stripeSdkModule.emitOnCustomPaymentMethodConfirmHandlerCallback( + mapFromCustomPaymentMethod(customPaymentMethod, billingDetails), + ) + + // Await JS result. + val resultFromJs = stripeSdkModule.customPaymentMethodResultCallback.await() + + keepJsAwakeTask.stop() + + val status = resultFromJs.getString("status") + + val nativeResult = + when (status) { + "completed" -> + CustomPaymentMethodResult.completed() + "canceled" -> + CustomPaymentMethodResult.canceled() + "failed" -> { + val errMsg = resultFromJs.getString("error") ?: "Custom payment failed" + CustomPaymentMethodResult.failed(displayMessage = errMsg) + } + else -> + CustomPaymentMethodResult.failed(displayMessage = "Unknown status") + } + + // Return result to Stripe SDK. + CustomPaymentMethodResultHandler.handleCustomPaymentMethodResult( + context, + nativeResult, + ) + } finally { + // Clean up the transparent activity + CustomPaymentMethodActivity.finishCurrent() + } + } + } + companion object { internal const val TAG = "payment_sheet_launch_fragment" + internal fun create( + context: ReactApplicationContext, + arguments: Bundle, + initPromise: Promise, + ): PaymentSheetFragment { + val instance = PaymentSheetFragment() + instance.context = context + instance.initPromise = initPromise + instance.arguments = arguments + return instance + } + private val mapIntToButtonType = mapOf( 1 to PaymentSheet.GooglePayConfiguration.ButtonType.Buy, @@ -488,8 +578,27 @@ class PaymentSheetFragment( ) } + internal fun buildLinkConfig(params: Bundle?): PaymentSheet.LinkConfiguration { + if (params == null) { + return PaymentSheet.LinkConfiguration() + } + + val display = mapStringToLinkDisplay(params.getString("display")) + + return PaymentSheet.LinkConfiguration( + display = display, + ) + } + + private fun mapStringToLinkDisplay(value: String?): PaymentSheet.LinkConfiguration.Display = + when (value) { + "automatic" -> PaymentSheet.LinkConfiguration.Display.Automatic + "never" -> PaymentSheet.LinkConfiguration.Display.Never + else -> PaymentSheet.LinkConfiguration.Display.Automatic + } + @Throws(PaymentSheetException::class) - private fun buildIntentConfiguration(intentConfigurationParams: Bundle?): PaymentSheet.IntentConfiguration? { + internal fun buildIntentConfiguration(intentConfigurationParams: Bundle?): PaymentSheet.IntentConfiguration? { if (intentConfigurationParams == null) { return null } @@ -507,6 +616,7 @@ class PaymentSheetFragment( ) } + @OptIn(PaymentMethodOptionsSetupFutureUsagePreview::class) private fun buildIntentConfigurationMode(modeParams: Bundle): PaymentSheet.IntentConfiguration.Mode { val currencyCode = modeParams.getString("currencyCode") @@ -520,6 +630,7 @@ class PaymentSheetFragment( currency = currencyCode, setupFutureUse = mapToSetupFutureUse(modeParams.getString("setupFutureUsage")), captureMethod = mapToCaptureMethod(modeParams.getString("captureMethod")), + paymentMethodOptions = mapToPaymentMethodOptions(modeParams.getBundle("paymentMethodOptions")), ) } else { val setupFutureUsage = @@ -536,7 +647,7 @@ class PaymentSheetFragment( @OptIn(ExperimentalCustomerSessionApi::class) @Throws(PaymentSheetException::class) - private fun buildCustomerConfiguration(bundle: Bundle?): PaymentSheet.CustomerConfiguration? { + internal fun buildCustomerConfiguration(bundle: Bundle?): PaymentSheet.CustomerConfiguration? { val customerId = bundle?.getString("customerId").orEmpty() val customerEphemeralKeySecret = bundle?.getString("customerEphemeralKeySecret").orEmpty() val customerSessionClientSecret = bundle?.getString("customerSessionClientSecret").orEmpty() @@ -618,6 +729,7 @@ fun mapToAddressCollectionMode(str: String?): PaymentSheet.BillingDetailsCollect when (str) { "automatic" -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode.Automatic + "never" -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode.Never "full" -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode.Full else -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode.Automatic @@ -627,6 +739,7 @@ fun mapToSetupFutureUse(type: String?): PaymentSheet.IntentConfiguration.SetupFu when (type) { "OffSession" -> PaymentSheet.IntentConfiguration.SetupFutureUse.OffSession "OnSession" -> PaymentSheet.IntentConfiguration.SetupFutureUse.OnSession + "None" -> PaymentSheet.IntentConfiguration.SetupFutureUse.None else -> null } @@ -638,6 +751,26 @@ fun mapToCaptureMethod(type: String?): PaymentSheet.IntentConfiguration.CaptureM else -> PaymentSheet.IntentConfiguration.CaptureMethod.Automatic } +@OptIn(PaymentMethodOptionsSetupFutureUsagePreview::class) +fun mapToPaymentMethodOptions(options: Bundle?): PaymentSheet.IntentConfiguration.Mode.Payment.PaymentMethodOptions? { + val sfuBundle = options?.getBundle("setupFutureUsageValues") + val paymentMethodToSfuMap = mutableMapOf() + sfuBundle?.keySet()?.forEach { code -> + val sfuValue = mapToSetupFutureUse(sfuBundle?.getString(code)) + val paymentMethodType = PaymentMethod.Type.fromCode(code) + if (paymentMethodType != null && sfuValue != null) { + paymentMethodToSfuMap[paymentMethodType] = sfuValue + } + } + return if (paymentMethodToSfuMap.isNotEmpty()) { + PaymentSheet.IntentConfiguration.Mode.Payment.PaymentMethodOptions( + setupFutureUsageValues = paymentMethodToSfuMap, + ) + } else { + null + } +} + fun mapToCardBrandAcceptance(params: Bundle?): PaymentSheet.CardBrandAcceptance { val cardBrandAcceptanceParams = params?.getBundle("cardBrandAcceptance") ?: return PaymentSheet.CardBrandAcceptance.all() val filter = cardBrandAcceptanceParams.getString("filter") ?: return PaymentSheet.CardBrandAcceptance.all() diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeAbstractComposeView.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeAbstractComposeView.kt new file mode 100644 index 000000000..a11e33b7d --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeAbstractComposeView.kt @@ -0,0 +1,113 @@ +package com.reactnativestripesdk + +import android.content.Context +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.AbstractComposeView +import androidx.compose.ui.platform.ViewCompositionStrategy +import androidx.compose.ui.platform.findViewTreeCompositionContext +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleEventObserver +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.LifecycleRegistry +import androidx.lifecycle.findViewTreeViewModelStoreOwner +import androidx.lifecycle.setViewTreeLifecycleOwner +import androidx.lifecycle.setViewTreeViewModelStoreOwner +import androidx.savedstate.findViewTreeSavedStateRegistryOwner +import androidx.savedstate.setViewTreeSavedStateRegistryOwner +import com.facebook.react.bridge.ReactContext + +/** + * Compose disposes views by default when using Fragments, which is not compatible with how + * react-native-screens work. To avoid this we change the composition strategy to use the + * activity lifecycle instead of the fragment. Note that `setViewTreeLifecycleOwner` also + * needs to be set otherwise a different code path will dispose of the view. + * + * **IMPORTANT** Views using this will need to call `handleOnDropViewInstance` manually to avoid leaking. + * This can be done using the using the following code in the view manager: + * + * ``` + * override fun onDropViewInstance(view: SomeStripeAbstractComposeView) { + * super.onDropViewInstance(view) + * + * view.handleOnDropViewInstance() + * } + * ``` + */ +abstract class StripeAbstractComposeView( + context: Context, +) : AbstractComposeView(context) { + /** + * Dummy compose view that will be added at the root of the app, this is needed so that the context + * that compose needs is already initialized and we can set it directly on our compose views. + * If we do not do this there are cases where react-native initializes compose views in ways that + * are not supported and causes crashes. An example is when using a compose view inside react-native + * Modal component. + */ + class CompatView( + context: Context, + ) : AbstractComposeView(context) { + init { + visibility = GONE + } + + @Composable + override fun Content() { + } + } + + private var isLifecycleSetup = false + + // Create a lifecycle this is tied to the activity, but that we can manually + // update to DESTROYED state when the view is dropped. + private val lifecycleOwner: LifecycleOwner = + object : LifecycleOwner { + override val lifecycle: Lifecycle get() { + return lifecycleRegistry + } + } + private var lifecycleRegistry = LifecycleRegistry(lifecycleOwner) + + init { + // Setup lifecycles + setViewCompositionStrategy( + ViewCompositionStrategy.DisposeOnLifecycleDestroyed(lifecycleOwner = lifecycleOwner), + ) + setViewTreeLifecycleOwner(lifecycleOwner = lifecycleOwner) + + // Setup context from dummy compose view. + (context as ReactContext).getNativeModule(StripeSdkModule::class.java)?.composeCompatView?.let { + setParentCompositionContext(it.findViewTreeCompositionContext()) + setViewTreeSavedStateRegistryOwner(it.findViewTreeSavedStateRegistryOwner()) + setViewTreeViewModelStoreOwner(it.findViewTreeViewModelStoreOwner()) + } + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + + if (isLifecycleSetup) { + return + } + + ((context as? ReactContext)?.currentActivity as? LifecycleOwner?)?.let { + isLifecycleSetup = true + + // Setup the lifecycle to match the activity. + it.lifecycle.addObserver( + object : LifecycleEventObserver { + override fun onStateChanged( + source: LifecycleOwner, + event: Lifecycle.Event, + ) { + lifecycleRegistry.handleLifecycleEvent(event) + } + }, + ) + } + } + + fun handleOnDropViewInstance() { + // Update the lifecycle state to DESTROYED to cause the composition to be destroyed. + lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY) + } +} diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeSdkModule.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeSdkModule.kt index a334e20cb..e277e1998 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeSdkModule.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/StripeSdkModule.kt @@ -1,23 +1,27 @@ package com.reactnativestripesdk +import android.annotation.SuppressLint import android.app.Activity +import android.app.Application import android.content.Intent +import android.os.Bundle import android.util.Log +import android.view.ViewGroup import androidx.fragment.app.FragmentActivity +import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.BaseActivityEventListener import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactContext -import com.facebook.react.bridge.ReactContextBaseJavaModule import com.facebook.react.bridge.ReactMethod import com.facebook.react.bridge.ReadableArray import com.facebook.react.bridge.ReadableMap +import com.facebook.react.bridge.UiThreadUtil import com.facebook.react.bridge.WritableMap import com.facebook.react.bridge.WritableNativeMap import com.facebook.react.module.annotations.ReactModule -import com.facebook.react.modules.core.DeviceEventManagerModule import com.flutter.stripe.invoke import com.reactnativestripesdk.addresssheet.AddressLauncherFragment +import com.reactnativestripesdk.customersheet.CustomerSheetFragment import com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy import com.reactnativestripesdk.utils.ConfirmPaymentErrorType import com.reactnativestripesdk.utils.CreateTokenErrorType @@ -62,6 +66,7 @@ import com.stripe.android.model.SetupIntent import com.stripe.android.model.Token import com.stripe.android.payments.bankaccount.CollectBankAccountConfiguration import com.stripe.android.paymentsheet.PaymentSheet +import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -70,9 +75,7 @@ import org.json.JSONObject @ReactModule(name = StripeSdkModule.NAME) class StripeSdkModule( val reactContext: ReactApplicationContext, -) : ReactContextBaseJavaModule(reactContext) { - override fun getName(): String = NAME - +) : NativeStripeSdkModuleSpec(reactContext) { var cardFieldView: CardFieldView? = null var cardFormView: CardFormView? = null @@ -90,7 +93,10 @@ class StripeSdkModule( private var customerSheetFragment: CustomerSheetFragment? = null - internal var eventListenerCount = 0 + internal var embeddedIntentCreationCallback = CompletableDeferred() + internal var customPaymentMethodResultCallback = CompletableDeferred() + + internal var composeCompatView: StripeAbstractComposeView.CompatView? = null // If you create a new Fragment, you must put the tag here, otherwise result callbacks for that // Fragment will not work on RN < 0.65 @@ -177,17 +183,18 @@ class StripeSdkModule( ) } - override fun getConstants(): MutableMap = - hashMapOf( + @SuppressLint("RestrictedApi") + override fun getTypedExportedConstants() = + mapOf( "API_VERSIONS" to - hashMapOf( + mapOf( "CORE" to ApiVersion.API_VERSION_CODE, "ISSUING" to PushProvisioningProxy.getApiVersion(), ), ) @ReactMethod - fun initialise( + override fun initialise( params: ReadableMap, promise: Promise, ) { @@ -214,21 +221,31 @@ class StripeSdkModule( stripe = Stripe(reactApplicationContext, publishableKey, stripeAccountId) PaymentConfiguration.init(reactApplicationContext, publishableKey, stripeAccountId) + + preventActivityRecreation() + setupComposeCompatView() + promise.resolve(null) } @ReactMethod - fun initPaymentSheet( + override fun initPaymentSheet( params: ReadableMap, promise: Promise, ) { getCurrentActivityOrResolveWithError(promise)?.let { activity -> paymentSheetFragment?.removeFragment(reactApplicationContext) + val bundle = toBundleObject(params) + + // Handle custom payment methods separately since toBundleObject cannot handle arrays of objects + val customPaymentMethodConfig = params.getMap("customPaymentMethodConfiguration") + if (customPaymentMethodConfig != null) { + // Store the original ReadableMap for custom payment methods + bundle.putSerializable("customPaymentMethodConfigurationReadableMap", customPaymentMethodConfig.toHashMap()) + } + paymentSheetFragment = - PaymentSheetFragment(reactApplicationContext, promise).also { - val bundle = toBundleObject(params) - it.arguments = bundle - } + PaymentSheetFragment.create(reactApplicationContext, bundle, promise) try { activity.supportFragmentManager .beginTransaction() @@ -241,7 +258,7 @@ class StripeSdkModule( } @ReactMethod - fun presentPaymentSheet( + override fun presentPaymentSheet( options: ReadableMap, promise: Promise, ) { @@ -262,7 +279,7 @@ class StripeSdkModule( } @ReactMethod - fun confirmPaymentSheetPayment(promise: Promise) { + override fun confirmPaymentSheetPayment(promise: Promise) { if (paymentSheetFragment == null) { promise.resolve(PaymentSheetFragment.createMissingInitError()) return @@ -272,16 +289,18 @@ class StripeSdkModule( } @ReactMethod - fun resetPaymentSheetCustomer(promise: Promise) { + override fun resetPaymentSheetCustomer(promise: Promise) { PaymentSheet.resetCustomer(context = reactApplicationContext) promise.resolve(null) } @ReactMethod - fun intentCreationCallback( + override fun intentCreationCallback( params: ReadableMap, promise: Promise, ) { + embeddedIntentCreationCallback.complete(params) + if (paymentSheetFragment == null) { promise.resolve(PaymentSheetFragment.createMissingInitError()) return @@ -291,7 +310,19 @@ class StripeSdkModule( } @ReactMethod - fun createPaymentMethod( + override fun customPaymentMethodResultCallback( + result: ReadableMap?, + promise: Promise?, + ) { + // Complete the deferred with the result from JavaScript + customPaymentMethodResultCallback.complete(result ?: Arguments.createMap()) + // Reset for next use + customPaymentMethodResultCallback = CompletableDeferred() + promise?.resolve(null) + } + + @ReactMethod + override fun createPaymentMethod( data: ReadableMap, options: ReadableMap, promise: Promise, @@ -331,7 +362,7 @@ class StripeSdkModule( } @ReactMethod - fun createToken( + override fun createToken( params: ReadableMap, promise: Promise, ) { @@ -468,7 +499,7 @@ class StripeSdkModule( } @ReactMethod - fun createTokenForCVCUpdate( + override fun createTokenForCVCUpdate( cvc: String, promise: Promise, ) { @@ -491,8 +522,9 @@ class StripeSdkModule( } @ReactMethod - fun handleNextAction( + override fun handleNextAction( paymentIntentClientSecret: String, + returnUrl: String?, promise: Promise, ) { paymentLauncherFragment = @@ -507,8 +539,9 @@ class StripeSdkModule( } @ReactMethod - fun handleNextActionForSetup( + override fun handleNextActionForSetup( setupIntentClientSecret: String, + returnUrl: String?, promise: Promise, ) { paymentLauncherFragment = @@ -542,10 +575,10 @@ class StripeSdkModule( // } @ReactMethod - fun confirmPayment( + override fun confirmPayment( paymentIntentClientSecret: String, params: ReadableMap?, - options: ReadableMap, + options: ReadableMap?, promise: Promise, ) { val paymentMethodData = getMapOrNull(params, "paymentMethodData") @@ -605,7 +638,7 @@ class StripeSdkModule( } @ReactMethod - fun retrievePaymentIntent( + override fun retrievePaymentIntent( clientSecret: String, promise: Promise, ) { @@ -616,7 +649,7 @@ class StripeSdkModule( } @ReactMethod - fun retrieveSetupIntent( + override fun retrieveSetupIntent( clientSecret: String, promise: Promise, ) { @@ -627,7 +660,7 @@ class StripeSdkModule( } @ReactMethod - fun confirmSetupIntent( + override fun confirmSetupIntent( setupIntentClientSecret: String, params: ReadableMap, options: ReadableMap, @@ -678,13 +711,13 @@ class StripeSdkModule( } @ReactMethod - fun isPlatformPaySupported( + override fun isPlatformPaySupported( params: ReadableMap?, promise: Promise, ) { val googlePayParams = params?.getMap("googlePay") val fragment = - GooglePayPaymentMethodLauncherFragment( + GooglePayPaymentMethodLauncherFragment.create( reactApplicationContext, getBooleanOrFalse(googlePayParams, "testEnv"), getBooleanOrFalse(googlePayParams, "existingPaymentMethodRequired"), @@ -704,7 +737,7 @@ class StripeSdkModule( } @ReactMethod - fun confirmPlatformPay( + override fun confirmPlatformPay( clientSecret: String, params: ReadableMap, isPaymentIntent: Boolean, @@ -800,7 +833,7 @@ class StripeSdkModule( } @ReactMethod - fun createPlatformPayPaymentMethod( + override fun createPlatformPayPaymentMethod( params: ReadableMap, usesDeprecatedTokenFlow: Boolean, promise: Promise, @@ -829,7 +862,7 @@ class StripeSdkModule( } @ReactMethod - fun canAddCardToWallet( + override fun canAddCardToWallet( params: ReadableMap, promise: Promise, ) { @@ -863,7 +896,7 @@ class StripeSdkModule( } @ReactMethod - fun isCardInWallet( + override fun isCardInWallet( params: ReadableMap, promise: Promise, ) { @@ -887,7 +920,7 @@ class StripeSdkModule( } @ReactMethod - fun collectBankAccount( + override fun collectBankAccount( isPaymentIntent: Boolean, clientSecret: String, params: ReadableMap, @@ -925,7 +958,7 @@ class StripeSdkModule( ) collectBankAccountLauncherFragment = - CollectBankAccountLauncherFragment( + CollectBankAccountLauncherFragment.create( reactApplicationContext, publishableKey, stripeAccountId, @@ -947,7 +980,7 @@ class StripeSdkModule( } @ReactMethod - fun verifyMicrodeposits( + override fun verifyMicrodeposits( isPaymentIntent: Boolean, clientSecret: String, params: ReadableMap, @@ -1032,8 +1065,9 @@ class StripeSdkModule( } @ReactMethod - fun collectBankAccountToken( + override fun collectBankAccountToken( clientSecret: String, + params: ReadableMap, promise: Promise, ) { if (!::stripe.isInitialized) { @@ -1053,8 +1087,9 @@ class StripeSdkModule( } @ReactMethod - fun collectFinancialConnectionsAccounts( + override fun collectFinancialConnectionsAccounts( clientSecret: String, + params: ReadableMap, promise: Promise, ) { if (!::stripe.isInitialized) { @@ -1074,7 +1109,7 @@ class StripeSdkModule( } @ReactMethod - fun initCustomerSheet( + override fun initCustomerSheet( params: ReadableMap, customerAdapterOverrides: ReadableMap, promise: Promise, @@ -1106,7 +1141,7 @@ class StripeSdkModule( } @ReactMethod - fun presentCustomerSheet( + override fun presentCustomerSheet( params: ReadableMap, promise: Promise, ) { @@ -1120,14 +1155,14 @@ class StripeSdkModule( } @ReactMethod - fun retrieveCustomerSheetPaymentOptionSelection(promise: Promise) { + override fun retrieveCustomerSheetPaymentOptionSelection(promise: Promise) { customerSheetFragment?.retrievePaymentOptionSelection(promise) ?: run { promise.resolve(CustomerSheetFragment.createMissingInitError()) } } @ReactMethod - fun customerAdapterFetchPaymentMethodsCallback( + override fun customerAdapterFetchPaymentMethodsCallback( paymentMethodJsonObjects: ReadableArray, promise: Promise, ) { @@ -1151,7 +1186,7 @@ class StripeSdkModule( } @ReactMethod - fun customerAdapterAttachPaymentMethodCallback( + override fun customerAdapterAttachPaymentMethodCallback( paymentMethodJson: ReadableMap, promise: Promise, ) { @@ -1173,7 +1208,7 @@ class StripeSdkModule( } @ReactMethod - fun customerAdapterDetachPaymentMethodCallback( + override fun customerAdapterDetachPaymentMethodCallback( paymentMethodJson: ReadableMap, promise: Promise, ) { @@ -1195,7 +1230,7 @@ class StripeSdkModule( } @ReactMethod - fun customerAdapterSetSelectedPaymentOptionCallback(promise: Promise) { + override fun customerAdapterSetSelectedPaymentOptionCallback(promise: Promise) { customerSheetFragment?.let { it.customerAdapter?.setSelectedPaymentOptionCallback?.complete(Unit) } ?: run { @@ -1205,7 +1240,7 @@ class StripeSdkModule( } @ReactMethod - fun customerAdapterFetchSelectedPaymentOptionCallback( + override fun customerAdapterFetchSelectedPaymentOptionCallback( paymentOption: String?, promise: Promise, ) { @@ -1218,7 +1253,7 @@ class StripeSdkModule( } @ReactMethod - fun customerAdapterSetupIntentClientSecretForCustomerAttachCallback( + override fun customerAdapterSetupIntentClientSecretForCustomerAttachCallback( clientSecret: String, promise: Promise, ) { @@ -1231,26 +1266,70 @@ class StripeSdkModule( } @ReactMethod - fun addListener(eventName: String) { - eventListenerCount++ + override fun createEmbeddedPaymentElement( + intentConfig: ReadableMap, + configuration: ReadableMap, + promise: Promise, + ) { + // TODO: + } + + @ReactMethod + override fun confirmEmbeddedPaymentElement( + viewTag: Double, + promise: Promise, + ) { + // noop, iOS only } @ReactMethod - fun removeListeners(count: Int) { - eventListenerCount -= count - if (eventListenerCount < 0) { - eventListenerCount = 0 - } + override fun updateEmbeddedPaymentElement( + intentConfig: ReadableMap, + promise: Promise, + ) { + // TODO: + } + + @ReactMethod + override fun clearEmbeddedPaymentOption( + viewTag: Double, + promise: Promise, + ) { + // noop, iOS only + } + + override fun handleURLCallback( + url: String, + promise: Promise, + ) { + // noop, iOS only. + } + + override fun openApplePaySetup(promise: Promise) { + // noop, iOS only. + } + + override fun configureOrderTracking( + orderTypeIdentifier: String, + orderIdentifier: String, + webServiceUrl: String, + authenticationToken: String, + promise: Promise, + ) { + // noop, iOS only. } - internal fun sendEvent( - reactContext: ReactContext, - eventName: String, - params: WritableMap, + override fun dismissPlatformPay(promise: Promise?) { + // noop, iOS only. + } + + override fun updatePlatformPaySheet( + summaryItems: ReadableArray?, + shippingMethods: ReadableArray?, + errors: ReadableArray?, + promise: Promise?, ) { - reactContext - .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) - .emit(eventName, params) + // noop, iOS only. } /** @@ -1265,7 +1344,67 @@ class StripeSdkModule( return null } + private var isRecreatingActivities = false + private val activityLifecycleCallbacks = + object : Application.ActivityLifecycleCallbacks { + override fun onActivityCreated( + activity: Activity, + bundle: Bundle?, + ) { + if (bundle != null) { + isRecreatingActivities = true + } + if (isRecreatingActivities && activity.javaClass.name.startsWith("com.stripe.android")) { + activity.finish() + } + } + + override fun onActivityStarted(activity: Activity) { + } + + override fun onActivityResumed(activity: Activity) { + isRecreatingActivities = false + } + + override fun onActivityPaused(activity: Activity) { + } + + override fun onActivityStopped(activity: Activity) { + } + + override fun onActivitySaveInstanceState( + activity: Activity, + bundle: Bundle, + ) { + } + + override fun onActivityDestroyed(activity: Activity) { + } + } + + /** + * React native apps do not properly handle activity re-creation so make + * sure to dismiss any stripe ui when that happens to make sure apps stay + * in a consistent state. + * + * Note that because of some restrictions on some system ui like google + * pay this might not always work. + */ + private fun preventActivityRecreation() { + currentActivity?.application?.registerActivityLifecycleCallbacks(activityLifecycleCallbacks) + } + + private fun setupComposeCompatView() { + UiThreadUtil.runOnUiThread { + composeCompatView = composeCompatView ?: StripeAbstractComposeView.CompatView(context = reactApplicationContext).also { + currentActivity?.findViewById(android.R.id.content)?.addView( + it, + ) + } + } + } + companion object { - const val NAME = "StripeSdk" + const val NAME = NativeStripeSdkModuleSpec.NAME } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt index 7502cd2e6..efda07de0 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt @@ -1,22 +1,17 @@ package com.reactnativestripesdk.addresssheet -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import com.facebook.react.bridge.ReactContext import com.facebook.react.bridge.WritableMap import com.reactnativestripesdk.utils.ErrorType +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.addresselement.AddressDetails import com.stripe.android.paymentsheet.addresselement.AddressLauncher import com.stripe.android.paymentsheet.addresselement.AddressLauncherResult -class AddressLauncherFragment : Fragment() { +class AddressLauncherFragment : StripeFragment() { companion object { internal var publishableKey: String? = null internal const val TAG = "address_launcher_fragment" @@ -26,16 +21,7 @@ class AddressLauncherFragment : Fragment() { private var configuration = AddressLauncher.Configuration() private var callback: ((error: WritableMap?, address: AddressDetails?) -> Unit)? = null - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View = FrameLayout(requireActivity()).also { it.visibility = View.GONE } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle?, - ) { + override fun prepare() { publishableKey?.let { publishableKey -> addressLauncher = AddressLauncher(this, ::onAddressLauncherResult).also { diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetView.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetView.kt index 839d8fffc..7b3099278 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetView.kt @@ -84,35 +84,35 @@ class AddressSheetView( } } - fun setAppearance(appearanceParams: ReadableMap) { + fun setAppearance(appearanceParams: ReadableMap?) { this.appearanceParams = appearanceParams } - fun setDefaultValues(defaults: ReadableMap) { - defaultAddress = buildAddressDetails(defaults) + fun setDefaultValues(defaults: ReadableMap?) { + defaultAddress = defaults?.let { buildAddressDetails(it) } } - fun setAdditionalFields(fields: ReadableMap) { - additionalFields = buildAdditionalFieldsConfiguration(fields) + fun setAdditionalFields(fields: ReadableMap?) { + additionalFields = fields?.let { buildAdditionalFieldsConfiguration(it) } } - fun setAllowedCountries(countries: List) { - allowedCountries = countries.toSet() + fun setAllowedCountries(countries: List?) { + allowedCountries = countries?.toSet() ?: emptySet() } - fun setAutocompleteCountries(countries: List) { - autocompleteCountries = countries.toSet() + fun setAutocompleteCountries(countries: List?) { + autocompleteCountries = countries?.toSet() ?: emptySet() } - fun setPrimaryButtonTitle(title: String) { + fun setPrimaryButtonTitle(title: String?) { buttonTitle = title } - fun setSheetTitle(title: String) { + fun setSheetTitle(title: String?) { sheetTitle = title } - fun setGooglePlacesApiKey(key: String) { + fun setGooglePlacesApiKey(key: String?) { googlePlacesApiKey = key } @@ -158,21 +158,27 @@ class AddressSheetView( ) } - internal fun buildResult(addressDetails: AddressDetails): WritableMap { - val result = WritableNativeMap() - result.putString("name", addressDetails.name) - WritableNativeMap().let { - it.putString("city", addressDetails.address?.city) - it.putString("country", addressDetails.address?.country) - it.putString("line1", addressDetails.address?.line1) - it.putString("line2", addressDetails.address?.line2) - it.putString("postalCode", addressDetails.address?.postalCode) - it.putString("state", addressDetails.address?.state) - result.putMap("address", it) + internal fun buildResult(addressDetails: AddressDetails): WritableMap = + WritableNativeMap().apply { + putMap( + "result", + WritableNativeMap().apply { + putString("name", addressDetails.name) + putMap( + "address", + WritableNativeMap().apply { + putString("city", addressDetails.address?.city) + putString("country", addressDetails.address?.country) + putString("line1", addressDetails.address?.line1) + putString("line2", addressDetails.address?.line2) + putString("postalCode", addressDetails.address?.postalCode) + putString("state", addressDetails.address?.state) + }, + ) + putString("phone", addressDetails.phoneNumber) + putBoolean("isCheckboxSelected", addressDetails.isCheckboxSelected ?: false) + }, + ) } - result.putString("phone", addressDetails.phoneNumber) - result.putBoolean("isCheckboxSelected", addressDetails.isCheckboxSelected ?: false) - return result - } } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt index 3346e0ecb..8b63a266d 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt @@ -1,16 +1,25 @@ package com.reactnativestripesdk.addresssheet +import com.facebook.react.bridge.Dynamic import com.facebook.react.bridge.ReadableArray -import com.facebook.react.bridge.ReadableMap import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.SimpleViewManager import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.AddressSheetViewManagerDelegate +import com.facebook.react.viewmanagers.AddressSheetViewManagerInterface +import com.reactnativestripesdk.utils.asMapOrNull @ReactModule(name = AddressSheetViewManager.REACT_CLASS) -class AddressSheetViewManager : SimpleViewManager() { +class AddressSheetViewManager : + SimpleViewManager(), + AddressSheetViewManagerInterface { + private val delegate = AddressSheetViewManagerDelegate(this) + override fun getName() = REACT_CLASS + override fun getDelegate() = delegate + override fun getExportedCustomDirectEventTypeConstants() = mutableMapOf( AddressSheetEvent.ON_SUBMIT to @@ -20,7 +29,7 @@ class AddressSheetViewManager : SimpleViewManager() { ) @ReactProp(name = "visible") - fun setVisible( + override fun setVisible( view: AddressSheetView, visibility: Boolean, ) { @@ -28,69 +37,85 @@ class AddressSheetViewManager : SimpleViewManager() { } @ReactProp(name = "appearance") - fun setAppearance( + override fun setAppearance( view: AddressSheetView, - appearance: ReadableMap, + appearance: Dynamic, ) { - view.setAppearance(appearance) + view.setAppearance(appearance.asMap()) } @ReactProp(name = "defaultValues") - fun setDefaultValues( + override fun setDefaultValues( view: AddressSheetView, - defaults: ReadableMap, + defaults: Dynamic, ) { - view.setDefaultValues(defaults) + view.setDefaultValues(defaults.asMap()) } @ReactProp(name = "additionalFields") - fun setAdditionalFields( + override fun setAdditionalFields( view: AddressSheetView, - fields: ReadableMap, + fields: Dynamic, ) { - view.setAdditionalFields(fields) + view.setAdditionalFields(fields.asMapOrNull()) } @ReactProp(name = "allowedCountries") - fun setAllowedCountries( + override fun setAllowedCountries( view: AddressSheetView, - countries: ReadableArray, + countries: ReadableArray?, ) { - view.setAllowedCountries(countries.toArrayList().filterIsInstance()) + view.setAllowedCountries(countries?.toArrayList()?.filterIsInstance()) } @ReactProp(name = "autocompleteCountries") - fun setAutocompleteCountries( + override fun setAutocompleteCountries( view: AddressSheetView, - countries: ReadableArray, + countries: ReadableArray?, ) { - view.setAutocompleteCountries(countries.toArrayList().filterIsInstance()) + view.setAutocompleteCountries(countries?.toArrayList()?.filterIsInstance()) } @ReactProp(name = "primaryButtonTitle") - fun setPrimaryButtonTitle( + override fun setPrimaryButtonTitle( view: AddressSheetView, - title: String, + title: String?, ) { view.setPrimaryButtonTitle(title) } @ReactProp(name = "sheetTitle") - fun setSheetTitle( + override fun setSheetTitle( view: AddressSheetView, - title: String, + title: String?, ) { view.setSheetTitle(title) } @ReactProp(name = "googlePlacesApiKey") - fun setGooglePlacesApiKey( + override fun setGooglePlacesApiKey( view: AddressSheetView, - key: String, + key: String?, ) { view.setGooglePlacesApiKey(key) } + @ReactProp(name = "presentationStyle") + override fun setPresentationStyle( + view: AddressSheetView, + value: String?, + ) { + // noop iOS only. + } + + @ReactProp(name = "animationStyle") + override fun setAnimationStyle( + view: AddressSheetView, + value: String?, + ) { + // noop iOS only. + } + override fun createViewInstance(reactContext: ThemedReactContext): AddressSheetView = AddressSheetView(reactContext) companion object { diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt index dee0f9707..f6af3434c 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt @@ -1,4 +1,4 @@ -package com.reactnativestripesdk +package com.reactnativestripesdk.customersheet import android.app.Activity import android.app.Application @@ -7,21 +7,23 @@ import android.os.Bundle import android.os.Handler import android.os.Looper import android.util.Log -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import androidx.fragment.app.Fragment import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.Promise import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.WritableMap import com.facebook.react.bridge.WritableNativeMap -import com.reactnativestripesdk.customersheet.ReactNativeCustomerAdapter +import com.reactnativestripesdk.ReactNativeCustomerAdapter +import com.reactnativestripesdk.buildPaymentSheetAppearance +import com.reactnativestripesdk.getBase64FromBitmap +import com.reactnativestripesdk.getBitmapFromDrawable +import com.reactnativestripesdk.mapToAddressCollectionMode +import com.reactnativestripesdk.mapToCardBrandAcceptance +import com.reactnativestripesdk.mapToCollectionMode import com.reactnativestripesdk.utils.CreateTokenErrorType import com.reactnativestripesdk.utils.ErrorType import com.reactnativestripesdk.utils.KeepJsAwakeTask import com.reactnativestripesdk.utils.PaymentSheetAppearanceException +import com.reactnativestripesdk.utils.StripeFragment import com.reactnativestripesdk.utils.createError import com.reactnativestripesdk.utils.mapFromPaymentMethod import com.reactnativestripesdk.utils.mapToPreferredNetworks @@ -38,7 +40,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @OptIn(ExperimentalAllowsRemovalOfLastSavedPaymentMethodApi::class) -class CustomerSheetFragment : Fragment() { +class CustomerSheetFragment : StripeFragment() { private var customerSheet: CustomerSheet? = null internal var customerAdapter: ReactNativeCustomerAdapter? = null internal var context: ReactApplicationContext? = null @@ -46,18 +48,7 @@ class CustomerSheetFragment : Fragment() { private var presentPromise: Promise? = null private var keepJsAwake: KeepJsAwakeTask? = null - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle?, - ): View = FrameLayout(requireActivity()).also { it.visibility = View.GONE } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle?, - ) { - super.onViewCreated(view, savedInstanceState) - + override fun prepare() { val context = context ?: run { @@ -161,9 +152,11 @@ class CustomerSheetFragment : Fragment() { is CustomerSheetResult.Failed -> { resolvePresentPromise(createError(ErrorType.Failed.toString(), result.exception)) } + is CustomerSheetResult.Selected -> { promiseResult = createPaymentOptionResult(result.selection) } + is CustomerSheetResult.Canceled -> { promiseResult = createPaymentOptionResult(result.selection) promiseResult.putMap( @@ -188,7 +181,6 @@ class CustomerSheetFragment : Fragment() { } private fun presentWithTimeout(timeout: Long) { - var customerSheetActivity: Activity? = null var activities: MutableList = mutableListOf() val activityLifecycleCallbacks = object : Application.ActivityLifecycleCallbacks { @@ -196,7 +188,6 @@ class CustomerSheetFragment : Fragment() { activity: Activity, savedInstanceState: Bundle?, ) { - customerSheetActivity = activity activities.add(activity) } @@ -211,10 +202,10 @@ class CustomerSheetFragment : Fragment() { override fun onActivitySaveInstanceState( activity: Activity, outState: Bundle, - ) {} + ) { + } override fun onActivityDestroyed(activity: Activity) { - customerSheetActivity = null activities = mutableListOf() context?.currentActivity?.application?.unregisterActivityLifecycleCallbacks(this) } @@ -253,9 +244,11 @@ class CustomerSheetFragment : Fragment() { is CustomerSheetResult.Failed -> { promise.resolve(createError(ErrorType.Failed.toString(), result.exception)) } + is CustomerSheetResult.Selected -> { promiseResult = createPaymentOptionResult(result.selection) } + is CustomerSheetResult.Canceled -> { promiseResult = createPaymentOptionResult(result.selection) promiseResult.putMap( @@ -316,7 +309,7 @@ class CustomerSheetFragment : Fragment() { phone = mapToCollectionMode(bundle.getString("phone")), email = mapToCollectionMode(bundle.getString("email")), address = mapToAddressCollectionMode(bundle.getString("address")), - attachDefaultsToPaymentMethod = bundle.getBoolean("attachDefaultsToPaymentMethod"), + attachDefaultsToPaymentMethod = bundle.getBoolean("attachDefaultsToPaymentMethod", false), ) internal fun createCustomerAdapter( @@ -380,6 +373,7 @@ class CustomerSheetFragment : Fragment() { paymentOptionResult = buildResult(selection.paymentOption.label, selection.paymentOption.icon(), null) } + is PaymentOptionSelection.PaymentMethod -> { paymentOptionResult = buildResult( @@ -388,6 +382,7 @@ class CustomerSheetFragment : Fragment() { selection.paymentMethod, ) } + null -> {} } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt index ec13f0966..d558381d2 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt @@ -1,16 +1,14 @@ -package com.reactnativestripesdk.customersheet +// This needs to be in the same package as StripeSdkModule to access protected methods. +package com.reactnativestripesdk -import android.util.Log import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.WritableMap -import com.reactnativestripesdk.StripeSdkModule import com.stripe.android.customersheet.CustomerAdapter import com.stripe.android.model.PaymentMethod import kotlinx.coroutines.CompletableDeferred class ReactNativeCustomerAdapter( - private val context: ReactApplicationContext, + val context: ReactApplicationContext, private val adapter: CustomerAdapter, private val overridesFetchPaymentMethods: Boolean, private val overridesAttachPaymentMethod: Boolean, @@ -19,6 +17,8 @@ class ReactNativeCustomerAdapter( private val overridesFetchSelectedPaymentOption: Boolean, private val overridesSetupIntentClientSecretForCustomerAttach: Boolean, ) : CustomerAdapter by adapter { + private val stripeSdkModule = context.getNativeModule(StripeSdkModule::class.java) + internal var fetchPaymentMethodsCallback: CompletableDeferred>? = null internal var attachPaymentMethodCallback: CompletableDeferred? = null internal var detachPaymentMethodCallback: CompletableDeferred? = null @@ -30,7 +30,7 @@ class ReactNativeCustomerAdapter( if (overridesFetchPaymentMethods) { CompletableDeferred>().also { fetchPaymentMethodsCallback = it - emitEvent("onCustomerAdapterFetchPaymentMethodsCallback", Arguments.createMap()) + stripeSdkModule?.emitOnCustomerAdapterFetchPaymentMethodsCallback() val resultFromJavascript = it.await() return CustomerAdapter.Result.success(resultFromJavascript) } @@ -44,7 +44,7 @@ class ReactNativeCustomerAdapter( CompletableDeferred().also { attachPaymentMethodCallback = it val params = Arguments.createMap().also { it.putString("paymentMethodId", paymentMethodId) } - emitEvent("onCustomerAdapterAttachPaymentMethodCallback", params) + stripeSdkModule?.emitOnCustomerAdapterAttachPaymentMethodCallback(params) val resultFromJavascript = it.await() return CustomerAdapter.Result.success(resultFromJavascript) } @@ -58,7 +58,7 @@ class ReactNativeCustomerAdapter( CompletableDeferred().also { detachPaymentMethodCallback = it val params = Arguments.createMap().also { it.putString("paymentMethodId", paymentMethodId) } - emitEvent("onCustomerAdapterDetachPaymentMethodCallback", params) + stripeSdkModule?.emitOnCustomerAdapterDetachPaymentMethodCallback(params) val resultFromJavascript = it.await() return CustomerAdapter.Result.success(resultFromJavascript) } @@ -72,7 +72,7 @@ class ReactNativeCustomerAdapter( CompletableDeferred().also { setSelectedPaymentOptionCallback = it val params = Arguments.createMap().also { it.putString("paymentOption", paymentOption?.id) } - emitEvent("onCustomerAdapterSetSelectedPaymentOptionCallback", params) + stripeSdkModule?.emitOnCustomerAdapterSetSelectedPaymentOptionCallback(params) val resultFromJavascript = it.await() return CustomerAdapter.Result.success(resultFromJavascript) } @@ -85,7 +85,7 @@ class ReactNativeCustomerAdapter( if (overridesFetchSelectedPaymentOption) { CompletableDeferred().also { fetchSelectedPaymentOptionCallback = it - emitEvent("onCustomerAdapterFetchSelectedPaymentOptionCallback", Arguments.createMap()) + stripeSdkModule?.emitOnCustomerAdapterFetchSelectedPaymentOptionCallback() val resultFromJavascript = it.await() return CustomerAdapter.Result.success( if (resultFromJavascript != null) { @@ -104,10 +104,7 @@ class ReactNativeCustomerAdapter( if (overridesSetupIntentClientSecretForCustomerAttach) { CompletableDeferred().also { setupIntentClientSecretForCustomerAttachCallback = it - emitEvent( - "onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback", - Arguments.createMap(), - ) + stripeSdkModule?.emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback() val resultFromJavascript = it.await() return CustomerAdapter.Result.success(resultFromJavascript) } @@ -115,19 +112,4 @@ class ReactNativeCustomerAdapter( return adapter.setupIntentClientSecretForCustomerAttach() } - - private fun emitEvent( - eventName: String, - params: WritableMap, - ) { - val stripeSdkModule: StripeSdkModule? = context.getNativeModule(StripeSdkModule::class.java) - if (stripeSdkModule == null || stripeSdkModule.eventListenerCount == 0) { - Log.e( - "StripeReactNative", - "Tried to call $eventName, but no callback was found. Please file an issue: https://github.com/stripe/stripe-react-native/issues", - ) - } - - stripeSdkModule?.sendEvent(context, eventName, params) - } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt index 0979e6903..ae3882180 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt @@ -2,20 +2,28 @@ package com.reactnativestripesdk.pushprovisioning import android.content.Context import com.bumptech.glide.Glide +import com.facebook.react.bridge.Dynamic import com.facebook.react.bridge.ReadableMap import com.facebook.react.module.annotations.ReactModule import com.facebook.react.uimanager.SimpleViewManager import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.annotations.ReactProp +import com.facebook.react.viewmanagers.AddToWalletButtonManagerDelegate +import com.facebook.react.viewmanagers.AddToWalletButtonManagerInterface +import com.reactnativestripesdk.utils.asMapOrNull @ReactModule(name = AddToWalletButtonManager.REACT_CLASS) class AddToWalletButtonManager( applicationContext: Context, -) : SimpleViewManager() { +) : SimpleViewManager(), + AddToWalletButtonManagerInterface { + private val delegate = AddToWalletButtonManagerDelegate(this) private val requestManager = Glide.with(applicationContext) override fun getName() = REACT_CLASS + override fun getDelegate() = delegate + override fun onDropViewInstance(view: AddToWalletButtonView) { view.onDropViewInstance() super.onDropViewInstance(view) @@ -36,35 +44,55 @@ class AddToWalletButtonManager( ) @ReactProp(name = "androidAssetSource") - fun source( + override fun setAndroidAssetSource( view: AddToWalletButtonView, - source: ReadableMap, + source: ReadableMap?, ) { view.setSourceMap(source) } @ReactProp(name = "cardDetails") - fun cardDetails( + override fun setCardDetails( view: AddToWalletButtonView, - cardDetails: ReadableMap, + cardDetails: Dynamic, ) { - view.setCardDetails(cardDetails) + view.setCardDetails(cardDetails.asMapOrNull()) } @ReactProp(name = "ephemeralKey") - fun ephemeralKey( + override fun setEphemeralKey( view: AddToWalletButtonView, - ephemeralKey: ReadableMap, + ephemeralKey: Dynamic, ) { - view.setEphemeralKey(ephemeralKey) + val map = ephemeralKey.asMap() + if (map == null) return + view.setEphemeralKey(map) } @ReactProp(name = "token") - fun token( + override fun setToken( + view: AddToWalletButtonView, + token: Dynamic, + ) { + val map = token.asMap() + if (map == null) return + view.setToken(map) + } + + @ReactProp(name = "iOSButtonStyle") + override fun setIOSButtonStyle( + view: AddToWalletButtonView, + value: String?, + ) { + // noop, iOS only. + } + + @ReactProp(name = "testEnv") + override fun setTestEnv( view: AddToWalletButtonView, - token: ReadableMap?, + value: Boolean, ) { - view.setToken(token) + // noop, iOS only. } companion object { diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt index ea4f2695b..3e54c8b65 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt @@ -159,11 +159,11 @@ class AddToWalletButtonView( requestManager.clear(this) } - fun setSourceMap(map: ReadableMap) { + fun setSourceMap(map: ReadableMap?) { sourceMap = map } - fun setCardDetails(detailsMap: ReadableMap) { + fun setCardDetails(detailsMap: ReadableMap?) { cardDetails = detailsMap } @@ -176,6 +176,8 @@ class AddToWalletButtonView( } fun dispatchEvent(error: WritableMap?) { - UIManagerHelper.getEventDispatcherForReactTag(context, id)?.dispatchEvent(AddToWalletCompleteEvent(context.surfaceId, id, error)) + UIManagerHelper + .getEventDispatcherForReactTag(context, id) + ?.dispatchEvent(AddToWalletCompleteEvent(context.surfaceId, id, error)) } } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Extensions.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Extensions.kt index 3d50aa3b9..74776b00b 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Extensions.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Extensions.kt @@ -5,8 +5,10 @@ import android.view.View import android.view.inputmethod.InputMethodManager import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity +import com.facebook.react.bridge.Dynamic import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReadableMap +import com.facebook.react.bridge.ReadableType fun View.showSoftKeyboard() { post { @@ -36,3 +38,5 @@ fun ReadableMap.getBooleanOr( key: String, default: Boolean, ): Boolean = if (this.hasKey(key)) this.getBoolean(key) else default + +fun Dynamic.asMapOrNull(): ReadableMap? = if (this.type == ReadableType.Map) this.asMap() else null diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt index 30974c146..b7c1a4de6 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt @@ -1,7 +1,7 @@ package com.reactnativestripesdk.utils import com.facebook.react.bridge.Arguments -import com.facebook.react.bridge.ReactContext +import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil import com.facebook.react.jstasks.HeadlessJsTaskConfig import com.facebook.react.jstasks.HeadlessJsTaskContext @@ -12,7 +12,7 @@ import com.facebook.react.jstasks.HeadlessJsTaskContext * pausing timers. */ internal class KeepJsAwakeTask( - private val context: ReactContext, + private val context: ReactApplicationContext, ) { private var taskId: Int? = null diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt index 1e1048ad9..ccf809d5e 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/Mappers.kt @@ -27,6 +27,8 @@ import com.stripe.android.model.StripeIntent import com.stripe.android.model.StripeIntent.NextActionData import com.stripe.android.model.StripeIntent.NextActionType import com.stripe.android.model.Token +import com.stripe.android.paymentelement.ExperimentalCustomPaymentMethodsApi +import com.stripe.android.paymentsheet.PaymentSheet internal fun createResult( key: String, @@ -138,7 +140,6 @@ internal fun mapPaymentMethodType(type: PaymentMethod.Type?): String = PaymentMethod.Type.Oxxo -> "Oxxo" PaymentMethod.Type.P24 -> "P24" PaymentMethod.Type.SepaDebit -> "SepaDebit" - PaymentMethod.Type.Sofort -> "Sofort" PaymentMethod.Type.Upi -> "Upi" PaymentMethod.Type.WeChatPay -> "WeChatPay" PaymentMethod.Type.Klarna -> "Klarna" @@ -168,7 +169,6 @@ internal fun mapToPaymentMethodType(type: String?): PaymentMethod.Type? = "Oxxo" -> PaymentMethod.Type.Oxxo "P24" -> PaymentMethod.Type.P24 "SepaDebit" -> PaymentMethod.Type.SepaDebit - "Sofort" -> PaymentMethod.Type.Sofort "Upi" -> PaymentMethod.Type.Upi "WeChatPay" -> PaymentMethod.Type.WeChatPay "Klarna" -> PaymentMethod.Type.Klarna @@ -199,6 +199,27 @@ internal fun mapFromBillingDetails(billingDatails: PaymentMethod.BillingDetails? return details } +internal fun mapFromPaymentSheetBillingDetails(billing: com.stripe.android.paymentsheet.PaymentSheet.BillingDetails?): WritableMap { + val details = Arguments.createMap() + details.putString("name", billing?.name) + details.putString("email", billing?.email) + details.putString("phone", billing?.phone) + + // map the nested address + val addrMap = Arguments.createMap() + billing?.address?.let { a -> + addrMap.putString("city", a.city) + addrMap.putString("country", a.country) + addrMap.putString("line1", a.line1) + addrMap.putString("line2", a.line2) + addrMap.putString("postalCode", a.postalCode) + addrMap.putString("state", a.state) + } + details.putMap("address", addrMap) + + return details +} + internal fun mapTokenType(type: Token.Type): String = when (type) { Token.Type.Account -> "Account" @@ -394,10 +415,6 @@ internal fun mapFromPaymentMethod(paymentMethod: PaymentMethod): WritableMap { it.putString("last4", paymentMethod.bacsDebit?.last4) }, ) - pm.putMap( - "Sofort", - WritableNativeMap().also { it.putString("country", paymentMethod.sofort?.country) }, - ) pm.putMap( "Ideal", WritableNativeMap().also { @@ -1044,3 +1061,53 @@ private fun Map.toReadableMap(): ReadableMap { return writableMap } + +@OptIn(ExperimentalCustomPaymentMethodsApi::class) +@SuppressLint("RestrictedApi") +internal fun parseCustomPaymentMethods(customPaymentMethodConfig: Bundle?): List { + if (customPaymentMethodConfig == null) { + return emptyList() + } + + val configHashMap = customPaymentMethodConfig.getSerializable("customPaymentMethodConfigurationReadableMap") as? HashMap + if (configHashMap != null) { + val customPaymentMethods = configHashMap["customPaymentMethods"] as? List> + if (customPaymentMethods != null) { + val result = mutableListOf() + + for (customPaymentMethodMap in customPaymentMethods) { + val id = customPaymentMethodMap["id"] as? String + if (id != null) { + val subtitle = customPaymentMethodMap["subtitle"] as? String + val disableBillingDetailCollection = customPaymentMethodMap["disableBillingDetailCollection"] as? Boolean ?: false + result.add( + PaymentSheet.CustomPaymentMethod( + id = id, + subtitle = subtitle, + disableBillingDetailCollection = disableBillingDetailCollection, + ), + ) + } + } + + return result + } + } + + return emptyList() +} + +@SuppressLint("RestrictedApi") +internal fun mapFromCustomPaymentMethod( + customPaymentMethod: PaymentSheet.CustomPaymentMethod, + billingDetails: PaymentMethod.BillingDetails, +): WritableMap = + WritableNativeMap().apply { + putMap( + "customPaymentMethod", + WritableNativeMap().apply { + putString("id", customPaymentMethod.id) + }, + ) + putMap("billingDetails", mapFromBillingDetails(billingDetails)) + } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/StripeFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/StripeFragment.kt new file mode 100644 index 000000000..4c64763dd --- /dev/null +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/utils/StripeFragment.kt @@ -0,0 +1,52 @@ +package com.reactnativestripesdk.utils + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.FrameLayout +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentActivity + +/** + * Base fragment class to be used to launch Stripe UI that requires a fragment. Use the prepare + * method to configure it. + * + * Note that subclasses of this must implement a no arguments constructor since that is what is + * invoked when fragments are restored after activity re-creation. + */ +abstract class StripeFragment : Fragment() { + private var isRestored = false + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + isRestored = savedInstanceState != null + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle?, + ): View = FrameLayout(requireActivity()).also { it.visibility = View.GONE } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle?, + ) { + super.onViewCreated(view, savedInstanceState) + + // Prevent fragment from being re-created. + if (isRestored) { + (context as? FragmentActivity) + ?.supportFragmentManager + ?.beginTransaction() + ?.remove(this) + ?.commitAllowingStateLoss() + } else { + prepare() + } + } + + abstract fun prepare() +} diff --git a/packages/stripe_android/android/src/main/res/values/styles.xml b/packages/stripe_android/android/src/main/res/values/styles.xml new file mode 100644 index 000000000..2b2922440 --- /dev/null +++ b/packages/stripe_android/android/src/main/res/values/styles.xml @@ -0,0 +1,27 @@ + + + + \ No newline at end of file diff --git a/packages/stripe_android/pubspec.yaml b/packages/stripe_android/pubspec.yaml index dffc599c8..ad0e5e26c 100644 --- a/packages/stripe_android/pubspec.yaml +++ b/packages/stripe_android/pubspec.yaml @@ -5,7 +5,7 @@ repository: https://github.com/flutter-stripe/flutter_stripe homepage: https://pub.dev/packages/flutter_stripe environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.8.1 <4.0.0" flutter: ">=3.0.0" dependencies: @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ^6.0.0 flutter: plugin: diff --git a/packages/stripe_ios/ios/stripe_ios.podspec b/packages/stripe_ios/ios/stripe_ios.podspec index 703212eff..ad65850c8 100644 --- a/packages/stripe_ios/ios/stripe_ios.podspec +++ b/packages/stripe_ios/ios/stripe_ios.podspec @@ -2,7 +2,7 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint stripe_ios.podspec' to validate before publishing. # -stripe_version = '~> 24.7.0' +stripe_version = '~> 24.16.1' Pod::Spec.new do |s| s.name = 'stripe_ios' s.version = '0.0.1' @@ -33,6 +33,7 @@ A new flutter plugin project. end s.platform = :ios, '13.0' + s.ios.deployment_target = '13.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/packages/stripe_ios/ios/stripe_ios/Package.resolved b/packages/stripe_ios/ios/stripe_ios/Package.resolved index 38f17cf34..ae558898c 100644 --- a/packages/stripe_ios/ios/stripe_ios/Package.resolved +++ b/packages/stripe_ios/ios/stripe_ios/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/stripe/stripe-ios-spm", "state" : { - "revision" : "653fc8cfc40b33740401f9bd9faa8588f9a53e5f", - "version" : "23.32.0" + "revision" : "f61cacd2da96a72cb0e454e58ed90b12182e5b98", + "version" : "24.7.0" } } ], diff --git a/packages/stripe_ios/ios/stripe_ios/Package.swift b/packages/stripe_ios/ios/stripe_ios/Package.swift index e81ae5a20..8aefa36c1 100644 --- a/packages/stripe_ios/ios/stripe_ios/Package.swift +++ b/packages/stripe_ios/ios/stripe_ios/Package.swift @@ -12,7 +12,7 @@ let package = Package( .library(name: "stripe-ios", targets: ["stripe_ios"]) ], dependencies: [ - .package(url: "https://github.com/stripe/stripe-ios-spm", exact: "24.7.0") + .package(url: "https://github.com/stripe/stripe-ios-spm", exact: "24.16.1") ], targets: [ .target( diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift index 9732d4233..81376ff92 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift @@ -14,9 +14,9 @@ import stripe_objc class ApplePayButtonViewFactory: NSObject, FlutterPlatformViewFactory { private var messenger: FlutterBinaryMessenger - private var stripeSdk: StripeSdk + private var stripeSdk: StripeSdkImpl - init(messenger: FlutterBinaryMessenger, stripeSdk: StripeSdk) { + init(messenger: FlutterBinaryMessenger, stripeSdk: StripeSdkImpl) { self.messenger = messenger self.stripeSdk = stripeSdk super.init() @@ -51,7 +51,7 @@ class ApplePayButtonView: NSObject, FlutterPlatformView { private let channel: FlutterMethodChannel var applePayButton: PKPaymentButton? - var stripeSdk: StripeSdk? + var stripeSdk: StripeSdkImpl? @objc var onShippingMethodSelectedAction: RCTDirectEventBlock? @objc var onShippingContactSelectedAction: RCTDirectEventBlock? diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/RCTPresentedViewController.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/RCTPresentedViewController.swift new file mode 100644 index 000000000..5e193201d --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/RCTPresentedViewController.swift @@ -0,0 +1,12 @@ +// +// RCTPresentedViewController.swift +// Pods +// +// Created by Jonas Bark on 17.06.25. +// + +import UIKit + +class RCTPresentedViewController: UIViewController { + +} diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetUtils.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetUtils.swift index 8912ae9a8..e4f058cd6 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetUtils.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetUtils.swift @@ -13,7 +13,7 @@ class AddressSheetUtils { guard let params = params else { return AddressViewController.Configuration.DefaultAddressDetails() } - + return AddressViewController.Configuration.DefaultAddressDetails( address: buildAddress(params: params["address"] as? NSDictionary), name: params["name"] as? String, @@ -21,7 +21,7 @@ class AddressSheetUtils { isCheckboxSelected: params["isCheckboxSelected"] as? Bool ) } - + internal class func buildAddressDetails(params: NSDictionary?) -> AddressViewController.AddressDetails { guard let params = params else { return AddressViewController.AddressDetails(address: buildAddress(params: nil)) } return AddressViewController.AddressDetails( @@ -30,7 +30,7 @@ class AddressSheetUtils { phone: params["phone"] as? String, isCheckboxSelected: params["isCheckboxSelected"] as? Bool) } - + internal class func buildAddress(params: NSDictionary?) -> PaymentSheet.Address { guard let params = params else { return PaymentSheet.Address() } return PaymentSheet.Address( @@ -42,7 +42,7 @@ class AddressSheetUtils { state: params["state"] as? String ) } - + internal class func buildAddress(params: NSDictionary?) -> AddressViewController.AddressDetails.Address { guard let params = params else { return AddressViewController.AddressDetails.Address(country: "", line1: "") } return AddressViewController.AddressDetails.Address( @@ -54,7 +54,7 @@ class AddressSheetUtils { state: params["state"] as? String ) } - + internal class func buildAdditionalFieldsConfiguration(params: NSDictionary?) -> AddressViewController.Configuration.AdditionalFields { guard let params = params else { return AddressViewController.Configuration.AdditionalFields(phone: .hidden, checkboxLabel: nil) @@ -65,7 +65,7 @@ class AddressSheetUtils { checkboxLabel: params["checkboxLabel"] as? String ) } - + internal class func getFieldConfiguration(input: String?, default: AddressViewController.Configuration.AdditionalFields.FieldConfiguration) -> AddressViewController.Configuration.AdditionalFields.FieldConfiguration { switch (input) { case "optional": @@ -78,21 +78,23 @@ class AddressSheetUtils { return `default` } } - + internal class func buildResult(address: AddressViewController.AddressDetails) -> [AnyHashable : Any] { return [ - "name": address.name ?? NSNull(), - "address": [ - "country": address.address.country, - "state": address.address.state, - "line1": address.address.line1, - "line2": address.address.line2, - "postalCode": address.address.postalCode, - "city": address.address.city, - ], - "phone": address.phone ?? NSNull(), - "isCheckboxSelected": address.isCheckboxSelected ?? NSNull(), - ] as [AnyHashable : Any] + "result": [ + "name": address.name ?? NSNull(), + "address": [ + "country": address.address.country, + "state": address.address.state, + "line1": address.address.line1, + "line2": address.address.line2, + "postalCode": address.address.postalCode, + "city": address.address.city, + ], + "phone": address.phone ?? NSNull(), + "isCheckboxSelected": address.isCheckboxSelected ?? NSNull(), + ] as [AnyHashable : Any] + ] } } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift index 2a21a63c2..d24fe9f84 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift @@ -8,38 +8,35 @@ import Foundation import StripePaymentSheet import UIKit -#if canImport(stripe_objc) -import stripe_objc -#endif @objc(AddressSheetView) -class AddressSheetView: UIView { - @objc var visible = false - @objc var presentationStyle: String = "popover" - @objc var animationStyle: String = "" - @objc var appearance: NSDictionary? = nil - @objc var defaultValues: NSDictionary? = nil - @objc var additionalFields: NSDictionary? = nil - @objc var allowedCountries: [String] = [] - @objc var autocompleteCountries: [String] = [] - @objc var primaryButtonTitle: String? = nil - @objc var sheetTitle: String? = nil - @objc var onSubmitAction: RCTDirectEventBlock? - @objc var onErrorAction: RCTDirectEventBlock? +public class AddressSheetView: UIView { + @objc public var visible = false + @objc public var presentationStyle: String = "popover" + @objc public var animationStyle: String = "" + @objc public var appearance: NSDictionary? = nil + @objc public var defaultValues: NSDictionary? = nil + @objc public var additionalFields: NSDictionary? = nil + @objc public var allowedCountries: [String] = [] + @objc public var autocompleteCountries: [String] = [] + @objc public var primaryButtonTitle: String? = nil + @objc public var sheetTitle: String? = nil + @objc public var onSubmitAction: RCTDirectEventBlock? + @objc public var onErrorAction: RCTDirectEventBlock? private var wasVisible = false private var addressViewController: AddressViewController? = nil internal var addressDetails: AddressViewController.AddressDetails? = nil - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - - override func didSetProps(_ changedProps: [String]!) { + + @objc public func didSetProps() { if (visible && !wasVisible) { presentAddressSheet() wasVisible = true @@ -48,6 +45,12 @@ class AddressSheetView: UIView { wasVisible = false } } + + override public func didSetProps(_ changedProps: [String]!) { + // This is only called on old arch, for new arch didSetProps() will be called + // by the view component. + self.didSetProps() + } private func presentAddressSheet() { if (STPAPIClient.shared.publishableKey == nil) { @@ -127,7 +130,7 @@ class AddressSheetView: UIView { } extension AddressSheetView: AddressViewControllerDelegate { - func addressViewControllerDidFinish(_ addressViewController: AddressViewController, with address: AddressViewController.AddressDetails?) { + public func addressViewControllerDidFinish(_ addressViewController: AddressViewController, with address: AddressViewController.AddressDetails?) { guard let address = address else { onErrorAction!( Errors.createError( diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/ApplePayViewController.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/ApplePayViewController.swift index ca547018e..b0e6a8a93 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/ApplePayViewController.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/ApplePayViewController.swift @@ -9,8 +9,8 @@ import Foundation import Stripe import PassKit -extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayContextDelegate { - func paymentAuthorizationViewController( +extension StripeSdkImpl : PKPaymentAuthorizationViewControllerDelegate, STPApplePayContextDelegate { + public func paymentAuthorizationViewController( _ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void @@ -52,7 +52,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func paymentAuthorizationViewControllerDidFinish( + public func paymentAuthorizationViewControllerDidFinish( _ controller: PKPaymentAuthorizationViewController ) { if (applePaymentMethodFlowCanBeCanceled) { @@ -73,7 +73,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } @available(iOS 15.0, *) - func paymentAuthorizationViewController( + public func paymentAuthorizationViewController( _ controller: PKPaymentAuthorizationViewController, didChangeCouponCode couponCode: String, handler completion: @escaping (PKPaymentRequestCouponCodeUpdate) -> Void @@ -92,7 +92,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func paymentAuthorizationViewController( + public func paymentAuthorizationViewController( _ controller: PKPaymentAuthorizationViewController, didSelect shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void @@ -107,7 +107,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func paymentAuthorizationViewController( + public func paymentAuthorizationViewController( _ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void @@ -126,7 +126,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func applePayContext( + public func applePayContext( _ context: STPApplePayContext, didSelect shippingMethod: PKShippingMethod, handler: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void @@ -141,7 +141,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func applePayContext( + public func applePayContext( _ context: STPApplePayContext, didSelectShippingContact contact: PKContact, handler: @escaping (PKPaymentRequestShippingContactUpdate) -> Void @@ -160,7 +160,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func applePayContext( + public func applePayContext( _ context: STPApplePayContext, didCreatePaymentMethod paymentMethod: STPPaymentMethod, paymentInformation: PKPayment, @@ -176,20 +176,20 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC } } - func applePayContext( - _ context: STPApplePayContext, - willCompleteWithResult authorizationResult: PKPaymentAuthorizationResult, - handler: @escaping (PKPaymentAuthorizationResult) -> Void - ) { - if let callback = self.platformPayOrderTrackingJSCallback { - self.orderTrackingHandler = (authorizationResult, handler) - callback(nil) - } else { - handler(authorizationResult) - } - } + public func applePayContext( + _ context: STPApplePayContext, + willCompleteWithResult authorizationResult: PKPaymentAuthorizationResult, + handler: @escaping (PKPaymentAuthorizationResult) -> Void + ) { + if let callback = self.platformPayOrderTrackingJSCallback { + self.orderTrackingHandler = (authorizationResult, handler) + callback(nil) + } else { + handler(authorizationResult) + } + } - func applePayContext( + public func applePayContext( _ context: STPApplePayContext, didCompleteWith status: STPPaymentStatus, error: Error? diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift index 62e83c78f..501f17ede 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift @@ -1,18 +1,15 @@ import Foundation import UIKit import Stripe -#if canImport(stripe_objc) -import stripe_objc -#endif @objc(AuBECSDebitFormView) -class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate { +public class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate { var auBecsFormView: STPAUBECSDebitFormView? - @objc var onCompleteAction: RCTDirectEventBlock? - @objc var companyName: NSString? + @objc public var onCompleteAction: RCTDirectEventBlock? + @objc public var companyName: NSString? - override func didSetProps(_ changedProps: [String]!) { + @objc public func didSetProps() { if let auBecsFormView = self.auBecsFormView { auBecsFormView.removeFromSuperview() } @@ -27,8 +24,14 @@ class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate { setStyles() } } + + override public func didSetProps(_ changedProps: [String]!) { + // This is only called on old arch, for new arch didSetProps() will be called + // by the view component. + self.didSetProps(); + } - @objc var formStyle: NSDictionary = NSDictionary() { + @objc public var formStyle: NSDictionary = NSDictionary() { didSet { setStyles() } @@ -63,7 +66,7 @@ class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate { } } - func auBECSDebitForm(_ form: STPAUBECSDebitFormView, didChangeToStateComplete complete: Bool) { + public func auBECSDebitForm(_ form: STPAUBECSDebitFormView, didChangeToStateComplete complete: Bool) { onCompleteAction!([ "accountNumber": form.paymentMethodParams?.auBECSDebit?.accountNumber ?? "", "bsbNumber": form.paymentMethodParams?.auBECSDebit?.bsbNumber ?? "", @@ -72,11 +75,11 @@ class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate { ]) } - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) } - override func layoutSubviews() { + override public func layoutSubviews() { if let auBecsFormView = self.auBecsFormView { auBecsFormView.frame = self.bounds } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift index 9a44ef31e..1215b6c69 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift @@ -1,45 +1,43 @@ import Foundation import UIKit import Stripe -#if canImport(stripe_objc) -import stripe_objc -#endif - -class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { - @objc var onCardChange: RCTDirectEventBlock? - @objc var onFocusChange: RCTDirectEventBlock? - @objc var dangerouslyGetFullCardDetails: Bool = false - - internal var cardField = STPPaymentCardTextField() - + +@objc(CardFieldView) +public class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { + @objc public var onCardChange: RCTDirectEventBlock? + @objc public var onFocusChange: RCTDirectEventBlock? + @objc public var dangerouslyGetFullCardDetails: Bool = false + + public var cardField = STPPaymentCardTextField() + public var cardParams: STPPaymentMethodParams? = nil public var cardPostalCode: String? = nil - @objc var disabled: Bool = false { + @objc public var disabled: Bool = false { didSet { cardField.isUserInteractionEnabled = !disabled } } - @objc var postalCodeEnabled: Bool = true { + @objc public var postalCodeEnabled: Bool = true { didSet { cardField.postalCodeEntryEnabled = postalCodeEnabled } } - @objc var countryCode: String? { + @objc public var countryCode: String? { didSet { cardField.countryCode = countryCode } } - @objc var onBehalfOf: String? { + @objc public var onBehalfOf: String? { didSet { cardField.onBehalfOf = onBehalfOf } } - @objc var preferredNetworks: Array? { + @objc public var preferredNetworks: Array? { didSet { if let preferredNetworks = preferredNetworks { cardField.preferredNetworks = preferredNetworks.map(Mappers.intToCardBrand).compactMap { $0 } @@ -47,7 +45,7 @@ class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { } } - @objc var placeholders: NSDictionary = NSDictionary() { + @objc public var placeholders: NSDictionary = NSDictionary() { didSet { if let numberPlaceholder = placeholders["number"] as? String { cardField.numberPlaceholder = numberPlaceholder @@ -66,7 +64,7 @@ class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { } } - @objc var autofocus: Bool = false { + @objc public var autofocus: Bool = false { didSet { if autofocus == true { cardField.reactFocus() @@ -74,7 +72,7 @@ class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { } } - @objc var cardStyle: NSDictionary = NSDictionary() { + @objc public var cardStyle: NSDictionary = NSDictionary() { didSet { if let borderWidth = cardStyle["borderWidth"] as? Int { cardField.borderWidth = CGFloat(borderWidth) @@ -114,46 +112,48 @@ class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { } } - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) cardField.delegate = self self.addSubview(cardField) + + StripeSdkImpl.shared.cardFieldView = self } - func focus() { + @objc public func focus() { cardField.becomeFirstResponder() } - func blur() { + @objc public func blur() { cardField.resignFirstResponder() } - func clear() { + @objc public func clear() { cardField.clear() } - func paymentCardTextFieldDidEndEditing(_ textField: STPPaymentCardTextField) { - onFocusChange?(["focusedField": NSNull()]) + public func paymentCardTextFieldDidEndEditing(_ textField: STPPaymentCardTextField) { + onFocusChange?(["focusedField": ""]) } - func paymentCardTextFieldDidBeginEditingNumber(_ textField: STPPaymentCardTextField) { + public func paymentCardTextFieldDidBeginEditingNumber(_ textField: STPPaymentCardTextField) { onFocusChange?(["focusedField": "CardNumber"]) } - func paymentCardTextFieldDidBeginEditingCVC(_ textField: STPPaymentCardTextField) { + public func paymentCardTextFieldDidBeginEditingCVC(_ textField: STPPaymentCardTextField) { onFocusChange?(["focusedField": "Cvc"]) } - func paymentCardTextFieldDidBeginEditingExpiration(_ textField: STPPaymentCardTextField) { + public func paymentCardTextFieldDidBeginEditingExpiration(_ textField: STPPaymentCardTextField) { onFocusChange?(["focusedField": "ExpiryDate"]) } - func paymentCardTextFieldDidBeginEditingPostalCode(_ textField: STPPaymentCardTextField) { + public func paymentCardTextFieldDidBeginEditingPostalCode(_ textField: STPPaymentCardTextField) { onFocusChange?(["focusedField": "PostalCode"]) } - func paymentCardTextFieldDidChange(_ textField: STPPaymentCardTextField) { + public func paymentCardTextFieldDidChange(_ textField: STPPaymentCardTextField) { if onCardChange != nil { let brand = STPCardValidator.brand(forNumber: textField.cardNumber ?? "") let validExpiryDate = STPCardValidator.validationState( @@ -179,7 +179,7 @@ class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { cardData["number"] = textField.cardNumber ?? "" cardData["cvc"] = textField.cvc ?? "" } - onCardChange!(cardData as [AnyHashable : Any]) + onCardChange!(["card": cardData as [AnyHashable : Any]]) } if (textField.isValid) { self.cardParams = textField.paymentMethodParams @@ -190,7 +190,7 @@ class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { } } - override func layoutSubviews() { + override public func layoutSubviews() { cardField.frame = self.bounds } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift index 8dda09ddd..03e5e4e35 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift @@ -1,26 +1,24 @@ import Foundation import UIKit import Stripe -#if canImport(stripe_objc) -import stripe_objc -#endif -class CardFormView: UIView, STPCardFormViewDelegate { +@objc(CardFormView) +public class CardFormView: UIView, STPCardFormViewDelegate { public var cardForm: STPCardFormView? public var cardParams: STPPaymentMethodCardParams? = nil - @objc var dangerouslyGetFullCardDetails: Bool = false - @objc var onFormComplete: RCTDirectEventBlock? - @objc var autofocus: Bool = false - @objc var disabled: Bool = false - @objc var preferredNetworks: Array? { + @objc public var dangerouslyGetFullCardDetails: Bool = false + @objc public var onFormComplete: RCTDirectEventBlock? + @objc public var autofocus: Bool = false + @objc public var disabled: Bool = false + @objc public var preferredNetworks: Array? { didSet { setPreferredNetworks() } } - - override func didSetProps(_ changedProps: [String]!) { + + @objc public func didSetProps() { if let cardForm = self.cardForm { cardForm.removeFromSuperview() } @@ -40,13 +38,19 @@ class CardFormView: UIView, STPCardFormViewDelegate { setPreferredNetworks() } - @objc var cardStyle: NSDictionary = NSDictionary() { + override public func didSetProps(_ changedProps: [String]!) { + // This is only called on old arch, for new arch didSetProps() will be called + // by the view component. + self.didSetProps() + } + + @objc public var cardStyle: NSDictionary = NSDictionary() { didSet { setStyles() } } - func cardFormView(_ form: STPCardFormView, didChangeToStateComplete complete: Bool) { + public func cardFormView(_ form: STPCardFormView, didChangeToStateComplete complete: Bool) { if onFormComplete != nil { let brand = STPCardValidator.brand(forNumber: cardForm?.cardParams?.card?.number ?? "") var cardData: [String: Any?] = [ @@ -68,15 +72,15 @@ class CardFormView: UIView, STPCardFormViewDelegate { } else { self.cardParams = nil } - onFormComplete!(cardData as [AnyHashable : Any]) + onFormComplete!(["card": cardData as [AnyHashable : Any]]) } } - func focus() { + @objc public func focus() { let _ = cardForm?.becomeFirstResponder() } - func blur() { + @objc public func blur() { let _ = cardForm?.resignFirstResponder() } @@ -115,11 +119,13 @@ class CardFormView: UIView, STPCardFormViewDelegate { } } - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) + + StripeSdkImpl.shared.cardFormView = self } - - override func layoutSubviews() { + + override public func layoutSubviews() { cardForm?.frame = self.bounds } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/CustomerSheetUtils.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/CustomerSheetUtils.swift index a14ded7a5..dcb934726 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/CustomerSheetUtils.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/CustomerSheetUtils.swift @@ -6,8 +6,8 @@ // import Foundation -import UIKit @_spi(PrivateBetaCustomerSheet) @_spi(STP) import StripePaymentSheet +import UIKit class CustomerSheetUtils { internal class func buildCustomerSheetConfiguration( @@ -38,10 +38,10 @@ class CustomerSheetUtils { config.preferredNetworks = preferredNetworks.map(Mappers.intToCardBrand).compactMap { $0 } } if let billingConfigParams = billingDetailsCollectionConfiguration { - config.billingDetailsCollectionConfiguration.name = StripeSdk.mapToCollectionMode(str: billingConfigParams["name"] as? String) - config.billingDetailsCollectionConfiguration.phone = StripeSdk.mapToCollectionMode(str: billingConfigParams["phone"] as? String) - config.billingDetailsCollectionConfiguration.email = StripeSdk.mapToCollectionMode(str: billingConfigParams["email"] as? String) - config.billingDetailsCollectionConfiguration.address = StripeSdk.mapToAddressCollectionMode(str: billingConfigParams["address"] as? String) + config.billingDetailsCollectionConfiguration.name = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["name"] as? String) + config.billingDetailsCollectionConfiguration.phone = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["phone"] as? String) + config.billingDetailsCollectionConfiguration.email = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["email"] as? String) + config.billingDetailsCollectionConfiguration.address = StripeSdkImpl.mapToAddressCollectionMode(str: billingConfigParams["address"] as? String) config.billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod = billingConfigParams["attachDefaultsToPaymentMethod"] as? Bool == true } if let defaultBillingDetails = defaultBillingDetails { @@ -69,7 +69,7 @@ class CustomerSheetUtils { ephemeralKeySecret: String, setupIntentClientSecret: String?, customerAdapter: NSDictionary, - stripeSdk: StripeSdk + stripeSdk: StripeSdkImpl ) -> StripeCustomerAdapter { if (customerAdapter.count > 0) { return buildCustomerAdapterOverride( @@ -104,7 +104,7 @@ class CustomerSheetUtils { customerId: String, ephemeralKeySecret: String, setupIntentClientSecret: String?, - stripeSdk: StripeSdk + stripeSdk: StripeSdkImpl ) -> StripeCustomerAdapter { return ReactNativeCustomerAdapter( fetchPaymentMethods: customerAdapter["fetchPaymentMethods"] as? Bool ?? false, diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/ReactNativeCustomerAdapter.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/ReactNativeCustomerAdapter.swift index c1ccf81f4..fddc7c724 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/ReactNativeCustomerAdapter.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CustomerSheet/ReactNativeCustomerAdapter.swift @@ -15,7 +15,7 @@ class ReactNativeCustomerAdapter: StripeCustomerAdapter { var overridesSetSelectedPaymentOption: Bool var overridesFetchSelectedPaymentOption: Bool var overridesSetupIntentClientSecretForCustomerAttach: Bool - var stripeSdk: StripeSdk + var stripeSdk: StripeSdkImpl init( fetchPaymentMethods: Bool, @@ -27,7 +27,7 @@ class ReactNativeCustomerAdapter: StripeCustomerAdapter { customerId: String, ephemeralKeySecret: String, setupIntentClientSecret: String?, - stripeSdk: StripeSdk + stripeSdk: StripeSdkImpl ) { self.overridesFetchPaymentMethods = fetchPaymentMethods self.overridesAttachPaymentMethod = attachPaymentMethod @@ -132,42 +132,42 @@ extension ReactNativeCustomerAdapter { func fetchPaymentMethods(completion: @escaping ([STPPaymentMethod]) -> Void) { DispatchQueue.main.async { self.stripeSdk.fetchPaymentMethodsCallback = completion - self.stripeSdk.sendEvent(withName: "onCustomerAdapterFetchPaymentMethodsCallback", body: [:]) + self.stripeSdk.emitter?.emitOnCustomerAdapterFetchPaymentMethodsCallback() } } func attachPaymentMethod(_ paymentMethodId: String, completion: @escaping () -> Void) { DispatchQueue.main.async { self.stripeSdk.attachPaymentMethodCallback = completion - self.stripeSdk.sendEvent(withName: "onCustomerAdapterAttachPaymentMethodCallback", body: ["paymentMethodId": paymentMethodId]) + self.stripeSdk.emitter?.emitOnCustomerAdapterAttachPaymentMethodCallback(["paymentMethodId": paymentMethodId]) } } func detachPaymentMethod(_ paymentMethodId: String, completion: @escaping () -> Void) { DispatchQueue.main.async { self.stripeSdk.detachPaymentMethodCallback = completion - self.stripeSdk.sendEvent(withName: "onCustomerAdapterDetachPaymentMethodCallback", body: ["paymentMethodId": paymentMethodId]) + self.stripeSdk.emitter?.emitOnCustomerAdapterDetachPaymentMethodCallback(["paymentMethodId": paymentMethodId]) } } func setSelectedPaymentOption(_ paymentOption: CustomerPaymentOption?, completion: @escaping () -> Void) { DispatchQueue.main.async { self.stripeSdk.setSelectedPaymentOptionCallback = completion - self.stripeSdk.sendEvent(withName: "onCustomerAdapterSetSelectedPaymentOptionCallback", body: ["paymentOption": paymentOption?.value]) + self.stripeSdk.emitter?.emitOnCustomerAdapterSetSelectedPaymentOptionCallback(["paymentOption": paymentOption?.value]) } } func fetchSelectedPaymentOption(completion: @escaping (CustomerPaymentOption?) -> Void) { DispatchQueue.main.async { self.stripeSdk.fetchSelectedPaymentOptionCallback = completion - self.stripeSdk.sendEvent(withName: "onCustomerAdapterFetchSelectedPaymentOptionCallback", body: [:]) + self.stripeSdk.emitter?.emitOnCustomerAdapterFetchSelectedPaymentOptionCallback() } } func setupIntentClientSecretForCustomerAttach(completion: @escaping (String) -> Void) { DispatchQueue.main.async { self.stripeSdk.setupIntentClientSecretForCustomerAttachCallback = completion - self.stripeSdk.sendEvent(withName: "onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback", body: [:]) + self.stripeSdk.emitter?.emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback() } } } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/EmbeddedPaymentElementView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/EmbeddedPaymentElementView.swift new file mode 100644 index 000000000..0d307d3b2 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/EmbeddedPaymentElementView.swift @@ -0,0 +1,88 @@ +// +// EmbeddedPaymentElementView.swift +// stripe-react-native +// +// Created by Nick Porter on 4/16/25. +// + +import Foundation +import UIKit +@_spi(EmbeddedPaymentElementPrivateBeta) import StripePaymentSheet + +@objc(EmbeddedPaymentElementView) +class EmbeddedPaymentElementView: RCTViewManager { + + override static func requiresMainQueueSetup() -> Bool { + return true + } + + override func view() -> UIView! { + return EmbeddedPaymentElementContainerView(frame: .zero) + } +} + +@objc(EmbeddedPaymentElementContainerView) +public class EmbeddedPaymentElementContainerView: UIView, UIGestureRecognizerDelegate { + private var embeddedPaymentElementView: UIView? + + override init(frame: CGRect) { + super.init(frame: frame) + backgroundColor = .clear + } + + required init?(coder: NSCoder) { + fatalError() + } + + public override func didMoveToWindow() { + super.didMoveToWindow() + if window != nil { + // Only attach when we have a valid window + attachPaymentElementIfAvailable() + } + } + + public override func willMove(toWindow newWindow: UIWindow?) { + super.willMove(toWindow: newWindow) + if newWindow == nil { + // Remove the embedded view when moving away from window + removePaymentElement() + } + } + + private func attachPaymentElementIfAvailable() { + // Don't attach if already attached + guard embeddedPaymentElementView == nil, + let embeddedElement = StripeSdkImpl.shared.embeddedInstance else { + return + } + + let paymentElementView = embeddedElement.view + addSubview(paymentElementView) + paymentElementView.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + paymentElementView.topAnchor.constraint(equalTo: topAnchor), + paymentElementView.leadingAnchor.constraint(equalTo: leadingAnchor), + paymentElementView.trailingAnchor.constraint(equalTo: trailingAnchor), + paymentElementView.bottomAnchor.constraint(equalTo: bottomAnchor), + ]) + + self.embeddedPaymentElementView = paymentElementView + + // Update the presenting view controller whenever we attach + updatePresentingViewController() + } + + private func removePaymentElement() { + embeddedPaymentElementView?.removeFromSuperview() + embeddedPaymentElementView = nil + } + + private func updatePresentingViewController() { + DispatchQueue.main.async { [weak self] in + guard let self = self else { return } + StripeSdkImpl.shared.embeddedInstance?.presentingViewController = RCTPresentedViewController() + } + } +} diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift index 6f19f6314..76c49ba30 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift @@ -9,9 +9,6 @@ import Foundation import StripeFinancialConnections import Stripe import UIKit -#if canImport(stripe_objc) -import stripe_objc -#endif class FinancialConnections { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/Mappers.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/Mappers.swift index 1df9696de..b57957441 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/Mappers.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/Mappers.swift @@ -286,7 +286,6 @@ class Mappers { case STPPaymentMethodType.EPS: return "Eps" case STPPaymentMethodType.bancontact: return "Bancontact" case STPPaymentMethodType.OXXO: return "Oxxo" - case STPPaymentMethodType.sofort: return "Sofort" case STPPaymentMethodType.UPI: return "Upi" case STPPaymentMethodType.afterpayClearpay: return "AfterpayClearpay" case STPPaymentMethodType.klarna: return "Klarna" @@ -317,7 +316,6 @@ class Mappers { case "Eps": return STPPaymentMethodType.EPS case "Bancontact": return STPPaymentMethodType.bancontact case "Oxxo": return STPPaymentMethodType.OXXO - case "Sofort": return STPPaymentMethodType.sofort case "Upi": return STPPaymentMethodType.UPI case "AfterpayClearpay": return STPPaymentMethodType.afterpayClearpay case "Klarna": return STPPaymentMethodType.klarna @@ -667,9 +665,6 @@ class Mappers { "SepaDebit": sepaDebit, "BacsDebit": bacsDebit, "AuBecsDebit": auBECSDebit, - "Sofort": [ - "country": paymentMethod.sofort?.country - ], "Upi": [ "vpa": paymentMethod.upi?.vpa ], diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentMethodFactory.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentMethodFactory.swift index 712f967fe..6130991f0 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentMethodFactory.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentMethodFactory.swift @@ -31,8 +31,6 @@ class PaymentMethodFactory { return try createFPXPaymentMethodParams() case STPPaymentMethodType.alipay: return try createAlipayPaymentMethodParams() - case STPPaymentMethodType.sofort: - return try createSofortPaymentMethodParams() case STPPaymentMethodType.bancontact: return try createBancontactPaymentMethodParams() case STPPaymentMethodType.SEPADebit: @@ -82,8 +80,6 @@ class PaymentMethodFactory { return createCardPaymentMethodOptions() case STPPaymentMethodType.FPX: return nil - case STPPaymentMethodType.sofort: - return nil case STPPaymentMethodType.alipay: return try createAlipayPaymentMethodOptions() case STPPaymentMethodType.bancontact: @@ -250,16 +246,6 @@ class PaymentMethodFactory { return options } - private func createSofortPaymentMethodParams() throws -> STPPaymentMethodParams { - guard let country = self.paymentMethodData?["country"] as? String else { - throw PaymentMethodError.sofortPaymentMissingParams - } - let params = STPPaymentMethodSofortParams() - params.country = country - - return STPPaymentMethodParams(sofort: params, billingDetails: billingDetailsParams, metadata: metadata) - } - private func createBancontactPaymentMethodParams() throws -> STPPaymentMethodParams { let params = STPPaymentMethodBancontactParams() @@ -411,7 +397,6 @@ enum PaymentMethodError: Error { case epsPaymentMissingParams case idealPaymentMissingParams case paymentNotSupported - case sofortPaymentMissingParams case cardPaymentOptionsMissingParams case bancontactPaymentMissingParams case sepaPaymentMissingParams @@ -434,8 +419,6 @@ extension PaymentMethodError: LocalizedError { return NSLocalizedString("You must provide billing details", comment: "Create payment error") case .idealPaymentMissingParams: return NSLocalizedString("You must provide bank name", comment: "Create payment error") - case .sofortPaymentMissingParams: - return NSLocalizedString("You must provide bank account country", comment: "Create payment error") case .p24PaymentMissingParams: return NSLocalizedString("You must provide billing details", comment: "Create payment error") case .bancontactPaymentMissingParams: diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentOptionDisplayData+ReactNative.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentOptionDisplayData+ReactNative.swift new file mode 100644 index 000000000..eab885565 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentOptionDisplayData+ReactNative.swift @@ -0,0 +1,55 @@ +// +// PaymentOptionDisplayData+ReactNative.swift +// stripe-react-native +// +// Created by Nick Porter on 4/16/25. +// + +import Foundation +@_spi(EmbeddedPaymentElementPrivateBeta) import StripePaymentSheet + +extension EmbeddedPaymentElement.PaymentOptionDisplayData { + /// Convert `PaymentOptionDisplayData` into a dictionary compatible with React Native bridge. + func toDictionary() -> [String: Any] { + // Convert UIImage to Base64 + let imageBase64: String = { + guard let data = image.pngData() else { return "" } + return data.base64EncodedString() + }() + + // Convert BillingDetails to a dictionary + let billingDetailsDict: [String: Any] = { + guard let billing = billingDetails else { + return [:] + } + + // Extract address + let addressDict: [String: Any] = { + let addr = billing.address + return [ + "city": addr.city ?? "", + "country": addr.country ?? "", + "line1": addr.line1 ?? "", + "line2": addr.line2 ?? "", + "postalCode": addr.postalCode ?? "", + "state": addr.state ?? "" + ] + }() + + return [ + "name": billing.name ?? "", + "email": billing.email ?? "", + "phone": billing.phone ?? "", + "address": addressDict + ] + }() + + // Return as a dictionary + return [ + "image": imageBase64, + "label": label, + "billingDetails": billingDetailsDict, + "paymentMethodType": paymentMethodType + ] + } +} diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentSheetAppearance.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentSheetAppearance.swift index 777277f25..41344db86 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentSheetAppearance.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/PaymentSheetAppearance.swift @@ -4,7 +4,7 @@ // // Created by Charles Cruzan on 5/11/22. // -import StripePaymentSheet +@_spi(EmbeddedPaymentElementPrivateBeta) import StripePaymentSheet import Foundation import UIKit @@ -12,7 +12,7 @@ internal class PaymentSheetAppearance { class func buildAppearanceFromParams(userParams: NSDictionary?) throws -> PaymentSheet.Appearance { var appearance = PaymentSheet.Appearance() guard let userParams = userParams else { return appearance } - + if let fontParams = userParams[PaymentSheetAppearanceKeys.FONT] as? NSDictionary { appearance.font = try buildFont(params: fontParams) } @@ -29,10 +29,19 @@ internal class PaymentSheetAppearance { if let primaryButtonParams = userParams[PaymentSheetAppearanceKeys.PRIMARY_BUTTON] as? NSDictionary { appearance.primaryButton = try buildPrimaryButton(params: primaryButtonParams) } - + + + if let embeddedPaymentElementParams = userParams[PaymentSheetAppearanceKeys.EMBEDDED_PAYMENT_ELEMENT] as? NSDictionary { + appearance.embeddedPaymentElement = try buildEmbeddedPaymentElementAppearance(params: embeddedPaymentElementParams) + } + + if let formInsetParams = userParams[PaymentSheetAppearanceKeys.FORM_INSETS] as? NSDictionary { + appearance.formInsets = try buildFormInsets(params: formInsetParams) + } + return appearance } - + private class func buildFont(params: NSDictionary) throws -> PaymentSheet.Appearance.Font { var font = PaymentSheet.Appearance.Font() if let fontName = params[PaymentSheetAppearanceKeys.FAMILY] as? String { @@ -47,15 +56,15 @@ internal class PaymentSheetAppearance { private class func buildColors(params: NSDictionary) throws -> PaymentSheet.Appearance.Colors { var colors = PaymentSheet.Appearance.Colors() - + if (params.object(forKey: PaymentSheetAppearanceKeys.LIGHT) != nil && params.object(forKey: PaymentSheetAppearanceKeys.DARK) == nil || params.object(forKey: PaymentSheetAppearanceKeys.DARK) != nil && params.object(forKey: PaymentSheetAppearanceKeys.LIGHT) == nil) { throw PaymentSheetAppearanceError.missingAppearanceMode } - + let lightModeParams = params[PaymentSheetAppearanceKeys.LIGHT] as? NSDictionary ?? params let darkModeParams = params[PaymentSheetAppearanceKeys.DARK] as? NSDictionary ?? params - + colors.primary = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.PRIMARY, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.primary colors.background = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.background colors.componentBackground = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.COMPONENT_BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.componentBackground @@ -67,13 +76,13 @@ internal class PaymentSheetAppearance { colors.componentPlaceholderText = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.PLACEHOLDER_TEXT, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.componentPlaceholderText colors.icon = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.ICON, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.icon colors.danger = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.ERROR, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.colors.danger - + return colors } - + private class func buildShadow(params: NSDictionary) throws -> PaymentSheet.Appearance.Shadow { var shadow = PaymentSheet.Appearance.Shadow() - + if let color = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.SHADOW_COLOR, lightParams: params, darkParams: params) { shadow.color = color } @@ -91,10 +100,10 @@ internal class PaymentSheetAppearance { return shadow } - + private class func buildPrimaryButton(params: NSDictionary) throws -> PaymentSheet.Appearance.PrimaryButton { var primaryButton = PaymentSheet.Appearance.PrimaryButton() - + if let fontName = (params[PaymentSheetAppearanceKeys.FONT] as? NSDictionary)?[PaymentSheetAppearanceKeys.FAMILY] as? String { guard let customFont = UIFont(name: fontName, size: UIFont.systemFontSize) else { throw PaymentSheetAppearanceError.missingFont(fontName) @@ -111,29 +120,32 @@ internal class PaymentSheetAppearance { if let shadowParams = shapeParams[PaymentSheetAppearanceKeys.SHADOW] as? NSDictionary { primaryButton.shadow = try buildShadow(params: shadowParams) } + if let height = shapeParams[PaymentSheetAppearanceKeys.HEIGHT] as? CGFloat { + primaryButton.height = height + } } if let colorParams = params[PaymentSheetAppearanceKeys.COLORS] as? NSDictionary { if (colorParams.object(forKey: PaymentSheetAppearanceKeys.LIGHT) != nil && colorParams.object(forKey: PaymentSheetAppearanceKeys.DARK) == nil || colorParams.object(forKey: PaymentSheetAppearanceKeys.DARK) != nil && colorParams.object(forKey: PaymentSheetAppearanceKeys.LIGHT) == nil) { throw PaymentSheetAppearanceError.missingAppearanceMode } - + let lightModeParams = colorParams[PaymentSheetAppearanceKeys.LIGHT] as? NSDictionary ?? colorParams let darkModeParams = colorParams[PaymentSheetAppearanceKeys.DARK] as? NSDictionary ?? colorParams - + primaryButton.backgroundColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.BACKGROUND, lightParams: lightModeParams, darkParams: darkModeParams) primaryButton.textColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.TEXT, lightParams: lightModeParams, darkParams: darkModeParams) primaryButton.borderColor = try buildUserInterfaceStyleAwareColor(key: PaymentSheetAppearanceKeys.BORDER, lightParams: lightModeParams, darkParams: darkModeParams) ?? PaymentSheet.Appearance.default.primaryButton.borderColor } - + return primaryButton } - + private class func buildUserInterfaceStyleAwareColor(key: String, lightParams: NSDictionary, darkParams: NSDictionary) throws -> UIColor? { guard let lightHexString = lightParams[key] as? String, let darkHexString = darkParams[key] as? String else { return nil } - + let darkCount = darkHexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted).count let lightCount = lightHexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted).count if (lightCount != 6 && lightCount != 8) { @@ -141,10 +153,10 @@ internal class PaymentSheetAppearance { } else if (darkCount != 6 && darkCount != 8) { throw PaymentSheetAppearanceError.unexpectedHexStringLength(darkHexString) } - + let lightColor = UIColor(hexString: lightHexString) let darkColor = UIColor(hexString: darkHexString) - + if #available(iOS 13.0, *) { return UIColor.init { traits in return traits.userInterfaceStyle == .dark ? darkColor : lightColor @@ -153,14 +165,220 @@ internal class PaymentSheetAppearance { return lightColor } } + + private class func buildEmbeddedPaymentElementAppearance(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement { + var embeddedAppearance = PaymentSheet.Appearance.EmbeddedPaymentElement() + + if let rowParams = params[PaymentSheetAppearanceKeys.ROW] as? NSDictionary { + embeddedAppearance.row = try buildEmbeddedRow(params: rowParams) + } + + return embeddedAppearance + } + + private class func buildEmbeddedRow(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row { + var row = PaymentSheet.Appearance.default.embeddedPaymentElement.row + + if let styleString = params[PaymentSheetAppearanceKeys.STYLE] as? String { + switch styleString { + case PaymentSheetAppearanceKeys.ROW_STYLE_FLAT_WITH_RADIO: + row.style = .flatWithRadio + case PaymentSheetAppearanceKeys.ROW_STYLE_FLOATING_BUTTON: + row.style = .floatingButton + case PaymentSheetAppearanceKeys.ROW_STYLE_FLAT_WITH_CHECKMARK: + row.style = .flatWithCheckmark + case PaymentSheetAppearanceKeys.ROW_STYLE_FLAT_WITH_CHEVRON: + row.style = .flatWithChevron + default: + throw PaymentSheetAppearanceError.invalidRowStyle(styleString) + } + } + + if let additionalInsets = params[PaymentSheetAppearanceKeys.ADDITIONAL_INSETS] as? CGFloat { + row.additionalInsets = additionalInsets + } + + if let flatParams = params[PaymentSheetAppearanceKeys.FLAT] as? NSDictionary { + row.flat = try buildEmbeddedFlat(params: flatParams) + } + + if let floatingParams = params[PaymentSheetAppearanceKeys.FLOATING] as? NSDictionary { + row.floating = try buildEmbeddedFloating(params: floatingParams) + } + + return row + } + + private class func buildEmbeddedFlat(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat { + var flat = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat + + if let thickness = params[PaymentSheetAppearanceKeys.SEPARATOR_THICKNESS] as? CGFloat { + flat.separatorThickness = thickness + } + + flat.separatorColor = parseThemedColor( + params: params, + key: PaymentSheetAppearanceKeys.SEPARATOR_COLOR, + default: PaymentSheet.Appearance.default.colors.componentBorder + ) + + if let insetsParams = params[PaymentSheetAppearanceKeys.SEPARATOR_INSETS] as? NSDictionary { + flat.separatorInsets = try buildEdgeInsets(params: insetsParams) + } + + if let topEnabled = params[PaymentSheetAppearanceKeys.TOP_SEPARATOR_ENABLED] as? Bool { + flat.topSeparatorEnabled = topEnabled + } + + if let bottomEnabled = params[PaymentSheetAppearanceKeys.BOTTOM_SEPARATOR_ENABLED] as? Bool { + flat.bottomSeparatorEnabled = bottomEnabled + } + + if let radioParams = params[PaymentSheetAppearanceKeys.RADIO] as? NSDictionary { + flat.radio = try buildEmbeddedRadio(params: radioParams) + } + + if let checkmarkParams = params[PaymentSheetAppearanceKeys.CHECKMARK] as? NSDictionary { + flat.checkmark = try buildEmbeddedCheckmark(params: checkmarkParams) + } + + if let chevronParams = params[PaymentSheetAppearanceKeys.CHEVRON] as? NSDictionary { + flat.chevron = try buildEmbeddedChevron(params: chevronParams) + } + + return flat + } + + private class func buildEmbeddedRadio(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Radio { + var radio = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.radio + + // Selected‐state color + radio.selectedColor = parseThemedColor( + params: params, + key: PaymentSheetAppearanceKeys.SELECTED_COLOR, + default: PaymentSheet.Appearance.default.colors.primary + ) + + // Unselected‐state color + radio.unselectedColor = parseThemedColor( + params: params, + key: PaymentSheetAppearanceKeys.UNSELECTED_COLOR, + default: PaymentSheet.Appearance.default.colors.componentBorder + ) + + return radio + } + + private class func buildEmbeddedCheckmark(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Checkmark { + var checkmark = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.checkmark + + checkmark.color = parseThemedColor( + params: params, + key: PaymentSheetAppearanceKeys.COLOR, + default: PaymentSheet.Appearance.default.colors.primary + ) + + return checkmark + } + + private class func buildEmbeddedChevron(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Flat.Chevron { + var chevron = PaymentSheet.Appearance.default.embeddedPaymentElement.row.flat.chevron + + chevron.color = parseThemedColor( + params: params, + key: PaymentSheetAppearanceKeys.COLOR, + default: UIColor.systemGray // Default iOS system gray color + ) + + return chevron + } + + private class func buildEmbeddedFloating(params: NSDictionary) throws -> PaymentSheet.Appearance.EmbeddedPaymentElement.Row.Floating { + var floating = PaymentSheet.Appearance.default.embeddedPaymentElement.row.floating + + if let spacing = params[PaymentSheetAppearanceKeys.SPACING] as? CGFloat { + floating.spacing = spacing + } + + return floating + } + + private class func buildEdgeInsets(params: NSDictionary) throws -> UIEdgeInsets { + let top = params[PaymentSheetAppearanceKeys.TOP] as? CGFloat ?? 0 + let left = params[PaymentSheetAppearanceKeys.LEFT] as? CGFloat ?? 0 + let bottom = params[PaymentSheetAppearanceKeys.BOTTOM] as? CGFloat ?? 0 + let right = params[PaymentSheetAppearanceKeys.RIGHT] as? CGFloat ?? 0 + + return UIEdgeInsets( + top: top, + left: left, + bottom: bottom, + right: right + ) + } + + private class func dynamicColor( + from hexDict: [String: String], + default defaultColor: UIColor + ) -> UIColor { + return UIColor( + dynamicProvider: { traitCollection in + if traitCollection.userInterfaceStyle == .dark, + let darkHex = hexDict[PaymentSheetAppearanceKeys.DARK] { + return .init( + hexString: darkHex + ) + } + if let lightHex = hexDict[PaymentSheetAppearanceKeys.LIGHT] { + return .init( + hexString: lightHex + ) + } + return defaultColor + }) + } + + private class func parseThemedColor( + params: NSDictionary, + key: String, + default defaultColor: UIColor + ) -> UIColor { + // Check if it's a dictionary with light/dark keys + if let colorDict = params[key] as? [String: String] { + return dynamicColor(from: colorDict, default: defaultColor) + } + + // Check if it's a plain string + if let colorString = params[key] as? String { + return UIColor(hexString: colorString) + } + + // Fall back to default if no color provided + return defaultColor + } + + private class func buildFormInsets(params: NSDictionary) throws -> NSDirectionalEdgeInsets { + let top = params[PaymentSheetAppearanceKeys.TOP] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.top + let leading = params[PaymentSheetAppearanceKeys.LEFT] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.leading + let bottom = params[PaymentSheetAppearanceKeys.BOTTOM] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.bottom + let trailing = params[PaymentSheetAppearanceKeys.RIGHT] as? CGFloat ?? PaymentSheet.Appearance.default.formInsets.trailing + + return NSDirectionalEdgeInsets( + top: top, + leading: leading, + bottom: bottom, + trailing: trailing + ) + } } enum PaymentSheetAppearanceError : Error { case missingFont(String) case missingAppearanceMode case unexpectedHexStringLength(String) + case invalidRowStyle(String) } - + extension PaymentSheetAppearanceError: LocalizedError { public var errorDescription: String? { switch self { @@ -170,6 +388,8 @@ extension PaymentSheetAppearanceError: LocalizedError { return NSLocalizedString("Failed to set Payment Sheet appearance. When providing 'colors.light' or 'colors.dark', you must provide both.", comment: "Failed to set colors") case .unexpectedHexStringLength(let hexString): return NSLocalizedString("Failed to set Payment Sheet appearance. Expected hex string of length 6 or 8, but received: \(hexString)", comment: "Failed to set color") + case .invalidRowStyle(let styleString): + return NSLocalizedString("Failed to set Embedded Payment Element appearance. Invalid row style '\(styleString)'. Expected one of: 'flatWithRadio', 'floatingButton', 'flatWithCheckmark', 'flatWithChevron'.", comment: "Invalid row style string") } } } @@ -189,14 +409,15 @@ private struct PaymentSheetAppearanceKeys { static let PLACEHOLDER_TEXT = "placeholderText" static let ICON = "icon" static let ERROR = "error" - + static let FONT = "font" static let FAMILY = "family" static let SCALE = "scale" - + static let SHAPES = "shapes" static let BORDER_RADIUS = "borderRadius" static let BORDER_WIDTH = "borderWidth" + static let HEIGHT = "height" static let SHADOW = "shadow" static let SHADOW_COLOR = "color" @@ -205,8 +426,39 @@ private struct PaymentSheetAppearanceKeys { static let BLUR_RADIUS = "blurRadius" static let X = "x" static let Y = "y" - + static let PRIMARY_BUTTON = "primaryButton" static let TEXT = "text" static let BORDER = "border" + + static let EMBEDDED_PAYMENT_ELEMENT = "embeddedPaymentElement" + static let ROW = "row" + static let STYLE = "style" + static let ADDITIONAL_INSETS = "additionalInsets" + static let FLAT = "flat" + static let FLOATING = "floating" + static let SEPARATOR_THICKNESS = "separatorThickness" + static let SEPARATOR_COLOR = "separatorColor" + static let SEPARATOR_INSETS = "separatorInsets" + static let TOP_SEPARATOR_ENABLED = "topSeparatorEnabled" + static let BOTTOM_SEPARATOR_ENABLED = "bottomSeparatorEnabled" + static let RADIO = "radio" + static let SELECTED_COLOR = "selectedColor" + static let UNSELECTED_COLOR = "unselectedColor" + static let CHECKMARK = "checkmark" + static let CHEVRON = "chevron" + static let SPACING = "spacing" + static let TOP = "top" + static let LEFT = "left" + static let BOTTOM = "bottom" + static let RIGHT = "right" + static let COLOR = "color" + + // Row Style Enum Values (match TS string enum values) + static let ROW_STYLE_FLAT_WITH_RADIO = "flatWithRadio" + static let ROW_STYLE_FLOATING_BUTTON = "floatingButton" + static let ROW_STYLE_FLAT_WITH_CHECKMARK = "flatWithCheckmark" + static let ROW_STYLE_FLAT_WITH_CHEVRON = "flatWithChevron" + + static let FORM_INSETS = "formInsetValues" } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeContainerView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeContainerView.swift index 5909761db..4e7b8c43d 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeContainerView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeContainerView.swift @@ -1,10 +1,11 @@ import Foundation import UIKit -class StripeContainerView: UIView { +@objc(StripeContainerView) +public class StripeContainerView: UIView { var tapRecognizer: UITapGestureRecognizer? = nil - @objc var keyboardShouldPersistTaps: Bool = true { + @objc public var keyboardShouldPersistTaps: Bool = true { didSet { if (keyboardShouldPersistTaps == true) { removeListener() @@ -14,11 +15,12 @@ class StripeContainerView: UIView { } } - override init(frame: CGRect) { + public override init(frame: CGRect) { super.init(frame: frame) } func setListener() { + removeListener() tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(endEditing(_:))) tapRecognizer!.cancelsTouchesInView = false diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkEmitter.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkEmitter.swift new file mode 100644 index 000000000..478476811 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkEmitter.swift @@ -0,0 +1,20 @@ +import Foundation + +@objc public protocol StripeSdkEmitter { + func emitOnConfirmHandlerCallback(_ value: [String: Any]) + func emitOnFinancialConnectionsEvent(_ value: [String: Any]) + func emitOnOrderTrackingCallback() + func emitOnCustomerAdapterFetchPaymentMethodsCallback() + func emitOnCustomerAdapterAttachPaymentMethodCallback(_ value: [String: Any]) + func emitOnCustomerAdapterDetachPaymentMethodCallback(_ value: [String: Any]) + func emitOnCustomerAdapterSetSelectedPaymentOptionCallback(_ value: [String: Any]) + func emitOnCustomerAdapterFetchSelectedPaymentOptionCallback() + func emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback() + func emitEmbeddedPaymentElementDidUpdateHeight(_ value: [String: Any]) + func emitEmbeddedPaymentElementWillPresent() + func emitEmbeddedPaymentElementDidUpdatePaymentOption(_ value: [String: Any]) + func emitEmbeddedPaymentElementFormSheetConfirmComplete(_ value: [String: Any]) + func emitEmbeddedPaymentElementRowSelectionImmediateAction() + func emitEmbeddedPaymentElementLoadingFailed(_ value: [String: Any]) + func emitOnCustomPaymentMethodConfirmHandlerCallback(_ value: [String: Any]) +} diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+CustomerSheet.swift similarity index 84% rename from packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift rename to packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+CustomerSheet.swift index 832aaca5a..f08756db4 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+CustomerSheet.swift @@ -8,13 +8,10 @@ import Foundation @_spi(PrivateBetaCustomerSheet) @_spi(STP) import StripePaymentSheet import UIKit -#if canImport(stripe_objc) -import stripe_objc -#endif -extension StripeSdk { +extension StripeSdkImpl { @objc(initCustomerSheet:customerAdapterOverrides:resolver:rejecter:) - func initCustomerSheet(params: NSDictionary, customerAdapterOverrides: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + public func initCustomerSheet(params: NSDictionary, customerAdapterOverrides: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { do { customerSheetConfiguration = CustomerSheetUtils.buildCustomerSheetConfiguration( @@ -37,7 +34,7 @@ extension StripeSdk { ) return } - + guard let customerId = params["customerId"] as? String else { resolve(Errors.createError(ErrorType.Failed, "You must provide `customerId`")) return @@ -46,7 +43,7 @@ extension StripeSdk { resolve(Errors.createError(ErrorType.Failed, "You must provide `customerEphemeralKeySecret`")) return } - + customerAdapter = CustomerSheetUtils.buildStripeCustomerAdapter( customerId: customerId, ephemeralKeySecret: customerEphemeralKeySecret, @@ -56,12 +53,12 @@ extension StripeSdk { ) customerSheet = CustomerSheet(configuration: customerSheetConfiguration, customer: customerAdapter!) - + resolve([]) } - + @objc(presentCustomerSheet:resolver:rejecter:) - func presentCustomerSheet(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + public func presentCustomerSheet(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { if (STPAPIClient.shared.publishableKey == nil) { resolve( @@ -78,7 +75,7 @@ extension StripeSdk { } } } - + DispatchQueue.main.async { self.customerSheetViewController = findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController()) if let customerSheetViewController = self.customerSheetViewController { @@ -96,15 +93,15 @@ extension StripeSdk { } } } - + @objc(retrieveCustomerSheetPaymentOptionSelection:rejecter:) - func retrieveCustomerSheetPaymentOptionSelection(resolver resolve: @escaping RCTPromiseResolveBlock, + public func retrieveCustomerSheetPaymentOptionSelection(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { guard let customerAdapter = customerAdapter else { resolve(Errors.createError(ErrorType.Failed, "CustomerSheet has not been properly initialized.")) return } - + Task { var payload: NSDictionary = [:] var paymentMethodOption: CustomerSheet.PaymentOptionSelection? = nil @@ -114,7 +111,7 @@ extension StripeSdk { resolve(Errors.createError(ErrorType.Failed, error as NSError)) return } - + switch paymentMethodOption { case .applePay(let paymentOptionDisplayData): payload = CustomerSheetUtils.buildPaymentOptionResult(label: paymentOptionDisplayData.label, imageData: paymentOptionDisplayData.image.pngData()?.base64EncodedString(), paymentMethod: nil) @@ -126,38 +123,38 @@ extension StripeSdk { resolve(payload) } } - + @objc(customerAdapterFetchPaymentMethodsCallback:resolver:rejecter:) - func customerAdapterFetchPaymentMethodsCallback(paymentMethods: [NSDictionary], resolver resolve: @escaping RCTPromiseResolveBlock, + public func customerAdapterFetchPaymentMethodsCallback(paymentMethods: [NSDictionary], resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { let decodedPaymentMethods = paymentMethods.compactMap { STPPaymentMethod.decodedObject(fromAPIResponse: $0 as? [AnyHashable : Any]) } self.fetchPaymentMethodsCallback?(decodedPaymentMethods) resolve([]) } - + @objc(customerAdapterAttachPaymentMethodCallback:resolver:rejecter:) - func customerAdapterAttachPaymentMethodCallback(unusedPaymentMethod: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + public func customerAdapterAttachPaymentMethodCallback(unusedPaymentMethod: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { self.attachPaymentMethodCallback?() resolve([]) } - + @objc(customerAdapterDetachPaymentMethodCallback:resolver:rejecter:) - func customerAdapterDetachPaymentMethodCallback(unusedPaymentMethod: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + public func customerAdapterDetachPaymentMethodCallback(unusedPaymentMethod: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { self.detachPaymentMethodCallback?() resolve([]) } - + @objc(customerAdapterSetSelectedPaymentOptionCallback:rejecter:) - func customerAdapterSetSelectedPaymentOptionCallback(resolver resolve: @escaping RCTPromiseResolveBlock, + public func customerAdapterSetSelectedPaymentOptionCallback(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { self.setSelectedPaymentOptionCallback?() resolve([]) } - + @objc(customerAdapterFetchSelectedPaymentOptionCallback:resolver:rejecter:) - func customerAdapterFetchSelectedPaymentOptionCallback(paymentOption: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + public func customerAdapterFetchSelectedPaymentOptionCallback(paymentOption: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { if let paymentOption = paymentOption { self.fetchSelectedPaymentOptionCallback?(CustomerPaymentOption.init(value: paymentOption)) } else { @@ -165,9 +162,9 @@ extension StripeSdk { } resolve([]) } - + @objc(customerAdapterSetupIntentClientSecretForCustomerAttachCallback:resolver:rejecter:) - func customerAdapterSetupIntentClientSecretForCustomerAttachCallback(clientSecret: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + public func customerAdapterSetupIntentClientSecretForCustomerAttachCallback(clientSecret: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { self.setupIntentClientSecretForCustomerAttachCallback?(clientSecret) resolve([]) } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+Embedded.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+Embedded.swift new file mode 100644 index 000000000..4e59ccd21 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+Embedded.swift @@ -0,0 +1,349 @@ +// +// EmbeddedPaymentElementManager.swift +// stripe-react-native +// +// Created by Nick Porter on 4/15/25. +// + +import Foundation +@_spi(EmbeddedPaymentElementPrivateBeta) @_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) @_spi(CustomPaymentMethodsBeta) import StripePaymentSheet + +@objc(StripeSdkImpl) +extension StripeSdkImpl { + + // MARK: Public API wrappers + + @objc(createEmbeddedPaymentElement:configuration:resolve:reject:) + public func createEmbeddedPaymentElement(intentConfig: NSDictionary, + configuration: NSDictionary, + resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock) { + guard let modeParams = intentConfig["mode"] as? NSDictionary else { + resolve(Errors.createError(ErrorType.Failed, "One of `paymentIntentClientSecret`, `setupIntentClientSecret`, or `intentConfiguration.mode` is required")) + return + } + if intentConfig.object(forKey: "confirmHandler") == nil { + resolve(Errors.createError(ErrorType.Failed, "You must provide `intentConfiguration.confirmHandler` if you are not passing an intent client secret")) + return + } + let captureMethodString = intentConfig["captureMethod"] as? String + let intentConfig = buildIntentConfiguration( + modeParams: modeParams, + paymentMethodTypes: intentConfig["paymentMethodTypes"] as? [String], + captureMethod: mapCaptureMethod(captureMethodString) + ) + + guard let configuration = buildEmbeddedPaymentElementConfiguration(params: configuration).configuration else { + resolve(Errors.createError(ErrorType.Failed, "Invalid configuration")) + return + } + + Task { + do { + let embeddedPaymentElement = try await EmbeddedPaymentElement.create( + intentConfiguration: intentConfig, + configuration: configuration + ) + embeddedPaymentElement.delegate = embeddedInstanceDelegate + embeddedPaymentElement.presentingViewController = RCTPresentedViewController() + self.embeddedInstance = embeddedPaymentElement + + // success: resolve promise + resolve(nil) + + // publish initial state + embeddedInstanceDelegate.embeddedPaymentElementDidUpdateHeight(embeddedPaymentElement: embeddedPaymentElement) + embeddedInstanceDelegate.embeddedPaymentElementDidUpdatePaymentOption(embeddedPaymentElement: embeddedPaymentElement) + } catch { + // 1) still resolve the promise so JS hook can finish loading + resolve(nil) + + // 2) emit a loading‐failed event with the error message + let msg = error.localizedDescription + self.emitter?.emitEmbeddedPaymentElementLoadingFailed(["message": msg]) + } + } + + } + + @objc(confirmEmbeddedPaymentElement:reject:) + public func confirmEmbeddedPaymentElement(resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock) { + DispatchQueue.main.async { [weak self] in + self?.embeddedInstance?.presentingViewController = RCTPresentedViewController() + self?.embeddedInstance?.confirm { result in + switch result { + case .completed: + // Return an object with { status: 'completed' } + resolve(["status": "completed"]) + case .canceled: + // Return an object with { status: 'canceled' } + resolve(["status": "canceled"]) + case .failed(let error): + // Return an object with { status: 'failed', error } + resolve([ + "status": "failed", + "error": error.localizedDescription + ]) + } + } + } + } + + @objc(updateEmbeddedPaymentElement:resolve:reject:) + public func updateEmbeddedPaymentElement( + intentConfig: NSDictionary, + resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock + ) { + guard let modeParams = intentConfig["mode"] as? NSDictionary else { + resolve(Errors.createError( + ErrorType.Failed, + "One of `paymentIntentClientSecret`, `setupIntentClientSecret`, or `intentConfiguration.mode` is required" + )) + return + } + let captureMethodString = intentConfig["captureMethod"] as? String + let intentConfiguration = buildIntentConfiguration( + modeParams: modeParams, + paymentMethodTypes: intentConfig["paymentMethodTypes"] as? [String], + captureMethod: mapCaptureMethod(captureMethodString) + ) + + Task { + guard let updateResult = await self.embeddedInstance?.update(intentConfiguration: intentConfiguration) else { + resolve(Errors.createError( + ErrorType.Failed, + "No EmbeddedPaymentElement instance — did you call create first?" + )) + return + } + + switch updateResult { + case .succeeded: + resolve(["status": "succeeded"]) + case .canceled: + resolve(["status": "canceled"]) + case .failed(let error): + self.emitter?.emitEmbeddedPaymentElementLoadingFailed(["message": error.localizedDescription]) + // We don't resolve with an error b/c loading errors are handled via the embeddedPaymentElementLoadingFailed event + resolve(nil) + } + } + } + + @objc(clearEmbeddedPaymentOption) + public func clearEmbeddedPaymentOption() { + DispatchQueue.main.async { + self.embeddedInstance?.clearPaymentOption() + } + } + +} + +// MARK: EmbeddedPaymentElementDelegate + +class StripeSdkEmbeddedPaymentElementDelegate: EmbeddedPaymentElementDelegate { + weak var sdkImpl: StripeSdkImpl? + + init(sdkImpl: StripeSdkImpl) { + self.sdkImpl = sdkImpl + } + + func embeddedPaymentElementDidUpdateHeight(embeddedPaymentElement: StripePaymentSheet.EmbeddedPaymentElement) { + let newHeight = embeddedPaymentElement.view.systemLayoutSizeFitting(CGSize(width: embeddedPaymentElement.view.bounds.width, height: UIView.layoutFittingCompressedSize.height)).height + self.sdkImpl?.emitter?.emitEmbeddedPaymentElementDidUpdateHeight(["height": newHeight]) + } + + func embeddedPaymentElementDidUpdatePaymentOption(embeddedPaymentElement: EmbeddedPaymentElement) { + let displayDataDict = embeddedPaymentElement.paymentOption?.toDictionary() + self.sdkImpl?.emitter?.emitEmbeddedPaymentElementDidUpdatePaymentOption(["paymentOption": displayDataDict as Any]) + } + + func embeddedPaymentElementWillPresent(embeddedPaymentElement: EmbeddedPaymentElement) { + self.sdkImpl?.emitter?.emitEmbeddedPaymentElementWillPresent() + } +} + +// MARK: Config parsing + +extension StripeSdkImpl { + @nonobjc + internal func buildEmbeddedPaymentElementConfiguration( + params: NSDictionary + ) -> (error: NSDictionary?, configuration: EmbeddedPaymentElement.Configuration?) { + var configuration = EmbeddedPaymentElement.Configuration() + + configuration.primaryButtonLabel = params["primaryButtonLabel"] as? String + + if let appearanceParams = params["appearance"] as? NSDictionary { + do { + configuration.appearance = try PaymentSheetAppearance.buildAppearanceFromParams(userParams: appearanceParams) + } catch { + return(error: Errors.createError(ErrorType.Failed, error.localizedDescription), configuration: nil) + } + } + + if let applePayParams = params["applePay"] as? NSDictionary { + do { + configuration.applePay = try ApplePayUtils.buildPaymentSheetApplePayConfig( + merchantIdentifier: self.merchantIdentifier, + merchantCountryCode: applePayParams["merchantCountryCode"] as? String, + paymentSummaryItems: applePayParams["cartItems"] as? [[String : Any]], + buttonType: applePayParams["buttonType"] as? NSNumber, + customHandlers: buildCustomerHandlersForPaymentSheet(applePayParams: applePayParams) + ) + } catch { + return(error: Errors.createError(ErrorType.Failed, error.localizedDescription), configuration: nil) + } + } + + if let linkParams = params["link"] as? NSDictionary { + let display = StripeSdkImpl.mapToLinkDisplay(value: linkParams["display"] as? String) + configuration.link = PaymentSheet.LinkConfiguration(display: display) + } + + if let merchantDisplayName = params["merchantDisplayName"] as? String { + configuration.merchantDisplayName = merchantDisplayName + } + + if let returnURL = params["returnURL"] as? String { + configuration.returnURL = returnURL + } + + if let allowsDelayedPaymentMethods = params["allowsDelayedPaymentMethods"] as? Bool { + configuration.allowsDelayedPaymentMethods = allowsDelayedPaymentMethods + } + + if let removeSavedPaymentMethodMessage = params["removeSavedPaymentMethodMessage"] as? String { + configuration.removeSavedPaymentMethodMessage = removeSavedPaymentMethodMessage + } + + if let billingConfigParams = params["billingDetailsCollectionConfiguration"] as? [String: Any?] { + configuration.billingDetailsCollectionConfiguration.name = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["name"] as? String) + configuration.billingDetailsCollectionConfiguration.phone = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["phone"] as? String) + configuration.billingDetailsCollectionConfiguration.email = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["email"] as? String) + configuration.billingDetailsCollectionConfiguration.address = StripeSdkImpl.mapToAddressCollectionMode(str: billingConfigParams["address"] as? String) + configuration.billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod = billingConfigParams["attachDefaultsToPaymentMethod"] as? Bool == true + } + + if let defaultBillingDetails = params["defaultBillingDetails"] as? [String: Any?] { + configuration.defaultBillingDetails.name = defaultBillingDetails["name"] as? String + configuration.defaultBillingDetails.email = defaultBillingDetails["email"] as? String + configuration.defaultBillingDetails.phone = defaultBillingDetails["phone"] as? String + + if let address = defaultBillingDetails["address"] as? [String: String] { + configuration.defaultBillingDetails.address = .init(city: address["city"], + country: address["country"], + line1: address["line1"], + line2: address["line2"], + postalCode: address["postalCode"], + state: address["state"]) + } + + } + + if let defaultShippingDetails = params["defaultShippingDetails"] as? NSDictionary { + configuration.shippingDetails = { + return AddressSheetUtils.buildAddressDetails(params: defaultShippingDetails) + } + } + + if #available(iOS 13.0, *) { + if let style = params["style"] as? String { + configuration.style = Mappers.mapToUserInterfaceStyle(style) + } + } + + if let customerId = params["customerId"] as? String { + let customerEphemeralKeySecret = params["customerEphemeralKeySecret"] as? String + let customerClientSecret = params["customerSessionClientSecret"] as? String + if customerEphemeralKeySecret != nil && customerClientSecret != nil { + return(error: Errors.createError(ErrorType.Failed, "`customerEphemeralKeySecret` and `customerSessionClientSecret cannot both be set"), configuration: nil) + } else if let customerEphemeralKeySecret { + if (!Errors.isEKClientSecretValid(clientSecret: customerEphemeralKeySecret)) { + return(error: Errors.createError(ErrorType.Failed, "`customerEphemeralKeySecret` format does not match expected client secret formatting."), configuration: nil) + } + configuration.customer = .init(id: customerId, ephemeralKeySecret: customerEphemeralKeySecret) + } else if let customerClientSecret { + configuration.customer = .init(id: customerId, customerSessionClientSecret: customerClientSecret) + } + } + + if let preferredNetworksAsInts = params["preferredNetworks"] as? Array { + configuration.preferredNetworks = preferredNetworksAsInts.map(Mappers.intToCardBrand).compactMap { $0 } + } + + if let allowsRemovalOfLastSavedPaymentMethod = params["allowsRemovalOfLastSavedPaymentMethod"] as? Bool { + configuration.allowsRemovalOfLastSavedPaymentMethod = allowsRemovalOfLastSavedPaymentMethod + } + + if let paymentMethodOrder = params["paymentMethodOrder"] as? Array { + configuration.paymentMethodOrder = paymentMethodOrder + } + + configuration.cardBrandAcceptance = computeCardBrandAcceptance(params: params) + + if let formSheetActionParams = params["formSheetAction"] as? NSDictionary, + let actionType = formSheetActionParams["type"] as? String { + if actionType == "confirm" { + configuration.formSheetAction = .confirm { [weak self] (result: EmbeddedPaymentElementResult) in + guard let self = self else { return } + let resultDict: [String: Any] + switch result { + case .completed: + resultDict = ["status": "completed"] + case .canceled: + resultDict = ["status": "canceled"] + case .failed(let error): + resultDict = [ + "status": "failed", + "error": error.localizedDescription + ] + } + + // Send the result back to JS via an event. + self.emitter?.emitEmbeddedPaymentElementFormSheetConfirmComplete(resultDict) + } + } else if actionType == "continue" { + configuration.formSheetAction = .continue + } + } + + if let rowSelectionBehaviorParams = params["rowSelectionBehavior"] as? NSDictionary, + let behaviorType = rowSelectionBehaviorParams["type"] as? String { + if behaviorType == "default" { + configuration.rowSelectionBehavior = .default + } else if behaviorType == "immediateAction" { + configuration.rowSelectionBehavior = .immediateAction { [weak self] in + // Send an event back to JS to notify that a row has been selected. + // Replace the event name and body details as needed. + self?.emitter?.emitEmbeddedPaymentElementRowSelectionImmediateAction() + } + } + } + // Parse custom payment method configuration + if let customPaymentMethodConfig = params["customPaymentMethodConfiguration"] as? NSDictionary { + let parsedMethods = StripeSdkImpl.parseCustomPaymentMethods(from: customPaymentMethodConfig) + + if !parsedMethods.isEmpty { + let customMethods = parsedMethods.map { parsed in + var customPaymentMethod = EmbeddedPaymentElement.CustomPaymentMethodConfiguration.CustomPaymentMethod( + id: parsed.id, + subtitle: parsed.subtitle + ) + customPaymentMethod.disableBillingDetailCollection = parsed.disableBillingDetailCollection + return customPaymentMethod + } + + configuration.customPaymentMethodConfiguration = .init( + customPaymentMethods: customMethods, + customPaymentMethodConfirmHandler: StripeSdkImpl.createCustomPaymentMethodConfirmHandler(sdkImpl: self) + ) + } + } + + return (nil, configuration) + } + +} diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+PaymentSheet.swift similarity index 64% rename from packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift rename to packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+PaymentSheet.swift index 52d80a285..81e688706 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl+PaymentSheet.swift @@ -6,17 +6,15 @@ // import Foundation -#if canImport(stripe_objc) -import stripe_objc -#endif -@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) import StripePaymentSheet +@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(EmbeddedPaymentElementPrivateBeta) @_spi(STP) @_spi(PaymentMethodOptionsSetupFutureUsagePreview) @_spi(CustomPaymentMethodsBeta) import StripePaymentSheet -extension StripeSdk { + +extension StripeSdkImpl { internal func buildPaymentSheetConfiguration( params: NSDictionary ) -> (error: NSDictionary?, configuration: PaymentSheet.Configuration?) { var configuration = PaymentSheet.Configuration() - + configuration.primaryButtonLabel = params["primaryButtonLabel"] as? String if let appearanceParams = params["appearance"] as? NSDictionary { @@ -40,7 +38,16 @@ extension StripeSdk { return(error: Errors.createError(ErrorType.Failed, error.localizedDescription), configuration: nil) } } - + + if let linkParams = params["link"] as? NSDictionary { + do { + let display = StripeSdkImpl.mapToLinkDisplay(value: linkParams["display"] as? String) + configuration.link = PaymentSheet.LinkConfiguration(display: display) + } catch { + return(error: Errors.createError(ErrorType.Failed, error.localizedDescription), configuration: nil) + } + } + if let merchantDisplayName = params["merchantDisplayName"] as? String { configuration.merchantDisplayName = merchantDisplayName } @@ -52,16 +59,16 @@ extension StripeSdk { if let allowsDelayedPaymentMethods = params["allowsDelayedPaymentMethods"] as? Bool { configuration.allowsDelayedPaymentMethods = allowsDelayedPaymentMethods } - + if let removeSavedPaymentMethodMessage = params["removeSavedPaymentMethodMessage"] as? String { configuration.removeSavedPaymentMethodMessage = removeSavedPaymentMethodMessage } - + if let billingConfigParams = params["billingDetailsCollectionConfiguration"] as? [String: Any?] { - configuration.billingDetailsCollectionConfiguration.name = StripeSdk.mapToCollectionMode(str: billingConfigParams["name"] as? String) - configuration.billingDetailsCollectionConfiguration.phone = StripeSdk.mapToCollectionMode(str: billingConfigParams["phone"] as? String) - configuration.billingDetailsCollectionConfiguration.email = StripeSdk.mapToCollectionMode(str: billingConfigParams["email"] as? String) - configuration.billingDetailsCollectionConfiguration.address = StripeSdk.mapToAddressCollectionMode(str: billingConfigParams["address"] as? String) + configuration.billingDetailsCollectionConfiguration.name = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["name"] as? String) + configuration.billingDetailsCollectionConfiguration.phone = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["phone"] as? String) + configuration.billingDetailsCollectionConfiguration.email = StripeSdkImpl.mapToCollectionMode(str: billingConfigParams["email"] as? String) + configuration.billingDetailsCollectionConfiguration.address = StripeSdkImpl.mapToAddressCollectionMode(str: billingConfigParams["address"] as? String) configuration.billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod = billingConfigParams["attachDefaultsToPaymentMethod"] as? Bool == true } @@ -80,19 +87,19 @@ extension StripeSdk { } } - + if let defaultShippingDetails = params["defaultShippingDetails"] as? NSDictionary { configuration.shippingDetails = { return AddressSheetUtils.buildAddressDetails(params: defaultShippingDetails) } } - + if #available(iOS 13.0, *) { if let style = params["style"] as? String { configuration.style = Mappers.mapToUserInterfaceStyle(style) } } - + if let customerId = params["customerId"] as? String { var customerEphemeralKeySecret = params["customerEphemeralKeySecret"] as? String var customerClientSecret = params["customerSessionClientSecret"] as? String @@ -107,19 +114,19 @@ extension StripeSdk { configuration.customer = .init(id: customerId, customerSessionClientSecret: customerClientSecret) } } - + if let preferredNetworksAsInts = params["preferredNetworks"] as? Array { configuration.preferredNetworks = preferredNetworksAsInts.map(Mappers.intToCardBrand).compactMap { $0 } } - + if let allowsRemovalOfLastSavedPaymentMethod = params["allowsRemovalOfLastSavedPaymentMethod"] as? Bool { configuration.allowsRemovalOfLastSavedPaymentMethod = allowsRemovalOfLastSavedPaymentMethod } - + if let paymentMethodOrder = params["paymentMethodOrder"] as? Array { configuration.paymentMethodOrder = paymentMethodOrder } - + switch params["paymentMethodLayout"] as? String? { case "Horizontal": configuration.paymentMethodLayout = .horizontal @@ -128,20 +135,28 @@ extension StripeSdk { default: configuration.paymentMethodLayout = .automatic } - + configuration.cardBrandAcceptance = computeCardBrandAcceptance(params: params) - + + // Parse custom payment method configuration + if let customPaymentMethodConfig = params["customPaymentMethodConfiguration"] as? [String: Any] { + configuration.customPaymentMethodConfiguration = StripeSdkImpl.buildCustomPaymentMethodConfiguration( + from: customPaymentMethodConfig, + sdkImpl: self + ) + } + return (nil, configuration) } - + internal func preparePaymentSheetInstance( params: NSDictionary, configuration: PaymentSheet.Configuration, resolve: @escaping RCTPromiseResolveBlock ) { self.paymentSheetFlowController = nil - - func handlePaymentSheetFlowControllerResult(result: Result, stripeSdk: StripeSdk?) { + + func handlePaymentSheetFlowControllerResult(result: Result, stripeSdk: StripeSdkImpl?) { switch result { case .failure(let error): resolve(Errors.createError(ErrorType.Failed, error as NSError)) @@ -207,7 +222,7 @@ extension StripeSdk { paymentMethodTypes: intentConfiguration["paymentMethodTypes"] as? [String], captureMethod: mapCaptureMethod(captureMethodString) ) - + if params["customFlow"] as? Bool == true { PaymentSheet.FlowController.create(intentConfiguration: intentConfig, configuration: configuration) { [weak self] result in handlePaymentSheetFlowControllerResult(result: result, stripeSdk: self) @@ -221,7 +236,7 @@ extension StripeSdk { } } } - + internal func computeCardBrandAcceptance(params: NSDictionary) -> PaymentSheet.CardBrandAcceptance { if let cardBrandAcceptanceParams = params["cardBrandAcceptance"] as? NSDictionary { if let filter = cardBrandAcceptanceParams["filter"] as? String { @@ -243,10 +258,10 @@ extension StripeSdk { } } } - + return .all } - + private func mapToCardBrandCategory(brand: String) -> PaymentSheet.CardBrandAcceptance.BrandCategory? { switch brand { case "visa": @@ -261,8 +276,8 @@ extension StripeSdk { return nil } } - - private func mapCaptureMethod(_ captureMethod: String?) -> PaymentSheet.IntentConfiguration.CaptureMethod { + + func mapCaptureMethod(_ captureMethod: String?) -> PaymentSheet.IntentConfiguration.CaptureMethod { if let captureMethod = captureMethod { switch captureMethod { case "Automatic": return PaymentSheet.IntentConfiguration.CaptureMethod.automatic @@ -273,8 +288,8 @@ extension StripeSdk { } return PaymentSheet.IntentConfiguration.CaptureMethod.automatic } - - private func buildIntentConfiguration( + + func buildIntentConfiguration( modeParams: NSDictionary, paymentMethodTypes: [String]?, captureMethod: PaymentSheet.IntentConfiguration.CaptureMethod @@ -284,10 +299,9 @@ extension StripeSdk { mode = PaymentSheet.IntentConfiguration.Mode.payment( amount: amount, currency: modeParams["currencyCode"] as? String ?? "", - setupFutureUsage: modeParams["setupFutureUsage"] != nil - ? (modeParams["setupFutureUsage"] as? String == "OffSession" ? .offSession : .onSession) - : nil, - captureMethod: captureMethod + setupFutureUsage: setupFutureUsageFromString(from: modeParams["setupFutureUsage"] as? String ?? ""), + captureMethod: captureMethod, + paymentMethodOptions: buildPaymentMethodOptions(paymentMethodOptionsParams: modeParams["paymentMethodOptions"] as? NSDictionary ?? [:]) ) } else { mode = PaymentSheet.IntentConfiguration.Mode.setup( @@ -300,19 +314,54 @@ extension StripeSdk { mode: mode, paymentMethodTypes: paymentMethodTypes, confirmHandler: { paymentMethod, shouldSavePaymentMethod, intentCreationCallback in - if (self.hasEventListeners) { - self.paymentSheetIntentCreationCallback = intentCreationCallback - self.sendEvent(withName: "onConfirmHandlerCallback", body: [ - "paymentMethod": Mappers.mapFromPaymentMethod(paymentMethod) ?? NSNull(), - "shouldSavePaymentMethod": shouldSavePaymentMethod - ]) - } else { - RCTMakeAndLogError("Tried to call confirmHandler, but no callback was found. Please file an issue: https://github.com/stripe/stripe-react-native/issues", nil, nil) - } + self.paymentSheetIntentCreationCallback = intentCreationCallback + self.emitter?.emitOnConfirmHandlerCallback([ + "paymentMethod": Mappers.mapFromPaymentMethod(paymentMethod) ?? NSNull(), + "shouldSavePaymentMethod": shouldSavePaymentMethod + ]) }) } - private func buildCustomerHandlersForPaymentSheet(applePayParams: NSDictionary) -> PaymentSheet.ApplePayConfiguration.Handlers? { + func buildPaymentMethodOptions(paymentMethodOptionsParams: NSDictionary) -> PaymentSheet.IntentConfiguration.Mode.PaymentMethodOptions? { + if let sfuDictionary = paymentMethodOptionsParams["setupFutureUsageValues"] as? NSDictionary { + var setupFutureUsageValues: [STPPaymentMethodType: PaymentSheet.IntentConfiguration.SetupFutureUsage] = [:] + + for (paymentMethodCode, sfuValue) in sfuDictionary { + if let paymentMethodCode = paymentMethodCode as? String, + let sfuString = sfuValue as? String { + let setupFutureUsage = setupFutureUsageFromString(from: sfuString) + let paymentMethodType = STPPaymentMethodType.fromIdentifier(paymentMethodCode) + + if let setupFutureUsage = setupFutureUsage { + if paymentMethodType != .unknown { + setupFutureUsageValues[paymentMethodType] = setupFutureUsage + } + } + } + } + + if !setupFutureUsageValues.isEmpty { + return PaymentSheet.IntentConfiguration.Mode.PaymentMethodOptions(setupFutureUsageValues: setupFutureUsageValues) + } + } + + return nil + } + + func setupFutureUsageFromString(from string: String) -> PaymentSheet.IntentConfiguration.SetupFutureUsage? { + switch string { + case "OnSession": + return PaymentSheet.IntentConfiguration.SetupFutureUsage.onSession + case "OffSession": + return PaymentSheet.IntentConfiguration.SetupFutureUsage.offSession + case "None": + return PaymentSheet.IntentConfiguration.SetupFutureUsage.none + default: + return nil + } + } + + func buildCustomerHandlersForPaymentSheet(applePayParams: NSDictionary) -> PaymentSheet.ApplePayConfiguration.Handlers? { if (applePayParams["request"] == nil) { return nil } @@ -326,18 +375,14 @@ extension StripeSdk { return request }, authorizationResultHandler: { result, completion in if applePayParams.object(forKey: "setOrderTracking") != nil { - if (self.hasEventListeners) { - self.orderTrackingHandler = (result, completion) - self.sendEvent(withName: "onOrderTrackingCallback", body: [:]) - } else { - RCTMakeAndLogError("Order tracking is enabled, but no callback was found. Please file an issue: https://github.com/stripe/stripe-react-native/issues", nil, nil) - } + self.orderTrackingHandler = (result, completion) + self.emitter?.emitOnOrderTrackingCallback() } else { completion(result) } }) } - + internal static func mapToCollectionMode(str: String?) -> PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode { switch str { case "automatic": @@ -350,7 +395,7 @@ extension StripeSdk { return .automatic } } - + internal static func mapToAddressCollectionMode(str: String?) -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode { switch str { case "automatic": @@ -363,5 +408,120 @@ extension StripeSdk { return .automatic } } + + internal static func mapToLinkDisplay(value: String?) -> PaymentSheet.LinkConfiguration.Display { + switch value { + case "automatic": + return .automatic + case "never": + return .never + default: + return .automatic + } + } + + // MARK: - Common Custom Payment Method Helper + + // Simple data structure for parsed custom payment method data + struct ParsedCustomPaymentMethod { + let id: String + let subtitle: String? + let disableBillingDetailCollection: Bool + } + + // Simple parser that extracts data without type complexity + static func parseCustomPaymentMethods(from config: [String: Any]) -> [ParsedCustomPaymentMethod] { + guard let customMethods = config["customPaymentMethods"] as? [[String: Any]], + !customMethods.isEmpty else { return [] } + + return customMethods.compactMap { methodDict in + guard let id = methodDict["id"] as? String else { return nil } + let subtitle = methodDict["subtitle"] as? String + let disableBillingDetailCollection = methodDict["disableBillingDetailCollection"] as? Bool ?? true + + return ParsedCustomPaymentMethod( + id: id, + subtitle: subtitle, + disableBillingDetailCollection: disableBillingDetailCollection + ) + } + } + + // Overload for NSDictionary + static func parseCustomPaymentMethods(from config: NSDictionary) -> [ParsedCustomPaymentMethod] { + guard let customPaymentMethods = config["customPaymentMethods"] as? NSArray, + customPaymentMethods.count > 0 else { return [] } + + var parsedMethods: [ParsedCustomPaymentMethod] = [] + + for customPaymentMethodData in customPaymentMethods { + if let customPaymentMethodDict = customPaymentMethodData as? NSDictionary, + let id = customPaymentMethodDict["id"] as? String { + let subtitle = customPaymentMethodDict["subtitle"] as? String + let disableBillingDetailCollection = customPaymentMethodDict["disableBillingDetailCollection"] as? Bool ?? true + + parsedMethods.append(ParsedCustomPaymentMethod( + id: id, + subtitle: subtitle, + disableBillingDetailCollection: disableBillingDetailCollection + )) + } + } + + return parsedMethods + } + + private static func buildCustomPaymentMethodConfiguration( + from config: [String: Any], + sdkImpl: StripeSdkImpl + ) -> PaymentSheet.CustomPaymentMethodConfiguration? { + let parsedMethods = parseCustomPaymentMethods(from: config) + guard !parsedMethods.isEmpty else { return nil } + + let customMethods = parsedMethods.map { parsed in + var cpm = PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethod( + id: parsed.id, + subtitle: parsed.subtitle + ) + cpm.disableBillingDetailCollection = parsed.disableBillingDetailCollection + return cpm + } + + return .init( + customPaymentMethods: customMethods, + customPaymentMethodConfirmHandler: createCustomPaymentMethodConfirmHandler(sdkImpl: sdkImpl) + ) + } + + // MARK: - Common Custom Payment Method Handler + + static func createCustomPaymentMethodConfirmHandler( + sdkImpl: StripeSdkImpl? + ) -> PaymentSheet.CustomPaymentMethodConfiguration.CustomPaymentMethodConfirmHandler { + return { customPaymentMethod, billingDetails in + // Send event to JS with the custom payment method data + let customPaymentMethodDict: [String: Any] = [ + "id": customPaymentMethod.id + ] + + let billingDetailsDict = Mappers.mapFromBillingDetails(billingDetails: billingDetails) + let payload: [String: Any] = [ + "customPaymentMethod": customPaymentMethodDict, + "billingDetails": billingDetailsDict + ] + + // Use async/await with continuation instead of blocking semaphore + return await withCheckedContinuation { continuation in + // Set up callback to receive result from JavaScript + sdkImpl?.customPaymentMethodResultCallback = { result in + sdkImpl?.customPaymentMethodResultCallback = nil + continuation.resume(returning: result) + } + + // Emit event to JavaScript + sdkImpl?.emitter?.emitOnCustomPaymentMethodConfirmHandlerCallback(payload) + } + } + } } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl.swift similarity index 90% rename from packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift rename to packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl.swift index 377501fb9..3ea3db8a2 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdkImpl.swift @@ -1,16 +1,16 @@ import PassKit -import Stripe -import StripePaymentSheet +@_spi(DashboardOnly) @_spi(STP) import Stripe +@_spi(EmbeddedPaymentElementPrivateBeta) import StripePaymentSheet import StripeFinancialConnections import Foundation -#if canImport(stripe_objc) -import stripe_objc -#endif -@objc(StripeSdk) -class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { - public var cardFieldView: CardFieldView? = nil - public var cardFormView: CardFormView? = nil +@objc(StripeSdkImpl) +public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate { + @objc public static let shared = StripeSdkImpl() + + @objc public weak var emitter: StripeSdkEmitter? = nil + var cardFieldView: CardFieldView? = nil + var cardFormView: CardFormView? = nil var merchantIdentifier: String? = nil @@ -62,26 +62,12 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { var setSelectedPaymentOptionCallback: (() -> Void)? = nil var fetchSelectedPaymentOptionCallback: ((CustomerPaymentOption?) -> Void)? = nil var setupIntentClientSecretForCustomerAttachCallback: ((String) -> Void)? = nil + var customPaymentMethodResultCallback: ((PaymentSheetResult) -> Void)? - var hasEventListeners = false - override func startObserving() { - hasEventListeners = true - } - override func stopObserving() { - hasEventListeners = false - } - - override func supportedEvents() -> [String]! { - return ["onOrderTrackingCallback", "onConfirmHandlerCallback", "onCustomerAdapterFetchPaymentMethodsCallback", "onCustomerAdapterAttachPaymentMethodCallback", - "onCustomerAdapterDetachPaymentMethodCallback", "onCustomerAdapterSetSelectedPaymentOptionCallback", "onCustomerAdapterFetchSelectedPaymentOptionCallback", - "onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback", "onFinancialConnectionsEvent"] - } - - @objc override static func requiresMainQueueSetup() -> Bool { - return false - } + var embeddedInstance: EmbeddedPaymentElement? = nil + lazy var embeddedInstanceDelegate = StripeSdkEmbeddedPaymentElementDelegate(sdkImpl: self) - @objc override func constantsToExport() -> [AnyHashable : Any] { + @objc public func getConstants() -> [AnyHashable : Any] { return [ "API_VERSIONS": [ "CORE": STPAPIClient.apiVersion, @@ -91,7 +77,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(initialise:resolver:rejecter:) - func initialise(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + public func initialise(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { let publishableKey = params["publishableKey"] as! String let appInfo = params["appInfo"] as! NSDictionary let stripeAccountId = params["stripeAccountId"] as? String @@ -109,6 +95,10 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { StripeAPI.defaultPublishableKey = publishableKey STPAPIClient.shared.stripeAccount = stripeAccountId + if STPAPIClient.shared.publishableKeyIsUserKey { + STPAPIClient.shared.userKeyLiveMode = UserDefaults.standard.object(forKey: "stripe_userKeyLiveMode") as? Bool ?? true + } + let name = appInfo["name"] as? String ?? "" let partnerId = appInfo["partnerId"] as? String ?? "" let version = appInfo["version"] as? String ?? "" @@ -120,7 +110,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(initPaymentSheet:resolver:rejecter:) - func initPaymentSheet(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + public func initPaymentSheet(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { let (error, configuration) = buildPaymentSheetConfiguration(params: params) guard let configuration = configuration else { @@ -132,7 +122,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(intentCreationCallback:resolver:rejecter:) - @MainActor func intentCreationCallback(result: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + @MainActor public func intentCreationCallback(result: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { guard let paymentSheetIntentCreationCallback = self.paymentSheetIntentCreationCallback else { resolve(Errors.createError(ErrorType.Failed, "No intent creation callback was set")) @@ -141,23 +131,41 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { if let clientSecret = result["clientSecret"] as? String { paymentSheetIntentCreationCallback(.success(clientSecret)) } else { - struct ConfirmationError: Error, LocalizedError { - private var errorMessage: String - init(errorMessage: String) { - self.errorMessage = errorMessage - } - public var errorDescription: String? { - return errorMessage - } - } let errorParams = result["error"] as? NSDictionary let error = ConfirmationError.init(errorMessage: errorParams?["localizedMessage"] as? String ?? "An unknown error occurred.") paymentSheetIntentCreationCallback(.failure(error)) } } + + @objc(customPaymentMethodResultCallback:resolver:rejecter:) + @MainActor public func customPaymentMethodResultCallback(result: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, + rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + guard let customPaymentMethodResultCallback = self.customPaymentMethodResultCallback else { + resolve(Errors.createError(ErrorType.Failed, "Internal error: no custom payment method callback")) + return + } + + let status = result["status"] as? String ?? "" + let errorMessage = result["error"] as? String + + switch status { + case "completed": + customPaymentMethodResultCallback(.completed) + case "canceled": + customPaymentMethodResultCallback(.canceled) + case "failed": + let error = ConfirmationError.init(errorMessage: errorMessage ?? "An unknown error occurred.") + customPaymentMethodResultCallback(.failed(error: error)) + default: + let error = ConfirmationError.init(errorMessage: "Unknown custom payment method result status") + customPaymentMethodResultCallback(.failed(error: error)) + } + + resolve(NSNull()) + } @objc(confirmPaymentSheetPayment:rejecter:) - func confirmPaymentSheetPayment(resolver resolve: @escaping RCTPromiseResolveBlock, + public func confirmPaymentSheetPayment(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { DispatchQueue.main.async { if (self.paymentSheetFlowController != nil) { @@ -179,14 +187,14 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(resetPaymentSheetCustomer:rejecter:) - func resetPaymentSheetCustomer(resolver resolve: @escaping RCTPromiseResolveBlock, + public func resetPaymentSheetCustomer(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { PaymentSheet.resetCustomer() resolve(nil) } @objc(presentPaymentSheet:resolver:rejecter:) - func presentPaymentSheet(options: NSDictionary, + public func presentPaymentSheet(options: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { var paymentSheetViewController: UIViewController? @@ -236,7 +244,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(createTokenForCVCUpdate:resolver:rejecter:) - func createTokenForCVCUpdate(cvc: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { + public func createTokenForCVCUpdate(cvc: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { guard let cvc = cvc else { resolve(Errors.createError(ErrorType.Failed, "You must provide CVC")) return; @@ -253,7 +261,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(confirmSetupIntent:data:options:resolver:rejecter:) - func confirmSetupIntent (setupIntentClientSecret: String, params: NSDictionary, + public func confirmSetupIntent (setupIntentClientSecret: String, params: NSDictionary, options: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { let paymentMethodData = params["paymentMethodData"] as? NSDictionary @@ -321,7 +329,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(updatePlatformPaySheet:shippingMethods:errors:resolver:rejecter:) - func updatePlatformPaySheet(summaryItems: NSArray, + public func updatePlatformPaySheet(summaryItems: NSArray, shippingMethods: NSArray, errors: [NSDictionary], resolver resolve: @escaping RCTPromiseResolveBlock, @@ -368,13 +376,13 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(openApplePaySetup:rejecter:) - func openApplePaySetup(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + public func openApplePaySetup(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { PKPassLibrary.init().openPaymentSetup() resolve([]) } @objc(handleURLCallback:resolver:rejecter:) - func handleURLCallback(url: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { + public func handleURLCallback(url: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { guard let url = url else { resolve(false) return; @@ -391,14 +399,14 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(isPlatformPaySupported:resolver:rejecter:) - func isPlatformPaySupported(params: NSDictionary, + public func isPlatformPaySupported(params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { resolve(StripeAPI.deviceSupportsApplePay()) } @objc(createPlatformPayPaymentMethod:usesDeprecatedTokenFlow:resolver:rejecter:) - func createPlatformPayPaymentMethod(params: NSDictionary, + public func createPlatformPayPaymentMethod(params: NSDictionary, usesDeprecatedTokenFlow: Bool, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) { @@ -436,13 +444,13 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(dismissPlatformPay:rejecter:) - func dismissPlatformPay(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + public func dismissPlatformPay(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { let didDismiss = maybeDismissApplePay() resolve(didDismiss) } @objc(confirmPlatformPay:params:isPaymentIntent:resolver:rejecter:) - func confirmPlatformPay( + public func confirmPlatformPay( clientSecret: String?, params: NSDictionary, isPaymentIntent: Bool, @@ -487,7 +495,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(createPaymentMethod:options:resolver:rejecter:) - func createPaymentMethod( + public func createPaymentMethod( params: NSDictionary, options: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, @@ -529,7 +537,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(createToken:resolver:rejecter:) - func createToken( + public func createToken( params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock @@ -636,7 +644,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(handleNextAction:returnURL:resolver:rejecter:) - func handleNextAction( + public func handleNextAction( paymentIntentClientSecret: String, returnURL: String?, resolver resolve: @escaping RCTPromiseResolveBlock, @@ -668,7 +676,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(handleNextActionForSetup:returnURL:resolver:rejecter:) - func handleNextActionForSetup( + public func handleNextActionForSetup( setupIntentClientSecret: String, returnURL: String?, resolver resolve: @escaping RCTPromiseResolveBlock, @@ -700,7 +708,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(collectBankAccount:clientSecret:params:resolver:rejecter:) - func collectBankAccount( + public func collectBankAccount( isPaymentIntent: Bool, clientSecret: NSString, params: NSDictionary, @@ -736,13 +744,9 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { connectionsReturnURL = nil } - var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil - - if hasEventListeners { - onEvent = { [weak self] event in - let mappedEvent = Mappers.financialConnectionsEventToMap(event) - self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent) - } + let onEvent = { [weak self] (event: FinancialConnectionsEvent) in + let mappedEvent = Mappers.financialConnectionsEventToMap(event) + self?.emitter?.emitOnFinancialConnectionsEvent(mappedEvent) } let style = STPBankAccountCollectorUserInterfaceStyle(from: params) @@ -806,7 +810,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(confirmPayment:data:options:resolver:rejecter:) - func confirmPayment( + public func confirmPayment( paymentIntentClientSecret: String, params: NSDictionary?, options: NSDictionary, @@ -897,7 +901,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(retrievePaymentIntent:resolver:rejecter:) - func retrievePaymentIntent( + public func retrievePaymentIntent( clientSecret: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock @@ -921,7 +925,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(retrieveSetupIntent:resolver:rejecter:) - func retrieveSetupIntent( + public func retrieveSetupIntent( clientSecret: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock @@ -945,7 +949,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(verifyMicrodeposits:clientSecret:params:resolver:rejecter:) - func verifyMicrodeposits( + public func verifyMicrodeposits( isPaymentIntent: Bool, clientSecret: NSString, params: NSDictionary, @@ -1013,7 +1017,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(canAddCardToWallet:resolver:rejecter:) - func canAddCardToWallet( + public func canAddCardToWallet( params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock @@ -1031,7 +1035,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(isCardInWallet:resolver:rejecter:) - func isCardInWallet( + public func isCardInWallet( params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock @@ -1044,7 +1048,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(collectBankAccountToken:params:resolver:rejecter:) - func collectBankAccountToken( + public func collectBankAccountToken( clientSecret: String, params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, @@ -1062,13 +1066,10 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } let configuration = FinancialConnectionsSheet.Configuration(from: params) - var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil - if hasEventListeners { - onEvent = { [weak self] event in + let onEvent = { [weak self] (event: FinancialConnectionsEvent) in let mappedEvent = Mappers.financialConnectionsEventToMap(event) - self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent) - } + self?.emitter?.emitOnFinancialConnectionsEvent(mappedEvent) } FinancialConnections.presentForToken( @@ -1081,7 +1082,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(collectFinancialConnectionsAccounts:params:resolver:rejecter:) - func collectFinancialConnectionsAccounts( + public func collectFinancialConnectionsAccounts( clientSecret: String, params: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, @@ -1099,13 +1100,10 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } let configuration = FinancialConnectionsSheet.Configuration(from: params) - var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil - if hasEventListeners { - onEvent = { [weak self] event in + let onEvent = { [weak self] (event: FinancialConnectionsEvent) in let mappedEvent = Mappers.financialConnectionsEventToMap(event) - self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent) - } + self?.emitter?.emitOnFinancialConnectionsEvent(mappedEvent) } FinancialConnections.present( @@ -1118,7 +1116,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { } @objc(configureOrderTracking:orderIdentifier:webServiceUrl:authenticationToken:resolver:rejecter:) - func configureOrderTracking( + public func configureOrderTracking( orderTypeIdentifier: String, orderIdentifier: String, webServiceUrl: String, @@ -1143,7 +1141,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { #endif } - func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { + public func presentationControllerDidDismiss(_ presentationController: UIPresentationController) { confirmPaymentResolver?(Errors.createError(ErrorType.Canceled, "FPX Payment has been canceled")) } @@ -1177,6 +1175,16 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate { break } } + + struct ConfirmationError: Error, LocalizedError { + private var errorMessage: String + init(errorMessage: String) { + self.errorMessage = errorMessage + } + public var errorDescription: String? { + return errorMessage + } + } } func findViewControllerPresenter(from uiViewController: UIViewController) -> UIViewController { @@ -1194,8 +1202,8 @@ func findViewControllerPresenter(from uiViewController: UIViewController) -> UIV return presentingViewController } -extension StripeSdk: STPAuthenticationContext { - func authenticationPresentingViewController() -> UIViewController { +extension StripeSdkImpl: STPAuthenticationContext { + public func authenticationPresentingViewController() -> UIViewController { return findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController()) } } diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/UIColorExtension.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/UIColorExtension.swift index 562f49a7c..d5649ba9b 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/UIColorExtension.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/UIColorExtension.swift @@ -4,7 +4,9 @@ // // Created by Arkadiusz Kubaczkowski on 24/11/2020. // + import UIKit + extension UIColor { public convenience init(hexString: String) { let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted) diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift index 0e4522685..b77c68eef 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift @@ -8,26 +8,23 @@ import Foundation import Stripe import PassKit -#if canImport(stripe_objc) -import stripe_objc -#endif @objc(AddToWalletButtonView) -class AddToWalletButtonView: UIView { +public class AddToWalletButtonView: UIView { var pushProvisioningContext: STPPushProvisioningContext? = nil var addToWalletButton: PKAddPassButton? = nil - @objc var testEnv: Bool = false - @objc var iOSButtonStyle: NSString? - @objc var cardDetails: NSDictionary? - @objc var ephemeralKey: NSDictionary? - @objc var onCompleteAction: RCTDirectEventBlock? + @objc public var testEnv: Bool = false + @objc public var iOSButtonStyle: NSString? + @objc public var cardDetails: NSDictionary? + @objc public var ephemeralKey: NSDictionary? + @objc public var onCompleteAction: RCTDirectEventBlock? required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - - override func didSetProps(_ changedProps: [String]!) { + + @objc public func didSetProps() { if let addToWalletButton = addToWalletButton { addToWalletButton.removeFromSuperview() } @@ -42,6 +39,12 @@ class AddToWalletButtonView: UIView { } } + public override func didSetProps(_ changedProps: [String]!) { + // This is only called on old arch, for new arch didSetProps() will be called + // by the view component. + self.didSetProps() + } + @objc func beginPushProvisioning() { if (!PushProvisioningUtils.canAddPaymentPass(isTestMode: self.testEnv)) { onCompleteAction!( @@ -91,11 +94,11 @@ class AddToWalletButtonView: UIView { vc.present(controller!, animated: true, completion: nil) } - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) } - override func layoutSubviews() { + override public func layoutSubviews() { if let addToWalletButton = self.addToWalletButton { addToWalletButton.frame = self.bounds } @@ -104,13 +107,13 @@ class AddToWalletButtonView: UIView { extension AddToWalletButtonView: PKAddPaymentPassViewControllerDelegate { - func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler handler: @escaping (PKAddPaymentPassRequest) -> Void) { + public func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler handler: @escaping (PKAddPaymentPassRequest) -> Void) { self.pushProvisioningContext = STPPushProvisioningContext(keyProvider: self) self.pushProvisioningContext?.addPaymentPassViewController(controller, generateRequestWithCertificateChain: certificates, nonce: nonce, nonceSignature: nonceSignature, completionHandler: handler); } - func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, didFinishAdding pass: PKPaymentPass?, error: Error?) { + public func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, didFinishAdding pass: PKPaymentPass?, error: Error?) { if let error = error as NSError? { onCompleteAction!( Errors.createError( @@ -129,7 +132,7 @@ extension AddToWalletButtonView: PKAddPaymentPassViewControllerDelegate { extension AddToWalletButtonView: STPIssuingCardEphemeralKeyProvider { - func createIssuingCardKey(withAPIVersion apiVersion: String, completion: @escaping STPJSONResponseCompletionBlock) { + public func createIssuingCardKey(withAPIVersion apiVersion: String, completion: @escaping STPJSONResponseCompletionBlock) { if let ephemeralKey = self.ephemeralKey as? [AnyHashable : Any] { completion(ephemeralKey, nil) } else { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift index 0a1a11ffa..cd98414c0 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift @@ -6,6 +6,28 @@ import PassKit import stripe_objc #endif +/// The type of a closure that is capable of sending a response to a bridged operation. +/// Use this for returning callback methods to JS. +public typealias RCTResponseSenderBlock = ([Any]) -> Void + +/// The type of a closure that is capable of sending an error response to a bridged operation. +/// Use this for returning error information to JS. +public typealias RCTResponseErrorBlock = (Error) -> Void + +/// Closure that bridge modules use to resolve the JS promise waiting for a result. +/// Nil results are supported and are converted to JS's undefined value. +public typealias RCTPromiseResolveBlock = (Any?) -> Void + +/// Closure that bridge modules use to reject the JS promise waiting for a result. +/// The error may be nil but it is preferable to pass an NSError object for more precise error messages. +public typealias RCTPromiseRejectBlock = (_ code: String, _ message: String, _ error: Error?) -> Void + +/// These closure types can be used for mapping input event handlers from JS to view properties. +/// Unlike JS method callbacks, these can be called multiple times. +public typealias RCTDirectEventBlock = ([AnyHashable: Any]?) -> Void +public typealias RCTBubblingEventBlock = ([String: Any]) -> Void + + protocol ViewManagerDelegate { var cardFieldView: CardFieldView? { get set } var cardFormView: CardFormView? { get set } @@ -16,8 +38,8 @@ func RCTMakeAndLogError(_ error: String, _ something: String?, _ anotherSomethin } @objc(StripePlugin) -class StripePlugin: StripeSdk, FlutterPlugin, ViewManagerDelegate { - +class StripePlugin: StripeSdkImpl, FlutterPlugin, ViewManagerDelegate { + private var channel: FlutterMethodChannel @@ -26,6 +48,7 @@ class StripePlugin: StripeSdk, FlutterPlugin, ViewManagerDelegate { let channel = FlutterMethodChannel(name: "flutter.stripe/payments", binaryMessenger: registrar.messenger(), codec: FlutterJSONMethodCodec()) let instance = StripePlugin(channel: channel) + instance.emitter = instance registrar.addMethodCallDelegate(instance, channel: channel) registrar.addApplicationDelegate(instance) @@ -124,6 +147,8 @@ class StripePlugin: StripeSdk, FlutterPlugin, ViewManagerDelegate { return removeListener(call, result: result) case "intentCreationCallback": return intentCreationCallback(call, result: result) + case "customPaymentMethodConfirmHandlerCallback": + return confirmCustomPaymentMethodCallback(call, result: result) case "initCustomerSheet": guard let arguments = call.arguments as? FlutterMap, let customerAdapterOverrides = arguments["customerAdapterOverrides"] as? NSDictionary, @@ -238,7 +263,6 @@ class StripePlugin: StripeSdk, FlutterPlugin, ViewManagerDelegate { } } - override func sendEvent(withName name: String, body: [String: Any]) { channel.invokeMethod(name, arguments: body) } @@ -258,6 +282,74 @@ class StripePlugin: StripeSdk, FlutterPlugin, ViewManagerDelegate { } } +extension StripePlugin: StripeSdkEmitter { + func emitOnCustomPaymentMethodConfirmHandlerCallback(_ value: [String : Any]) { + self.sendEvent(withName: "onCustomPaymentMethodConfirmHandlerCallback", body: value) + } + + + func emitOnConfirmHandlerCallback(_ value: [String : Any]) { + self.sendEvent(withName: "onConfirmHandlerCallback", body: value) + } + + func emitOnFinancialConnectionsEvent(_ value: [String : Any]) { + self.sendEvent(withName: "onFinancialConnectionsEvent", body: value) + } + + func emitOnOrderTrackingCallback() { + self.sendEvent(withName: "onOrderTrackingCallback", body:[:]) + } + + func emitOnCustomerAdapterFetchPaymentMethodsCallback() { + self.sendEvent(withName: "onCustomerAdapterFetchPaymentMethodsCallback", body:[:]) + } + + func emitOnCustomerAdapterAttachPaymentMethodCallback(_ value: [String : Any]) { + self.sendEvent(withName: "onCustomerAdapterAttachPaymentMethodCallback", body:value) + } + + func emitOnCustomerAdapterDetachPaymentMethodCallback(_ value: [String : Any]) { + self.sendEvent(withName: "onCustomerAdapterDetachPaymentMethodCallback", body:value) + } + + func emitOnCustomerAdapterSetSelectedPaymentOptionCallback(_ value: [String : Any]) { + self.sendEvent(withName: "onCustomerAdapterSetSelectedPaymentOptionCallback", body:value) + } + + func emitOnCustomerAdapterFetchSelectedPaymentOptionCallback() { + self.sendEvent(withName: "onCustomerAdapterFetchSelectedPaymentOptionCallback", body:[:]) + } + + func emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback() { + self.sendEvent(withName: "onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback", body:[:]) + } + + func emitEmbeddedPaymentElementDidUpdateHeight(_ value: [String : Any]) { + self.sendEvent(withName: "embeddedPaymentElementDidUpdateHeight", body:value) + } + + func emitEmbeddedPaymentElementWillPresent() { + self.sendEvent(withName: "embeddedPaymentElementWillPresent", body:[:]) + } + + func emitEmbeddedPaymentElementDidUpdatePaymentOption(_ value: [String : Any]) { + self.sendEvent(withName: "embeddedPaymentElementDidUpdatePaymentOption", body: value) + } + + func emitEmbeddedPaymentElementFormSheetConfirmComplete(_ value: [String : Any]) { + self.sendEvent(withName: "embeddedPaymentElementFormSheetConfirmComplete", body: value) + } + + func emitEmbeddedPaymentElementRowSelectionImmediateAction() { + self.sendEvent(withName: "embeddedPaymentElementRowSelectionImmediateAction", body:[:]) + } + + func emitEmbeddedPaymentElementLoadingFailed(_ value: [String : Any]) { + self.sendEvent(withName: "embeddedPaymentElementLoadingFailed", body:value) + } + +} + // Mark: MethodChannel handlers extension StripePlugin { @@ -652,11 +744,11 @@ extension StripePlugin { } func addListener(_ call: FlutterMethodCall, result: @escaping FlutterResult) { - startObserving() + //startObserving() } func removeListener(_ call: FlutterMethodCall, result: @escaping FlutterResult) { - stopObserving() + //stopObserving() } func intentCreationCallback(_ call: FlutterMethodCall, result: @escaping FlutterResult) { @@ -671,6 +763,18 @@ extension StripePlugin { result(nil) } + func confirmCustomPaymentMethodCallback (_ call: FlutterMethodCall, result: @escaping FlutterResult){ + guard let arguments = call.arguments as? FlutterMap, + let params = arguments["params"] as? NSDictionary + else { + result(FlutterError.invalidParams) + return + } + + customPaymentMethodResultCallback(result: params, resolver: resolver(for: result), rejecter: rejecter(for: result)) + result(nil) + } + func dangerouslyUpdateCardDetails(_ call: FlutterMethodCall, result: @escaping FlutterResult) { guard let arguments = call.arguments as? FlutterMap, let params = arguments["params"] as? NSDictionary else { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/stripe_ios.h b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/stripe_ios.h new file mode 100644 index 000000000..5c048c3f7 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/stripe_ios.h @@ -0,0 +1,34 @@ +// stripe_react_native-Swift.h includes this + + +/** + * The type of a block that is capable of sending a response to a bridged + * operation. Use this for returning callback methods to JS. + */ +typedef void (^RCTResponseSenderBlock)(NSArray *response) NS_SWIFT_NAME(RCTResponseSenderBlock); + +/** + * The type of a block that is capable of sending an error response to a + * bridged operation. Use this for returning error information to JS. + */ +typedef void (^RCTResponseErrorBlock)(NSError *error) NS_SWIFT_NAME(RCTResponseErrorBlock); + +/** + * Block that bridge modules use to resolve the JS promise waiting for a result. + * Nil results are supported and are converted to JS's undefined value. + */ +typedef void (^RCTPromiseResolveBlock)(id result) NS_SWIFT_NAME(RCTPromiseResolveBlock); + +/** + * Block that bridge modules use to reject the JS promise waiting for a result. + * The error may be nil but it is preferable to pass an NSError object for more + * precise error messages. + */ +typedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError *error) NS_SWIFT_NAME(RCTPromiseRejectBlock); + +/** + * These block types can be used for mapping input event handlers from JS to view + * properties. Unlike JS method callbacks, these can be called multiple times. + */ +typedef void (^RCTDirectEventBlock)(NSDictionary *body) NS_SWIFT_NAME(RCTDirectEventBlock); +typedef void (^RCTBubblingEventBlock)(NSDictionary *body) NS_SWIFT_NAME(RCTBubblingEventBlock); diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdk.h b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdk.h new file mode 100644 index 000000000..05296688c --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdk.h @@ -0,0 +1,23 @@ +#ifdef RCT_NEW_ARCH_ENABLED +#import +#else +#import + +#import "StripeSdkEventEmitterCompat.h" + +#endif + +NS_ASSUME_NONNULL_BEGIN + +@class StripeSdkImpl; + +#ifdef RCT_NEW_ARCH_ENABLED +@interface StripeSdk : NativeStripeSdkModuleSpecBase +#else +@interface StripeSdk : StripeSdkEventEmitterCompat +#endif + +@end + +NS_ASSUME_NONNULL_END + diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdkEventEmitterCompat.h b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdkEventEmitterCompat.h new file mode 100644 index 000000000..33f750c34 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdkEventEmitterCompat.h @@ -0,0 +1,28 @@ +// This is a compat layer for NativeStripeSdkModuleSpecBase which is generated with codegen +// for the new arch. This implements the same methods, but using old arch apis. + +#ifndef RCT_NEW_ARCH_ENABLED +#import + +@interface StripeSdkEventEmitterCompat : NSObject +- (void)emitOnConfirmHandlerCallback:(NSDictionary *)value; +- (void)emitOnFinancialConnectionsEvent:(NSDictionary *)value; +- (void)emitOnOrderTrackingCallback; +- (void)emitOnCustomerAdapterFetchPaymentMethodsCallback; +- (void)emitOnCustomerAdapterAttachPaymentMethodCallback:(NSDictionary *)value; +- (void)emitOnCustomerAdapterDetachPaymentMethodCallback:(NSDictionary *)value; +- (void)emitOnCustomerAdapterSetSelectedPaymentOptionCallback:(NSDictionary *)value; +- (void)emitOnCustomerAdapterFetchSelectedPaymentOptionCallback; +- (void)emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback; +- (void)emitEmbeddedPaymentElementDidUpdateHeight:(NSDictionary *)value; +- (void)emitEmbeddedPaymentElementWillPresent; +- (void)emitEmbeddedPaymentElementDidUpdatePaymentOption:(NSDictionary *)value; +- (void)emitEmbeddedPaymentElementFormSheetConfirmComplete:(NSDictionary *)value; +- (void)emitEmbeddedPaymentElementRowSelectionImmediateAction; +- (void)emitEmbeddedPaymentElementLoadingFailed:(NSDictionary *)value; +- (void)emitOnCustomPaymentMethodConfirmHandlerCallback:(NSDictionary *)value; + +- (void)sendEventWithName:(NSString *)name body:(NSDictionary *)body; +@end + +#endif diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdkEventEmitterCompat.m b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdkEventEmitterCompat.m new file mode 100644 index 000000000..d228dea20 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/StripeSdkEventEmitterCompat.m @@ -0,0 +1,111 @@ +#ifndef RCT_NEW_ARCH_ENABLED + +#import "StripeSdkEventEmitterCompat.h" + +@implementation StripeSdkEventEmitterCompat + +- (NSArray *)supportedEvents +{ + return @[ + @"onOrderTrackingCallback", + @"onConfirmHandlerCallback", + @"onCustomerAdapterFetchPaymentMethodsCallback", + @"onCustomerAdapterAttachPaymentMethodCallback", + @"onCustomerAdapterDetachPaymentMethodCallback", + @"onCustomerAdapterSetSelectedPaymentOptionCallback", + @"onCustomerAdapterFetchSelectedPaymentOptionCallback", + @"onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback", + @"onFinancialConnectionsEvent", + @"embeddedPaymentElementDidUpdateHeight", + @"embeddedPaymentElementWillPresent", + @"embeddedPaymentElementDidUpdatePaymentOption", + @"embeddedPaymentElementFormSheetConfirmComplete", + @"embeddedPaymentElementRowSelectionImmediateAction", + @"embeddedPaymentElementLoadingFailed", + @"onCustomPaymentMethodConfirmHandlerCallback" + ]; +} + +- (void)emitOnConfirmHandlerCallback:(NSDictionary *)value +{ + [self sendEventWithName:@"onConfirmHandlerCallback" body:value]; +} + +- (void)emitOnFinancialConnectionsEvent:(NSDictionary *)value +{ + [self sendEventWithName:@"onFinancialConnectionsEvent" body:value]; +} + +- (void)emitOnOrderTrackingCallback +{ + [self sendEventWithName:@"onOrderTrackingCallback" body:@{}]; +} + +- (void)emitOnCustomerAdapterFetchPaymentMethodsCallback +{ + [self sendEventWithName:@"onCustomerAdapterFetchPaymentMethodsCallback" body:@{}]; +} + +- (void)emitOnCustomerAdapterAttachPaymentMethodCallback:(NSDictionary *)value +{ + [self sendEventWithName:@"onCustomerAdapterAttachPaymentMethodCallback" body:value]; +} + +- (void)emitOnCustomerAdapterDetachPaymentMethodCallback:(NSDictionary *)value +{ + [self sendEventWithName:@"onCustomerAdapterDetachPaymentMethodCallback" body:value]; +} + +- (void)emitOnCustomerAdapterSetSelectedPaymentOptionCallback:(NSDictionary *)value +{ + [self sendEventWithName:@"onCustomerAdapterSetSelectedPaymentOptionCallback" body:value]; +} + +- (void)emitOnCustomerAdapterFetchSelectedPaymentOptionCallback +{ + [self sendEventWithName:@"onCustomerAdapterFetchSelectedPaymentOptionCallback" body:@{}]; +} + +- (void)emitOnCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback +{ + [self sendEventWithName:@"onCustomerAdapterSetupIntentClientSecretForCustomerAttachCallback" body:@{}]; +} + +- (void)emitEmbeddedPaymentElementDidUpdateHeight:(NSDictionary *)value +{ + [self sendEventWithName:@"embeddedPaymentElementDidUpdateHeight" body:value]; +} + +- (void)emitEmbeddedPaymentElementWillPresent +{ + [self sendEventWithName:@"embeddedPaymentElementWillPresent" body:@{}]; +} + +- (void)emitEmbeddedPaymentElementDidUpdatePaymentOption:(NSDictionary *)value +{ + [self sendEventWithName:@"embeddedPaymentElementDidUpdatePaymentOption" body:value]; +} + +- (void)emitEmbeddedPaymentElementFormSheetConfirmComplete:(NSDictionary *)value +{ + [self sendEventWithName:@"embeddedPaymentElementFormSheetConfirmComplete" body:value]; +} + +- (void)emitEmbeddedPaymentElementRowSelectionImmediateAction +{ + [self sendEventWithName:@"embeddedPaymentElementRowSelectionImmediateAction" body:@{}]; +} + +- (void)emitEmbeddedPaymentElementLoadingFailed:(NSDictionary *)value +{ + [self sendEventWithName:@"embeddedPaymentElementLoadingFailed" body:value]; +} + +- (void)emitOnCustomPaymentMethodConfirmHandlerCallback:(NSDictionary *)value +{ + [self sendEventWithName:@"onCustomPaymentMethodConfirmHandlerCallback" body:value]; +} + +@end + +#endif diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/stripe_react_native.h b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/stripe_react_native.h new file mode 100644 index 000000000..5050480b5 --- /dev/null +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/Stripe Sdk/stripe_react_native.h @@ -0,0 +1,2 @@ +// stripe_react_native-Swift.h includes this + diff --git a/packages/stripe_ios/pubspec.yaml b/packages/stripe_ios/pubspec.yaml index c516b26a0..6f87f6bc7 100644 --- a/packages/stripe_ios/pubspec.yaml +++ b/packages/stripe_ios/pubspec.yaml @@ -5,7 +5,7 @@ repository: https://github.com/flutter-stripe/flutter_stripe homepage: https://pub.dev/packages/flutter_stripe environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.8.1 <4.0.0" flutter: ">=3.0.0" dependencies: @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ^6.0.0 flutter: plugin: diff --git a/packages/stripe_js/lib/src/api/core/billing_details.dart b/packages/stripe_js/lib/src/api/core/billing_details.dart index 5b7866aca..cd1272333 100644 --- a/packages/stripe_js/lib/src/api/core/billing_details.dart +++ b/packages/stripe_js/lib/src/api/core/billing_details.dart @@ -5,7 +5,7 @@ part 'billing_details.g.dart'; /// Billing information associated with the payment method. @freezed -class BillingDetails with _$BillingDetails { +abstract class BillingDetails with _$BillingDetails { const factory BillingDetails({ /// Email address. String? email, @@ -25,7 +25,7 @@ class BillingDetails with _$BillingDetails { } @freezed -class BillingAddress with _$BillingAddress { +abstract class BillingAddress with _$BillingAddress { const factory BillingAddress({ /// Address line 1 (e.g., street, PO Box, or company name). String? line1, diff --git a/packages/stripe_js/lib/src/api/core/billing_details.freezed.dart b/packages/stripe_js/lib/src/api/core/billing_details.freezed.dart index 5d4162ca9..d65c5ee48 100644 --- a/packages/stripe_js/lib/src/api/core/billing_details.freezed.dart +++ b/packages/stripe_js/lib/src/api/core/billing_details.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,552 +9,607 @@ part of 'billing_details.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -BillingDetails _$BillingDetailsFromJson(Map json) { - return _BillingDetails.fromJson(json); -} - /// @nodoc mixin _$BillingDetails { - /// Email address. - String? get email => throw _privateConstructorUsedError; - /// Billing address. - BillingAddress? get address => throw _privateConstructorUsedError; +/// Email address. + String? get email;/// Billing address. + BillingAddress? get address;/// Billing phone number. + String? get phone;/// Full name. + String? get name; +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith get copyWith => _$BillingDetailsCopyWithImpl(this as BillingDetails, _$identity); - /// Billing phone number. - String? get phone => throw _privateConstructorUsedError; + /// Serializes this BillingDetails to a JSON map. + Map toJson(); - /// Full name. - String? get name => throw _privateConstructorUsedError; - /// Serializes this BillingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BillingDetails&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,email,address,phone,name); - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BillingDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'BillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; } -/// @nodoc -abstract class $BillingDetailsCopyWith<$Res> { - factory $BillingDetailsCopyWith( - BillingDetails value, $Res Function(BillingDetails) then) = - _$BillingDetailsCopyWithImpl<$Res, BillingDetails>; - @useResult - $Res call( - {String? email, BillingAddress? address, String? phone, String? name}); - $BillingAddressCopyWith<$Res>? get address; } /// @nodoc -class _$BillingDetailsCopyWithImpl<$Res, $Val extends BillingDetails> +abstract mixin class $BillingDetailsCopyWith<$Res> { + factory $BillingDetailsCopyWith(BillingDetails value, $Res Function(BillingDetails) _then) = _$BillingDetailsCopyWithImpl; +@useResult +$Res call({ + String? email, BillingAddress? address, String? phone, String? name +}); + + +$BillingAddressCopyWith<$Res>? get address; + +} +/// @nodoc +class _$BillingDetailsCopyWithImpl<$Res> implements $BillingDetailsCopyWith<$Res> { - _$BillingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? email = freezed, - Object? address = freezed, - Object? phone = freezed, - Object? name = freezed, - }) { - return _then(_value.copyWith( - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as BillingAddress?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + _$BillingDetailsCopyWithImpl(this._self, this._then); + + final BillingDetails _self; + final $Res Function(BillingDetails) _then; + +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? email = freezed,Object? address = freezed,Object? phone = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as BillingAddress?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingAddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingAddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $BillingAddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } + return $BillingAddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} } -/// @nodoc -abstract class _$$BillingDetailsImplCopyWith<$Res> - implements $BillingDetailsCopyWith<$Res> { - factory _$$BillingDetailsImplCopyWith(_$BillingDetailsImpl value, - $Res Function(_$BillingDetailsImpl) then) = - __$$BillingDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? email, BillingAddress? address, String? phone, String? name}); - @override - $BillingAddressCopyWith<$Res>? get address; +/// Adds pattern-matching-related methods to [BillingDetails]. +extension BillingDetailsPatterns on BillingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BillingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BillingDetails value) $default,){ +final _that = this; +switch (_that) { +case _BillingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BillingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? email, BillingAddress? address, String? phone, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? email, BillingAddress? address, String? phone, String? name) $default,) {final _that = this; +switch (_that) { +case _BillingDetails(): +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? email, BillingAddress? address, String? phone, String? name)? $default,) {final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + return null; + +} } -/// @nodoc -class __$$BillingDetailsImplCopyWithImpl<$Res> - extends _$BillingDetailsCopyWithImpl<$Res, _$BillingDetailsImpl> - implements _$$BillingDetailsImplCopyWith<$Res> { - __$$BillingDetailsImplCopyWithImpl( - _$BillingDetailsImpl _value, $Res Function(_$BillingDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? email = freezed, - Object? address = freezed, - Object? phone = freezed, - Object? name = freezed, - }) { - return _then(_$BillingDetailsImpl( - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as BillingAddress?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$BillingDetailsImpl implements _BillingDetails { - const _$BillingDetailsImpl({this.email, this.address, this.phone, this.name}); - factory _$BillingDetailsImpl.fromJson(Map json) => - _$$BillingDetailsImplFromJson(json); +class _BillingDetails implements BillingDetails { + const _BillingDetails({this.email, this.address, this.phone, this.name}); + factory _BillingDetails.fromJson(Map json) => _$BillingDetailsFromJson(json); + +/// Email address. +@override final String? email; +/// Billing address. +@override final BillingAddress? address; +/// Billing phone number. +@override final String? phone; +/// Full name. +@override final String? name; + +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BillingDetailsCopyWith<_BillingDetails> get copyWith => __$BillingDetailsCopyWithImpl<_BillingDetails>(this, _$identity); + +@override +Map toJson() { + return _$BillingDetailsToJson(this, ); +} - /// Email address. - @override - final String? email; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BillingDetails&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.name, name) || other.name == name)); +} - /// Billing address. - @override - final BillingAddress? address; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,email,address,phone,name); - /// Billing phone number. - @override - final String? phone; +@override +String toString() { + return 'BillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; +} - /// Full name. - @override - final String? name; - @override - String toString() { - return 'BillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; - } +} + +/// @nodoc +abstract mixin class _$BillingDetailsCopyWith<$Res> implements $BillingDetailsCopyWith<$Res> { + factory _$BillingDetailsCopyWith(_BillingDetails value, $Res Function(_BillingDetails) _then) = __$BillingDetailsCopyWithImpl; +@override @useResult +$Res call({ + String? email, BillingAddress? address, String? phone, String? name +}); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BillingDetailsImpl && - (identical(other.email, email) || other.email == email) && - (identical(other.address, address) || other.address == address) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.name, name) || other.name == name)); + +@override $BillingAddressCopyWith<$Res>? get address; + +} +/// @nodoc +class __$BillingDetailsCopyWithImpl<$Res> + implements _$BillingDetailsCopyWith<$Res> { + __$BillingDetailsCopyWithImpl(this._self, this._then); + + final _BillingDetails _self; + final $Res Function(_BillingDetails) _then; + +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? email = freezed,Object? address = freezed,Object? phone = freezed,Object? name = freezed,}) { + return _then(_BillingDetails( +email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as BillingAddress?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingAddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, email, address, phone, name); - - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BillingDetailsImplCopyWith<_$BillingDetailsImpl> get copyWith => - __$$BillingDetailsImplCopyWithImpl<_$BillingDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$BillingDetailsImplToJson( - this, + return $BillingAddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + +BillingAddress _$BillingAddressFromJson( + Map json +) { + return _PaymentElementBillingDetailsAddress.fromJson( + json ); - } } -abstract class _BillingDetails implements BillingDetails { - const factory _BillingDetails( - {final String? email, - final BillingAddress? address, - final String? phone, - final String? name}) = _$BillingDetailsImpl; +/// @nodoc +mixin _$BillingAddress { - factory _BillingDetails.fromJson(Map json) = - _$BillingDetailsImpl.fromJson; +/// Address line 1 (e.g., street, PO Box, or company name). + String? get line1;/// Address line 2 (e.g., apartment, suite, unit, or building). + String? get line2;/// City, district, suburb, town, or village. + String? get city;/// State, county, province, or region. + String? get state;/// Two-letter country code (ISO 3166-1 alpha-2). + String? get country;/// ZIP or postal code. +@JsonKey(name: 'postal_code') String? get postalCode; +/// Create a copy of BillingAddress +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BillingAddressCopyWith get copyWith => _$BillingAddressCopyWithImpl(this as BillingAddress, _$identity); - /// Email address. - @override - String? get email; + /// Serializes this BillingAddress to a JSON map. + Map toJson(); - /// Billing address. - @override - BillingAddress? get address; - /// Billing phone number. - @override - String? get phone; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BillingAddress&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} - /// Full name. - @override - String? get name; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BillingDetailsImplCopyWith<_$BillingDetailsImpl> get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'BillingAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; } -BillingAddress _$BillingAddressFromJson(Map json) { - return _PaymentElementBillingDetailsAddress.fromJson(json); + } /// @nodoc -mixin _$BillingAddress { - /// Address line 1 (e.g., street, PO Box, or company name). - String? get line1 => throw _privateConstructorUsedError; +abstract mixin class $BillingAddressCopyWith<$Res> { + factory $BillingAddressCopyWith(BillingAddress value, $Res Function(BillingAddress) _then) = _$BillingAddressCopyWithImpl; +@useResult +$Res call({ + String? line1, String? line2, String? city, String? state, String? country,@JsonKey(name: 'postal_code') String? postalCode +}); - /// Address line 2 (e.g., apartment, suite, unit, or building). - String? get line2 => throw _privateConstructorUsedError; - /// City, district, suburb, town, or village. - String? get city => throw _privateConstructorUsedError; - /// State, county, province, or region. - String? get state => throw _privateConstructorUsedError; - /// Two-letter country code (ISO 3166-1 alpha-2). - String? get country => throw _privateConstructorUsedError; +} +/// @nodoc +class _$BillingAddressCopyWithImpl<$Res> + implements $BillingAddressCopyWith<$Res> { + _$BillingAddressCopyWithImpl(this._self, this._then); + + final BillingAddress _self; + final $Res Function(BillingAddress) _then; + +/// Create a copy of BillingAddress +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? line1 = freezed,Object? line2 = freezed,Object? city = freezed,Object? state = freezed,Object? country = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// ZIP or postal code. - @JsonKey(name: 'postal_code') - String? get postalCode => throw _privateConstructorUsedError; +} - /// Serializes this BillingAddress to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of BillingAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BillingAddressCopyWith get copyWith => - throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [BillingAddress]. +extension BillingAddressPatterns on BillingAddress { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementBillingDetailsAddress value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that);case _: + return orElse(); + } +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementBillingDetailsAddress value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class $BillingAddressCopyWith<$Res> { - factory $BillingAddressCopyWith( - BillingAddress value, $Res Function(BillingAddress) then) = - _$BillingAddressCopyWithImpl<$Res, BillingAddress>; - @useResult - $Res call( - {String? line1, - String? line2, - String? city, - String? state, - String? country, - @JsonKey(name: 'postal_code') String? postalCode}); } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementBillingDetailsAddress value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc -class _$BillingAddressCopyWithImpl<$Res, $Val extends BillingAddress> - implements $BillingAddressCopyWith<$Res> { - _$BillingAddressCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BillingAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = freezed, - Object? line2 = freezed, - Object? city = freezed, - Object? state = freezed, - Object? country = freezed, - Object? postalCode = freezed, - }) { - return _then(_value.copyWith( - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } } +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return orElse(); -/// @nodoc -abstract class _$$PaymentElementBillingDetailsAddressImplCopyWith<$Res> - implements $BillingAddressCopyWith<$Res> { - factory _$$PaymentElementBillingDetailsAddressImplCopyWith( - _$PaymentElementBillingDetailsAddressImpl value, - $Res Function(_$PaymentElementBillingDetailsAddressImpl) then) = - __$$PaymentElementBillingDetailsAddressImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? line1, - String? line2, - String? city, - String? state, - String? country, - @JsonKey(name: 'postal_code') String? postalCode}); +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode) $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress(): +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementBillingDetailsAddressImplCopyWithImpl<$Res> - extends _$BillingAddressCopyWithImpl<$Res, - _$PaymentElementBillingDetailsAddressImpl> - implements _$$PaymentElementBillingDetailsAddressImplCopyWith<$Res> { - __$$PaymentElementBillingDetailsAddressImplCopyWithImpl( - _$PaymentElementBillingDetailsAddressImpl _value, - $Res Function(_$PaymentElementBillingDetailsAddressImpl) _then) - : super(_value, _then); - - /// Create a copy of BillingAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = freezed, - Object? line2 = freezed, - Object? city = freezed, - Object? state = freezed, - Object? country = freezed, - Object? postalCode = freezed, - }) { - return _then(_$PaymentElementBillingDetailsAddressImpl( - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementBillingDetailsAddressImpl - implements _PaymentElementBillingDetailsAddress { - const _$PaymentElementBillingDetailsAddressImpl( - {this.line1, - this.line2, - this.city, - this.state, - this.country, - @JsonKey(name: 'postal_code') this.postalCode}); - - factory _$PaymentElementBillingDetailsAddressImpl.fromJson( - Map json) => - _$$PaymentElementBillingDetailsAddressImplFromJson(json); - - /// Address line 1 (e.g., street, PO Box, or company name). - @override - final String? line1; - - /// Address line 2 (e.g., apartment, suite, unit, or building). - @override - final String? line2; - - /// City, district, suburb, town, or village. - @override - final String? city; - - /// State, county, province, or region. - @override - final String? state; - - /// Two-letter country code (ISO 3166-1 alpha-2). - @override - final String? country; - - /// ZIP or postal code. - @override - @JsonKey(name: 'postal_code') - final String? postalCode; - - @override - String toString() { - return 'BillingAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementBillingDetailsAddressImpl && - (identical(other.line1, line1) || other.line1 == line1) && - (identical(other.line2, line2) || other.line2 == line2) && - (identical(other.city, city) || other.city == city) && - (identical(other.state, state) || other.state == state) && - (identical(other.country, country) || other.country == country) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode)); - } +class _PaymentElementBillingDetailsAddress implements BillingAddress { + const _PaymentElementBillingDetailsAddress({this.line1, this.line2, this.city, this.state, this.country, @JsonKey(name: 'postal_code') this.postalCode}); + factory _PaymentElementBillingDetailsAddress.fromJson(Map json) => _$PaymentElementBillingDetailsAddressFromJson(json); + +/// Address line 1 (e.g., street, PO Box, or company name). +@override final String? line1; +/// Address line 2 (e.g., apartment, suite, unit, or building). +@override final String? line2; +/// City, district, suburb, town, or village. +@override final String? city; +/// State, county, province, or region. +@override final String? state; +/// Two-letter country code (ISO 3166-1 alpha-2). +@override final String? country; +/// ZIP or postal code. +@override@JsonKey(name: 'postal_code') final String? postalCode; + +/// Create a copy of BillingAddress +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementBillingDetailsAddressCopyWith<_PaymentElementBillingDetailsAddress> get copyWith => __$PaymentElementBillingDetailsAddressCopyWithImpl<_PaymentElementBillingDetailsAddress>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementBillingDetailsAddressToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, line1, line2, city, state, country, postalCode); - - /// Create a copy of BillingAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementBillingDetailsAddressImplCopyWith< - _$PaymentElementBillingDetailsAddressImpl> - get copyWith => __$$PaymentElementBillingDetailsAddressImplCopyWithImpl< - _$PaymentElementBillingDetailsAddressImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementBillingDetailsAddressImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementBillingDetailsAddress&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); } -abstract class _PaymentElementBillingDetailsAddress implements BillingAddress { - const factory _PaymentElementBillingDetailsAddress( - {final String? line1, - final String? line2, - final String? city, - final String? state, - final String? country, - @JsonKey(name: 'postal_code') final String? postalCode}) = - _$PaymentElementBillingDetailsAddressImpl; - - factory _PaymentElementBillingDetailsAddress.fromJson( - Map json) = - _$PaymentElementBillingDetailsAddressImpl.fromJson; - - /// Address line 1 (e.g., street, PO Box, or company name). - @override - String? get line1; - - /// Address line 2 (e.g., apartment, suite, unit, or building). - @override - String? get line2; - - /// City, district, suburb, town, or village. - @override - String? get city; - - /// State, county, province, or region. - @override - String? get state; - - /// Two-letter country code (ISO 3166-1 alpha-2). - @override - String? get country; - - /// ZIP or postal code. - @override - @JsonKey(name: 'postal_code') - String? get postalCode; - - /// Create a copy of BillingAddress - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementBillingDetailsAddressImplCopyWith< - _$PaymentElementBillingDetailsAddressImpl> - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); + +@override +String toString() { + return 'BillingAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +} + + } + +/// @nodoc +abstract mixin class _$PaymentElementBillingDetailsAddressCopyWith<$Res> implements $BillingAddressCopyWith<$Res> { + factory _$PaymentElementBillingDetailsAddressCopyWith(_PaymentElementBillingDetailsAddress value, $Res Function(_PaymentElementBillingDetailsAddress) _then) = __$PaymentElementBillingDetailsAddressCopyWithImpl; +@override @useResult +$Res call({ + String? line1, String? line2, String? city, String? state, String? country,@JsonKey(name: 'postal_code') String? postalCode +}); + + + + +} +/// @nodoc +class __$PaymentElementBillingDetailsAddressCopyWithImpl<$Res> + implements _$PaymentElementBillingDetailsAddressCopyWith<$Res> { + __$PaymentElementBillingDetailsAddressCopyWithImpl(this._self, this._then); + + final _PaymentElementBillingDetailsAddress _self; + final $Res Function(_PaymentElementBillingDetailsAddress) _then; + +/// Create a copy of BillingAddress +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? line1 = freezed,Object? line2 = freezed,Object? city = freezed,Object? state = freezed,Object? country = freezed,Object? postalCode = freezed,}) { + return _then(_PaymentElementBillingDetailsAddress( +line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/core/billing_details.g.dart b/packages/stripe_js/lib/src/api/core/billing_details.g.dart index 48a3fcd60..f1b027804 100644 --- a/packages/stripe_js/lib/src/api/core/billing_details.g.dart +++ b/packages/stripe_js/lib/src/api/core/billing_details.g.dart @@ -6,60 +6,43 @@ part of 'billing_details.dart'; // JsonSerializableGenerator // ************************************************************************** -_$BillingDetailsImpl _$$BillingDetailsImplFromJson(Map json) => - _$BillingDetailsImpl( - email: json['email'] as String?, - address: json['address'] == null - ? null - : BillingAddress.fromJson( - Map.from(json['address'] as Map)), - phone: json['phone'] as String?, - name: json['name'] as String?, +_BillingDetails _$BillingDetailsFromJson(Map json) => _BillingDetails( + email: json['email'] as String?, + address: json['address'] == null + ? null + : BillingAddress.fromJson( + Map.from(json['address'] as Map), + ), + phone: json['phone'] as String?, + name: json['name'] as String?, +); + +Map _$BillingDetailsToJson(_BillingDetails instance) => + { + 'email': ?instance.email, + 'address': ?instance.address?.toJson(), + 'phone': ?instance.phone, + 'name': ?instance.name, + }; + +_PaymentElementBillingDetailsAddress +_$PaymentElementBillingDetailsAddressFromJson(Map json) => + _PaymentElementBillingDetailsAddress( + line1: json['line1'] as String?, + line2: json['line2'] as String?, + city: json['city'] as String?, + state: json['state'] as String?, + country: json['country'] as String?, + postalCode: json['postal_code'] as String?, ); -Map _$$BillingDetailsImplToJson( - _$BillingDetailsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('email', instance.email); - writeNotNull('address', instance.address?.toJson()); - writeNotNull('phone', instance.phone); - writeNotNull('name', instance.name); - return val; -} - -_$PaymentElementBillingDetailsAddressImpl - _$$PaymentElementBillingDetailsAddressImplFromJson(Map json) => - _$PaymentElementBillingDetailsAddressImpl( - line1: json['line1'] as String?, - line2: json['line2'] as String?, - city: json['city'] as String?, - state: json['state'] as String?, - country: json['country'] as String?, - postalCode: json['postal_code'] as String?, - ); - -Map _$$PaymentElementBillingDetailsAddressImplToJson( - _$PaymentElementBillingDetailsAddressImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('line1', instance.line1); - writeNotNull('line2', instance.line2); - writeNotNull('city', instance.city); - writeNotNull('state', instance.state); - writeNotNull('country', instance.country); - writeNotNull('postal_code', instance.postalCode); - return val; -} +Map _$PaymentElementBillingDetailsAddressToJson( + _PaymentElementBillingDetailsAddress instance, +) => { + 'line1': ?instance.line1, + 'line2': ?instance.line2, + 'city': ?instance.city, + 'state': ?instance.state, + 'country': ?instance.country, + 'postal_code': ?instance.postalCode, +}; diff --git a/packages/stripe_js/lib/src/api/core/error.dart b/packages/stripe_js/lib/src/api/core/error.dart index e9add8aad..3ba84504e 100644 --- a/packages/stripe_js/lib/src/api/core/error.dart +++ b/packages/stripe_js/lib/src/api/core/error.dart @@ -6,7 +6,7 @@ part 'error.freezed.dart'; part 'error.g.dart'; @freezed -class StripeError with _$StripeError { +abstract class StripeError with _$StripeError { const factory StripeError({ /// The type of error returned. One of api_error, card_error, /// idempotency_error, or invalid_request_error diff --git a/packages/stripe_js/lib/src/api/core/error.freezed.dart b/packages/stripe_js/lib/src/api/core/error.freezed.dart index b65f2f95a..0b56a8136 100644 --- a/packages/stripe_js/lib/src/api/core/error.freezed.dart +++ b/packages/stripe_js/lib/src/api/core/error.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,286 +9,310 @@ part of 'error.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -StripeError _$StripeErrorFromJson(Map json) { - return _PaymentElementChangeEvent.fromJson(json); +StripeError _$StripeErrorFromJson( + Map json +) { + return _PaymentElementChangeEvent.fromJson( + json + ); } /// @nodoc mixin _$StripeError { - /// The type of error returned. One of api_error, card_error, - /// idempotency_error, or invalid_request_error - String? get type => throw _privateConstructorUsedError; - /// For some errors that could be handled programmatically, - /// a short string indicating the error code reported. - String? get code => throw _privateConstructorUsedError; +/// The type of error returned. One of api_error, card_error, +/// idempotency_error, or invalid_request_error + String? get type;/// For some errors that could be handled programmatically, +/// a short string indicating the error code reported. + String? get code;/// For card errors resulting from a card issuer decline, a short string +/// indicating the card issuer’s reason for the decline if they provide one. + String? get decline_code;/// A human-readable message providing more details about the error. +/// For card errors, these messages can be shown to your users. + String? get message;/// If the error is parameter-specific, the parameter related to the error. +/// For example, you can use this to display a message near the correct form +/// field. + String? get param; +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StripeErrorCopyWith get copyWith => _$StripeErrorCopyWithImpl(this as StripeError, _$identity); - /// For card errors resulting from a card issuer decline, a short string - /// indicating the card issuer’s reason for the decline if they provide one. - String? get decline_code => throw _privateConstructorUsedError; + /// Serializes this StripeError to a JSON map. + Map toJson(); - /// A human-readable message providing more details about the error. - /// For card errors, these messages can be shown to your users. - String? get message => throw _privateConstructorUsedError; - /// If the error is parameter-specific, the parameter related to the error. - /// For example, you can use this to display a message near the correct form - /// field. - String? get param => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StripeError&&(identical(other.type, type) || other.type == type)&&(identical(other.code, code) || other.code == code)&&(identical(other.decline_code, decline_code) || other.decline_code == decline_code)&&(identical(other.message, message) || other.message == message)&&(identical(other.param, param) || other.param == param)); +} - /// Serializes this StripeError to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,code,decline_code,message,param); - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $StripeErrorCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'StripeError(type: $type, code: $code, decline_code: $decline_code, message: $message, param: $param)'; } -/// @nodoc -abstract class $StripeErrorCopyWith<$Res> { - factory $StripeErrorCopyWith( - StripeError value, $Res Function(StripeError) then) = - _$StripeErrorCopyWithImpl<$Res, StripeError>; - @useResult - $Res call( - {String? type, - String? code, - String? decline_code, - String? message, - String? param}); + } /// @nodoc -class _$StripeErrorCopyWithImpl<$Res, $Val extends StripeError> - implements $StripeErrorCopyWith<$Res> { - _$StripeErrorCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = freezed, - Object? code = freezed, - Object? decline_code = freezed, - Object? message = freezed, - Object? param = freezed, - }) { - return _then(_value.copyWith( - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String?, - decline_code: freezed == decline_code - ? _value.decline_code - : decline_code // ignore: cast_nullable_to_non_nullable - as String?, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - param: freezed == param - ? _value.param - : param // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} +abstract mixin class $StripeErrorCopyWith<$Res> { + factory $StripeErrorCopyWith(StripeError value, $Res Function(StripeError) _then) = _$StripeErrorCopyWithImpl; +@useResult +$Res call({ + String? type, String? code, String? decline_code, String? message, String? param +}); + + + +} /// @nodoc -abstract class _$$PaymentElementChangeEventImplCopyWith<$Res> +class _$StripeErrorCopyWithImpl<$Res> implements $StripeErrorCopyWith<$Res> { - factory _$$PaymentElementChangeEventImplCopyWith( - _$PaymentElementChangeEventImpl value, - $Res Function(_$PaymentElementChangeEventImpl) then) = - __$$PaymentElementChangeEventImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? type, - String? code, - String? decline_code, - String? message, - String? param}); + _$StripeErrorCopyWithImpl(this._self, this._then); + + final StripeError _self; + final $Res Function(StripeError) _then; + +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = freezed,Object? code = freezed,Object? decline_code = freezed,Object? message = freezed,Object? param = freezed,}) { + return _then(_self.copyWith( +type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,code: freezed == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as String?,decline_code: freezed == decline_code ? _self.decline_code : decline_code // ignore: cast_nullable_to_non_nullable +as String?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,param: freezed == param ? _self.param : param // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [StripeError]. +extension StripeErrorPatterns on StripeError { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementChangeEvent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementChangeEvent value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementChangeEvent value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? type, String? code, String? decline_code, String? message, String? param)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that.type,_that.code,_that.decline_code,_that.message,_that.param);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? type, String? code, String? decline_code, String? message, String? param) $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent(): +return $default(_that.type,_that.code,_that.decline_code,_that.message,_that.param);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? type, String? code, String? decline_code, String? message, String? param)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that.type,_that.code,_that.decline_code,_that.message,_that.param);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementChangeEventImplCopyWithImpl<$Res> - extends _$StripeErrorCopyWithImpl<$Res, _$PaymentElementChangeEventImpl> - implements _$$PaymentElementChangeEventImplCopyWith<$Res> { - __$$PaymentElementChangeEventImplCopyWithImpl( - _$PaymentElementChangeEventImpl _value, - $Res Function(_$PaymentElementChangeEventImpl) _then) - : super(_value, _then); - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = freezed, - Object? code = freezed, - Object? decline_code = freezed, - Object? message = freezed, - Object? param = freezed, - }) { - return _then(_$PaymentElementChangeEventImpl( - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String?, - decline_code: freezed == decline_code - ? _value.decline_code - : decline_code // ignore: cast_nullable_to_non_nullable - as String?, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - param: freezed == param - ? _value.param - : param // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementChangeEventImpl implements _PaymentElementChangeEvent { - const _$PaymentElementChangeEventImpl( - {this.type, this.code, this.decline_code, this.message, this.param}); - - factory _$PaymentElementChangeEventImpl.fromJson(Map json) => - _$$PaymentElementChangeEventImplFromJson(json); - - /// The type of error returned. One of api_error, card_error, - /// idempotency_error, or invalid_request_error - @override - final String? type; - - /// For some errors that could be handled programmatically, - /// a short string indicating the error code reported. - @override - final String? code; - - /// For card errors resulting from a card issuer decline, a short string - /// indicating the card issuer’s reason for the decline if they provide one. - @override - final String? decline_code; - - /// A human-readable message providing more details about the error. - /// For card errors, these messages can be shown to your users. - @override - final String? message; - - /// If the error is parameter-specific, the parameter related to the error. - /// For example, you can use this to display a message near the correct form - /// field. - @override - final String? param; - - @override - String toString() { - return 'StripeError(type: $type, code: $code, decline_code: $decline_code, message: $message, param: $param)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementChangeEventImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.code, code) || other.code == code) && - (identical(other.decline_code, decline_code) || - other.decline_code == decline_code) && - (identical(other.message, message) || other.message == message) && - (identical(other.param, param) || other.param == param)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, type, code, decline_code, message, param); - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementChangeEventImplCopyWith<_$PaymentElementChangeEventImpl> - get copyWith => __$$PaymentElementChangeEventImplCopyWithImpl< - _$PaymentElementChangeEventImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementChangeEventImplToJson( - this, - ); - } + +class _PaymentElementChangeEvent implements StripeError { + const _PaymentElementChangeEvent({this.type, this.code, this.decline_code, this.message, this.param}); + factory _PaymentElementChangeEvent.fromJson(Map json) => _$PaymentElementChangeEventFromJson(json); + +/// The type of error returned. One of api_error, card_error, +/// idempotency_error, or invalid_request_error +@override final String? type; +/// For some errors that could be handled programmatically, +/// a short string indicating the error code reported. +@override final String? code; +/// For card errors resulting from a card issuer decline, a short string +/// indicating the card issuer’s reason for the decline if they provide one. +@override final String? decline_code; +/// A human-readable message providing more details about the error. +/// For card errors, these messages can be shown to your users. +@override final String? message; +/// If the error is parameter-specific, the parameter related to the error. +/// For example, you can use this to display a message near the correct form +/// field. +@override final String? param; + +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementChangeEventCopyWith<_PaymentElementChangeEvent> get copyWith => __$PaymentElementChangeEventCopyWithImpl<_PaymentElementChangeEvent>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementChangeEventToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementChangeEvent&&(identical(other.type, type) || other.type == type)&&(identical(other.code, code) || other.code == code)&&(identical(other.decline_code, decline_code) || other.decline_code == decline_code)&&(identical(other.message, message) || other.message == message)&&(identical(other.param, param) || other.param == param)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,code,decline_code,message,param); + +@override +String toString() { + return 'StripeError(type: $type, code: $code, decline_code: $decline_code, message: $message, param: $param)'; } -abstract class _PaymentElementChangeEvent implements StripeError { - const factory _PaymentElementChangeEvent( - {final String? type, - final String? code, - final String? decline_code, - final String? message, - final String? param}) = _$PaymentElementChangeEventImpl; - - factory _PaymentElementChangeEvent.fromJson(Map json) = - _$PaymentElementChangeEventImpl.fromJson; - - /// The type of error returned. One of api_error, card_error, - /// idempotency_error, or invalid_request_error - @override - String? get type; - - /// For some errors that could be handled programmatically, - /// a short string indicating the error code reported. - @override - String? get code; - - /// For card errors resulting from a card issuer decline, a short string - /// indicating the card issuer’s reason for the decline if they provide one. - @override - String? get decline_code; - - /// A human-readable message providing more details about the error. - /// For card errors, these messages can be shown to your users. - @override - String? get message; - - /// If the error is parameter-specific, the parameter related to the error. - /// For example, you can use this to display a message near the correct form - /// field. - @override - String? get param; - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementChangeEventImplCopyWith<_$PaymentElementChangeEventImpl> - get copyWith => throw _privateConstructorUsedError; + } + +/// @nodoc +abstract mixin class _$PaymentElementChangeEventCopyWith<$Res> implements $StripeErrorCopyWith<$Res> { + factory _$PaymentElementChangeEventCopyWith(_PaymentElementChangeEvent value, $Res Function(_PaymentElementChangeEvent) _then) = __$PaymentElementChangeEventCopyWithImpl; +@override @useResult +$Res call({ + String? type, String? code, String? decline_code, String? message, String? param +}); + + + + +} +/// @nodoc +class __$PaymentElementChangeEventCopyWithImpl<$Res> + implements _$PaymentElementChangeEventCopyWith<$Res> { + __$PaymentElementChangeEventCopyWithImpl(this._self, this._then); + + final _PaymentElementChangeEvent _self; + final $Res Function(_PaymentElementChangeEvent) _then; + +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = freezed,Object? code = freezed,Object? decline_code = freezed,Object? message = freezed,Object? param = freezed,}) { + return _then(_PaymentElementChangeEvent( +type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?,code: freezed == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as String?,decline_code: freezed == decline_code ? _self.decline_code : decline_code // ignore: cast_nullable_to_non_nullable +as String?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,param: freezed == param ? _self.param : param // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/core/error.g.dart b/packages/stripe_js/lib/src/api/core/error.g.dart index 88d7b9c5a..77b7ddc45 100644 --- a/packages/stripe_js/lib/src/api/core/error.g.dart +++ b/packages/stripe_js/lib/src/api/core/error.g.dart @@ -6,9 +6,8 @@ part of 'error.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentElementChangeEventImpl _$$PaymentElementChangeEventImplFromJson( - Map json) => - _$PaymentElementChangeEventImpl( +_PaymentElementChangeEvent _$PaymentElementChangeEventFromJson(Map json) => + _PaymentElementChangeEvent( type: json['type'] as String?, code: json['code'] as String?, decline_code: json['decline_code'] as String?, @@ -16,20 +15,12 @@ _$PaymentElementChangeEventImpl _$$PaymentElementChangeEventImplFromJson( param: json['param'] as String?, ); -Map _$$PaymentElementChangeEventImplToJson( - _$PaymentElementChangeEventImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('type', instance.type); - writeNotNull('code', instance.code); - writeNotNull('decline_code', instance.decline_code); - writeNotNull('message', instance.message); - writeNotNull('param', instance.param); - return val; -} +Map _$PaymentElementChangeEventToJson( + _PaymentElementChangeEvent instance, +) => { + 'type': ?instance.type, + 'code': ?instance.code, + 'decline_code': ?instance.decline_code, + 'message': ?instance.message, + 'param': ?instance.param, +}; diff --git a/packages/stripe_js/lib/src/api/core/shipping_details.dart b/packages/stripe_js/lib/src/api/core/shipping_details.dart index 833a16f60..3837c848c 100644 --- a/packages/stripe_js/lib/src/api/core/shipping_details.dart +++ b/packages/stripe_js/lib/src/api/core/shipping_details.dart @@ -4,7 +4,7 @@ part 'shipping_details.freezed.dart'; part 'shipping_details.g.dart'; @freezed -class ShippingDetails with _$ShippingDetails { +abstract class ShippingDetails with _$ShippingDetails { const factory ShippingDetails({ /// Shipping address. @Default(ShippingDetailsAddress()) ShippingDetailsAddress address, @@ -14,11 +14,9 @@ class ShippingDetails with _$ShippingDetails { String? carrier, /// Recipient name. - String? name, /// Recipient phone (including extension). - String? phone, /// The tracking number for a physical product, obtained from the @@ -32,7 +30,7 @@ class ShippingDetails with _$ShippingDetails { } @freezed -class ShippingDetailsAddress with _$ShippingDetailsAddress { +abstract class ShippingDetailsAddress with _$ShippingDetailsAddress { const factory ShippingDetailsAddress({ /// Address line 1 (e.g., street, PO Box, or company name). String? line1, diff --git a/packages/stripe_js/lib/src/api/core/shipping_details.freezed.dart b/packages/stripe_js/lib/src/api/core/shipping_details.freezed.dart index 6cacbe472..6cbd72d17 100644 --- a/packages/stripe_js/lib/src/api/core/shipping_details.freezed.dart +++ b/packages/stripe_js/lib/src/api/core/shipping_details.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,605 +9,619 @@ part of 'shipping_details.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ShippingDetails _$ShippingDetailsFromJson(Map json) { - return _PaymentElementChangeEvent.fromJson(json); +ShippingDetails _$ShippingDetailsFromJson( + Map json +) { + return _PaymentElementChangeEvent.fromJson( + json + ); } /// @nodoc mixin _$ShippingDetails { - /// Shipping address. - ShippingDetailsAddress get address => throw _privateConstructorUsedError; - /// The delivery service that shipped a physical product, - /// such as Fedex, UPS, USPS, etc. - String? get carrier => throw _privateConstructorUsedError; +/// Shipping address. + ShippingDetailsAddress get address;/// The delivery service that shipped a physical product, +/// such as Fedex, UPS, USPS, etc. + String? get carrier;/// Recipient name. + String? get name;/// Recipient phone (including extension). + String? get phone;/// The tracking number for a physical product, obtained from the +/// delivery service. If multiple tracking numbers were +/// generated for this purchase, please separate them with commas. +@JsonKey(name: 'tracking_number') String? get trackingNumber; +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith get copyWith => _$ShippingDetailsCopyWithImpl(this as ShippingDetails, _$identity); - /// Recipient name. - String? get name => throw _privateConstructorUsedError; + /// Serializes this ShippingDetails to a JSON map. + Map toJson(); - /// Recipient phone (including extension). - String? get phone => throw _privateConstructorUsedError; - /// The tracking number for a physical product, obtained from the - /// delivery service. If multiple tracking numbers were - /// generated for this purchase, please separate them with commas. - @JsonKey(name: 'tracking_number') - String? get trackingNumber => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ShippingDetails&&(identical(other.address, address) || other.address == address)&&(identical(other.carrier, carrier) || other.carrier == carrier)&&(identical(other.name, name) || other.name == name)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.trackingNumber, trackingNumber) || other.trackingNumber == trackingNumber)); +} - /// Serializes this ShippingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,address,carrier,name,phone,trackingNumber); - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ShippingDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'ShippingDetails(address: $address, carrier: $carrier, name: $name, phone: $phone, trackingNumber: $trackingNumber)'; } -/// @nodoc -abstract class $ShippingDetailsCopyWith<$Res> { - factory $ShippingDetailsCopyWith( - ShippingDetails value, $Res Function(ShippingDetails) then) = - _$ShippingDetailsCopyWithImpl<$Res, ShippingDetails>; - @useResult - $Res call( - {ShippingDetailsAddress address, - String? carrier, - String? name, - String? phone, - @JsonKey(name: 'tracking_number') String? trackingNumber}); - $ShippingDetailsAddressCopyWith<$Res> get address; } /// @nodoc -class _$ShippingDetailsCopyWithImpl<$Res, $Val extends ShippingDetails> - implements $ShippingDetailsCopyWith<$Res> { - _$ShippingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? address = null, - Object? carrier = freezed, - Object? name = freezed, - Object? phone = freezed, - Object? trackingNumber = freezed, - }) { - return _then(_value.copyWith( - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as ShippingDetailsAddress, - carrier: freezed == carrier - ? _value.carrier - : carrier // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - trackingNumber: freezed == trackingNumber - ? _value.trackingNumber - : trackingNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsAddressCopyWith<$Res> get address { - return $ShippingDetailsAddressCopyWith<$Res>(_value.address, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } -} +abstract mixin class $ShippingDetailsCopyWith<$Res> { + factory $ShippingDetailsCopyWith(ShippingDetails value, $Res Function(ShippingDetails) _then) = _$ShippingDetailsCopyWithImpl; +@useResult +$Res call({ + ShippingDetailsAddress address, String? carrier, String? name, String? phone,@JsonKey(name: 'tracking_number') String? trackingNumber +}); + +$ShippingDetailsAddressCopyWith<$Res> get address; + +} /// @nodoc -abstract class _$$PaymentElementChangeEventImplCopyWith<$Res> +class _$ShippingDetailsCopyWithImpl<$Res> implements $ShippingDetailsCopyWith<$Res> { - factory _$$PaymentElementChangeEventImplCopyWith( - _$PaymentElementChangeEventImpl value, - $Res Function(_$PaymentElementChangeEventImpl) then) = - __$$PaymentElementChangeEventImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ShippingDetailsAddress address, - String? carrier, - String? name, - String? phone, - @JsonKey(name: 'tracking_number') String? trackingNumber}); - - @override - $ShippingDetailsAddressCopyWith<$Res> get address; + _$ShippingDetailsCopyWithImpl(this._self, this._then); + + final ShippingDetails _self; + final $Res Function(ShippingDetails) _then; + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? address = null,Object? carrier = freezed,Object? name = freezed,Object? phone = freezed,Object? trackingNumber = freezed,}) { + return _then(_self.copyWith( +address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as ShippingDetailsAddress,carrier: freezed == carrier ? _self.carrier : carrier // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,trackingNumber: freezed == trackingNumber ? _self.trackingNumber : trackingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsAddressCopyWith<$Res> get address { + + return $ShippingDetailsAddressCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ShippingDetails]. +extension ShippingDetailsPatterns on ShippingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementChangeEvent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementChangeEvent value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementChangeEvent value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ShippingDetailsAddress address, String? carrier, String? name, String? phone, @JsonKey(name: 'tracking_number') String? trackingNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that.address,_that.carrier,_that.name,_that.phone,_that.trackingNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ShippingDetailsAddress address, String? carrier, String? name, String? phone, @JsonKey(name: 'tracking_number') String? trackingNumber) $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent(): +return $default(_that.address,_that.carrier,_that.name,_that.phone,_that.trackingNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ShippingDetailsAddress address, String? carrier, String? name, String? phone, @JsonKey(name: 'tracking_number') String? trackingNumber)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that.address,_that.carrier,_that.name,_that.phone,_that.trackingNumber);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementChangeEventImplCopyWithImpl<$Res> - extends _$ShippingDetailsCopyWithImpl<$Res, _$PaymentElementChangeEventImpl> - implements _$$PaymentElementChangeEventImplCopyWith<$Res> { - __$$PaymentElementChangeEventImplCopyWithImpl( - _$PaymentElementChangeEventImpl _value, - $Res Function(_$PaymentElementChangeEventImpl) _then) - : super(_value, _then); - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? address = null, - Object? carrier = freezed, - Object? name = freezed, - Object? phone = freezed, - Object? trackingNumber = freezed, - }) { - return _then(_$PaymentElementChangeEventImpl( - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as ShippingDetailsAddress, - carrier: freezed == carrier - ? _value.carrier - : carrier // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - trackingNumber: freezed == trackingNumber - ? _value.trackingNumber - : trackingNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementChangeEventImpl implements _PaymentElementChangeEvent { - const _$PaymentElementChangeEventImpl( - {this.address = const ShippingDetailsAddress(), - this.carrier, - this.name, - this.phone, - @JsonKey(name: 'tracking_number') this.trackingNumber}); - - factory _$PaymentElementChangeEventImpl.fromJson(Map json) => - _$$PaymentElementChangeEventImplFromJson(json); - - /// Shipping address. - @override - @JsonKey() - final ShippingDetailsAddress address; - - /// The delivery service that shipped a physical product, - /// such as Fedex, UPS, USPS, etc. - @override - final String? carrier; - - /// Recipient name. - @override - final String? name; - - /// Recipient phone (including extension). - @override - final String? phone; - - /// The tracking number for a physical product, obtained from the - /// delivery service. If multiple tracking numbers were - /// generated for this purchase, please separate them with commas. - @override - @JsonKey(name: 'tracking_number') - final String? trackingNumber; - - @override - String toString() { - return 'ShippingDetails(address: $address, carrier: $carrier, name: $name, phone: $phone, trackingNumber: $trackingNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementChangeEventImpl && - (identical(other.address, address) || other.address == address) && - (identical(other.carrier, carrier) || other.carrier == carrier) && - (identical(other.name, name) || other.name == name) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.trackingNumber, trackingNumber) || - other.trackingNumber == trackingNumber)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, address, carrier, name, phone, trackingNumber); - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementChangeEventImplCopyWith<_$PaymentElementChangeEventImpl> - get copyWith => __$$PaymentElementChangeEventImplCopyWithImpl< - _$PaymentElementChangeEventImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementChangeEventImplToJson( - this, - ); - } + +class _PaymentElementChangeEvent implements ShippingDetails { + const _PaymentElementChangeEvent({this.address = const ShippingDetailsAddress(), this.carrier, this.name, this.phone, @JsonKey(name: 'tracking_number') this.trackingNumber}); + factory _PaymentElementChangeEvent.fromJson(Map json) => _$PaymentElementChangeEventFromJson(json); + +/// Shipping address. +@override@JsonKey() final ShippingDetailsAddress address; +/// The delivery service that shipped a physical product, +/// such as Fedex, UPS, USPS, etc. +@override final String? carrier; +/// Recipient name. +@override final String? name; +/// Recipient phone (including extension). +@override final String? phone; +/// The tracking number for a physical product, obtained from the +/// delivery service. If multiple tracking numbers were +/// generated for this purchase, please separate them with commas. +@override@JsonKey(name: 'tracking_number') final String? trackingNumber; + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementChangeEventCopyWith<_PaymentElementChangeEvent> get copyWith => __$PaymentElementChangeEventCopyWithImpl<_PaymentElementChangeEvent>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementChangeEventToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementChangeEvent&&(identical(other.address, address) || other.address == address)&&(identical(other.carrier, carrier) || other.carrier == carrier)&&(identical(other.name, name) || other.name == name)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.trackingNumber, trackingNumber) || other.trackingNumber == trackingNumber)); } -abstract class _PaymentElementChangeEvent implements ShippingDetails { - const factory _PaymentElementChangeEvent( - {final ShippingDetailsAddress address, - final String? carrier, - final String? name, - final String? phone, - @JsonKey(name: 'tracking_number') final String? trackingNumber}) = - _$PaymentElementChangeEventImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,address,carrier,name,phone,trackingNumber); - factory _PaymentElementChangeEvent.fromJson(Map json) = - _$PaymentElementChangeEventImpl.fromJson; +@override +String toString() { + return 'ShippingDetails(address: $address, carrier: $carrier, name: $name, phone: $phone, trackingNumber: $trackingNumber)'; +} - /// Shipping address. - @override - ShippingDetailsAddress get address; - /// The delivery service that shipped a physical product, - /// such as Fedex, UPS, USPS, etc. - @override - String? get carrier; +} - /// Recipient name. - @override - String? get name; +/// @nodoc +abstract mixin class _$PaymentElementChangeEventCopyWith<$Res> implements $ShippingDetailsCopyWith<$Res> { + factory _$PaymentElementChangeEventCopyWith(_PaymentElementChangeEvent value, $Res Function(_PaymentElementChangeEvent) _then) = __$PaymentElementChangeEventCopyWithImpl; +@override @useResult +$Res call({ + ShippingDetailsAddress address, String? carrier, String? name, String? phone,@JsonKey(name: 'tracking_number') String? trackingNumber +}); - /// Recipient phone (including extension). - @override - String? get phone; - /// The tracking number for a physical product, obtained from the - /// delivery service. If multiple tracking numbers were - /// generated for this purchase, please separate them with commas. - @override - @JsonKey(name: 'tracking_number') - String? get trackingNumber; +@override $ShippingDetailsAddressCopyWith<$Res> get address; - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementChangeEventImplCopyWith<_$PaymentElementChangeEventImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$PaymentElementChangeEventCopyWithImpl<$Res> + implements _$PaymentElementChangeEventCopyWith<$Res> { + __$PaymentElementChangeEventCopyWithImpl(this._self, this._then); + + final _PaymentElementChangeEvent _self; + final $Res Function(_PaymentElementChangeEvent) _then; + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? address = null,Object? carrier = freezed,Object? name = freezed,Object? phone = freezed,Object? trackingNumber = freezed,}) { + return _then(_PaymentElementChangeEvent( +address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as ShippingDetailsAddress,carrier: freezed == carrier ? _self.carrier : carrier // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,trackingNumber: freezed == trackingNumber ? _self.trackingNumber : trackingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsAddressCopyWith<$Res> get address { + + return $ShippingDetailsAddressCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} } ShippingDetailsAddress _$ShippingDetailsAddressFromJson( - Map json) { - return _PaymentElementBillingDetailsAddress.fromJson(json); + Map json +) { + return _PaymentElementBillingDetailsAddress.fromJson( + json + ); } /// @nodoc mixin _$ShippingDetailsAddress { - /// Address line 1 (e.g., street, PO Box, or company name). - String? get line1 => throw _privateConstructorUsedError; - /// Address line 2 (e.g., apartment, suite, unit, or building). - String? get line2 => throw _privateConstructorUsedError; +/// Address line 1 (e.g., street, PO Box, or company name). + String? get line1;/// Address line 2 (e.g., apartment, suite, unit, or building). + String? get line2;/// City, district, suburb, town, or village. + String? get city;/// State, county, province, or region. + String? get state;/// Two-letter country code (ISO 3166-1 alpha-2). + String? get country;/// ZIP or postal code. +@JsonKey(name: 'postal_code') String? get postalCode; +/// Create a copy of ShippingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ShippingDetailsAddressCopyWith get copyWith => _$ShippingDetailsAddressCopyWithImpl(this as ShippingDetailsAddress, _$identity); - /// City, district, suburb, town, or village. - String? get city => throw _privateConstructorUsedError; + /// Serializes this ShippingDetailsAddress to a JSON map. + Map toJson(); - /// State, county, province, or region. - String? get state => throw _privateConstructorUsedError; - /// Two-letter country code (ISO 3166-1 alpha-2). - String? get country => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ShippingDetailsAddress&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} - /// ZIP or postal code. - @JsonKey(name: 'postal_code') - String? get postalCode => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); + +@override +String toString() { + return 'ShippingDetailsAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +} - /// Serializes this ShippingDetailsAddress to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of ShippingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ShippingDetailsAddressCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $ShippingDetailsAddressCopyWith<$Res> { - factory $ShippingDetailsAddressCopyWith(ShippingDetailsAddress value, - $Res Function(ShippingDetailsAddress) then) = - _$ShippingDetailsAddressCopyWithImpl<$Res, ShippingDetailsAddress>; - @useResult - $Res call( - {String? line1, - String? line2, - String? city, - String? state, - String? country, - @JsonKey(name: 'postal_code') String? postalCode}); -} +abstract mixin class $ShippingDetailsAddressCopyWith<$Res> { + factory $ShippingDetailsAddressCopyWith(ShippingDetailsAddress value, $Res Function(ShippingDetailsAddress) _then) = _$ShippingDetailsAddressCopyWithImpl; +@useResult +$Res call({ + String? line1, String? line2, String? city, String? state, String? country,@JsonKey(name: 'postal_code') String? postalCode +}); + + + +} /// @nodoc -class _$ShippingDetailsAddressCopyWithImpl<$Res, - $Val extends ShippingDetailsAddress> +class _$ShippingDetailsAddressCopyWithImpl<$Res> implements $ShippingDetailsAddressCopyWith<$Res> { - _$ShippingDetailsAddressCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ShippingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = freezed, - Object? line2 = freezed, - Object? city = freezed, - Object? state = freezed, - Object? country = freezed, - Object? postalCode = freezed, - }) { - return _then(_value.copyWith( - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + _$ShippingDetailsAddressCopyWithImpl(this._self, this._then); + + final ShippingDetailsAddress _self; + final $Res Function(ShippingDetailsAddress) _then; + +/// Create a copy of ShippingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? line1 = freezed,Object? line2 = freezed,Object? city = freezed,Object? state = freezed,Object? country = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$PaymentElementBillingDetailsAddressImplCopyWith<$Res> - implements $ShippingDetailsAddressCopyWith<$Res> { - factory _$$PaymentElementBillingDetailsAddressImplCopyWith( - _$PaymentElementBillingDetailsAddressImpl value, - $Res Function(_$PaymentElementBillingDetailsAddressImpl) then) = - __$$PaymentElementBillingDetailsAddressImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? line1, - String? line2, - String? city, - String? state, - String? country, - @JsonKey(name: 'postal_code') String? postalCode}); } -/// @nodoc -class __$$PaymentElementBillingDetailsAddressImplCopyWithImpl<$Res> - extends _$ShippingDetailsAddressCopyWithImpl<$Res, - _$PaymentElementBillingDetailsAddressImpl> - implements _$$PaymentElementBillingDetailsAddressImplCopyWith<$Res> { - __$$PaymentElementBillingDetailsAddressImplCopyWithImpl( - _$PaymentElementBillingDetailsAddressImpl _value, - $Res Function(_$PaymentElementBillingDetailsAddressImpl) _then) - : super(_value, _then); - - /// Create a copy of ShippingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = freezed, - Object? line2 = freezed, - Object? city = freezed, - Object? state = freezed, - Object? country = freezed, - Object? postalCode = freezed, - }) { - return _then(_$PaymentElementBillingDetailsAddressImpl( - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + +/// Adds pattern-matching-related methods to [ShippingDetailsAddress]. +extension ShippingDetailsAddressPatterns on ShippingDetailsAddress { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementBillingDetailsAddress value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementBillingDetailsAddress value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementBillingDetailsAddress value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode) $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress(): +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() -class _$PaymentElementBillingDetailsAddressImpl - implements _PaymentElementBillingDetailsAddress { - const _$PaymentElementBillingDetailsAddressImpl( - {this.line1, - this.line2, - this.city, - this.state, - this.country, - @JsonKey(name: 'postal_code') this.postalCode}); - - factory _$PaymentElementBillingDetailsAddressImpl.fromJson( - Map json) => - _$$PaymentElementBillingDetailsAddressImplFromJson(json); - - /// Address line 1 (e.g., street, PO Box, or company name). - @override - final String? line1; - - /// Address line 2 (e.g., apartment, suite, unit, or building). - @override - final String? line2; - - /// City, district, suburb, town, or village. - @override - final String? city; - - /// State, county, province, or region. - @override - final String? state; - - /// Two-letter country code (ISO 3166-1 alpha-2). - @override - final String? country; - - /// ZIP or postal code. - @override - @JsonKey(name: 'postal_code') - final String? postalCode; - - @override - String toString() { - return 'ShippingDetailsAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementBillingDetailsAddressImpl && - (identical(other.line1, line1) || other.line1 == line1) && - (identical(other.line2, line2) || other.line2 == line2) && - (identical(other.city, city) || other.city == city) && - (identical(other.state, state) || other.state == state) && - (identical(other.country, country) || other.country == country) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, line1, line2, city, state, country, postalCode); - - /// Create a copy of ShippingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementBillingDetailsAddressImplCopyWith< - _$PaymentElementBillingDetailsAddressImpl> - get copyWith => __$$PaymentElementBillingDetailsAddressImplCopyWithImpl< - _$PaymentElementBillingDetailsAddressImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementBillingDetailsAddressImplToJson( - this, - ); - } -} - -abstract class _PaymentElementBillingDetailsAddress - implements ShippingDetailsAddress { - const factory _PaymentElementBillingDetailsAddress( - {final String? line1, - final String? line2, - final String? city, - final String? state, - final String? country, - @JsonKey(name: 'postal_code') final String? postalCode}) = - _$PaymentElementBillingDetailsAddressImpl; - - factory _PaymentElementBillingDetailsAddress.fromJson( - Map json) = - _$PaymentElementBillingDetailsAddressImpl.fromJson; - - /// Address line 1 (e.g., street, PO Box, or company name). - @override - String? get line1; - - /// Address line 2 (e.g., apartment, suite, unit, or building). - @override - String? get line2; - - /// City, district, suburb, town, or village. - @override - String? get city; - - /// State, county, province, or region. - @override - String? get state; - - /// Two-letter country code (ISO 3166-1 alpha-2). - @override - String? get country; - - /// ZIP or postal code. - @override - @JsonKey(name: 'postal_code') - String? get postalCode; - - /// Create a copy of ShippingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementBillingDetailsAddressImplCopyWith< - _$PaymentElementBillingDetailsAddressImpl> - get copyWith => throw _privateConstructorUsedError; + +class _PaymentElementBillingDetailsAddress implements ShippingDetailsAddress { + const _PaymentElementBillingDetailsAddress({this.line1, this.line2, this.city, this.state, this.country, @JsonKey(name: 'postal_code') this.postalCode}); + factory _PaymentElementBillingDetailsAddress.fromJson(Map json) => _$PaymentElementBillingDetailsAddressFromJson(json); + +/// Address line 1 (e.g., street, PO Box, or company name). +@override final String? line1; +/// Address line 2 (e.g., apartment, suite, unit, or building). +@override final String? line2; +/// City, district, suburb, town, or village. +@override final String? city; +/// State, county, province, or region. +@override final String? state; +/// Two-letter country code (ISO 3166-1 alpha-2). +@override final String? country; +/// ZIP or postal code. +@override@JsonKey(name: 'postal_code') final String? postalCode; + +/// Create a copy of ShippingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementBillingDetailsAddressCopyWith<_PaymentElementBillingDetailsAddress> get copyWith => __$PaymentElementBillingDetailsAddressCopyWithImpl<_PaymentElementBillingDetailsAddress>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementBillingDetailsAddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementBillingDetailsAddress&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); + +@override +String toString() { + return 'ShippingDetailsAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +} + + } + +/// @nodoc +abstract mixin class _$PaymentElementBillingDetailsAddressCopyWith<$Res> implements $ShippingDetailsAddressCopyWith<$Res> { + factory _$PaymentElementBillingDetailsAddressCopyWith(_PaymentElementBillingDetailsAddress value, $Res Function(_PaymentElementBillingDetailsAddress) _then) = __$PaymentElementBillingDetailsAddressCopyWithImpl; +@override @useResult +$Res call({ + String? line1, String? line2, String? city, String? state, String? country,@JsonKey(name: 'postal_code') String? postalCode +}); + + + + +} +/// @nodoc +class __$PaymentElementBillingDetailsAddressCopyWithImpl<$Res> + implements _$PaymentElementBillingDetailsAddressCopyWith<$Res> { + __$PaymentElementBillingDetailsAddressCopyWithImpl(this._self, this._then); + + final _PaymentElementBillingDetailsAddress _self; + final $Res Function(_PaymentElementBillingDetailsAddress) _then; + +/// Create a copy of ShippingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? line1 = freezed,Object? line2 = freezed,Object? city = freezed,Object? state = freezed,Object? country = freezed,Object? postalCode = freezed,}) { + return _then(_PaymentElementBillingDetailsAddress( +line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/core/shipping_details.g.dart b/packages/stripe_js/lib/src/api/core/shipping_details.g.dart index 24b77611a..61ff5e76b 100644 --- a/packages/stripe_js/lib/src/api/core/shipping_details.g.dart +++ b/packages/stripe_js/lib/src/api/core/shipping_details.g.dart @@ -6,64 +6,47 @@ part of 'shipping_details.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentElementChangeEventImpl _$$PaymentElementChangeEventImplFromJson( - Map json) => - _$PaymentElementChangeEventImpl( +_PaymentElementChangeEvent _$PaymentElementChangeEventFromJson(Map json) => + _PaymentElementChangeEvent( address: json['address'] == null ? const ShippingDetailsAddress() : ShippingDetailsAddress.fromJson( - Map.from(json['address'] as Map)), + Map.from(json['address'] as Map), + ), carrier: json['carrier'] as String?, name: json['name'] as String?, phone: json['phone'] as String?, trackingNumber: json['tracking_number'] as String?, ); -Map _$$PaymentElementChangeEventImplToJson( - _$PaymentElementChangeEventImpl instance) { - final val = { - 'address': instance.address.toJson(), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('carrier', instance.carrier); - writeNotNull('name', instance.name); - writeNotNull('phone', instance.phone); - writeNotNull('tracking_number', instance.trackingNumber); - return val; -} - -_$PaymentElementBillingDetailsAddressImpl - _$$PaymentElementBillingDetailsAddressImplFromJson(Map json) => - _$PaymentElementBillingDetailsAddressImpl( - line1: json['line1'] as String?, - line2: json['line2'] as String?, - city: json['city'] as String?, - state: json['state'] as String?, - country: json['country'] as String?, - postalCode: json['postal_code'] as String?, - ); - -Map _$$PaymentElementBillingDetailsAddressImplToJson( - _$PaymentElementBillingDetailsAddressImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +Map _$PaymentElementChangeEventToJson( + _PaymentElementChangeEvent instance, +) => { + 'address': instance.address.toJson(), + 'carrier': ?instance.carrier, + 'name': ?instance.name, + 'phone': ?instance.phone, + 'tracking_number': ?instance.trackingNumber, +}; + +_PaymentElementBillingDetailsAddress +_$PaymentElementBillingDetailsAddressFromJson(Map json) => + _PaymentElementBillingDetailsAddress( + line1: json['line1'] as String?, + line2: json['line2'] as String?, + city: json['city'] as String?, + state: json['state'] as String?, + country: json['country'] as String?, + postalCode: json['postal_code'] as String?, + ); - writeNotNull('line1', instance.line1); - writeNotNull('line2', instance.line2); - writeNotNull('city', instance.city); - writeNotNull('state', instance.state); - writeNotNull('country', instance.country); - writeNotNull('postal_code', instance.postalCode); - return val; -} +Map _$PaymentElementBillingDetailsAddressToJson( + _PaymentElementBillingDetailsAddress instance, +) => { + 'line1': ?instance.line1, + 'line2': ?instance.line2, + 'city': ?instance.city, + 'state': ?instance.state, + 'country': ?instance.country, + 'postal_code': ?instance.postalCode, +}; diff --git a/packages/stripe_js/lib/src/api/elements/card_element_change_event.dart b/packages/stripe_js/lib/src/api/elements/card_element_change_event.dart index c78ca9e1e..264dc21d0 100644 --- a/packages/stripe_js/lib/src/api/elements/card_element_change_event.dart +++ b/packages/stripe_js/lib/src/api/elements/card_element_change_event.dart @@ -5,7 +5,7 @@ part 'card_element_change_event.freezed.dart'; part 'card_element_change_event.g.dart'; @freezed -class CardElementChangeEvent with _$CardElementChangeEvent { +abstract class CardElementChangeEvent with _$CardElementChangeEvent { const factory CardElementChangeEvent({ required String elementType, required bool empty, @@ -20,10 +20,9 @@ class CardElementChangeEvent with _$CardElementChangeEvent { } @freezed -class CardElementChangeEventValue with _$CardElementChangeEventValue { - const factory CardElementChangeEventValue({ - required String? postalCode, - }) = _CardElementChangeEventValue; +abstract class CardElementChangeEventValue with _$CardElementChangeEventValue { + const factory CardElementChangeEventValue({required String? postalCode}) = + _CardElementChangeEventValue; factory CardElementChangeEventValue.fromJson(Map json) => _$CardElementChangeEventValueFromJson(json); diff --git a/packages/stripe_js/lib/src/api/elements/card_element_change_event.freezed.dart b/packages/stripe_js/lib/src/api/elements/card_element_change_event.freezed.dart index 0821de34d..9bf3f8892 100644 --- a/packages/stripe_js/lib/src/api/elements/card_element_change_event.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/card_element_change_event.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,467 +9,595 @@ part of 'card_element_change_event.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CardElementChangeEvent _$CardElementChangeEventFromJson( - Map json) { - return _CardElementChangeEvent.fromJson(json); -} - /// @nodoc mixin _$CardElementChangeEvent { - String get elementType => throw _privateConstructorUsedError; - bool get empty => throw _privateConstructorUsedError; - bool get complete => throw _privateConstructorUsedError; - StripeError? get error => throw _privateConstructorUsedError; - String get brand => throw _privateConstructorUsedError; - CardElementChangeEventValue? get value => throw _privateConstructorUsedError; + + String get elementType; bool get empty; bool get complete; StripeError? get error; String get brand; CardElementChangeEventValue? get value; +/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardElementChangeEventCopyWith get copyWith => _$CardElementChangeEventCopyWithImpl(this as CardElementChangeEvent, _$identity); /// Serializes this CardElementChangeEvent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardElementChangeEventCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardElementChangeEvent&&(identical(other.elementType, elementType) || other.elementType == elementType)&&(identical(other.empty, empty) || other.empty == empty)&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.error, error) || other.error == error)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.value, value) || other.value == value)); } -/// @nodoc -abstract class $CardElementChangeEventCopyWith<$Res> { - factory $CardElementChangeEventCopyWith(CardElementChangeEvent value, - $Res Function(CardElementChangeEvent) then) = - _$CardElementChangeEventCopyWithImpl<$Res, CardElementChangeEvent>; - @useResult - $Res call( - {String elementType, - bool empty, - bool complete, - StripeError? error, - String brand, - CardElementChangeEventValue? value}); - - $StripeErrorCopyWith<$Res>? get error; - $CardElementChangeEventValueCopyWith<$Res>? get value; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elementType,empty,complete,error,brand,value); + +@override +String toString() { + return 'CardElementChangeEvent(elementType: $elementType, empty: $empty, complete: $complete, error: $error, brand: $brand, value: $value)'; +} + + } /// @nodoc -class _$CardElementChangeEventCopyWithImpl<$Res, - $Val extends CardElementChangeEvent> +abstract mixin class $CardElementChangeEventCopyWith<$Res> { + factory $CardElementChangeEventCopyWith(CardElementChangeEvent value, $Res Function(CardElementChangeEvent) _then) = _$CardElementChangeEventCopyWithImpl; +@useResult +$Res call({ + String elementType, bool empty, bool complete, StripeError? error, String brand, CardElementChangeEventValue? value +}); + + +$StripeErrorCopyWith<$Res>? get error;$CardElementChangeEventValueCopyWith<$Res>? get value; + +} +/// @nodoc +class _$CardElementChangeEventCopyWithImpl<$Res> implements $CardElementChangeEventCopyWith<$Res> { - _$CardElementChangeEventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elementType = null, - Object? empty = null, - Object? complete = null, - Object? error = freezed, - Object? brand = null, - Object? value = freezed, - }) { - return _then(_value.copyWith( - elementType: null == elementType - ? _value.elementType - : elementType // ignore: cast_nullable_to_non_nullable - as String, - empty: null == empty - ? _value.empty - : empty // ignore: cast_nullable_to_non_nullable - as bool, - complete: null == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as bool, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - brand: null == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as CardElementChangeEventValue?, - ) as $Val); + _$CardElementChangeEventCopyWithImpl(this._self, this._then); + + final CardElementChangeEvent _self; + final $Res Function(CardElementChangeEvent) _then; + +/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? elementType = null,Object? empty = null,Object? complete = null,Object? error = freezed,Object? brand = null,Object? value = freezed,}) { + return _then(_self.copyWith( +elementType: null == elementType ? _self.elementType : elementType // ignore: cast_nullable_to_non_nullable +as String,empty: null == empty ? _self.empty : empty // ignore: cast_nullable_to_non_nullable +as bool,complete: null == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as bool,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?,brand: null == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as CardElementChangeEventValue?, + )); +} +/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith<$Res>? get error { - if (_value.error == null) { - return null; - } - - return $StripeErrorCopyWith<$Res>(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +}/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardElementChangeEventValueCopyWith<$Res>? get value { + if (_self.value == null) { + return null; } - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardElementChangeEventValueCopyWith<$Res>? get value { - if (_value.value == null) { - return null; - } - - return $CardElementChangeEventValueCopyWith<$Res>(_value.value!, (value) { - return _then(_value.copyWith(value: value) as $Val); - }); - } + return $CardElementChangeEventValueCopyWith<$Res>(_self.value!, (value) { + return _then(_self.copyWith(value: value)); + }); +} } -/// @nodoc -abstract class _$$CardElementChangeEventImplCopyWith<$Res> - implements $CardElementChangeEventCopyWith<$Res> { - factory _$$CardElementChangeEventImplCopyWith( - _$CardElementChangeEventImpl value, - $Res Function(_$CardElementChangeEventImpl) then) = - __$$CardElementChangeEventImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String elementType, - bool empty, - bool complete, - StripeError? error, - String brand, - CardElementChangeEventValue? value}); - - @override - $StripeErrorCopyWith<$Res>? get error; - @override - $CardElementChangeEventValueCopyWith<$Res>? get value; + +/// Adds pattern-matching-related methods to [CardElementChangeEvent]. +extension CardElementChangeEventPatterns on CardElementChangeEvent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardElementChangeEvent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardElementChangeEvent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardElementChangeEvent value) $default,){ +final _that = this; +switch (_that) { +case _CardElementChangeEvent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardElementChangeEvent value)? $default,){ +final _that = this; +switch (_that) { +case _CardElementChangeEvent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String elementType, bool empty, bool complete, StripeError? error, String brand, CardElementChangeEventValue? value)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardElementChangeEvent() when $default != null: +return $default(_that.elementType,_that.empty,_that.complete,_that.error,_that.brand,_that.value);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String elementType, bool empty, bool complete, StripeError? error, String brand, CardElementChangeEventValue? value) $default,) {final _that = this; +switch (_that) { +case _CardElementChangeEvent(): +return $default(_that.elementType,_that.empty,_that.complete,_that.error,_that.brand,_that.value);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String elementType, bool empty, bool complete, StripeError? error, String brand, CardElementChangeEventValue? value)? $default,) {final _that = this; +switch (_that) { +case _CardElementChangeEvent() when $default != null: +return $default(_that.elementType,_that.empty,_that.complete,_that.error,_that.brand,_that.value);case _: + return null; + +} } -/// @nodoc -class __$$CardElementChangeEventImplCopyWithImpl<$Res> - extends _$CardElementChangeEventCopyWithImpl<$Res, - _$CardElementChangeEventImpl> - implements _$$CardElementChangeEventImplCopyWith<$Res> { - __$$CardElementChangeEventImplCopyWithImpl( - _$CardElementChangeEventImpl _value, - $Res Function(_$CardElementChangeEventImpl) _then) - : super(_value, _then); - - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elementType = null, - Object? empty = null, - Object? complete = null, - Object? error = freezed, - Object? brand = null, - Object? value = freezed, - }) { - return _then(_$CardElementChangeEventImpl( - elementType: null == elementType - ? _value.elementType - : elementType // ignore: cast_nullable_to_non_nullable - as String, - empty: null == empty - ? _value.empty - : empty // ignore: cast_nullable_to_non_nullable - as bool, - complete: null == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as bool, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - brand: null == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as CardElementChangeEventValue?, - )); - } } /// @nodoc @JsonSerializable() -class _$CardElementChangeEventImpl implements _CardElementChangeEvent { - const _$CardElementChangeEventImpl( - {required this.elementType, - required this.empty, - required this.complete, - this.error, - required this.brand, - this.value}); - - factory _$CardElementChangeEventImpl.fromJson(Map json) => - _$$CardElementChangeEventImplFromJson(json); - - @override - final String elementType; - @override - final bool empty; - @override - final bool complete; - @override - final StripeError? error; - @override - final String brand; - @override - final CardElementChangeEventValue? value; - - @override - String toString() { - return 'CardElementChangeEvent(elementType: $elementType, empty: $empty, complete: $complete, error: $error, brand: $brand, value: $value)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardElementChangeEventImpl && - (identical(other.elementType, elementType) || - other.elementType == elementType) && - (identical(other.empty, empty) || other.empty == empty) && - (identical(other.complete, complete) || - other.complete == complete) && - (identical(other.error, error) || other.error == error) && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.value, value) || other.value == value)); +class _CardElementChangeEvent implements CardElementChangeEvent { + const _CardElementChangeEvent({required this.elementType, required this.empty, required this.complete, this.error, required this.brand, this.value}); + factory _CardElementChangeEvent.fromJson(Map json) => _$CardElementChangeEventFromJson(json); + +@override final String elementType; +@override final bool empty; +@override final bool complete; +@override final StripeError? error; +@override final String brand; +@override final CardElementChangeEventValue? value; + +/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardElementChangeEventCopyWith<_CardElementChangeEvent> get copyWith => __$CardElementChangeEventCopyWithImpl<_CardElementChangeEvent>(this, _$identity); + +@override +Map toJson() { + return _$CardElementChangeEventToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardElementChangeEvent&&(identical(other.elementType, elementType) || other.elementType == elementType)&&(identical(other.empty, empty) || other.empty == empty)&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.error, error) || other.error == error)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.value, value) || other.value == value)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elementType,empty,complete,error,brand,value); + +@override +String toString() { + return 'CardElementChangeEvent(elementType: $elementType, empty: $empty, complete: $complete, error: $error, brand: $brand, value: $value)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardElementChangeEventCopyWith<$Res> implements $CardElementChangeEventCopyWith<$Res> { + factory _$CardElementChangeEventCopyWith(_CardElementChangeEvent value, $Res Function(_CardElementChangeEvent) _then) = __$CardElementChangeEventCopyWithImpl; +@override @useResult +$Res call({ + String elementType, bool empty, bool complete, StripeError? error, String brand, CardElementChangeEventValue? value +}); + + +@override $StripeErrorCopyWith<$Res>? get error;@override $CardElementChangeEventValueCopyWith<$Res>? get value; + +} +/// @nodoc +class __$CardElementChangeEventCopyWithImpl<$Res> + implements _$CardElementChangeEventCopyWith<$Res> { + __$CardElementChangeEventCopyWithImpl(this._self, this._then); + + final _CardElementChangeEvent _self; + final $Res Function(_CardElementChangeEvent) _then; + +/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? elementType = null,Object? empty = null,Object? complete = null,Object? error = freezed,Object? brand = null,Object? value = freezed,}) { + return _then(_CardElementChangeEvent( +elementType: null == elementType ? _self.elementType : elementType // ignore: cast_nullable_to_non_nullable +as String,empty: null == empty ? _self.empty : empty // ignore: cast_nullable_to_non_nullable +as bool,complete: null == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as bool,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?,brand: null == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as CardElementChangeEventValue?, + )); +} + +/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, elementType, empty, complete, error, brand, value); - - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardElementChangeEventImplCopyWith<_$CardElementChangeEventImpl> - get copyWith => __$$CardElementChangeEventImplCopyWithImpl< - _$CardElementChangeEventImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardElementChangeEventImplToJson( - this, - ); + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +}/// Create a copy of CardElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardElementChangeEventValueCopyWith<$Res>? get value { + if (_self.value == null) { + return null; } -} -abstract class _CardElementChangeEvent implements CardElementChangeEvent { - const factory _CardElementChangeEvent( - {required final String elementType, - required final bool empty, - required final bool complete, - final StripeError? error, - required final String brand, - final CardElementChangeEventValue? value}) = _$CardElementChangeEventImpl; - - factory _CardElementChangeEvent.fromJson(Map json) = - _$CardElementChangeEventImpl.fromJson; - - @override - String get elementType; - @override - bool get empty; - @override - bool get complete; - @override - StripeError? get error; - @override - String get brand; - @override - CardElementChangeEventValue? get value; - - /// Create a copy of CardElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardElementChangeEventImplCopyWith<_$CardElementChangeEventImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CardElementChangeEventValue _$CardElementChangeEventValueFromJson( - Map json) { - return _CardElementChangeEventValue.fromJson(json); + return $CardElementChangeEventValueCopyWith<$Res>(_self.value!, (value) { + return _then(_self.copyWith(value: value)); + }); } +} + /// @nodoc mixin _$CardElementChangeEventValue { - String? get postalCode => throw _privateConstructorUsedError; + + String? get postalCode; +/// Create a copy of CardElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardElementChangeEventValueCopyWith get copyWith => _$CardElementChangeEventValueCopyWithImpl(this as CardElementChangeEventValue, _$identity); /// Serializes this CardElementChangeEventValue to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CardElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardElementChangeEventValueCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardElementChangeEventValue&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); } -/// @nodoc -abstract class $CardElementChangeEventValueCopyWith<$Res> { - factory $CardElementChangeEventValueCopyWith( - CardElementChangeEventValue value, - $Res Function(CardElementChangeEventValue) then) = - _$CardElementChangeEventValueCopyWithImpl<$Res, - CardElementChangeEventValue>; - @useResult - $Res call({String? postalCode}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,postalCode); + +@override +String toString() { + return 'CardElementChangeEventValue(postalCode: $postalCode)'; } -/// @nodoc -class _$CardElementChangeEventValueCopyWithImpl<$Res, - $Val extends CardElementChangeEventValue> - implements $CardElementChangeEventValueCopyWith<$Res> { - _$CardElementChangeEventValueCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? postalCode = freezed, - }) { - return _then(_value.copyWith( - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardElementChangeEventValueImplCopyWith<$Res> +abstract mixin class $CardElementChangeEventValueCopyWith<$Res> { + factory $CardElementChangeEventValueCopyWith(CardElementChangeEventValue value, $Res Function(CardElementChangeEventValue) _then) = _$CardElementChangeEventValueCopyWithImpl; +@useResult +$Res call({ + String? postalCode +}); + + + + +} +/// @nodoc +class _$CardElementChangeEventValueCopyWithImpl<$Res> implements $CardElementChangeEventValueCopyWith<$Res> { - factory _$$CardElementChangeEventValueImplCopyWith( - _$CardElementChangeEventValueImpl value, - $Res Function(_$CardElementChangeEventValueImpl) then) = - __$$CardElementChangeEventValueImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? postalCode}); + _$CardElementChangeEventValueCopyWithImpl(this._self, this._then); + + final CardElementChangeEventValue _self; + final $Res Function(CardElementChangeEventValue) _then; + +/// Create a copy of CardElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? postalCode = freezed,}) { + return _then(_self.copyWith( +postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardElementChangeEventValue]. +extension CardElementChangeEventValuePatterns on CardElementChangeEventValue { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardElementChangeEventValue value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardElementChangeEventValue() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardElementChangeEventValue value) $default,){ +final _that = this; +switch (_that) { +case _CardElementChangeEventValue(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardElementChangeEventValue value)? $default,){ +final _that = this; +switch (_that) { +case _CardElementChangeEventValue() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardElementChangeEventValue() when $default != null: +return $default(_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? postalCode) $default,) {final _that = this; +switch (_that) { +case _CardElementChangeEventValue(): +return $default(_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _CardElementChangeEventValue() when $default != null: +return $default(_that.postalCode);case _: + return null; + +} } -/// @nodoc -class __$$CardElementChangeEventValueImplCopyWithImpl<$Res> - extends _$CardElementChangeEventValueCopyWithImpl<$Res, - _$CardElementChangeEventValueImpl> - implements _$$CardElementChangeEventValueImplCopyWith<$Res> { - __$$CardElementChangeEventValueImplCopyWithImpl( - _$CardElementChangeEventValueImpl _value, - $Res Function(_$CardElementChangeEventValueImpl) _then) - : super(_value, _then); - - /// Create a copy of CardElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? postalCode = freezed, - }) { - return _then(_$CardElementChangeEventValueImpl( - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$CardElementChangeEventValueImpl - implements _CardElementChangeEventValue { - const _$CardElementChangeEventValueImpl({required this.postalCode}); - factory _$CardElementChangeEventValueImpl.fromJson( - Map json) => - _$$CardElementChangeEventValueImplFromJson(json); +class _CardElementChangeEventValue implements CardElementChangeEventValue { + const _CardElementChangeEventValue({required this.postalCode}); + factory _CardElementChangeEventValue.fromJson(Map json) => _$CardElementChangeEventValueFromJson(json); - @override - final String? postalCode; +@override final String? postalCode; - @override - String toString() { - return 'CardElementChangeEventValue(postalCode: $postalCode)'; - } +/// Create a copy of CardElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardElementChangeEventValueCopyWith<_CardElementChangeEventValue> get copyWith => __$CardElementChangeEventValueCopyWithImpl<_CardElementChangeEventValue>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardElementChangeEventValueImpl && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode)); - } +@override +Map toJson() { + return _$CardElementChangeEventValueToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, postalCode); - - /// Create a copy of CardElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardElementChangeEventValueImplCopyWith<_$CardElementChangeEventValueImpl> - get copyWith => __$$CardElementChangeEventValueImplCopyWithImpl< - _$CardElementChangeEventValueImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardElementChangeEventValueImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardElementChangeEventValue&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); } -abstract class _CardElementChangeEventValue - implements CardElementChangeEventValue { - const factory _CardElementChangeEventValue( - {required final String? postalCode}) = _$CardElementChangeEventValueImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,postalCode); - factory _CardElementChangeEventValue.fromJson(Map json) = - _$CardElementChangeEventValueImpl.fromJson; +@override +String toString() { + return 'CardElementChangeEventValue(postalCode: $postalCode)'; +} - @override - String? get postalCode; - /// Create a copy of CardElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardElementChangeEventValueImplCopyWith<_$CardElementChangeEventValueImpl> - get copyWith => throw _privateConstructorUsedError; } + +/// @nodoc +abstract mixin class _$CardElementChangeEventValueCopyWith<$Res> implements $CardElementChangeEventValueCopyWith<$Res> { + factory _$CardElementChangeEventValueCopyWith(_CardElementChangeEventValue value, $Res Function(_CardElementChangeEventValue) _then) = __$CardElementChangeEventValueCopyWithImpl; +@override @useResult +$Res call({ + String? postalCode +}); + + + + +} +/// @nodoc +class __$CardElementChangeEventValueCopyWithImpl<$Res> + implements _$CardElementChangeEventValueCopyWith<$Res> { + __$CardElementChangeEventValueCopyWithImpl(this._self, this._then); + + final _CardElementChangeEventValue _self; + final $Res Function(_CardElementChangeEventValue) _then; + +/// Create a copy of CardElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? postalCode = freezed,}) { + return _then(_CardElementChangeEventValue( +postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/card_element_change_event.g.dart b/packages/stripe_js/lib/src/api/elements/card_element_change_event.g.dart index a91faf06b..ed9f5375e 100644 --- a/packages/stripe_js/lib/src/api/elements/card_element_change_event.g.dart +++ b/packages/stripe_js/lib/src/api/elements/card_element_change_event.g.dart @@ -6,58 +6,38 @@ part of 'card_element_change_event.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CardElementChangeEventImpl _$$CardElementChangeEventImplFromJson(Map json) => - _$CardElementChangeEventImpl( +_CardElementChangeEvent _$CardElementChangeEventFromJson(Map json) => + _CardElementChangeEvent( elementType: json['elementType'] as String, empty: json['empty'] as bool, complete: json['complete'] as bool, error: json['error'] == null ? null : StripeError.fromJson( - Map.from(json['error'] as Map)), + Map.from(json['error'] as Map), + ), brand: json['brand'] as String, value: json['value'] == null ? null : CardElementChangeEventValue.fromJson( - Map.from(json['value'] as Map)), + Map.from(json['value'] as Map), + ), ); -Map _$$CardElementChangeEventImplToJson( - _$CardElementChangeEventImpl instance) { - final val = { - 'elementType': instance.elementType, - 'empty': instance.empty, - 'complete': instance.complete, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('error', instance.error?.toJson()); - val['brand'] = instance.brand; - writeNotNull('value', instance.value?.toJson()); - return val; -} - -_$CardElementChangeEventValueImpl _$$CardElementChangeEventValueImplFromJson( - Map json) => - _$CardElementChangeEventValueImpl( - postalCode: json['postalCode'] as String?, - ); - -Map _$$CardElementChangeEventValueImplToJson( - _$CardElementChangeEventValueImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('postalCode', instance.postalCode); - return val; -} +Map _$CardElementChangeEventToJson( + _CardElementChangeEvent instance, +) => { + 'elementType': instance.elementType, + 'empty': instance.empty, + 'complete': instance.complete, + 'error': ?instance.error?.toJson(), + 'brand': instance.brand, + 'value': ?instance.value?.toJson(), +}; + +_CardElementChangeEventValue _$CardElementChangeEventValueFromJson(Map json) => + _CardElementChangeEventValue(postalCode: json['postalCode'] as String?); + +Map _$CardElementChangeEventValueToJson( + _CardElementChangeEventValue instance, +) => {'postalCode': ?instance.postalCode}; diff --git a/packages/stripe_js/lib/src/api/elements/card_element_options.dart b/packages/stripe_js/lib/src/api/elements/card_element_options.dart index 14db36cb2..893dfbe49 100644 --- a/packages/stripe_js/lib/src/api/elements/card_element_options.dart +++ b/packages/stripe_js/lib/src/api/elements/card_element_options.dart @@ -6,11 +6,11 @@ part 'card_element_options.g.dart'; enum CardElementIconStyle { solid, @JsonKey(name: 'default') - defaultStyle + defaultStyle, } @freezed -class CardElementOptions with _$CardElementOptions { +abstract class CardElementOptions with _$CardElementOptions { const factory CardElementOptions({ /// Set custom class names on the container DOM element when the /// Stripe element is in a particular state. @@ -53,7 +53,7 @@ class CardElementOptions with _$CardElementOptions { //} @freezed -class CardElementClasses with _$CardElementClasses { +abstract class CardElementClasses with _$CardElementClasses { const factory CardElementClasses({ /// The base class applied to the container. Defaults to StripeElement. String? base, diff --git a/packages/stripe_js/lib/src/api/elements/card_element_options.freezed.dart b/packages/stripe_js/lib/src/api/elements/card_element_options.freezed.dart index 914c439ee..af234c9cd 100644 --- a/packages/stripe_js/lib/src/api/elements/card_element_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/card_element_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,626 +9,617 @@ part of 'card_element_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CardElementOptions _$CardElementOptionsFromJson(Map json) { - return _CardElementOptions.fromJson(json); -} - /// @nodoc mixin _$CardElementOptions { - /// Set custom class names on the container DOM element when the - /// Stripe element is in a particular state. - CardElementClasses? get classes => throw _privateConstructorUsedError; - dynamic get style => throw _privateConstructorUsedError; - String? get value => throw _privateConstructorUsedError; - bool? get hidePostalCode => throw _privateConstructorUsedError; - CardElementIconStyle? get iconStyle => throw _privateConstructorUsedError; - bool? get hideIcon => throw _privateConstructorUsedError; - bool? get disabled => throw _privateConstructorUsedError; + +/// Set custom class names on the container DOM element when the +/// Stripe element is in a particular state. + CardElementClasses? get classes; dynamic get style; String? get value; bool? get hidePostalCode; CardElementIconStyle? get iconStyle; bool? get hideIcon; bool? get disabled; +/// Create a copy of CardElementOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardElementOptionsCopyWith get copyWith => _$CardElementOptionsCopyWithImpl(this as CardElementOptions, _$identity); /// Serializes this CardElementOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CardElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardElementOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardElementOptions&&(identical(other.classes, classes) || other.classes == classes)&&const DeepCollectionEquality().equals(other.style, style)&&(identical(other.value, value) || other.value == value)&&(identical(other.hidePostalCode, hidePostalCode) || other.hidePostalCode == hidePostalCode)&&(identical(other.iconStyle, iconStyle) || other.iconStyle == iconStyle)&&(identical(other.hideIcon, hideIcon) || other.hideIcon == hideIcon)&&(identical(other.disabled, disabled) || other.disabled == disabled)); } -/// @nodoc -abstract class $CardElementOptionsCopyWith<$Res> { - factory $CardElementOptionsCopyWith( - CardElementOptions value, $Res Function(CardElementOptions) then) = - _$CardElementOptionsCopyWithImpl<$Res, CardElementOptions>; - @useResult - $Res call( - {CardElementClasses? classes, - dynamic style, - String? value, - bool? hidePostalCode, - CardElementIconStyle? iconStyle, - bool? hideIcon, - bool? disabled}); - - $CardElementClassesCopyWith<$Res>? get classes; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,classes,const DeepCollectionEquality().hash(style),value,hidePostalCode,iconStyle,hideIcon,disabled); + +@override +String toString() { + return 'CardElementOptions(classes: $classes, style: $style, value: $value, hidePostalCode: $hidePostalCode, iconStyle: $iconStyle, hideIcon: $hideIcon, disabled: $disabled)'; +} + + } /// @nodoc -class _$CardElementOptionsCopyWithImpl<$Res, $Val extends CardElementOptions> +abstract mixin class $CardElementOptionsCopyWith<$Res> { + factory $CardElementOptionsCopyWith(CardElementOptions value, $Res Function(CardElementOptions) _then) = _$CardElementOptionsCopyWithImpl; +@useResult +$Res call({ + CardElementClasses? classes, dynamic style, String? value, bool? hidePostalCode, CardElementIconStyle? iconStyle, bool? hideIcon, bool? disabled +}); + + +$CardElementClassesCopyWith<$Res>? get classes; + +} +/// @nodoc +class _$CardElementOptionsCopyWithImpl<$Res> implements $CardElementOptionsCopyWith<$Res> { - _$CardElementOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? classes = freezed, - Object? style = freezed, - Object? value = freezed, - Object? hidePostalCode = freezed, - Object? iconStyle = freezed, - Object? hideIcon = freezed, - Object? disabled = freezed, - }) { - return _then(_value.copyWith( - classes: freezed == classes - ? _value.classes - : classes // ignore: cast_nullable_to_non_nullable - as CardElementClasses?, - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as dynamic, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as String?, - hidePostalCode: freezed == hidePostalCode - ? _value.hidePostalCode - : hidePostalCode // ignore: cast_nullable_to_non_nullable - as bool?, - iconStyle: freezed == iconStyle - ? _value.iconStyle - : iconStyle // ignore: cast_nullable_to_non_nullable - as CardElementIconStyle?, - hideIcon: freezed == hideIcon - ? _value.hideIcon - : hideIcon // ignore: cast_nullable_to_non_nullable - as bool?, - disabled: freezed == disabled - ? _value.disabled - : disabled // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); + _$CardElementOptionsCopyWithImpl(this._self, this._then); + + final CardElementOptions _self; + final $Res Function(CardElementOptions) _then; + +/// Create a copy of CardElementOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? classes = freezed,Object? style = freezed,Object? value = freezed,Object? hidePostalCode = freezed,Object? iconStyle = freezed,Object? hideIcon = freezed,Object? disabled = freezed,}) { + return _then(_self.copyWith( +classes: freezed == classes ? _self.classes : classes // ignore: cast_nullable_to_non_nullable +as CardElementClasses?,style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as dynamic,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as String?,hidePostalCode: freezed == hidePostalCode ? _self.hidePostalCode : hidePostalCode // ignore: cast_nullable_to_non_nullable +as bool?,iconStyle: freezed == iconStyle ? _self.iconStyle : iconStyle // ignore: cast_nullable_to_non_nullable +as CardElementIconStyle?,hideIcon: freezed == hideIcon ? _self.hideIcon : hideIcon // ignore: cast_nullable_to_non_nullable +as bool?,disabled: freezed == disabled ? _self.disabled : disabled // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} +/// Create a copy of CardElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardElementClassesCopyWith<$Res>? get classes { + if (_self.classes == null) { + return null; } - /// Create a copy of CardElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardElementClassesCopyWith<$Res>? get classes { - if (_value.classes == null) { - return null; - } - - return $CardElementClassesCopyWith<$Res>(_value.classes!, (value) { - return _then(_value.copyWith(classes: value) as $Val); - }); - } + return $CardElementClassesCopyWith<$Res>(_self.classes!, (value) { + return _then(_self.copyWith(classes: value)); + }); +} } -/// @nodoc -abstract class _$$CardElementOptionsImplCopyWith<$Res> - implements $CardElementOptionsCopyWith<$Res> { - factory _$$CardElementOptionsImplCopyWith(_$CardElementOptionsImpl value, - $Res Function(_$CardElementOptionsImpl) then) = - __$$CardElementOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {CardElementClasses? classes, - dynamic style, - String? value, - bool? hidePostalCode, - CardElementIconStyle? iconStyle, - bool? hideIcon, - bool? disabled}); - - @override - $CardElementClassesCopyWith<$Res>? get classes; + +/// Adds pattern-matching-related methods to [CardElementOptions]. +extension CardElementOptionsPatterns on CardElementOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardElementOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardElementOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardElementOptions value) $default,){ +final _that = this; +switch (_that) { +case _CardElementOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardElementOptions value)? $default,){ +final _that = this; +switch (_that) { +case _CardElementOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( CardElementClasses? classes, dynamic style, String? value, bool? hidePostalCode, CardElementIconStyle? iconStyle, bool? hideIcon, bool? disabled)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardElementOptions() when $default != null: +return $default(_that.classes,_that.style,_that.value,_that.hidePostalCode,_that.iconStyle,_that.hideIcon,_that.disabled);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( CardElementClasses? classes, dynamic style, String? value, bool? hidePostalCode, CardElementIconStyle? iconStyle, bool? hideIcon, bool? disabled) $default,) {final _that = this; +switch (_that) { +case _CardElementOptions(): +return $default(_that.classes,_that.style,_that.value,_that.hidePostalCode,_that.iconStyle,_that.hideIcon,_that.disabled);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( CardElementClasses? classes, dynamic style, String? value, bool? hidePostalCode, CardElementIconStyle? iconStyle, bool? hideIcon, bool? disabled)? $default,) {final _that = this; +switch (_that) { +case _CardElementOptions() when $default != null: +return $default(_that.classes,_that.style,_that.value,_that.hidePostalCode,_that.iconStyle,_that.hideIcon,_that.disabled);case _: + return null; + +} } -/// @nodoc -class __$$CardElementOptionsImplCopyWithImpl<$Res> - extends _$CardElementOptionsCopyWithImpl<$Res, _$CardElementOptionsImpl> - implements _$$CardElementOptionsImplCopyWith<$Res> { - __$$CardElementOptionsImplCopyWithImpl(_$CardElementOptionsImpl _value, - $Res Function(_$CardElementOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of CardElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? classes = freezed, - Object? style = freezed, - Object? value = freezed, - Object? hidePostalCode = freezed, - Object? iconStyle = freezed, - Object? hideIcon = freezed, - Object? disabled = freezed, - }) { - return _then(_$CardElementOptionsImpl( - classes: freezed == classes - ? _value.classes - : classes // ignore: cast_nullable_to_non_nullable - as CardElementClasses?, - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as dynamic, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as String?, - hidePostalCode: freezed == hidePostalCode - ? _value.hidePostalCode - : hidePostalCode // ignore: cast_nullable_to_non_nullable - as bool?, - iconStyle: freezed == iconStyle - ? _value.iconStyle - : iconStyle // ignore: cast_nullable_to_non_nullable - as CardElementIconStyle?, - hideIcon: freezed == hideIcon - ? _value.hideIcon - : hideIcon // ignore: cast_nullable_to_non_nullable - as bool?, - disabled: freezed == disabled - ? _value.disabled - : disabled // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$CardElementOptionsImpl implements _CardElementOptions { - const _$CardElementOptionsImpl( - {this.classes, - this.style, - this.value, - this.hidePostalCode, - this.iconStyle, - this.hideIcon, - this.disabled}); - - factory _$CardElementOptionsImpl.fromJson(Map json) => - _$$CardElementOptionsImplFromJson(json); - - /// Set custom class names on the container DOM element when the - /// Stripe element is in a particular state. - @override - final CardElementClasses? classes; - @override - final dynamic style; - @override - final String? value; - @override - final bool? hidePostalCode; - @override - final CardElementIconStyle? iconStyle; - @override - final bool? hideIcon; - @override - final bool? disabled; - - @override - String toString() { - return 'CardElementOptions(classes: $classes, style: $style, value: $value, hidePostalCode: $hidePostalCode, iconStyle: $iconStyle, hideIcon: $hideIcon, disabled: $disabled)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardElementOptionsImpl && - (identical(other.classes, classes) || other.classes == classes) && - const DeepCollectionEquality().equals(other.style, style) && - (identical(other.value, value) || other.value == value) && - (identical(other.hidePostalCode, hidePostalCode) || - other.hidePostalCode == hidePostalCode) && - (identical(other.iconStyle, iconStyle) || - other.iconStyle == iconStyle) && - (identical(other.hideIcon, hideIcon) || - other.hideIcon == hideIcon) && - (identical(other.disabled, disabled) || - other.disabled == disabled)); - } +class _CardElementOptions implements CardElementOptions { + const _CardElementOptions({this.classes, this.style, this.value, this.hidePostalCode, this.iconStyle, this.hideIcon, this.disabled}); + factory _CardElementOptions.fromJson(Map json) => _$CardElementOptionsFromJson(json); + +/// Set custom class names on the container DOM element when the +/// Stripe element is in a particular state. +@override final CardElementClasses? classes; +@override final dynamic style; +@override final String? value; +@override final bool? hidePostalCode; +@override final CardElementIconStyle? iconStyle; +@override final bool? hideIcon; +@override final bool? disabled; + +/// Create a copy of CardElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardElementOptionsCopyWith<_CardElementOptions> get copyWith => __$CardElementOptionsCopyWithImpl<_CardElementOptions>(this, _$identity); + +@override +Map toJson() { + return _$CardElementOptionsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - classes, - const DeepCollectionEquality().hash(style), - value, - hidePostalCode, - iconStyle, - hideIcon, - disabled); - - /// Create a copy of CardElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardElementOptionsImplCopyWith<_$CardElementOptionsImpl> get copyWith => - __$$CardElementOptionsImplCopyWithImpl<_$CardElementOptionsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CardElementOptionsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardElementOptions&&(identical(other.classes, classes) || other.classes == classes)&&const DeepCollectionEquality().equals(other.style, style)&&(identical(other.value, value) || other.value == value)&&(identical(other.hidePostalCode, hidePostalCode) || other.hidePostalCode == hidePostalCode)&&(identical(other.iconStyle, iconStyle) || other.iconStyle == iconStyle)&&(identical(other.hideIcon, hideIcon) || other.hideIcon == hideIcon)&&(identical(other.disabled, disabled) || other.disabled == disabled)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,classes,const DeepCollectionEquality().hash(style),value,hidePostalCode,iconStyle,hideIcon,disabled); + +@override +String toString() { + return 'CardElementOptions(classes: $classes, style: $style, value: $value, hidePostalCode: $hidePostalCode, iconStyle: $iconStyle, hideIcon: $hideIcon, disabled: $disabled)'; } -abstract class _CardElementOptions implements CardElementOptions { - const factory _CardElementOptions( - {final CardElementClasses? classes, - final dynamic style, - final String? value, - final bool? hidePostalCode, - final CardElementIconStyle? iconStyle, - final bool? hideIcon, - final bool? disabled}) = _$CardElementOptionsImpl; - - factory _CardElementOptions.fromJson(Map json) = - _$CardElementOptionsImpl.fromJson; - - /// Set custom class names on the container DOM element when the - /// Stripe element is in a particular state. - @override - CardElementClasses? get classes; - @override - dynamic get style; - @override - String? get value; - @override - bool? get hidePostalCode; - @override - CardElementIconStyle? get iconStyle; - @override - bool? get hideIcon; - @override - bool? get disabled; - - /// Create a copy of CardElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardElementOptionsImplCopyWith<_$CardElementOptionsImpl> get copyWith => - throw _privateConstructorUsedError; -} - -CardElementClasses _$CardElementClassesFromJson(Map json) { - return _CardElementClasses.fromJson(json); + } /// @nodoc -mixin _$CardElementClasses { - /// The base class applied to the container. Defaults to StripeElement. - String? get base => throw _privateConstructorUsedError; +abstract mixin class _$CardElementOptionsCopyWith<$Res> implements $CardElementOptionsCopyWith<$Res> { + factory _$CardElementOptionsCopyWith(_CardElementOptions value, $Res Function(_CardElementOptions) _then) = __$CardElementOptionsCopyWithImpl; +@override @useResult +$Res call({ + CardElementClasses? classes, dynamic style, String? value, bool? hidePostalCode, CardElementIconStyle? iconStyle, bool? hideIcon, bool? disabled +}); - /// The class name to apply when the Element is complete. - /// Defaults to StripeElement--complete - String? get complete => throw _privateConstructorUsedError; - /// The class name to apply when the Element is empty. - /// Defaults to StripeElement--empty. - String? get empty => throw _privateConstructorUsedError; +@override $CardElementClassesCopyWith<$Res>? get classes; + +} +/// @nodoc +class __$CardElementOptionsCopyWithImpl<$Res> + implements _$CardElementOptionsCopyWith<$Res> { + __$CardElementOptionsCopyWithImpl(this._self, this._then); + + final _CardElementOptions _self; + final $Res Function(_CardElementOptions) _then; + +/// Create a copy of CardElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? classes = freezed,Object? style = freezed,Object? value = freezed,Object? hidePostalCode = freezed,Object? iconStyle = freezed,Object? hideIcon = freezed,Object? disabled = freezed,}) { + return _then(_CardElementOptions( +classes: freezed == classes ? _self.classes : classes // ignore: cast_nullable_to_non_nullable +as CardElementClasses?,style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as dynamic,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as String?,hidePostalCode: freezed == hidePostalCode ? _self.hidePostalCode : hidePostalCode // ignore: cast_nullable_to_non_nullable +as bool?,iconStyle: freezed == iconStyle ? _self.iconStyle : iconStyle // ignore: cast_nullable_to_non_nullable +as CardElementIconStyle?,hideIcon: freezed == hideIcon ? _self.hideIcon : hideIcon // ignore: cast_nullable_to_non_nullable +as bool?,disabled: freezed == disabled ? _self.disabled : disabled // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +/// Create a copy of CardElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardElementClassesCopyWith<$Res>? get classes { + if (_self.classes == null) { + return null; + } + + return $CardElementClassesCopyWith<$Res>(_self.classes!, (value) { + return _then(_self.copyWith(classes: value)); + }); +} +} - /// The class name to apply when the Element is focus. - /// Defaults to StripeElement--focus. - String? get focus => throw _privateConstructorUsedError; - /// The class name to apply when the Element is invalid. - /// Defaults to StripeElement--invalid. - String? get invalid => throw _privateConstructorUsedError; +/// @nodoc +mixin _$CardElementClasses { - /// The class name to apply when the Element has its value autofilled - /// by the browser (only on Chrome and Safari). - /// Defaults to StripeElement--webkit-autofill. - bool? get webkitAutofill => throw _privateConstructorUsedError; +/// The base class applied to the container. Defaults to StripeElement. + String? get base;/// The class name to apply when the Element is complete. +/// Defaults to StripeElement--complete + String? get complete;/// The class name to apply when the Element is empty. +/// Defaults to StripeElement--empty. + String? get empty;/// The class name to apply when the Element is focus. +/// Defaults to StripeElement--focus. + String? get focus;/// The class name to apply when the Element is invalid. +/// Defaults to StripeElement--invalid. + String? get invalid;/// The class name to apply when the Element has its value autofilled +/// by the browser (only on Chrome and Safari). +/// Defaults to StripeElement--webkit-autofill. + bool? get webkitAutofill; +/// Create a copy of CardElementClasses +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardElementClassesCopyWith get copyWith => _$CardElementClassesCopyWithImpl(this as CardElementClasses, _$identity); /// Serializes this CardElementClasses to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CardElementClasses - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardElementClassesCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardElementClasses&&(identical(other.base, base) || other.base == base)&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.empty, empty) || other.empty == empty)&&(identical(other.focus, focus) || other.focus == focus)&&(identical(other.invalid, invalid) || other.invalid == invalid)&&(identical(other.webkitAutofill, webkitAutofill) || other.webkitAutofill == webkitAutofill)); } -/// @nodoc -abstract class $CardElementClassesCopyWith<$Res> { - factory $CardElementClassesCopyWith( - CardElementClasses value, $Res Function(CardElementClasses) then) = - _$CardElementClassesCopyWithImpl<$Res, CardElementClasses>; - @useResult - $Res call( - {String? base, - String? complete, - String? empty, - String? focus, - String? invalid, - bool? webkitAutofill}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,base,complete,empty,focus,invalid,webkitAutofill); + +@override +String toString() { + return 'CardElementClasses(base: $base, complete: $complete, empty: $empty, focus: $focus, invalid: $invalid, webkitAutofill: $webkitAutofill)'; } -/// @nodoc -class _$CardElementClassesCopyWithImpl<$Res, $Val extends CardElementClasses> - implements $CardElementClassesCopyWith<$Res> { - _$CardElementClassesCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardElementClasses - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? base = freezed, - Object? complete = freezed, - Object? empty = freezed, - Object? focus = freezed, - Object? invalid = freezed, - Object? webkitAutofill = freezed, - }) { - return _then(_value.copyWith( - base: freezed == base - ? _value.base - : base // ignore: cast_nullable_to_non_nullable - as String?, - complete: freezed == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as String?, - empty: freezed == empty - ? _value.empty - : empty // ignore: cast_nullable_to_non_nullable - as String?, - focus: freezed == focus - ? _value.focus - : focus // ignore: cast_nullable_to_non_nullable - as String?, - invalid: freezed == invalid - ? _value.invalid - : invalid // ignore: cast_nullable_to_non_nullable - as String?, - webkitAutofill: freezed == webkitAutofill - ? _value.webkitAutofill - : webkitAutofill // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardElementClassesImplCopyWith<$Res> +abstract mixin class $CardElementClassesCopyWith<$Res> { + factory $CardElementClassesCopyWith(CardElementClasses value, $Res Function(CardElementClasses) _then) = _$CardElementClassesCopyWithImpl; +@useResult +$Res call({ + String? base, String? complete, String? empty, String? focus, String? invalid, bool? webkitAutofill +}); + + + + +} +/// @nodoc +class _$CardElementClassesCopyWithImpl<$Res> implements $CardElementClassesCopyWith<$Res> { - factory _$$CardElementClassesImplCopyWith(_$CardElementClassesImpl value, - $Res Function(_$CardElementClassesImpl) then) = - __$$CardElementClassesImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? base, - String? complete, - String? empty, - String? focus, - String? invalid, - bool? webkitAutofill}); + _$CardElementClassesCopyWithImpl(this._self, this._then); + + final CardElementClasses _self; + final $Res Function(CardElementClasses) _then; + +/// Create a copy of CardElementClasses +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? base = freezed,Object? complete = freezed,Object? empty = freezed,Object? focus = freezed,Object? invalid = freezed,Object? webkitAutofill = freezed,}) { + return _then(_self.copyWith( +base: freezed == base ? _self.base : base // ignore: cast_nullable_to_non_nullable +as String?,complete: freezed == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as String?,empty: freezed == empty ? _self.empty : empty // ignore: cast_nullable_to_non_nullable +as String?,focus: freezed == focus ? _self.focus : focus // ignore: cast_nullable_to_non_nullable +as String?,invalid: freezed == invalid ? _self.invalid : invalid // ignore: cast_nullable_to_non_nullable +as String?,webkitAutofill: freezed == webkitAutofill ? _self.webkitAutofill : webkitAutofill // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardElementClasses]. +extension CardElementClassesPatterns on CardElementClasses { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardElementClasses value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardElementClasses() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardElementClasses value) $default,){ +final _that = this; +switch (_that) { +case _CardElementClasses(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardElementClasses value)? $default,){ +final _that = this; +switch (_that) { +case _CardElementClasses() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? base, String? complete, String? empty, String? focus, String? invalid, bool? webkitAutofill)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardElementClasses() when $default != null: +return $default(_that.base,_that.complete,_that.empty,_that.focus,_that.invalid,_that.webkitAutofill);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? base, String? complete, String? empty, String? focus, String? invalid, bool? webkitAutofill) $default,) {final _that = this; +switch (_that) { +case _CardElementClasses(): +return $default(_that.base,_that.complete,_that.empty,_that.focus,_that.invalid,_that.webkitAutofill);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? base, String? complete, String? empty, String? focus, String? invalid, bool? webkitAutofill)? $default,) {final _that = this; +switch (_that) { +case _CardElementClasses() when $default != null: +return $default(_that.base,_that.complete,_that.empty,_that.focus,_that.invalid,_that.webkitAutofill);case _: + return null; + +} } -/// @nodoc -class __$$CardElementClassesImplCopyWithImpl<$Res> - extends _$CardElementClassesCopyWithImpl<$Res, _$CardElementClassesImpl> - implements _$$CardElementClassesImplCopyWith<$Res> { - __$$CardElementClassesImplCopyWithImpl(_$CardElementClassesImpl _value, - $Res Function(_$CardElementClassesImpl) _then) - : super(_value, _then); - - /// Create a copy of CardElementClasses - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? base = freezed, - Object? complete = freezed, - Object? empty = freezed, - Object? focus = freezed, - Object? invalid = freezed, - Object? webkitAutofill = freezed, - }) { - return _then(_$CardElementClassesImpl( - base: freezed == base - ? _value.base - : base // ignore: cast_nullable_to_non_nullable - as String?, - complete: freezed == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as String?, - empty: freezed == empty - ? _value.empty - : empty // ignore: cast_nullable_to_non_nullable - as String?, - focus: freezed == focus - ? _value.focus - : focus // ignore: cast_nullable_to_non_nullable - as String?, - invalid: freezed == invalid - ? _value.invalid - : invalid // ignore: cast_nullable_to_non_nullable - as String?, - webkitAutofill: freezed == webkitAutofill - ? _value.webkitAutofill - : webkitAutofill // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$CardElementClassesImpl implements _CardElementClasses { - const _$CardElementClassesImpl( - {this.base, - this.complete, - this.empty, - this.focus, - this.invalid, - this.webkitAutofill}); - - factory _$CardElementClassesImpl.fromJson(Map json) => - _$$CardElementClassesImplFromJson(json); - - /// The base class applied to the container. Defaults to StripeElement. - @override - final String? base; - - /// The class name to apply when the Element is complete. - /// Defaults to StripeElement--complete - @override - final String? complete; - - /// The class name to apply when the Element is empty. - /// Defaults to StripeElement--empty. - @override - final String? empty; - - /// The class name to apply when the Element is focus. - /// Defaults to StripeElement--focus. - @override - final String? focus; - - /// The class name to apply when the Element is invalid. - /// Defaults to StripeElement--invalid. - @override - final String? invalid; - - /// The class name to apply when the Element has its value autofilled - /// by the browser (only on Chrome and Safari). - /// Defaults to StripeElement--webkit-autofill. - @override - final bool? webkitAutofill; - - @override - String toString() { - return 'CardElementClasses(base: $base, complete: $complete, empty: $empty, focus: $focus, invalid: $invalid, webkitAutofill: $webkitAutofill)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardElementClassesImpl && - (identical(other.base, base) || other.base == base) && - (identical(other.complete, complete) || - other.complete == complete) && - (identical(other.empty, empty) || other.empty == empty) && - (identical(other.focus, focus) || other.focus == focus) && - (identical(other.invalid, invalid) || other.invalid == invalid) && - (identical(other.webkitAutofill, webkitAutofill) || - other.webkitAutofill == webkitAutofill)); - } +class _CardElementClasses implements CardElementClasses { + const _CardElementClasses({this.base, this.complete, this.empty, this.focus, this.invalid, this.webkitAutofill}); + factory _CardElementClasses.fromJson(Map json) => _$CardElementClassesFromJson(json); + +/// The base class applied to the container. Defaults to StripeElement. +@override final String? base; +/// The class name to apply when the Element is complete. +/// Defaults to StripeElement--complete +@override final String? complete; +/// The class name to apply when the Element is empty. +/// Defaults to StripeElement--empty. +@override final String? empty; +/// The class name to apply when the Element is focus. +/// Defaults to StripeElement--focus. +@override final String? focus; +/// The class name to apply when the Element is invalid. +/// Defaults to StripeElement--invalid. +@override final String? invalid; +/// The class name to apply when the Element has its value autofilled +/// by the browser (only on Chrome and Safari). +/// Defaults to StripeElement--webkit-autofill. +@override final bool? webkitAutofill; + +/// Create a copy of CardElementClasses +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardElementClassesCopyWith<_CardElementClasses> get copyWith => __$CardElementClassesCopyWithImpl<_CardElementClasses>(this, _$identity); + +@override +Map toJson() { + return _$CardElementClassesToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, base, complete, empty, focus, invalid, webkitAutofill); - - /// Create a copy of CardElementClasses - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardElementClassesImplCopyWith<_$CardElementClassesImpl> get copyWith => - __$$CardElementClassesImplCopyWithImpl<_$CardElementClassesImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CardElementClassesImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardElementClasses&&(identical(other.base, base) || other.base == base)&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.empty, empty) || other.empty == empty)&&(identical(other.focus, focus) || other.focus == focus)&&(identical(other.invalid, invalid) || other.invalid == invalid)&&(identical(other.webkitAutofill, webkitAutofill) || other.webkitAutofill == webkitAutofill)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,base,complete,empty,focus,invalid,webkitAutofill); + +@override +String toString() { + return 'CardElementClasses(base: $base, complete: $complete, empty: $empty, focus: $focus, invalid: $invalid, webkitAutofill: $webkitAutofill)'; } -abstract class _CardElementClasses implements CardElementClasses { - const factory _CardElementClasses( - {final String? base, - final String? complete, - final String? empty, - final String? focus, - final String? invalid, - final bool? webkitAutofill}) = _$CardElementClassesImpl; - - factory _CardElementClasses.fromJson(Map json) = - _$CardElementClassesImpl.fromJson; - - /// The base class applied to the container. Defaults to StripeElement. - @override - String? get base; - - /// The class name to apply when the Element is complete. - /// Defaults to StripeElement--complete - @override - String? get complete; - - /// The class name to apply when the Element is empty. - /// Defaults to StripeElement--empty. - @override - String? get empty; - - /// The class name to apply when the Element is focus. - /// Defaults to StripeElement--focus. - @override - String? get focus; - - /// The class name to apply when the Element is invalid. - /// Defaults to StripeElement--invalid. - @override - String? get invalid; - - /// The class name to apply when the Element has its value autofilled - /// by the browser (only on Chrome and Safari). - /// Defaults to StripeElement--webkit-autofill. - @override - bool? get webkitAutofill; - - /// Create a copy of CardElementClasses - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardElementClassesImplCopyWith<_$CardElementClassesImpl> get copyWith => - throw _privateConstructorUsedError; + } + +/// @nodoc +abstract mixin class _$CardElementClassesCopyWith<$Res> implements $CardElementClassesCopyWith<$Res> { + factory _$CardElementClassesCopyWith(_CardElementClasses value, $Res Function(_CardElementClasses) _then) = __$CardElementClassesCopyWithImpl; +@override @useResult +$Res call({ + String? base, String? complete, String? empty, String? focus, String? invalid, bool? webkitAutofill +}); + + + + +} +/// @nodoc +class __$CardElementClassesCopyWithImpl<$Res> + implements _$CardElementClassesCopyWith<$Res> { + __$CardElementClassesCopyWithImpl(this._self, this._then); + + final _CardElementClasses _self; + final $Res Function(_CardElementClasses) _then; + +/// Create a copy of CardElementClasses +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? base = freezed,Object? complete = freezed,Object? empty = freezed,Object? focus = freezed,Object? invalid = freezed,Object? webkitAutofill = freezed,}) { + return _then(_CardElementClasses( +base: freezed == base ? _self.base : base // ignore: cast_nullable_to_non_nullable +as String?,complete: freezed == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as String?,empty: freezed == empty ? _self.empty : empty // ignore: cast_nullable_to_non_nullable +as String?,focus: freezed == focus ? _self.focus : focus // ignore: cast_nullable_to_non_nullable +as String?,invalid: freezed == invalid ? _self.invalid : invalid // ignore: cast_nullable_to_non_nullable +as String?,webkitAutofill: freezed == webkitAutofill ? _self.webkitAutofill : webkitAutofill // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/card_element_options.g.dart b/packages/stripe_js/lib/src/api/elements/card_element_options.g.dart index 23027d83a..fcab3e238 100644 --- a/packages/stripe_js/lib/src/api/elements/card_element_options.g.dart +++ b/packages/stripe_js/lib/src/api/elements/card_element_options.g.dart @@ -6,48 +6,42 @@ part of 'card_element_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CardElementOptionsImpl _$$CardElementOptionsImplFromJson(Map json) => - _$CardElementOptionsImpl( +_CardElementOptions _$CardElementOptionsFromJson(Map json) => + _CardElementOptions( classes: json['classes'] == null ? null : CardElementClasses.fromJson( - Map.from(json['classes'] as Map)), + Map.from(json['classes'] as Map), + ), style: json['style'], value: json['value'] as String?, hidePostalCode: json['hidePostalCode'] as bool?, - iconStyle: - $enumDecodeNullable(_$CardElementIconStyleEnumMap, json['iconStyle']), + iconStyle: $enumDecodeNullable( + _$CardElementIconStyleEnumMap, + json['iconStyle'], + ), hideIcon: json['hideIcon'] as bool?, disabled: json['disabled'] as bool?, ); -Map _$$CardElementOptionsImplToJson( - _$CardElementOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('classes', instance.classes?.toJson()); - writeNotNull('style', instance.style); - writeNotNull('value', instance.value); - writeNotNull('hidePostalCode', instance.hidePostalCode); - writeNotNull('iconStyle', _$CardElementIconStyleEnumMap[instance.iconStyle]); - writeNotNull('hideIcon', instance.hideIcon); - writeNotNull('disabled', instance.disabled); - return val; -} +Map _$CardElementOptionsToJson(_CardElementOptions instance) => + { + 'classes': ?instance.classes?.toJson(), + 'style': ?instance.style, + 'value': ?instance.value, + 'hidePostalCode': ?instance.hidePostalCode, + 'iconStyle': ?_$CardElementIconStyleEnumMap[instance.iconStyle], + 'hideIcon': ?instance.hideIcon, + 'disabled': ?instance.disabled, + }; const _$CardElementIconStyleEnumMap = { CardElementIconStyle.solid: 'solid', CardElementIconStyle.defaultStyle: 'defaultStyle', }; -_$CardElementClassesImpl _$$CardElementClassesImplFromJson(Map json) => - _$CardElementClassesImpl( +_CardElementClasses _$CardElementClassesFromJson(Map json) => + _CardElementClasses( base: json['base'] as String?, complete: json['complete'] as String?, empty: json['empty'] as String?, @@ -56,21 +50,12 @@ _$CardElementClassesImpl _$$CardElementClassesImplFromJson(Map json) => webkitAutofill: json['webkitAutofill'] as bool?, ); -Map _$$CardElementClassesImplToJson( - _$CardElementClassesImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('base', instance.base); - writeNotNull('complete', instance.complete); - writeNotNull('empty', instance.empty); - writeNotNull('focus', instance.focus); - writeNotNull('invalid', instance.invalid); - writeNotNull('webkitAutofill', instance.webkitAutofill); - return val; -} +Map _$CardElementClassesToJson(_CardElementClasses instance) => + { + 'base': ?instance.base, + 'complete': ?instance.complete, + 'empty': ?instance.empty, + 'focus': ?instance.focus, + 'invalid': ?instance.invalid, + 'webkitAutofill': ?instance.webkitAutofill, + }; diff --git a/packages/stripe_js/lib/src/api/elements/element_appearance.dart b/packages/stripe_js/lib/src/api/elements/element_appearance.dart index a16686c19..f43a3d474 100644 --- a/packages/stripe_js/lib/src/api/elements/element_appearance.dart +++ b/packages/stripe_js/lib/src/api/elements/element_appearance.dart @@ -10,10 +10,9 @@ enum ElementTheme { stripe, night, flat, none } enum ElementAppearanceLabels { above, floating } @freezed - /// Appareance options for the Payment Element and other elements. /// https://stripe.com/docs/elements/appearance-api -class ElementAppearance with _$ElementAppearance { +abstract class ElementAppearance with _$ElementAppearance { const factory ElementAppearance({ @Default(ElementTheme.stripe) ElementTheme theme, Map? variables, diff --git a/packages/stripe_js/lib/src/api/elements/element_appearance.freezed.dart b/packages/stripe_js/lib/src/api/elements/element_appearance.freezed.dart index a86426563..a7ce7fcfa 100644 --- a/packages/stripe_js/lib/src/api/elements/element_appearance.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/element_appearance.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,248 +9,294 @@ part of 'element_appearance.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ElementAppearance _$ElementAppearanceFromJson(Map json) { - return _ElementAppearance.fromJson(json); -} - /// @nodoc mixin _$ElementAppearance { - ElementTheme get theme => throw _privateConstructorUsedError; - Map? get variables => throw _privateConstructorUsedError; - Map>? get rules => - throw _privateConstructorUsedError; - ElementAppearanceLabels get labels => throw _privateConstructorUsedError; + + ElementTheme get theme; Map? get variables; Map>? get rules; ElementAppearanceLabels get labels; +/// Create a copy of ElementAppearance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ElementAppearanceCopyWith get copyWith => _$ElementAppearanceCopyWithImpl(this as ElementAppearance, _$identity); /// Serializes this ElementAppearance to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ElementAppearance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ElementAppearanceCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ElementAppearance&&(identical(other.theme, theme) || other.theme == theme)&&const DeepCollectionEquality().equals(other.variables, variables)&&const DeepCollectionEquality().equals(other.rules, rules)&&(identical(other.labels, labels) || other.labels == labels)); } -/// @nodoc -abstract class $ElementAppearanceCopyWith<$Res> { - factory $ElementAppearanceCopyWith( - ElementAppearance value, $Res Function(ElementAppearance) then) = - _$ElementAppearanceCopyWithImpl<$Res, ElementAppearance>; - @useResult - $Res call( - {ElementTheme theme, - Map? variables, - Map>? rules, - ElementAppearanceLabels labels}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,theme,const DeepCollectionEquality().hash(variables),const DeepCollectionEquality().hash(rules),labels); + +@override +String toString() { + return 'ElementAppearance(theme: $theme, variables: $variables, rules: $rules, labels: $labels)'; } -/// @nodoc -class _$ElementAppearanceCopyWithImpl<$Res, $Val extends ElementAppearance> - implements $ElementAppearanceCopyWith<$Res> { - _$ElementAppearanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ElementAppearance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? theme = null, - Object? variables = freezed, - Object? rules = freezed, - Object? labels = null, - }) { - return _then(_value.copyWith( - theme: null == theme - ? _value.theme - : theme // ignore: cast_nullable_to_non_nullable - as ElementTheme, - variables: freezed == variables - ? _value.variables - : variables // ignore: cast_nullable_to_non_nullable - as Map?, - rules: freezed == rules - ? _value.rules - : rules // ignore: cast_nullable_to_non_nullable - as Map>?, - labels: null == labels - ? _value.labels - : labels // ignore: cast_nullable_to_non_nullable - as ElementAppearanceLabels, - ) as $Val); - } + } /// @nodoc -abstract class _$$ElementAppearanceImplCopyWith<$Res> +abstract mixin class $ElementAppearanceCopyWith<$Res> { + factory $ElementAppearanceCopyWith(ElementAppearance value, $Res Function(ElementAppearance) _then) = _$ElementAppearanceCopyWithImpl; +@useResult +$Res call({ + ElementTheme theme, Map? variables, Map>? rules, ElementAppearanceLabels labels +}); + + + + +} +/// @nodoc +class _$ElementAppearanceCopyWithImpl<$Res> implements $ElementAppearanceCopyWith<$Res> { - factory _$$ElementAppearanceImplCopyWith(_$ElementAppearanceImpl value, - $Res Function(_$ElementAppearanceImpl) then) = - __$$ElementAppearanceImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ElementTheme theme, - Map? variables, - Map>? rules, - ElementAppearanceLabels labels}); + _$ElementAppearanceCopyWithImpl(this._self, this._then); + + final ElementAppearance _self; + final $Res Function(ElementAppearance) _then; + +/// Create a copy of ElementAppearance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? theme = null,Object? variables = freezed,Object? rules = freezed,Object? labels = null,}) { + return _then(_self.copyWith( +theme: null == theme ? _self.theme : theme // ignore: cast_nullable_to_non_nullable +as ElementTheme,variables: freezed == variables ? _self.variables : variables // ignore: cast_nullable_to_non_nullable +as Map?,rules: freezed == rules ? _self.rules : rules // ignore: cast_nullable_to_non_nullable +as Map>?,labels: null == labels ? _self.labels : labels // ignore: cast_nullable_to_non_nullable +as ElementAppearanceLabels, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ElementAppearance]. +extension ElementAppearancePatterns on ElementAppearance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ElementAppearance value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ElementAppearance() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ElementAppearance value) $default,){ +final _that = this; +switch (_that) { +case _ElementAppearance(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ElementAppearance value)? $default,){ +final _that = this; +switch (_that) { +case _ElementAppearance() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ElementTheme theme, Map? variables, Map>? rules, ElementAppearanceLabels labels)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ElementAppearance() when $default != null: +return $default(_that.theme,_that.variables,_that.rules,_that.labels);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ElementTheme theme, Map? variables, Map>? rules, ElementAppearanceLabels labels) $default,) {final _that = this; +switch (_that) { +case _ElementAppearance(): +return $default(_that.theme,_that.variables,_that.rules,_that.labels);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ElementTheme theme, Map? variables, Map>? rules, ElementAppearanceLabels labels)? $default,) {final _that = this; +switch (_that) { +case _ElementAppearance() when $default != null: +return $default(_that.theme,_that.variables,_that.rules,_that.labels);case _: + return null; + +} } -/// @nodoc -class __$$ElementAppearanceImplCopyWithImpl<$Res> - extends _$ElementAppearanceCopyWithImpl<$Res, _$ElementAppearanceImpl> - implements _$$ElementAppearanceImplCopyWith<$Res> { - __$$ElementAppearanceImplCopyWithImpl(_$ElementAppearanceImpl _value, - $Res Function(_$ElementAppearanceImpl) _then) - : super(_value, _then); - - /// Create a copy of ElementAppearance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? theme = null, - Object? variables = freezed, - Object? rules = freezed, - Object? labels = null, - }) { - return _then(_$ElementAppearanceImpl( - theme: null == theme - ? _value.theme - : theme // ignore: cast_nullable_to_non_nullable - as ElementTheme, - variables: freezed == variables - ? _value._variables - : variables // ignore: cast_nullable_to_non_nullable - as Map?, - rules: freezed == rules - ? _value._rules - : rules // ignore: cast_nullable_to_non_nullable - as Map>?, - labels: null == labels - ? _value.labels - : labels // ignore: cast_nullable_to_non_nullable - as ElementAppearanceLabels, - )); - } } /// @nodoc @JsonSerializable() -class _$ElementAppearanceImpl implements _ElementAppearance { - const _$ElementAppearanceImpl( - {this.theme = ElementTheme.stripe, - final Map? variables, - final Map>? rules, - this.labels = ElementAppearanceLabels.above}) - : _variables = variables, - _rules = rules; - - factory _$ElementAppearanceImpl.fromJson(Map json) => - _$$ElementAppearanceImplFromJson(json); - - @override - @JsonKey() - final ElementTheme theme; - final Map? _variables; - @override - Map? get variables { - final value = _variables; - if (value == null) return null; - if (_variables is EqualUnmodifiableMapView) return _variables; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - final Map>? _rules; - @override - Map>? get rules { - final value = _rules; - if (value == null) return null; - if (_rules is EqualUnmodifiableMapView) return _rules; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - @override - @JsonKey() - final ElementAppearanceLabels labels; - - @override - String toString() { - return 'ElementAppearance(theme: $theme, variables: $variables, rules: $rules, labels: $labels)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ElementAppearanceImpl && - (identical(other.theme, theme) || other.theme == theme) && - const DeepCollectionEquality() - .equals(other._variables, _variables) && - const DeepCollectionEquality().equals(other._rules, _rules) && - (identical(other.labels, labels) || other.labels == labels)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - theme, - const DeepCollectionEquality().hash(_variables), - const DeepCollectionEquality().hash(_rules), - labels); - - /// Create a copy of ElementAppearance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ElementAppearanceImplCopyWith<_$ElementAppearanceImpl> get copyWith => - __$$ElementAppearanceImplCopyWithImpl<_$ElementAppearanceImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ElementAppearanceImplToJson( - this, - ); - } + +class _ElementAppearance implements ElementAppearance { + const _ElementAppearance({this.theme = ElementTheme.stripe, final Map? variables, final Map>? rules, this.labels = ElementAppearanceLabels.above}): _variables = variables,_rules = rules; + factory _ElementAppearance.fromJson(Map json) => _$ElementAppearanceFromJson(json); + +@override@JsonKey() final ElementTheme theme; + final Map? _variables; +@override Map? get variables { + final value = _variables; + if (value == null) return null; + if (_variables is EqualUnmodifiableMapView) return _variables; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + + final Map>? _rules; +@override Map>? get rules { + final value = _rules; + if (value == null) return null; + if (_rules is EqualUnmodifiableMapView) return _rules; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + +@override@JsonKey() final ElementAppearanceLabels labels; + +/// Create a copy of ElementAppearance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ElementAppearanceCopyWith<_ElementAppearance> get copyWith => __$ElementAppearanceCopyWithImpl<_ElementAppearance>(this, _$identity); + +@override +Map toJson() { + return _$ElementAppearanceToJson(this, ); } -abstract class _ElementAppearance implements ElementAppearance { - const factory _ElementAppearance( - {final ElementTheme theme, - final Map? variables, - final Map>? rules, - final ElementAppearanceLabels labels}) = _$ElementAppearanceImpl; - - factory _ElementAppearance.fromJson(Map json) = - _$ElementAppearanceImpl.fromJson; - - @override - ElementTheme get theme; - @override - Map? get variables; - @override - Map>? get rules; - @override - ElementAppearanceLabels get labels; - - /// Create a copy of ElementAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ElementAppearanceImplCopyWith<_$ElementAppearanceImpl> get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ElementAppearance&&(identical(other.theme, theme) || other.theme == theme)&&const DeepCollectionEquality().equals(other._variables, _variables)&&const DeepCollectionEquality().equals(other._rules, _rules)&&(identical(other.labels, labels) || other.labels == labels)); } + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,theme,const DeepCollectionEquality().hash(_variables),const DeepCollectionEquality().hash(_rules),labels); + +@override +String toString() { + return 'ElementAppearance(theme: $theme, variables: $variables, rules: $rules, labels: $labels)'; +} + + +} + +/// @nodoc +abstract mixin class _$ElementAppearanceCopyWith<$Res> implements $ElementAppearanceCopyWith<$Res> { + factory _$ElementAppearanceCopyWith(_ElementAppearance value, $Res Function(_ElementAppearance) _then) = __$ElementAppearanceCopyWithImpl; +@override @useResult +$Res call({ + ElementTheme theme, Map? variables, Map>? rules, ElementAppearanceLabels labels +}); + + + + +} +/// @nodoc +class __$ElementAppearanceCopyWithImpl<$Res> + implements _$ElementAppearanceCopyWith<$Res> { + __$ElementAppearanceCopyWithImpl(this._self, this._then); + + final _ElementAppearance _self; + final $Res Function(_ElementAppearance) _then; + +/// Create a copy of ElementAppearance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? theme = null,Object? variables = freezed,Object? rules = freezed,Object? labels = null,}) { + return _then(_ElementAppearance( +theme: null == theme ? _self.theme : theme // ignore: cast_nullable_to_non_nullable +as ElementTheme,variables: freezed == variables ? _self._variables : variables // ignore: cast_nullable_to_non_nullable +as Map?,rules: freezed == rules ? _self._rules : rules // ignore: cast_nullable_to_non_nullable +as Map>?,labels: null == labels ? _self.labels : labels // ignore: cast_nullable_to_non_nullable +as ElementAppearanceLabels, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/element_appearance.g.dart b/packages/stripe_js/lib/src/api/elements/element_appearance.g.dart index 77a5f7282..24d968d39 100644 --- a/packages/stripe_js/lib/src/api/elements/element_appearance.g.dart +++ b/packages/stripe_js/lib/src/api/elements/element_appearance.g.dart @@ -6,38 +6,28 @@ part of 'element_appearance.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ElementAppearanceImpl _$$ElementAppearanceImplFromJson(Map json) => - _$ElementAppearanceImpl( - theme: $enumDecodeNullable(_$ElementThemeEnumMap, json['theme']) ?? - ElementTheme.stripe, - variables: (json['variables'] as Map?)?.map( - (k, e) => MapEntry(k as String, e as String), - ), - rules: (json['rules'] as Map?)?.map( - (k, e) => MapEntry(k as String, Map.from(e as Map)), - ), - labels: $enumDecodeNullable( - _$ElementAppearanceLabelsEnumMap, json['labels']) ?? - ElementAppearanceLabels.above, - ); - -Map _$$ElementAppearanceImplToJson( - _$ElementAppearanceImpl instance) { - final val = { - 'theme': _$ElementThemeEnumMap[instance.theme]!, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('variables', instance.variables); - writeNotNull('rules', instance.rules); - val['labels'] = _$ElementAppearanceLabelsEnumMap[instance.labels]!; - return val; -} +_ElementAppearance _$ElementAppearanceFromJson(Map json) => _ElementAppearance( + theme: + $enumDecodeNullable(_$ElementThemeEnumMap, json['theme']) ?? + ElementTheme.stripe, + variables: (json['variables'] as Map?)?.map( + (k, e) => MapEntry(k as String, e as String), + ), + rules: (json['rules'] as Map?)?.map( + (k, e) => MapEntry(k as String, Map.from(e as Map)), + ), + labels: + $enumDecodeNullable(_$ElementAppearanceLabelsEnumMap, json['labels']) ?? + ElementAppearanceLabels.above, +); + +Map _$ElementAppearanceToJson(_ElementAppearance instance) => + { + 'theme': _$ElementThemeEnumMap[instance.theme]!, + 'variables': ?instance.variables, + 'rules': ?instance.rules, + 'labels': _$ElementAppearanceLabelsEnumMap[instance.labels]!, + }; const _$ElementThemeEnumMap = { ElementTheme.stripe: 'stripe', diff --git a/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.dart b/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.dart index 3c68ef86f..d45f36503 100644 --- a/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.dart +++ b/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.dart @@ -5,9 +5,8 @@ part 'express_checkout_element_options.freezed.dart'; part 'express_checkout_element_options.g.dart'; @freezed - /// Options for the express checkout element -class ExpressCheckoutOptions with _$ExpressCheckoutOptions { +abstract class ExpressCheckoutOptions with _$ExpressCheckoutOptions { factory ExpressCheckoutOptions({ /// height of the widget double? height, @@ -30,9 +29,8 @@ class ExpressCheckoutOptions with _$ExpressCheckoutOptions { } @freezed - /// Confirm parameters from the express checkout element -class ExpressCheckoutConfirmEvent with _$ExpressCheckoutConfirmEvent { +abstract class ExpressCheckoutConfirmEvent with _$ExpressCheckoutConfirmEvent { factory ExpressCheckoutConfirmEvent({ /// The method that was used to pay. required String expressPaymentType, @@ -44,9 +42,8 @@ class ExpressCheckoutConfirmEvent with _$ExpressCheckoutConfirmEvent { } @freezed - /// Layout parameters of the express checkout element -class ExpressCheckoutLayout with _$ExpressCheckoutLayout { +abstract class ExpressCheckoutLayout with _$ExpressCheckoutLayout { const factory ExpressCheckoutLayout({ int? maxColumns, int? maxRows, @@ -58,9 +55,8 @@ class ExpressCheckoutLayout with _$ExpressCheckoutLayout { } @freezed - /// The theme of the express checkout button -class ExpressCheckoutButtonTheme with _$ExpressCheckoutButtonTheme { +abstract class ExpressCheckoutButtonTheme with _$ExpressCheckoutButtonTheme { const factory ExpressCheckoutButtonTheme({ ExpressApplePayButtonTheme? applePay, ExpressGooglePayButtonTheme? googlePay, @@ -72,9 +68,8 @@ class ExpressCheckoutButtonTheme with _$ExpressCheckoutButtonTheme { } @freezed - /// Specify the preferred button type to display. -class ExpressCheckoutButtonType with _$ExpressCheckoutButtonType { +abstract class ExpressCheckoutButtonType with _$ExpressCheckoutButtonType { const factory ExpressCheckoutButtonType({ ExpressApplePayButtonType? applePay, ExpressGooglePayButtonType? googlePay, @@ -86,9 +81,9 @@ class ExpressCheckoutButtonType with _$ExpressCheckoutButtonType { } @freezed - /// The layout of the express checkout button -class ExpressCheckoutPaymentMethods with _$ExpressCheckoutPaymentMethods { +abstract class ExpressCheckoutPaymentMethods + with _$ExpressCheckoutPaymentMethods { const factory ExpressCheckoutPaymentMethods({ ExpressPaymentNethodEnabled? applePay, ExpressPaymentNethodEnabled? googlePay, @@ -128,7 +123,7 @@ enum ExpressApplePayButtonType { subscribe, support, tip, - topUp + topUp, } /// The type of google pay button to display @@ -140,7 +135,7 @@ enum ExpressGooglePayButtonType { order, pay, plain, - subscribe + subscribe, } /// The type of paypal button to display diff --git a/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.freezed.dart b/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.freezed.dart index 7c51340fe..d8690c3f5 100644 --- a/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1406 +9,1761 @@ part of 'express_checkout_element_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ExpressCheckoutOptions _$ExpressCheckoutOptionsFromJson( - Map json) { - return _ExpressCheckoutOptions.fromJson(json); -} - /// @nodoc mixin _$ExpressCheckoutOptions { - /// height of the widget - double? get height => throw _privateConstructorUsedError; - /// The theme of the buttons - ExpressCheckoutButtonTheme? get buttonTheme => - throw _privateConstructorUsedError; +/// height of the widget + double? get height;/// The theme of the buttons + ExpressCheckoutButtonTheme? get buttonTheme;/// The type of buttons + ExpressCheckoutButtonType? get buttonType;/// Layout parameters of the express checkout element + ExpressCheckoutLayout? get layout;/// Payment methods to display + ExpressCheckoutPaymentMethods? get paymentMethods; +/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ExpressCheckoutOptionsCopyWith get copyWith => _$ExpressCheckoutOptionsCopyWithImpl(this as ExpressCheckoutOptions, _$identity); - /// The type of buttons - ExpressCheckoutButtonType? get buttonType => - throw _privateConstructorUsedError; + /// Serializes this ExpressCheckoutOptions to a JSON map. + Map toJson(); - /// Layout parameters of the express checkout element - ExpressCheckoutLayout? get layout => throw _privateConstructorUsedError; - /// Payment methods to display - ExpressCheckoutPaymentMethods? get paymentMethods => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ExpressCheckoutOptions&&(identical(other.height, height) || other.height == height)&&(identical(other.buttonTheme, buttonTheme) || other.buttonTheme == buttonTheme)&&(identical(other.buttonType, buttonType) || other.buttonType == buttonType)&&(identical(other.layout, layout) || other.layout == layout)&&(identical(other.paymentMethods, paymentMethods) || other.paymentMethods == paymentMethods)); +} - /// Serializes this ExpressCheckoutOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,height,buttonTheme,buttonType,layout,paymentMethods); - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ExpressCheckoutOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'ExpressCheckoutOptions(height: $height, buttonTheme: $buttonTheme, buttonType: $buttonType, layout: $layout, paymentMethods: $paymentMethods)'; } -/// @nodoc -abstract class $ExpressCheckoutOptionsCopyWith<$Res> { - factory $ExpressCheckoutOptionsCopyWith(ExpressCheckoutOptions value, - $Res Function(ExpressCheckoutOptions) then) = - _$ExpressCheckoutOptionsCopyWithImpl<$Res, ExpressCheckoutOptions>; - @useResult - $Res call( - {double? height, - ExpressCheckoutButtonTheme? buttonTheme, - ExpressCheckoutButtonType? buttonType, - ExpressCheckoutLayout? layout, - ExpressCheckoutPaymentMethods? paymentMethods}); - - $ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme; - $ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType; - $ExpressCheckoutLayoutCopyWith<$Res>? get layout; - $ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods; + } /// @nodoc -class _$ExpressCheckoutOptionsCopyWithImpl<$Res, - $Val extends ExpressCheckoutOptions> +abstract mixin class $ExpressCheckoutOptionsCopyWith<$Res> { + factory $ExpressCheckoutOptionsCopyWith(ExpressCheckoutOptions value, $Res Function(ExpressCheckoutOptions) _then) = _$ExpressCheckoutOptionsCopyWithImpl; +@useResult +$Res call({ + double? height, ExpressCheckoutButtonTheme? buttonTheme, ExpressCheckoutButtonType? buttonType, ExpressCheckoutLayout? layout, ExpressCheckoutPaymentMethods? paymentMethods +}); + + +$ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme;$ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType;$ExpressCheckoutLayoutCopyWith<$Res>? get layout;$ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods; + +} +/// @nodoc +class _$ExpressCheckoutOptionsCopyWithImpl<$Res> implements $ExpressCheckoutOptionsCopyWith<$Res> { - _$ExpressCheckoutOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? height = freezed, - Object? buttonTheme = freezed, - Object? buttonType = freezed, - Object? layout = freezed, - Object? paymentMethods = freezed, - }) { - return _then(_value.copyWith( - height: freezed == height - ? _value.height - : height // ignore: cast_nullable_to_non_nullable - as double?, - buttonTheme: freezed == buttonTheme - ? _value.buttonTheme - : buttonTheme // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutButtonTheme?, - buttonType: freezed == buttonType - ? _value.buttonType - : buttonType // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutButtonType?, - layout: freezed == layout - ? _value.layout - : layout // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutLayout?, - paymentMethods: freezed == paymentMethods - ? _value.paymentMethods - : paymentMethods // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutPaymentMethods?, - ) as $Val); + _$ExpressCheckoutOptionsCopyWithImpl(this._self, this._then); + + final ExpressCheckoutOptions _self; + final $Res Function(ExpressCheckoutOptions) _then; + +/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? height = freezed,Object? buttonTheme = freezed,Object? buttonType = freezed,Object? layout = freezed,Object? paymentMethods = freezed,}) { + return _then(_self.copyWith( +height: freezed == height ? _self.height : height // ignore: cast_nullable_to_non_nullable +as double?,buttonTheme: freezed == buttonTheme ? _self.buttonTheme : buttonTheme // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutButtonTheme?,buttonType: freezed == buttonType ? _self.buttonType : buttonType // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutButtonType?,layout: freezed == layout ? _self.layout : layout // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutLayout?,paymentMethods: freezed == paymentMethods ? _self.paymentMethods : paymentMethods // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutPaymentMethods?, + )); +} +/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme { + if (_self.buttonTheme == null) { + return null; } - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme { - if (_value.buttonTheme == null) { - return null; - } - - return $ExpressCheckoutButtonThemeCopyWith<$Res>(_value.buttonTheme!, - (value) { - return _then(_value.copyWith(buttonTheme: value) as $Val); - }); + return $ExpressCheckoutButtonThemeCopyWith<$Res>(_self.buttonTheme!, (value) { + return _then(_self.copyWith(buttonTheme: value)); + }); +}/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType { + if (_self.buttonType == null) { + return null; } - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType { - if (_value.buttonType == null) { - return null; - } - - return $ExpressCheckoutButtonTypeCopyWith<$Res>(_value.buttonType!, - (value) { - return _then(_value.copyWith(buttonType: value) as $Val); - }); + return $ExpressCheckoutButtonTypeCopyWith<$Res>(_self.buttonType!, (value) { + return _then(_self.copyWith(buttonType: value)); + }); +}/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutLayoutCopyWith<$Res>? get layout { + if (_self.layout == null) { + return null; } - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ExpressCheckoutLayoutCopyWith<$Res>? get layout { - if (_value.layout == null) { - return null; - } - - return $ExpressCheckoutLayoutCopyWith<$Res>(_value.layout!, (value) { - return _then(_value.copyWith(layout: value) as $Val); - }); + return $ExpressCheckoutLayoutCopyWith<$Res>(_self.layout!, (value) { + return _then(_self.copyWith(layout: value)); + }); +}/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods { + if (_self.paymentMethods == null) { + return null; } - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods { - if (_value.paymentMethods == null) { - return null; - } - - return $ExpressCheckoutPaymentMethodsCopyWith<$Res>(_value.paymentMethods!, - (value) { - return _then(_value.copyWith(paymentMethods: value) as $Val); - }); - } + return $ExpressCheckoutPaymentMethodsCopyWith<$Res>(_self.paymentMethods!, (value) { + return _then(_self.copyWith(paymentMethods: value)); + }); +} } -/// @nodoc -abstract class _$$ExpressCheckoutOptionsImplCopyWith<$Res> - implements $ExpressCheckoutOptionsCopyWith<$Res> { - factory _$$ExpressCheckoutOptionsImplCopyWith( - _$ExpressCheckoutOptionsImpl value, - $Res Function(_$ExpressCheckoutOptionsImpl) then) = - __$$ExpressCheckoutOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {double? height, - ExpressCheckoutButtonTheme? buttonTheme, - ExpressCheckoutButtonType? buttonType, - ExpressCheckoutLayout? layout, - ExpressCheckoutPaymentMethods? paymentMethods}); - - @override - $ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme; - @override - $ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType; - @override - $ExpressCheckoutLayoutCopyWith<$Res>? get layout; - @override - $ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods; + +/// Adds pattern-matching-related methods to [ExpressCheckoutOptions]. +extension ExpressCheckoutOptionsPatterns on ExpressCheckoutOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ExpressCheckoutOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ExpressCheckoutOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ExpressCheckoutOptions value) $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ExpressCheckoutOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? height, ExpressCheckoutButtonTheme? buttonTheme, ExpressCheckoutButtonType? buttonType, ExpressCheckoutLayout? layout, ExpressCheckoutPaymentMethods? paymentMethods)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ExpressCheckoutOptions() when $default != null: +return $default(_that.height,_that.buttonTheme,_that.buttonType,_that.layout,_that.paymentMethods);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? height, ExpressCheckoutButtonTheme? buttonTheme, ExpressCheckoutButtonType? buttonType, ExpressCheckoutLayout? layout, ExpressCheckoutPaymentMethods? paymentMethods) $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutOptions(): +return $default(_that.height,_that.buttonTheme,_that.buttonType,_that.layout,_that.paymentMethods);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? height, ExpressCheckoutButtonTheme? buttonTheme, ExpressCheckoutButtonType? buttonType, ExpressCheckoutLayout? layout, ExpressCheckoutPaymentMethods? paymentMethods)? $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutOptions() when $default != null: +return $default(_that.height,_that.buttonTheme,_that.buttonType,_that.layout,_that.paymentMethods);case _: + return null; + +} } -/// @nodoc -class __$$ExpressCheckoutOptionsImplCopyWithImpl<$Res> - extends _$ExpressCheckoutOptionsCopyWithImpl<$Res, - _$ExpressCheckoutOptionsImpl> - implements _$$ExpressCheckoutOptionsImplCopyWith<$Res> { - __$$ExpressCheckoutOptionsImplCopyWithImpl( - _$ExpressCheckoutOptionsImpl _value, - $Res Function(_$ExpressCheckoutOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? height = freezed, - Object? buttonTheme = freezed, - Object? buttonType = freezed, - Object? layout = freezed, - Object? paymentMethods = freezed, - }) { - return _then(_$ExpressCheckoutOptionsImpl( - height: freezed == height - ? _value.height - : height // ignore: cast_nullable_to_non_nullable - as double?, - buttonTheme: freezed == buttonTheme - ? _value.buttonTheme - : buttonTheme // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutButtonTheme?, - buttonType: freezed == buttonType - ? _value.buttonType - : buttonType // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutButtonType?, - layout: freezed == layout - ? _value.layout - : layout // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutLayout?, - paymentMethods: freezed == paymentMethods - ? _value.paymentMethods - : paymentMethods // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutPaymentMethods?, - )); - } } /// @nodoc @JsonSerializable() -class _$ExpressCheckoutOptionsImpl implements _ExpressCheckoutOptions { - _$ExpressCheckoutOptionsImpl( - {this.height, - this.buttonTheme, - this.buttonType, - this.layout, - this.paymentMethods}); - - factory _$ExpressCheckoutOptionsImpl.fromJson(Map json) => - _$$ExpressCheckoutOptionsImplFromJson(json); - - /// height of the widget - @override - final double? height; - - /// The theme of the buttons - @override - final ExpressCheckoutButtonTheme? buttonTheme; - - /// The type of buttons - @override - final ExpressCheckoutButtonType? buttonType; - - /// Layout parameters of the express checkout element - @override - final ExpressCheckoutLayout? layout; - - /// Payment methods to display - @override - final ExpressCheckoutPaymentMethods? paymentMethods; - - @override - String toString() { - return 'ExpressCheckoutOptions(height: $height, buttonTheme: $buttonTheme, buttonType: $buttonType, layout: $layout, paymentMethods: $paymentMethods)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ExpressCheckoutOptionsImpl && - (identical(other.height, height) || other.height == height) && - (identical(other.buttonTheme, buttonTheme) || - other.buttonTheme == buttonTheme) && - (identical(other.buttonType, buttonType) || - other.buttonType == buttonType) && - (identical(other.layout, layout) || other.layout == layout) && - (identical(other.paymentMethods, paymentMethods) || - other.paymentMethods == paymentMethods)); - } +class _ExpressCheckoutOptions implements ExpressCheckoutOptions { + _ExpressCheckoutOptions({this.height, this.buttonTheme, this.buttonType, this.layout, this.paymentMethods}); + factory _ExpressCheckoutOptions.fromJson(Map json) => _$ExpressCheckoutOptionsFromJson(json); + +/// height of the widget +@override final double? height; +/// The theme of the buttons +@override final ExpressCheckoutButtonTheme? buttonTheme; +/// The type of buttons +@override final ExpressCheckoutButtonType? buttonType; +/// Layout parameters of the express checkout element +@override final ExpressCheckoutLayout? layout; +/// Payment methods to display +@override final ExpressCheckoutPaymentMethods? paymentMethods; + +/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExpressCheckoutOptionsCopyWith<_ExpressCheckoutOptions> get copyWith => __$ExpressCheckoutOptionsCopyWithImpl<_ExpressCheckoutOptions>(this, _$identity); + +@override +Map toJson() { + return _$ExpressCheckoutOptionsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, height, buttonTheme, buttonType, layout, paymentMethods); - - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ExpressCheckoutOptionsImplCopyWith<_$ExpressCheckoutOptionsImpl> - get copyWith => __$$ExpressCheckoutOptionsImplCopyWithImpl< - _$ExpressCheckoutOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ExpressCheckoutOptionsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ExpressCheckoutOptions&&(identical(other.height, height) || other.height == height)&&(identical(other.buttonTheme, buttonTheme) || other.buttonTheme == buttonTheme)&&(identical(other.buttonType, buttonType) || other.buttonType == buttonType)&&(identical(other.layout, layout) || other.layout == layout)&&(identical(other.paymentMethods, paymentMethods) || other.paymentMethods == paymentMethods)); } -abstract class _ExpressCheckoutOptions implements ExpressCheckoutOptions { - factory _ExpressCheckoutOptions( - {final double? height, - final ExpressCheckoutButtonTheme? buttonTheme, - final ExpressCheckoutButtonType? buttonType, - final ExpressCheckoutLayout? layout, - final ExpressCheckoutPaymentMethods? paymentMethods}) = - _$ExpressCheckoutOptionsImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,height,buttonTheme,buttonType,layout,paymentMethods); - factory _ExpressCheckoutOptions.fromJson(Map json) = - _$ExpressCheckoutOptionsImpl.fromJson; +@override +String toString() { + return 'ExpressCheckoutOptions(height: $height, buttonTheme: $buttonTheme, buttonType: $buttonType, layout: $layout, paymentMethods: $paymentMethods)'; +} - /// height of the widget - @override - double? get height; - /// The theme of the buttons - @override - ExpressCheckoutButtonTheme? get buttonTheme; +} - /// The type of buttons - @override - ExpressCheckoutButtonType? get buttonType; +/// @nodoc +abstract mixin class _$ExpressCheckoutOptionsCopyWith<$Res> implements $ExpressCheckoutOptionsCopyWith<$Res> { + factory _$ExpressCheckoutOptionsCopyWith(_ExpressCheckoutOptions value, $Res Function(_ExpressCheckoutOptions) _then) = __$ExpressCheckoutOptionsCopyWithImpl; +@override @useResult +$Res call({ + double? height, ExpressCheckoutButtonTheme? buttonTheme, ExpressCheckoutButtonType? buttonType, ExpressCheckoutLayout? layout, ExpressCheckoutPaymentMethods? paymentMethods +}); - /// Layout parameters of the express checkout element - @override - ExpressCheckoutLayout? get layout; - /// Payment methods to display - @override - ExpressCheckoutPaymentMethods? get paymentMethods; +@override $ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme;@override $ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType;@override $ExpressCheckoutLayoutCopyWith<$Res>? get layout;@override $ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods; - /// Create a copy of ExpressCheckoutOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ExpressCheckoutOptionsImplCopyWith<_$ExpressCheckoutOptionsImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$ExpressCheckoutOptionsCopyWithImpl<$Res> + implements _$ExpressCheckoutOptionsCopyWith<$Res> { + __$ExpressCheckoutOptionsCopyWithImpl(this._self, this._then); + + final _ExpressCheckoutOptions _self; + final $Res Function(_ExpressCheckoutOptions) _then; + +/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? height = freezed,Object? buttonTheme = freezed,Object? buttonType = freezed,Object? layout = freezed,Object? paymentMethods = freezed,}) { + return _then(_ExpressCheckoutOptions( +height: freezed == height ? _self.height : height // ignore: cast_nullable_to_non_nullable +as double?,buttonTheme: freezed == buttonTheme ? _self.buttonTheme : buttonTheme // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutButtonTheme?,buttonType: freezed == buttonType ? _self.buttonType : buttonType // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutButtonType?,layout: freezed == layout ? _self.layout : layout // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutLayout?,paymentMethods: freezed == paymentMethods ? _self.paymentMethods : paymentMethods // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutPaymentMethods?, + )); +} + +/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutButtonThemeCopyWith<$Res>? get buttonTheme { + if (_self.buttonTheme == null) { + return null; + } + + return $ExpressCheckoutButtonThemeCopyWith<$Res>(_self.buttonTheme!, (value) { + return _then(_self.copyWith(buttonTheme: value)); + }); +}/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutButtonTypeCopyWith<$Res>? get buttonType { + if (_self.buttonType == null) { + return null; + } + + return $ExpressCheckoutButtonTypeCopyWith<$Res>(_self.buttonType!, (value) { + return _then(_self.copyWith(buttonType: value)); + }); +}/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutLayoutCopyWith<$Res>? get layout { + if (_self.layout == null) { + return null; + } + + return $ExpressCheckoutLayoutCopyWith<$Res>(_self.layout!, (value) { + return _then(_self.copyWith(layout: value)); + }); +}/// Create a copy of ExpressCheckoutOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ExpressCheckoutPaymentMethodsCopyWith<$Res>? get paymentMethods { + if (_self.paymentMethods == null) { + return null; + } -ExpressCheckoutConfirmEvent _$ExpressCheckoutConfirmEventFromJson( - Map json) { - return _ExpressCheckoutConfirmEvent.fromJson(json); + return $ExpressCheckoutPaymentMethodsCopyWith<$Res>(_self.paymentMethods!, (value) { + return _then(_self.copyWith(paymentMethods: value)); + }); } +} + /// @nodoc mixin _$ExpressCheckoutConfirmEvent { - /// The method that was used to pay. - String get expressPaymentType => throw _privateConstructorUsedError; - BillingDetails? get billingDetails => throw _privateConstructorUsedError; + +/// The method that was used to pay. + String get expressPaymentType; BillingDetails? get billingDetails; +/// Create a copy of ExpressCheckoutConfirmEvent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ExpressCheckoutConfirmEventCopyWith get copyWith => _$ExpressCheckoutConfirmEventCopyWithImpl(this as ExpressCheckoutConfirmEvent, _$identity); /// Serializes this ExpressCheckoutConfirmEvent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ExpressCheckoutConfirmEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ExpressCheckoutConfirmEventCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ExpressCheckoutConfirmEvent&&(identical(other.expressPaymentType, expressPaymentType) || other.expressPaymentType == expressPaymentType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,expressPaymentType,billingDetails); + +@override +String toString() { + return 'ExpressCheckoutConfirmEvent(expressPaymentType: $expressPaymentType, billingDetails: $billingDetails)'; } -/// @nodoc -abstract class $ExpressCheckoutConfirmEventCopyWith<$Res> { - factory $ExpressCheckoutConfirmEventCopyWith( - ExpressCheckoutConfirmEvent value, - $Res Function(ExpressCheckoutConfirmEvent) then) = - _$ExpressCheckoutConfirmEventCopyWithImpl<$Res, - ExpressCheckoutConfirmEvent>; - @useResult - $Res call({String expressPaymentType, BillingDetails? billingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; } /// @nodoc -class _$ExpressCheckoutConfirmEventCopyWithImpl<$Res, - $Val extends ExpressCheckoutConfirmEvent> +abstract mixin class $ExpressCheckoutConfirmEventCopyWith<$Res> { + factory $ExpressCheckoutConfirmEventCopyWith(ExpressCheckoutConfirmEvent value, $Res Function(ExpressCheckoutConfirmEvent) _then) = _$ExpressCheckoutConfirmEventCopyWithImpl; +@useResult +$Res call({ + String expressPaymentType, BillingDetails? billingDetails +}); + + +$BillingDetailsCopyWith<$Res>? get billingDetails; + +} +/// @nodoc +class _$ExpressCheckoutConfirmEventCopyWithImpl<$Res> implements $ExpressCheckoutConfirmEventCopyWith<$Res> { - _$ExpressCheckoutConfirmEventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ExpressCheckoutConfirmEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? expressPaymentType = null, - Object? billingDetails = freezed, - }) { - return _then(_value.copyWith( - expressPaymentType: null == expressPaymentType - ? _value.expressPaymentType - : expressPaymentType // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - ) as $Val); + _$ExpressCheckoutConfirmEventCopyWithImpl(this._self, this._then); + + final ExpressCheckoutConfirmEvent _self; + final $Res Function(ExpressCheckoutConfirmEvent) _then; + +/// Create a copy of ExpressCheckoutConfirmEvent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? expressPaymentType = null,Object? billingDetails = freezed,}) { + return _then(_self.copyWith( +expressPaymentType: null == expressPaymentType ? _self.expressPaymentType : expressPaymentType // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} +/// Create a copy of ExpressCheckoutConfirmEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - /// Create a copy of ExpressCheckoutConfirmEvent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } -/// @nodoc -abstract class _$$ExpressCheckoutConfirmEventImplCopyWith<$Res> - implements $ExpressCheckoutConfirmEventCopyWith<$Res> { - factory _$$ExpressCheckoutConfirmEventImplCopyWith( - _$ExpressCheckoutConfirmEventImpl value, - $Res Function(_$ExpressCheckoutConfirmEventImpl) then) = - __$$ExpressCheckoutConfirmEventImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String expressPaymentType, BillingDetails? billingDetails}); - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; +/// Adds pattern-matching-related methods to [ExpressCheckoutConfirmEvent]. +extension ExpressCheckoutConfirmEventPatterns on ExpressCheckoutConfirmEvent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ExpressCheckoutConfirmEvent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ExpressCheckoutConfirmEvent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ExpressCheckoutConfirmEvent value) $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutConfirmEvent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ExpressCheckoutConfirmEvent value)? $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutConfirmEvent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String expressPaymentType, BillingDetails? billingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ExpressCheckoutConfirmEvent() when $default != null: +return $default(_that.expressPaymentType,_that.billingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String expressPaymentType, BillingDetails? billingDetails) $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutConfirmEvent(): +return $default(_that.expressPaymentType,_that.billingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String expressPaymentType, BillingDetails? billingDetails)? $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutConfirmEvent() when $default != null: +return $default(_that.expressPaymentType,_that.billingDetails);case _: + return null; + +} } -/// @nodoc -class __$$ExpressCheckoutConfirmEventImplCopyWithImpl<$Res> - extends _$ExpressCheckoutConfirmEventCopyWithImpl<$Res, - _$ExpressCheckoutConfirmEventImpl> - implements _$$ExpressCheckoutConfirmEventImplCopyWith<$Res> { - __$$ExpressCheckoutConfirmEventImplCopyWithImpl( - _$ExpressCheckoutConfirmEventImpl _value, - $Res Function(_$ExpressCheckoutConfirmEventImpl) _then) - : super(_value, _then); - - /// Create a copy of ExpressCheckoutConfirmEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? expressPaymentType = null, - Object? billingDetails = freezed, - }) { - return _then(_$ExpressCheckoutConfirmEventImpl( - expressPaymentType: null == expressPaymentType - ? _value.expressPaymentType - : expressPaymentType // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } } /// @nodoc @JsonSerializable() -class _$ExpressCheckoutConfirmEventImpl - implements _ExpressCheckoutConfirmEvent { - _$ExpressCheckoutConfirmEventImpl( - {required this.expressPaymentType, this.billingDetails}); - - factory _$ExpressCheckoutConfirmEventImpl.fromJson( - Map json) => - _$$ExpressCheckoutConfirmEventImplFromJson(json); - - /// The method that was used to pay. - @override - final String expressPaymentType; - @override - final BillingDetails? billingDetails; - - @override - String toString() { - return 'ExpressCheckoutConfirmEvent(expressPaymentType: $expressPaymentType, billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ExpressCheckoutConfirmEventImpl && - (identical(other.expressPaymentType, expressPaymentType) || - other.expressPaymentType == expressPaymentType) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _ExpressCheckoutConfirmEvent implements ExpressCheckoutConfirmEvent { + _ExpressCheckoutConfirmEvent({required this.expressPaymentType, this.billingDetails}); + factory _ExpressCheckoutConfirmEvent.fromJson(Map json) => _$ExpressCheckoutConfirmEventFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, expressPaymentType, billingDetails); - - /// Create a copy of ExpressCheckoutConfirmEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ExpressCheckoutConfirmEventImplCopyWith<_$ExpressCheckoutConfirmEventImpl> - get copyWith => __$$ExpressCheckoutConfirmEventImplCopyWithImpl< - _$ExpressCheckoutConfirmEventImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ExpressCheckoutConfirmEventImplToJson( - this, - ); - } +/// The method that was used to pay. +@override final String expressPaymentType; +@override final BillingDetails? billingDetails; + +/// Create a copy of ExpressCheckoutConfirmEvent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExpressCheckoutConfirmEventCopyWith<_ExpressCheckoutConfirmEvent> get copyWith => __$ExpressCheckoutConfirmEventCopyWithImpl<_ExpressCheckoutConfirmEvent>(this, _$identity); + +@override +Map toJson() { + return _$ExpressCheckoutConfirmEventToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ExpressCheckoutConfirmEvent&&(identical(other.expressPaymentType, expressPaymentType) || other.expressPaymentType == expressPaymentType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); } -abstract class _ExpressCheckoutConfirmEvent - implements ExpressCheckoutConfirmEvent { - factory _ExpressCheckoutConfirmEvent( - {required final String expressPaymentType, - final BillingDetails? billingDetails}) = - _$ExpressCheckoutConfirmEventImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,expressPaymentType,billingDetails); - factory _ExpressCheckoutConfirmEvent.fromJson(Map json) = - _$ExpressCheckoutConfirmEventImpl.fromJson; +@override +String toString() { + return 'ExpressCheckoutConfirmEvent(expressPaymentType: $expressPaymentType, billingDetails: $billingDetails)'; +} - /// The method that was used to pay. - @override - String get expressPaymentType; - @override - BillingDetails? get billingDetails; - /// Create a copy of ExpressCheckoutConfirmEvent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ExpressCheckoutConfirmEventImplCopyWith<_$ExpressCheckoutConfirmEventImpl> - get copyWith => throw _privateConstructorUsedError; } -ExpressCheckoutLayout _$ExpressCheckoutLayoutFromJson( - Map json) { - return _ExpressCheckoutLayout.fromJson(json); +/// @nodoc +abstract mixin class _$ExpressCheckoutConfirmEventCopyWith<$Res> implements $ExpressCheckoutConfirmEventCopyWith<$Res> { + factory _$ExpressCheckoutConfirmEventCopyWith(_ExpressCheckoutConfirmEvent value, $Res Function(_ExpressCheckoutConfirmEvent) _then) = __$ExpressCheckoutConfirmEventCopyWithImpl; +@override @useResult +$Res call({ + String expressPaymentType, BillingDetails? billingDetails +}); + + +@override $BillingDetailsCopyWith<$Res>? get billingDetails; + +} +/// @nodoc +class __$ExpressCheckoutConfirmEventCopyWithImpl<$Res> + implements _$ExpressCheckoutConfirmEventCopyWith<$Res> { + __$ExpressCheckoutConfirmEventCopyWithImpl(this._self, this._then); + + final _ExpressCheckoutConfirmEvent _self; + final $Res Function(_ExpressCheckoutConfirmEvent) _then; + +/// Create a copy of ExpressCheckoutConfirmEvent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? expressPaymentType = null,Object? billingDetails = freezed,}) { + return _then(_ExpressCheckoutConfirmEvent( +expressPaymentType: null == expressPaymentType ? _self.expressPaymentType : expressPaymentType // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); } +/// Create a copy of ExpressCheckoutConfirmEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} +} + + /// @nodoc mixin _$ExpressCheckoutLayout { - int? get maxColumns => throw _privateConstructorUsedError; - int? get maxRows => throw _privateConstructorUsedError; - ExpressCheckoutOverflow? get overflow => throw _privateConstructorUsedError; + + int? get maxColumns; int? get maxRows; ExpressCheckoutOverflow? get overflow; +/// Create a copy of ExpressCheckoutLayout +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ExpressCheckoutLayoutCopyWith get copyWith => _$ExpressCheckoutLayoutCopyWithImpl(this as ExpressCheckoutLayout, _$identity); /// Serializes this ExpressCheckoutLayout to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ExpressCheckoutLayout - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ExpressCheckoutLayoutCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ExpressCheckoutLayout&&(identical(other.maxColumns, maxColumns) || other.maxColumns == maxColumns)&&(identical(other.maxRows, maxRows) || other.maxRows == maxRows)&&(identical(other.overflow, overflow) || other.overflow == overflow)); } -/// @nodoc -abstract class $ExpressCheckoutLayoutCopyWith<$Res> { - factory $ExpressCheckoutLayoutCopyWith(ExpressCheckoutLayout value, - $Res Function(ExpressCheckoutLayout) then) = - _$ExpressCheckoutLayoutCopyWithImpl<$Res, ExpressCheckoutLayout>; - @useResult - $Res call({int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,maxColumns,maxRows,overflow); + +@override +String toString() { + return 'ExpressCheckoutLayout(maxColumns: $maxColumns, maxRows: $maxRows, overflow: $overflow)'; } -/// @nodoc -class _$ExpressCheckoutLayoutCopyWithImpl<$Res, - $Val extends ExpressCheckoutLayout> - implements $ExpressCheckoutLayoutCopyWith<$Res> { - _$ExpressCheckoutLayoutCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ExpressCheckoutLayout - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? maxColumns = freezed, - Object? maxRows = freezed, - Object? overflow = freezed, - }) { - return _then(_value.copyWith( - maxColumns: freezed == maxColumns - ? _value.maxColumns - : maxColumns // ignore: cast_nullable_to_non_nullable - as int?, - maxRows: freezed == maxRows - ? _value.maxRows - : maxRows // ignore: cast_nullable_to_non_nullable - as int?, - overflow: freezed == overflow - ? _value.overflow - : overflow // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutOverflow?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ExpressCheckoutLayoutImplCopyWith<$Res> +abstract mixin class $ExpressCheckoutLayoutCopyWith<$Res> { + factory $ExpressCheckoutLayoutCopyWith(ExpressCheckoutLayout value, $Res Function(ExpressCheckoutLayout) _then) = _$ExpressCheckoutLayoutCopyWithImpl; +@useResult +$Res call({ + int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow +}); + + + + +} +/// @nodoc +class _$ExpressCheckoutLayoutCopyWithImpl<$Res> implements $ExpressCheckoutLayoutCopyWith<$Res> { - factory _$$ExpressCheckoutLayoutImplCopyWith( - _$ExpressCheckoutLayoutImpl value, - $Res Function(_$ExpressCheckoutLayoutImpl) then) = - __$$ExpressCheckoutLayoutImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow}); + _$ExpressCheckoutLayoutCopyWithImpl(this._self, this._then); + + final ExpressCheckoutLayout _self; + final $Res Function(ExpressCheckoutLayout) _then; + +/// Create a copy of ExpressCheckoutLayout +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? maxColumns = freezed,Object? maxRows = freezed,Object? overflow = freezed,}) { + return _then(_self.copyWith( +maxColumns: freezed == maxColumns ? _self.maxColumns : maxColumns // ignore: cast_nullable_to_non_nullable +as int?,maxRows: freezed == maxRows ? _self.maxRows : maxRows // ignore: cast_nullable_to_non_nullable +as int?,overflow: freezed == overflow ? _self.overflow : overflow // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutOverflow?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ExpressCheckoutLayout]. +extension ExpressCheckoutLayoutPatterns on ExpressCheckoutLayout { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ExpressCheckoutLayout value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ExpressCheckoutLayout() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ExpressCheckoutLayout value) $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutLayout(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ExpressCheckoutLayout value)? $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutLayout() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ExpressCheckoutLayout() when $default != null: +return $default(_that.maxColumns,_that.maxRows,_that.overflow);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow) $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutLayout(): +return $default(_that.maxColumns,_that.maxRows,_that.overflow);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow)? $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutLayout() when $default != null: +return $default(_that.maxColumns,_that.maxRows,_that.overflow);case _: + return null; + +} } -/// @nodoc -class __$$ExpressCheckoutLayoutImplCopyWithImpl<$Res> - extends _$ExpressCheckoutLayoutCopyWithImpl<$Res, - _$ExpressCheckoutLayoutImpl> - implements _$$ExpressCheckoutLayoutImplCopyWith<$Res> { - __$$ExpressCheckoutLayoutImplCopyWithImpl(_$ExpressCheckoutLayoutImpl _value, - $Res Function(_$ExpressCheckoutLayoutImpl) _then) - : super(_value, _then); - - /// Create a copy of ExpressCheckoutLayout - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? maxColumns = freezed, - Object? maxRows = freezed, - Object? overflow = freezed, - }) { - return _then(_$ExpressCheckoutLayoutImpl( - maxColumns: freezed == maxColumns - ? _value.maxColumns - : maxColumns // ignore: cast_nullable_to_non_nullable - as int?, - maxRows: freezed == maxRows - ? _value.maxRows - : maxRows // ignore: cast_nullable_to_non_nullable - as int?, - overflow: freezed == overflow - ? _value.overflow - : overflow // ignore: cast_nullable_to_non_nullable - as ExpressCheckoutOverflow?, - )); - } } /// @nodoc @JsonSerializable() -class _$ExpressCheckoutLayoutImpl implements _ExpressCheckoutLayout { - const _$ExpressCheckoutLayoutImpl( - {this.maxColumns, this.maxRows, this.overflow}); - - factory _$ExpressCheckoutLayoutImpl.fromJson(Map json) => - _$$ExpressCheckoutLayoutImplFromJson(json); - - @override - final int? maxColumns; - @override - final int? maxRows; - @override - final ExpressCheckoutOverflow? overflow; - - @override - String toString() { - return 'ExpressCheckoutLayout(maxColumns: $maxColumns, maxRows: $maxRows, overflow: $overflow)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ExpressCheckoutLayoutImpl && - (identical(other.maxColumns, maxColumns) || - other.maxColumns == maxColumns) && - (identical(other.maxRows, maxRows) || other.maxRows == maxRows) && - (identical(other.overflow, overflow) || - other.overflow == overflow)); - } +class _ExpressCheckoutLayout implements ExpressCheckoutLayout { + const _ExpressCheckoutLayout({this.maxColumns, this.maxRows, this.overflow}); + factory _ExpressCheckoutLayout.fromJson(Map json) => _$ExpressCheckoutLayoutFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, maxColumns, maxRows, overflow); - - /// Create a copy of ExpressCheckoutLayout - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ExpressCheckoutLayoutImplCopyWith<_$ExpressCheckoutLayoutImpl> - get copyWith => __$$ExpressCheckoutLayoutImplCopyWithImpl< - _$ExpressCheckoutLayoutImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ExpressCheckoutLayoutImplToJson( - this, - ); - } +@override final int? maxColumns; +@override final int? maxRows; +@override final ExpressCheckoutOverflow? overflow; + +/// Create a copy of ExpressCheckoutLayout +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExpressCheckoutLayoutCopyWith<_ExpressCheckoutLayout> get copyWith => __$ExpressCheckoutLayoutCopyWithImpl<_ExpressCheckoutLayout>(this, _$identity); + +@override +Map toJson() { + return _$ExpressCheckoutLayoutToJson(this, ); } -abstract class _ExpressCheckoutLayout implements ExpressCheckoutLayout { - const factory _ExpressCheckoutLayout( - {final int? maxColumns, - final int? maxRows, - final ExpressCheckoutOverflow? overflow}) = _$ExpressCheckoutLayoutImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ExpressCheckoutLayout&&(identical(other.maxColumns, maxColumns) || other.maxColumns == maxColumns)&&(identical(other.maxRows, maxRows) || other.maxRows == maxRows)&&(identical(other.overflow, overflow) || other.overflow == overflow)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,maxColumns,maxRows,overflow); - factory _ExpressCheckoutLayout.fromJson(Map json) = - _$ExpressCheckoutLayoutImpl.fromJson; +@override +String toString() { + return 'ExpressCheckoutLayout(maxColumns: $maxColumns, maxRows: $maxRows, overflow: $overflow)'; +} - @override - int? get maxColumns; - @override - int? get maxRows; - @override - ExpressCheckoutOverflow? get overflow; - /// Create a copy of ExpressCheckoutLayout - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ExpressCheckoutLayoutImplCopyWith<_$ExpressCheckoutLayoutImpl> - get copyWith => throw _privateConstructorUsedError; } -ExpressCheckoutButtonTheme _$ExpressCheckoutButtonThemeFromJson( - Map json) { - return _ExpressCheckoutButtonTheme.fromJson(json); +/// @nodoc +abstract mixin class _$ExpressCheckoutLayoutCopyWith<$Res> implements $ExpressCheckoutLayoutCopyWith<$Res> { + factory _$ExpressCheckoutLayoutCopyWith(_ExpressCheckoutLayout value, $Res Function(_ExpressCheckoutLayout) _then) = __$ExpressCheckoutLayoutCopyWithImpl; +@override @useResult +$Res call({ + int? maxColumns, int? maxRows, ExpressCheckoutOverflow? overflow +}); + + + + +} +/// @nodoc +class __$ExpressCheckoutLayoutCopyWithImpl<$Res> + implements _$ExpressCheckoutLayoutCopyWith<$Res> { + __$ExpressCheckoutLayoutCopyWithImpl(this._self, this._then); + + final _ExpressCheckoutLayout _self; + final $Res Function(_ExpressCheckoutLayout) _then; + +/// Create a copy of ExpressCheckoutLayout +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? maxColumns = freezed,Object? maxRows = freezed,Object? overflow = freezed,}) { + return _then(_ExpressCheckoutLayout( +maxColumns: freezed == maxColumns ? _self.maxColumns : maxColumns // ignore: cast_nullable_to_non_nullable +as int?,maxRows: freezed == maxRows ? _self.maxRows : maxRows // ignore: cast_nullable_to_non_nullable +as int?,overflow: freezed == overflow ? _self.overflow : overflow // ignore: cast_nullable_to_non_nullable +as ExpressCheckoutOverflow?, + )); } + +} + + /// @nodoc mixin _$ExpressCheckoutButtonTheme { - ExpressApplePayButtonTheme? get applePay => - throw _privateConstructorUsedError; - ExpressGooglePayButtonTheme? get googlePay => - throw _privateConstructorUsedError; - ExpressPaypalButtonTheme? get paypal => throw _privateConstructorUsedError; + + ExpressApplePayButtonTheme? get applePay; ExpressGooglePayButtonTheme? get googlePay; ExpressPaypalButtonTheme? get paypal; +/// Create a copy of ExpressCheckoutButtonTheme +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ExpressCheckoutButtonThemeCopyWith get copyWith => _$ExpressCheckoutButtonThemeCopyWithImpl(this as ExpressCheckoutButtonTheme, _$identity); /// Serializes this ExpressCheckoutButtonTheme to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ExpressCheckoutButtonTheme - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ExpressCheckoutButtonThemeCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ExpressCheckoutButtonTheme&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.paypal, paypal) || other.paypal == paypal)); } -/// @nodoc -abstract class $ExpressCheckoutButtonThemeCopyWith<$Res> { - factory $ExpressCheckoutButtonThemeCopyWith(ExpressCheckoutButtonTheme value, - $Res Function(ExpressCheckoutButtonTheme) then) = - _$ExpressCheckoutButtonThemeCopyWithImpl<$Res, - ExpressCheckoutButtonTheme>; - @useResult - $Res call( - {ExpressApplePayButtonTheme? applePay, - ExpressGooglePayButtonTheme? googlePay, - ExpressPaypalButtonTheme? paypal}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay,paypal); + +@override +String toString() { + return 'ExpressCheckoutButtonTheme(applePay: $applePay, googlePay: $googlePay, paypal: $paypal)'; } -/// @nodoc -class _$ExpressCheckoutButtonThemeCopyWithImpl<$Res, - $Val extends ExpressCheckoutButtonTheme> - implements $ExpressCheckoutButtonThemeCopyWith<$Res> { - _$ExpressCheckoutButtonThemeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ExpressCheckoutButtonTheme - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - Object? paypal = freezed, - }) { - return _then(_value.copyWith( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ExpressApplePayButtonTheme?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as ExpressGooglePayButtonTheme?, - paypal: freezed == paypal - ? _value.paypal - : paypal // ignore: cast_nullable_to_non_nullable - as ExpressPaypalButtonTheme?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ExpressCheckoutButtonThemeImplCopyWith<$Res> +abstract mixin class $ExpressCheckoutButtonThemeCopyWith<$Res> { + factory $ExpressCheckoutButtonThemeCopyWith(ExpressCheckoutButtonTheme value, $Res Function(ExpressCheckoutButtonTheme) _then) = _$ExpressCheckoutButtonThemeCopyWithImpl; +@useResult +$Res call({ + ExpressApplePayButtonTheme? applePay, ExpressGooglePayButtonTheme? googlePay, ExpressPaypalButtonTheme? paypal +}); + + + + +} +/// @nodoc +class _$ExpressCheckoutButtonThemeCopyWithImpl<$Res> implements $ExpressCheckoutButtonThemeCopyWith<$Res> { - factory _$$ExpressCheckoutButtonThemeImplCopyWith( - _$ExpressCheckoutButtonThemeImpl value, - $Res Function(_$ExpressCheckoutButtonThemeImpl) then) = - __$$ExpressCheckoutButtonThemeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ExpressApplePayButtonTheme? applePay, - ExpressGooglePayButtonTheme? googlePay, - ExpressPaypalButtonTheme? paypal}); + _$ExpressCheckoutButtonThemeCopyWithImpl(this._self, this._then); + + final ExpressCheckoutButtonTheme _self; + final $Res Function(ExpressCheckoutButtonTheme) _then; + +/// Create a copy of ExpressCheckoutButtonTheme +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? applePay = freezed,Object? googlePay = freezed,Object? paypal = freezed,}) { + return _then(_self.copyWith( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ExpressApplePayButtonTheme?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as ExpressGooglePayButtonTheme?,paypal: freezed == paypal ? _self.paypal : paypal // ignore: cast_nullable_to_non_nullable +as ExpressPaypalButtonTheme?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ExpressCheckoutButtonTheme]. +extension ExpressCheckoutButtonThemePatterns on ExpressCheckoutButtonTheme { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ExpressCheckoutButtonTheme value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ExpressCheckoutButtonTheme() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ExpressCheckoutButtonTheme value) $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutButtonTheme(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ExpressCheckoutButtonTheme value)? $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutButtonTheme() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ExpressApplePayButtonTheme? applePay, ExpressGooglePayButtonTheme? googlePay, ExpressPaypalButtonTheme? paypal)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ExpressCheckoutButtonTheme() when $default != null: +return $default(_that.applePay,_that.googlePay,_that.paypal);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ExpressApplePayButtonTheme? applePay, ExpressGooglePayButtonTheme? googlePay, ExpressPaypalButtonTheme? paypal) $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutButtonTheme(): +return $default(_that.applePay,_that.googlePay,_that.paypal);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ExpressApplePayButtonTheme? applePay, ExpressGooglePayButtonTheme? googlePay, ExpressPaypalButtonTheme? paypal)? $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutButtonTheme() when $default != null: +return $default(_that.applePay,_that.googlePay,_that.paypal);case _: + return null; + +} } -/// @nodoc -class __$$ExpressCheckoutButtonThemeImplCopyWithImpl<$Res> - extends _$ExpressCheckoutButtonThemeCopyWithImpl<$Res, - _$ExpressCheckoutButtonThemeImpl> - implements _$$ExpressCheckoutButtonThemeImplCopyWith<$Res> { - __$$ExpressCheckoutButtonThemeImplCopyWithImpl( - _$ExpressCheckoutButtonThemeImpl _value, - $Res Function(_$ExpressCheckoutButtonThemeImpl) _then) - : super(_value, _then); - - /// Create a copy of ExpressCheckoutButtonTheme - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - Object? paypal = freezed, - }) { - return _then(_$ExpressCheckoutButtonThemeImpl( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ExpressApplePayButtonTheme?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as ExpressGooglePayButtonTheme?, - paypal: freezed == paypal - ? _value.paypal - : paypal // ignore: cast_nullable_to_non_nullable - as ExpressPaypalButtonTheme?, - )); - } } /// @nodoc @JsonSerializable() -class _$ExpressCheckoutButtonThemeImpl implements _ExpressCheckoutButtonTheme { - const _$ExpressCheckoutButtonThemeImpl( - {this.applePay, this.googlePay, this.paypal}); - - factory _$ExpressCheckoutButtonThemeImpl.fromJson( - Map json) => - _$$ExpressCheckoutButtonThemeImplFromJson(json); - - @override - final ExpressApplePayButtonTheme? applePay; - @override - final ExpressGooglePayButtonTheme? googlePay; - @override - final ExpressPaypalButtonTheme? paypal; - - @override - String toString() { - return 'ExpressCheckoutButtonTheme(applePay: $applePay, googlePay: $googlePay, paypal: $paypal)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ExpressCheckoutButtonThemeImpl && - (identical(other.applePay, applePay) || - other.applePay == applePay) && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay) && - (identical(other.paypal, paypal) || other.paypal == paypal)); - } +class _ExpressCheckoutButtonTheme implements ExpressCheckoutButtonTheme { + const _ExpressCheckoutButtonTheme({this.applePay, this.googlePay, this.paypal}); + factory _ExpressCheckoutButtonTheme.fromJson(Map json) => _$ExpressCheckoutButtonThemeFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, applePay, googlePay, paypal); - - /// Create a copy of ExpressCheckoutButtonTheme - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ExpressCheckoutButtonThemeImplCopyWith<_$ExpressCheckoutButtonThemeImpl> - get copyWith => __$$ExpressCheckoutButtonThemeImplCopyWithImpl< - _$ExpressCheckoutButtonThemeImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ExpressCheckoutButtonThemeImplToJson( - this, - ); - } +@override final ExpressApplePayButtonTheme? applePay; +@override final ExpressGooglePayButtonTheme? googlePay; +@override final ExpressPaypalButtonTheme? paypal; + +/// Create a copy of ExpressCheckoutButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExpressCheckoutButtonThemeCopyWith<_ExpressCheckoutButtonTheme> get copyWith => __$ExpressCheckoutButtonThemeCopyWithImpl<_ExpressCheckoutButtonTheme>(this, _$identity); + +@override +Map toJson() { + return _$ExpressCheckoutButtonThemeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ExpressCheckoutButtonTheme&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.paypal, paypal) || other.paypal == paypal)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay,paypal); + +@override +String toString() { + return 'ExpressCheckoutButtonTheme(applePay: $applePay, googlePay: $googlePay, paypal: $paypal)'; } -abstract class _ExpressCheckoutButtonTheme - implements ExpressCheckoutButtonTheme { - const factory _ExpressCheckoutButtonTheme( - {final ExpressApplePayButtonTheme? applePay, - final ExpressGooglePayButtonTheme? googlePay, - final ExpressPaypalButtonTheme? paypal}) = - _$ExpressCheckoutButtonThemeImpl; - factory _ExpressCheckoutButtonTheme.fromJson(Map json) = - _$ExpressCheckoutButtonThemeImpl.fromJson; +} - @override - ExpressApplePayButtonTheme? get applePay; - @override - ExpressGooglePayButtonTheme? get googlePay; - @override - ExpressPaypalButtonTheme? get paypal; +/// @nodoc +abstract mixin class _$ExpressCheckoutButtonThemeCopyWith<$Res> implements $ExpressCheckoutButtonThemeCopyWith<$Res> { + factory _$ExpressCheckoutButtonThemeCopyWith(_ExpressCheckoutButtonTheme value, $Res Function(_ExpressCheckoutButtonTheme) _then) = __$ExpressCheckoutButtonThemeCopyWithImpl; +@override @useResult +$Res call({ + ExpressApplePayButtonTheme? applePay, ExpressGooglePayButtonTheme? googlePay, ExpressPaypalButtonTheme? paypal +}); - /// Create a copy of ExpressCheckoutButtonTheme - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ExpressCheckoutButtonThemeImplCopyWith<_$ExpressCheckoutButtonThemeImpl> - get copyWith => throw _privateConstructorUsedError; + + + +} +/// @nodoc +class __$ExpressCheckoutButtonThemeCopyWithImpl<$Res> + implements _$ExpressCheckoutButtonThemeCopyWith<$Res> { + __$ExpressCheckoutButtonThemeCopyWithImpl(this._self, this._then); + + final _ExpressCheckoutButtonTheme _self; + final $Res Function(_ExpressCheckoutButtonTheme) _then; + +/// Create a copy of ExpressCheckoutButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? applePay = freezed,Object? googlePay = freezed,Object? paypal = freezed,}) { + return _then(_ExpressCheckoutButtonTheme( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ExpressApplePayButtonTheme?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as ExpressGooglePayButtonTheme?,paypal: freezed == paypal ? _self.paypal : paypal // ignore: cast_nullable_to_non_nullable +as ExpressPaypalButtonTheme?, + )); } -ExpressCheckoutButtonType _$ExpressCheckoutButtonTypeFromJson( - Map json) { - return _ExpressCheckoutButtonType.fromJson(json); + } + /// @nodoc mixin _$ExpressCheckoutButtonType { - ExpressApplePayButtonType? get applePay => throw _privateConstructorUsedError; - ExpressGooglePayButtonType? get googlePay => - throw _privateConstructorUsedError; - ExpressPaypalButtonType? get paypal => throw _privateConstructorUsedError; + + ExpressApplePayButtonType? get applePay; ExpressGooglePayButtonType? get googlePay; ExpressPaypalButtonType? get paypal; +/// Create a copy of ExpressCheckoutButtonType +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ExpressCheckoutButtonTypeCopyWith get copyWith => _$ExpressCheckoutButtonTypeCopyWithImpl(this as ExpressCheckoutButtonType, _$identity); /// Serializes this ExpressCheckoutButtonType to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ExpressCheckoutButtonType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ExpressCheckoutButtonTypeCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ExpressCheckoutButtonType&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.paypal, paypal) || other.paypal == paypal)); } -/// @nodoc -abstract class $ExpressCheckoutButtonTypeCopyWith<$Res> { - factory $ExpressCheckoutButtonTypeCopyWith(ExpressCheckoutButtonType value, - $Res Function(ExpressCheckoutButtonType) then) = - _$ExpressCheckoutButtonTypeCopyWithImpl<$Res, ExpressCheckoutButtonType>; - @useResult - $Res call( - {ExpressApplePayButtonType? applePay, - ExpressGooglePayButtonType? googlePay, - ExpressPaypalButtonType? paypal}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay,paypal); + +@override +String toString() { + return 'ExpressCheckoutButtonType(applePay: $applePay, googlePay: $googlePay, paypal: $paypal)'; } -/// @nodoc -class _$ExpressCheckoutButtonTypeCopyWithImpl<$Res, - $Val extends ExpressCheckoutButtonType> - implements $ExpressCheckoutButtonTypeCopyWith<$Res> { - _$ExpressCheckoutButtonTypeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ExpressCheckoutButtonType - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - Object? paypal = freezed, - }) { - return _then(_value.copyWith( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ExpressApplePayButtonType?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as ExpressGooglePayButtonType?, - paypal: freezed == paypal - ? _value.paypal - : paypal // ignore: cast_nullable_to_non_nullable - as ExpressPaypalButtonType?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ExpressCheckoutButtonTypeImplCopyWith<$Res> +abstract mixin class $ExpressCheckoutButtonTypeCopyWith<$Res> { + factory $ExpressCheckoutButtonTypeCopyWith(ExpressCheckoutButtonType value, $Res Function(ExpressCheckoutButtonType) _then) = _$ExpressCheckoutButtonTypeCopyWithImpl; +@useResult +$Res call({ + ExpressApplePayButtonType? applePay, ExpressGooglePayButtonType? googlePay, ExpressPaypalButtonType? paypal +}); + + + + +} +/// @nodoc +class _$ExpressCheckoutButtonTypeCopyWithImpl<$Res> implements $ExpressCheckoutButtonTypeCopyWith<$Res> { - factory _$$ExpressCheckoutButtonTypeImplCopyWith( - _$ExpressCheckoutButtonTypeImpl value, - $Res Function(_$ExpressCheckoutButtonTypeImpl) then) = - __$$ExpressCheckoutButtonTypeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ExpressApplePayButtonType? applePay, - ExpressGooglePayButtonType? googlePay, - ExpressPaypalButtonType? paypal}); + _$ExpressCheckoutButtonTypeCopyWithImpl(this._self, this._then); + + final ExpressCheckoutButtonType _self; + final $Res Function(ExpressCheckoutButtonType) _then; + +/// Create a copy of ExpressCheckoutButtonType +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? applePay = freezed,Object? googlePay = freezed,Object? paypal = freezed,}) { + return _then(_self.copyWith( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ExpressApplePayButtonType?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as ExpressGooglePayButtonType?,paypal: freezed == paypal ? _self.paypal : paypal // ignore: cast_nullable_to_non_nullable +as ExpressPaypalButtonType?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ExpressCheckoutButtonType]. +extension ExpressCheckoutButtonTypePatterns on ExpressCheckoutButtonType { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ExpressCheckoutButtonType value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ExpressCheckoutButtonType() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ExpressCheckoutButtonType value) $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutButtonType(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ExpressCheckoutButtonType value)? $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutButtonType() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ExpressApplePayButtonType? applePay, ExpressGooglePayButtonType? googlePay, ExpressPaypalButtonType? paypal)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ExpressCheckoutButtonType() when $default != null: +return $default(_that.applePay,_that.googlePay,_that.paypal);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ExpressApplePayButtonType? applePay, ExpressGooglePayButtonType? googlePay, ExpressPaypalButtonType? paypal) $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutButtonType(): +return $default(_that.applePay,_that.googlePay,_that.paypal);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ExpressApplePayButtonType? applePay, ExpressGooglePayButtonType? googlePay, ExpressPaypalButtonType? paypal)? $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutButtonType() when $default != null: +return $default(_that.applePay,_that.googlePay,_that.paypal);case _: + return null; + +} } -/// @nodoc -class __$$ExpressCheckoutButtonTypeImplCopyWithImpl<$Res> - extends _$ExpressCheckoutButtonTypeCopyWithImpl<$Res, - _$ExpressCheckoutButtonTypeImpl> - implements _$$ExpressCheckoutButtonTypeImplCopyWith<$Res> { - __$$ExpressCheckoutButtonTypeImplCopyWithImpl( - _$ExpressCheckoutButtonTypeImpl _value, - $Res Function(_$ExpressCheckoutButtonTypeImpl) _then) - : super(_value, _then); - - /// Create a copy of ExpressCheckoutButtonType - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - Object? paypal = freezed, - }) { - return _then(_$ExpressCheckoutButtonTypeImpl( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ExpressApplePayButtonType?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as ExpressGooglePayButtonType?, - paypal: freezed == paypal - ? _value.paypal - : paypal // ignore: cast_nullable_to_non_nullable - as ExpressPaypalButtonType?, - )); - } } /// @nodoc @JsonSerializable() -class _$ExpressCheckoutButtonTypeImpl implements _ExpressCheckoutButtonType { - const _$ExpressCheckoutButtonTypeImpl( - {this.applePay, this.googlePay, this.paypal}); - - factory _$ExpressCheckoutButtonTypeImpl.fromJson(Map json) => - _$$ExpressCheckoutButtonTypeImplFromJson(json); - - @override - final ExpressApplePayButtonType? applePay; - @override - final ExpressGooglePayButtonType? googlePay; - @override - final ExpressPaypalButtonType? paypal; - - @override - String toString() { - return 'ExpressCheckoutButtonType(applePay: $applePay, googlePay: $googlePay, paypal: $paypal)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ExpressCheckoutButtonTypeImpl && - (identical(other.applePay, applePay) || - other.applePay == applePay) && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay) && - (identical(other.paypal, paypal) || other.paypal == paypal)); - } +class _ExpressCheckoutButtonType implements ExpressCheckoutButtonType { + const _ExpressCheckoutButtonType({this.applePay, this.googlePay, this.paypal}); + factory _ExpressCheckoutButtonType.fromJson(Map json) => _$ExpressCheckoutButtonTypeFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, applePay, googlePay, paypal); - - /// Create a copy of ExpressCheckoutButtonType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ExpressCheckoutButtonTypeImplCopyWith<_$ExpressCheckoutButtonTypeImpl> - get copyWith => __$$ExpressCheckoutButtonTypeImplCopyWithImpl< - _$ExpressCheckoutButtonTypeImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ExpressCheckoutButtonTypeImplToJson( - this, - ); - } +@override final ExpressApplePayButtonType? applePay; +@override final ExpressGooglePayButtonType? googlePay; +@override final ExpressPaypalButtonType? paypal; + +/// Create a copy of ExpressCheckoutButtonType +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExpressCheckoutButtonTypeCopyWith<_ExpressCheckoutButtonType> get copyWith => __$ExpressCheckoutButtonTypeCopyWithImpl<_ExpressCheckoutButtonType>(this, _$identity); + +@override +Map toJson() { + return _$ExpressCheckoutButtonTypeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ExpressCheckoutButtonType&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.paypal, paypal) || other.paypal == paypal)); } -abstract class _ExpressCheckoutButtonType implements ExpressCheckoutButtonType { - const factory _ExpressCheckoutButtonType( - {final ExpressApplePayButtonType? applePay, - final ExpressGooglePayButtonType? googlePay, - final ExpressPaypalButtonType? paypal}) = _$ExpressCheckoutButtonTypeImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay,paypal); - factory _ExpressCheckoutButtonType.fromJson(Map json) = - _$ExpressCheckoutButtonTypeImpl.fromJson; +@override +String toString() { + return 'ExpressCheckoutButtonType(applePay: $applePay, googlePay: $googlePay, paypal: $paypal)'; +} - @override - ExpressApplePayButtonType? get applePay; - @override - ExpressGooglePayButtonType? get googlePay; - @override - ExpressPaypalButtonType? get paypal; - /// Create a copy of ExpressCheckoutButtonType - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ExpressCheckoutButtonTypeImplCopyWith<_$ExpressCheckoutButtonTypeImpl> - get copyWith => throw _privateConstructorUsedError; } -ExpressCheckoutPaymentMethods _$ExpressCheckoutPaymentMethodsFromJson( - Map json) { - return _ExpressCheckoutPaymentMethods.fromJson(json); +/// @nodoc +abstract mixin class _$ExpressCheckoutButtonTypeCopyWith<$Res> implements $ExpressCheckoutButtonTypeCopyWith<$Res> { + factory _$ExpressCheckoutButtonTypeCopyWith(_ExpressCheckoutButtonType value, $Res Function(_ExpressCheckoutButtonType) _then) = __$ExpressCheckoutButtonTypeCopyWithImpl; +@override @useResult +$Res call({ + ExpressApplePayButtonType? applePay, ExpressGooglePayButtonType? googlePay, ExpressPaypalButtonType? paypal +}); + + + + } +/// @nodoc +class __$ExpressCheckoutButtonTypeCopyWithImpl<$Res> + implements _$ExpressCheckoutButtonTypeCopyWith<$Res> { + __$ExpressCheckoutButtonTypeCopyWithImpl(this._self, this._then); + + final _ExpressCheckoutButtonType _self; + final $Res Function(_ExpressCheckoutButtonType) _then; + +/// Create a copy of ExpressCheckoutButtonType +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? applePay = freezed,Object? googlePay = freezed,Object? paypal = freezed,}) { + return _then(_ExpressCheckoutButtonType( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ExpressApplePayButtonType?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as ExpressGooglePayButtonType?,paypal: freezed == paypal ? _self.paypal : paypal // ignore: cast_nullable_to_non_nullable +as ExpressPaypalButtonType?, + )); +} + + +} + /// @nodoc mixin _$ExpressCheckoutPaymentMethods { - ExpressPaymentNethodEnabled? get applePay => - throw _privateConstructorUsedError; - ExpressPaymentNethodEnabled? get googlePay => - throw _privateConstructorUsedError; - ExpressPaymentNethodEnabled? get paypal => throw _privateConstructorUsedError; - ExpressPaymentNethodEnabled? get link => throw _privateConstructorUsedError; - ExpressPaymentNethodEnabled? get amazonPay => - throw _privateConstructorUsedError; + + ExpressPaymentNethodEnabled? get applePay; ExpressPaymentNethodEnabled? get googlePay; ExpressPaymentNethodEnabled? get paypal; ExpressPaymentNethodEnabled? get link; ExpressPaymentNethodEnabled? get amazonPay; +/// Create a copy of ExpressCheckoutPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ExpressCheckoutPaymentMethodsCopyWith get copyWith => _$ExpressCheckoutPaymentMethodsCopyWithImpl(this as ExpressCheckoutPaymentMethods, _$identity); /// Serializes this ExpressCheckoutPaymentMethods to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ExpressCheckoutPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ExpressCheckoutPaymentMethodsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ExpressCheckoutPaymentMethods&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.paypal, paypal) || other.paypal == paypal)&&(identical(other.link, link) || other.link == link)&&(identical(other.amazonPay, amazonPay) || other.amazonPay == amazonPay)); } -/// @nodoc -abstract class $ExpressCheckoutPaymentMethodsCopyWith<$Res> { - factory $ExpressCheckoutPaymentMethodsCopyWith( - ExpressCheckoutPaymentMethods value, - $Res Function(ExpressCheckoutPaymentMethods) then) = - _$ExpressCheckoutPaymentMethodsCopyWithImpl<$Res, - ExpressCheckoutPaymentMethods>; - @useResult - $Res call( - {ExpressPaymentNethodEnabled? applePay, - ExpressPaymentNethodEnabled? googlePay, - ExpressPaymentNethodEnabled? paypal, - ExpressPaymentNethodEnabled? link, - ExpressPaymentNethodEnabled? amazonPay}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay,paypal,link,amazonPay); + +@override +String toString() { + return 'ExpressCheckoutPaymentMethods(applePay: $applePay, googlePay: $googlePay, paypal: $paypal, link: $link, amazonPay: $amazonPay)'; } -/// @nodoc -class _$ExpressCheckoutPaymentMethodsCopyWithImpl<$Res, - $Val extends ExpressCheckoutPaymentMethods> - implements $ExpressCheckoutPaymentMethodsCopyWith<$Res> { - _$ExpressCheckoutPaymentMethodsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ExpressCheckoutPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - Object? paypal = freezed, - Object? link = freezed, - Object? amazonPay = freezed, - }) { - return _then(_value.copyWith( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - paypal: freezed == paypal - ? _value.paypal - : paypal // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - link: freezed == link - ? _value.link - : link // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - amazonPay: freezed == amazonPay - ? _value.amazonPay - : amazonPay // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ExpressCheckoutPaymentMethodsImplCopyWith<$Res> +abstract mixin class $ExpressCheckoutPaymentMethodsCopyWith<$Res> { + factory $ExpressCheckoutPaymentMethodsCopyWith(ExpressCheckoutPaymentMethods value, $Res Function(ExpressCheckoutPaymentMethods) _then) = _$ExpressCheckoutPaymentMethodsCopyWithImpl; +@useResult +$Res call({ + ExpressPaymentNethodEnabled? applePay, ExpressPaymentNethodEnabled? googlePay, ExpressPaymentNethodEnabled? paypal, ExpressPaymentNethodEnabled? link, ExpressPaymentNethodEnabled? amazonPay +}); + + + + +} +/// @nodoc +class _$ExpressCheckoutPaymentMethodsCopyWithImpl<$Res> implements $ExpressCheckoutPaymentMethodsCopyWith<$Res> { - factory _$$ExpressCheckoutPaymentMethodsImplCopyWith( - _$ExpressCheckoutPaymentMethodsImpl value, - $Res Function(_$ExpressCheckoutPaymentMethodsImpl) then) = - __$$ExpressCheckoutPaymentMethodsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ExpressPaymentNethodEnabled? applePay, - ExpressPaymentNethodEnabled? googlePay, - ExpressPaymentNethodEnabled? paypal, - ExpressPaymentNethodEnabled? link, - ExpressPaymentNethodEnabled? amazonPay}); + _$ExpressCheckoutPaymentMethodsCopyWithImpl(this._self, this._then); + + final ExpressCheckoutPaymentMethods _self; + final $Res Function(ExpressCheckoutPaymentMethods) _then; + +/// Create a copy of ExpressCheckoutPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? applePay = freezed,Object? googlePay = freezed,Object? paypal = freezed,Object? link = freezed,Object? amazonPay = freezed,}) { + return _then(_self.copyWith( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,paypal: freezed == paypal ? _self.paypal : paypal // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,link: freezed == link ? _self.link : link // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,amazonPay: freezed == amazonPay ? _self.amazonPay : amazonPay // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ExpressCheckoutPaymentMethods]. +extension ExpressCheckoutPaymentMethodsPatterns on ExpressCheckoutPaymentMethods { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ExpressCheckoutPaymentMethods value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ExpressCheckoutPaymentMethods() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ExpressCheckoutPaymentMethods value) $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutPaymentMethods(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ExpressCheckoutPaymentMethods value)? $default,){ +final _that = this; +switch (_that) { +case _ExpressCheckoutPaymentMethods() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ExpressPaymentNethodEnabled? applePay, ExpressPaymentNethodEnabled? googlePay, ExpressPaymentNethodEnabled? paypal, ExpressPaymentNethodEnabled? link, ExpressPaymentNethodEnabled? amazonPay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ExpressCheckoutPaymentMethods() when $default != null: +return $default(_that.applePay,_that.googlePay,_that.paypal,_that.link,_that.amazonPay);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ExpressPaymentNethodEnabled? applePay, ExpressPaymentNethodEnabled? googlePay, ExpressPaymentNethodEnabled? paypal, ExpressPaymentNethodEnabled? link, ExpressPaymentNethodEnabled? amazonPay) $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutPaymentMethods(): +return $default(_that.applePay,_that.googlePay,_that.paypal,_that.link,_that.amazonPay);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ExpressPaymentNethodEnabled? applePay, ExpressPaymentNethodEnabled? googlePay, ExpressPaymentNethodEnabled? paypal, ExpressPaymentNethodEnabled? link, ExpressPaymentNethodEnabled? amazonPay)? $default,) {final _that = this; +switch (_that) { +case _ExpressCheckoutPaymentMethods() when $default != null: +return $default(_that.applePay,_that.googlePay,_that.paypal,_that.link,_that.amazonPay);case _: + return null; + +} } -/// @nodoc -class __$$ExpressCheckoutPaymentMethodsImplCopyWithImpl<$Res> - extends _$ExpressCheckoutPaymentMethodsCopyWithImpl<$Res, - _$ExpressCheckoutPaymentMethodsImpl> - implements _$$ExpressCheckoutPaymentMethodsImplCopyWith<$Res> { - __$$ExpressCheckoutPaymentMethodsImplCopyWithImpl( - _$ExpressCheckoutPaymentMethodsImpl _value, - $Res Function(_$ExpressCheckoutPaymentMethodsImpl) _then) - : super(_value, _then); - - /// Create a copy of ExpressCheckoutPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - Object? paypal = freezed, - Object? link = freezed, - Object? amazonPay = freezed, - }) { - return _then(_$ExpressCheckoutPaymentMethodsImpl( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - paypal: freezed == paypal - ? _value.paypal - : paypal // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - link: freezed == link - ? _value.link - : link // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - amazonPay: freezed == amazonPay - ? _value.amazonPay - : amazonPay // ignore: cast_nullable_to_non_nullable - as ExpressPaymentNethodEnabled?, - )); - } } /// @nodoc @JsonSerializable() -class _$ExpressCheckoutPaymentMethodsImpl - implements _ExpressCheckoutPaymentMethods { - const _$ExpressCheckoutPaymentMethodsImpl( - {this.applePay, this.googlePay, this.paypal, this.link, this.amazonPay}); - - factory _$ExpressCheckoutPaymentMethodsImpl.fromJson( - Map json) => - _$$ExpressCheckoutPaymentMethodsImplFromJson(json); - - @override - final ExpressPaymentNethodEnabled? applePay; - @override - final ExpressPaymentNethodEnabled? googlePay; - @override - final ExpressPaymentNethodEnabled? paypal; - @override - final ExpressPaymentNethodEnabled? link; - @override - final ExpressPaymentNethodEnabled? amazonPay; - - @override - String toString() { - return 'ExpressCheckoutPaymentMethods(applePay: $applePay, googlePay: $googlePay, paypal: $paypal, link: $link, amazonPay: $amazonPay)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ExpressCheckoutPaymentMethodsImpl && - (identical(other.applePay, applePay) || - other.applePay == applePay) && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay) && - (identical(other.paypal, paypal) || other.paypal == paypal) && - (identical(other.link, link) || other.link == link) && - (identical(other.amazonPay, amazonPay) || - other.amazonPay == amazonPay)); - } +class _ExpressCheckoutPaymentMethods implements ExpressCheckoutPaymentMethods { + const _ExpressCheckoutPaymentMethods({this.applePay, this.googlePay, this.paypal, this.link, this.amazonPay}); + factory _ExpressCheckoutPaymentMethods.fromJson(Map json) => _$ExpressCheckoutPaymentMethodsFromJson(json); + +@override final ExpressPaymentNethodEnabled? applePay; +@override final ExpressPaymentNethodEnabled? googlePay; +@override final ExpressPaymentNethodEnabled? paypal; +@override final ExpressPaymentNethodEnabled? link; +@override final ExpressPaymentNethodEnabled? amazonPay; + +/// Create a copy of ExpressCheckoutPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExpressCheckoutPaymentMethodsCopyWith<_ExpressCheckoutPaymentMethods> get copyWith => __$ExpressCheckoutPaymentMethodsCopyWithImpl<_ExpressCheckoutPaymentMethods>(this, _$identity); + +@override +Map toJson() { + return _$ExpressCheckoutPaymentMethodsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, applePay, googlePay, paypal, link, amazonPay); - - /// Create a copy of ExpressCheckoutPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ExpressCheckoutPaymentMethodsImplCopyWith< - _$ExpressCheckoutPaymentMethodsImpl> - get copyWith => __$$ExpressCheckoutPaymentMethodsImplCopyWithImpl< - _$ExpressCheckoutPaymentMethodsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ExpressCheckoutPaymentMethodsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ExpressCheckoutPaymentMethods&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.paypal, paypal) || other.paypal == paypal)&&(identical(other.link, link) || other.link == link)&&(identical(other.amazonPay, amazonPay) || other.amazonPay == amazonPay)); } -abstract class _ExpressCheckoutPaymentMethods - implements ExpressCheckoutPaymentMethods { - const factory _ExpressCheckoutPaymentMethods( - {final ExpressPaymentNethodEnabled? applePay, - final ExpressPaymentNethodEnabled? googlePay, - final ExpressPaymentNethodEnabled? paypal, - final ExpressPaymentNethodEnabled? link, - final ExpressPaymentNethodEnabled? amazonPay}) = - _$ExpressCheckoutPaymentMethodsImpl; - - factory _ExpressCheckoutPaymentMethods.fromJson(Map json) = - _$ExpressCheckoutPaymentMethodsImpl.fromJson; - - @override - ExpressPaymentNethodEnabled? get applePay; - @override - ExpressPaymentNethodEnabled? get googlePay; - @override - ExpressPaymentNethodEnabled? get paypal; - @override - ExpressPaymentNethodEnabled? get link; - @override - ExpressPaymentNethodEnabled? get amazonPay; - - /// Create a copy of ExpressCheckoutPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ExpressCheckoutPaymentMethodsImplCopyWith< - _$ExpressCheckoutPaymentMethodsImpl> - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay,paypal,link,amazonPay); + +@override +String toString() { + return 'ExpressCheckoutPaymentMethods(applePay: $applePay, googlePay: $googlePay, paypal: $paypal, link: $link, amazonPay: $amazonPay)'; } + + +} + +/// @nodoc +abstract mixin class _$ExpressCheckoutPaymentMethodsCopyWith<$Res> implements $ExpressCheckoutPaymentMethodsCopyWith<$Res> { + factory _$ExpressCheckoutPaymentMethodsCopyWith(_ExpressCheckoutPaymentMethods value, $Res Function(_ExpressCheckoutPaymentMethods) _then) = __$ExpressCheckoutPaymentMethodsCopyWithImpl; +@override @useResult +$Res call({ + ExpressPaymentNethodEnabled? applePay, ExpressPaymentNethodEnabled? googlePay, ExpressPaymentNethodEnabled? paypal, ExpressPaymentNethodEnabled? link, ExpressPaymentNethodEnabled? amazonPay +}); + + + + +} +/// @nodoc +class __$ExpressCheckoutPaymentMethodsCopyWithImpl<$Res> + implements _$ExpressCheckoutPaymentMethodsCopyWith<$Res> { + __$ExpressCheckoutPaymentMethodsCopyWithImpl(this._self, this._then); + + final _ExpressCheckoutPaymentMethods _self; + final $Res Function(_ExpressCheckoutPaymentMethods) _then; + +/// Create a copy of ExpressCheckoutPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? applePay = freezed,Object? googlePay = freezed,Object? paypal = freezed,Object? link = freezed,Object? amazonPay = freezed,}) { + return _then(_ExpressCheckoutPaymentMethods( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,paypal: freezed == paypal ? _self.paypal : paypal // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,link: freezed == link ? _self.link : link // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?,amazonPay: freezed == amazonPay ? _self.amazonPay : amazonPay // ignore: cast_nullable_to_non_nullable +as ExpressPaymentNethodEnabled?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.g.dart b/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.g.dart index eb7c9d1b7..7280b78c5 100644 --- a/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.g.dart +++ b/packages/stripe_js/lib/src/api/elements/express_checkout_element_options.g.dart @@ -6,128 +6,104 @@ part of 'express_checkout_element_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ExpressCheckoutOptionsImpl _$$ExpressCheckoutOptionsImplFromJson(Map json) => - _$ExpressCheckoutOptionsImpl( +_ExpressCheckoutOptions _$ExpressCheckoutOptionsFromJson(Map json) => + _ExpressCheckoutOptions( height: (json['height'] as num?)?.toDouble(), buttonTheme: json['buttonTheme'] == null ? null : ExpressCheckoutButtonTheme.fromJson( - Map.from(json['buttonTheme'] as Map)), + Map.from(json['buttonTheme'] as Map), + ), buttonType: json['buttonType'] == null ? null : ExpressCheckoutButtonType.fromJson( - Map.from(json['buttonType'] as Map)), + Map.from(json['buttonType'] as Map), + ), layout: json['layout'] == null ? null : ExpressCheckoutLayout.fromJson( - Map.from(json['layout'] as Map)), + Map.from(json['layout'] as Map), + ), paymentMethods: json['paymentMethods'] == null ? null : ExpressCheckoutPaymentMethods.fromJson( - Map.from(json['paymentMethods'] as Map)), + Map.from(json['paymentMethods'] as Map), + ), ); -Map _$$ExpressCheckoutOptionsImplToJson( - _$ExpressCheckoutOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('height', instance.height); - writeNotNull('buttonTheme', instance.buttonTheme?.toJson()); - writeNotNull('buttonType', instance.buttonType?.toJson()); - writeNotNull('layout', instance.layout?.toJson()); - writeNotNull('paymentMethods', instance.paymentMethods?.toJson()); - return val; -} - -_$ExpressCheckoutConfirmEventImpl _$$ExpressCheckoutConfirmEventImplFromJson( - Map json) => - _$ExpressCheckoutConfirmEventImpl( +Map _$ExpressCheckoutOptionsToJson( + _ExpressCheckoutOptions instance, +) => { + 'height': ?instance.height, + 'buttonTheme': ?instance.buttonTheme?.toJson(), + 'buttonType': ?instance.buttonType?.toJson(), + 'layout': ?instance.layout?.toJson(), + 'paymentMethods': ?instance.paymentMethods?.toJson(), +}; + +_ExpressCheckoutConfirmEvent _$ExpressCheckoutConfirmEventFromJson(Map json) => + _ExpressCheckoutConfirmEvent( expressPaymentType: json['expressPaymentType'] as String, billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), ); -Map _$$ExpressCheckoutConfirmEventImplToJson( - _$ExpressCheckoutConfirmEventImpl instance) { - final val = { - 'expressPaymentType': instance.expressPaymentType, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - return val; -} +Map _$ExpressCheckoutConfirmEventToJson( + _ExpressCheckoutConfirmEvent instance, +) => { + 'expressPaymentType': instance.expressPaymentType, + 'billingDetails': ?instance.billingDetails?.toJson(), +}; -_$ExpressCheckoutLayoutImpl _$$ExpressCheckoutLayoutImplFromJson(Map json) => - _$ExpressCheckoutLayoutImpl( +_ExpressCheckoutLayout _$ExpressCheckoutLayoutFromJson(Map json) => + _ExpressCheckoutLayout( maxColumns: (json['maxColumns'] as num?)?.toInt(), maxRows: (json['maxRows'] as num?)?.toInt(), overflow: $enumDecodeNullable( - _$ExpressCheckoutOverflowEnumMap, json['overflow']), + _$ExpressCheckoutOverflowEnumMap, + json['overflow'], + ), ); -Map _$$ExpressCheckoutLayoutImplToJson( - _$ExpressCheckoutLayoutImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('maxColumns', instance.maxColumns); - writeNotNull('maxRows', instance.maxRows); - writeNotNull('overflow', _$ExpressCheckoutOverflowEnumMap[instance.overflow]); - return val; -} +Map _$ExpressCheckoutLayoutToJson( + _ExpressCheckoutLayout instance, +) => { + 'maxColumns': ?instance.maxColumns, + 'maxRows': ?instance.maxRows, + 'overflow': ?_$ExpressCheckoutOverflowEnumMap[instance.overflow], +}; const _$ExpressCheckoutOverflowEnumMap = { ExpressCheckoutOverflow.auto: 'auto', ExpressCheckoutOverflow.never: 'never', }; -_$ExpressCheckoutButtonThemeImpl _$$ExpressCheckoutButtonThemeImplFromJson( - Map json) => - _$ExpressCheckoutButtonThemeImpl( +_ExpressCheckoutButtonTheme _$ExpressCheckoutButtonThemeFromJson(Map json) => + _ExpressCheckoutButtonTheme( applePay: $enumDecodeNullable( - _$ExpressApplePayButtonThemeEnumMap, json['applePay']), + _$ExpressApplePayButtonThemeEnumMap, + json['applePay'], + ), googlePay: $enumDecodeNullable( - _$ExpressGooglePayButtonThemeEnumMap, json['googlePay']), + _$ExpressGooglePayButtonThemeEnumMap, + json['googlePay'], + ), paypal: $enumDecodeNullable( - _$ExpressPaypalButtonThemeEnumMap, json['paypal']), + _$ExpressPaypalButtonThemeEnumMap, + json['paypal'], + ), ); -Map _$$ExpressCheckoutButtonThemeImplToJson( - _$ExpressCheckoutButtonThemeImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'applePay', _$ExpressApplePayButtonThemeEnumMap[instance.applePay]); - writeNotNull( - 'googlePay', _$ExpressGooglePayButtonThemeEnumMap[instance.googlePay]); - writeNotNull('paypal', _$ExpressPaypalButtonThemeEnumMap[instance.paypal]); - return val; -} +Map _$ExpressCheckoutButtonThemeToJson( + _ExpressCheckoutButtonTheme instance, +) => { + 'applePay': ?_$ExpressApplePayButtonThemeEnumMap[instance.applePay], + 'googlePay': ?_$ExpressGooglePayButtonThemeEnumMap[instance.googlePay], + 'paypal': ?_$ExpressPaypalButtonThemeEnumMap[instance.paypal], +}; const _$ExpressApplePayButtonThemeEnumMap = { ExpressApplePayButtonTheme.black: 'black', @@ -148,34 +124,29 @@ const _$ExpressPaypalButtonThemeEnumMap = { ExpressPaypalButtonTheme.white: 'white', }; -_$ExpressCheckoutButtonTypeImpl _$$ExpressCheckoutButtonTypeImplFromJson( - Map json) => - _$ExpressCheckoutButtonTypeImpl( +_ExpressCheckoutButtonType _$ExpressCheckoutButtonTypeFromJson(Map json) => + _ExpressCheckoutButtonType( applePay: $enumDecodeNullable( - _$ExpressApplePayButtonTypeEnumMap, json['applePay']), + _$ExpressApplePayButtonTypeEnumMap, + json['applePay'], + ), googlePay: $enumDecodeNullable( - _$ExpressGooglePayButtonTypeEnumMap, json['googlePay']), - paypal: - $enumDecodeNullable(_$ExpressPaypalButtonTypeEnumMap, json['paypal']), + _$ExpressGooglePayButtonTypeEnumMap, + json['googlePay'], + ), + paypal: $enumDecodeNullable( + _$ExpressPaypalButtonTypeEnumMap, + json['paypal'], + ), ); -Map _$$ExpressCheckoutButtonTypeImplToJson( - _$ExpressCheckoutButtonTypeImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'applePay', _$ExpressApplePayButtonTypeEnumMap[instance.applePay]); - writeNotNull( - 'googlePay', _$ExpressGooglePayButtonTypeEnumMap[instance.googlePay]); - writeNotNull('paypal', _$ExpressPaypalButtonTypeEnumMap[instance.paypal]); - return val; -} +Map _$ExpressCheckoutButtonTypeToJson( + _ExpressCheckoutButtonType instance, +) => { + 'applePay': ?_$ExpressApplePayButtonTypeEnumMap[instance.applePay], + 'googlePay': ?_$ExpressGooglePayButtonTypeEnumMap[instance.googlePay], + 'paypal': ?_$ExpressPaypalButtonTypeEnumMap[instance.paypal], +}; const _$ExpressApplePayButtonTypeEnumMap = { ExpressApplePayButtonType.addMoney: 'addMoney', @@ -212,41 +183,37 @@ const _$ExpressPaypalButtonTypeEnumMap = { ExpressPaypalButtonType.pay: 'pay', }; -_$ExpressCheckoutPaymentMethodsImpl - _$$ExpressCheckoutPaymentMethodsImplFromJson(Map json) => - _$ExpressCheckoutPaymentMethodsImpl( - applePay: $enumDecodeNullable( - _$ExpressPaymentNethodEnabledEnumMap, json['applePay']), - googlePay: $enumDecodeNullable( - _$ExpressPaymentNethodEnabledEnumMap, json['googlePay']), - paypal: $enumDecodeNullable( - _$ExpressPaymentNethodEnabledEnumMap, json['paypal']), - link: $enumDecodeNullable( - _$ExpressPaymentNethodEnabledEnumMap, json['link']), - amazonPay: $enumDecodeNullable( - _$ExpressPaymentNethodEnabledEnumMap, json['amazonPay']), - ); - -Map _$$ExpressCheckoutPaymentMethodsImplToJson( - _$ExpressCheckoutPaymentMethodsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'applePay', _$ExpressPaymentNethodEnabledEnumMap[instance.applePay]); - writeNotNull( - 'googlePay', _$ExpressPaymentNethodEnabledEnumMap[instance.googlePay]); - writeNotNull('paypal', _$ExpressPaymentNethodEnabledEnumMap[instance.paypal]); - writeNotNull('link', _$ExpressPaymentNethodEnabledEnumMap[instance.link]); - writeNotNull( - 'amazonPay', _$ExpressPaymentNethodEnabledEnumMap[instance.amazonPay]); - return val; -} +_ExpressCheckoutPaymentMethods _$ExpressCheckoutPaymentMethodsFromJson( + Map json, +) => _ExpressCheckoutPaymentMethods( + applePay: $enumDecodeNullable( + _$ExpressPaymentNethodEnabledEnumMap, + json['applePay'], + ), + googlePay: $enumDecodeNullable( + _$ExpressPaymentNethodEnabledEnumMap, + json['googlePay'], + ), + paypal: $enumDecodeNullable( + _$ExpressPaymentNethodEnabledEnumMap, + json['paypal'], + ), + link: $enumDecodeNullable(_$ExpressPaymentNethodEnabledEnumMap, json['link']), + amazonPay: $enumDecodeNullable( + _$ExpressPaymentNethodEnabledEnumMap, + json['amazonPay'], + ), +); + +Map _$ExpressCheckoutPaymentMethodsToJson( + _ExpressCheckoutPaymentMethods instance, +) => { + 'applePay': ?_$ExpressPaymentNethodEnabledEnumMap[instance.applePay], + 'googlePay': ?_$ExpressPaymentNethodEnabledEnumMap[instance.googlePay], + 'paypal': ?_$ExpressPaymentNethodEnabledEnumMap[instance.paypal], + 'link': ?_$ExpressPaymentNethodEnabledEnumMap[instance.link], + 'amazonPay': ?_$ExpressPaymentNethodEnabledEnumMap[instance.amazonPay], +}; const _$ExpressPaymentNethodEnabledEnumMap = { ExpressPaymentNethodEnabled.auto: 'auto', diff --git a/packages/stripe_js/lib/src/api/elements/payment_element_change_event.dart b/packages/stripe_js/lib/src/api/elements/payment_element_change_event.dart index 618fb450e..05de18e60 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_element_change_event.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_element_change_event.dart @@ -4,7 +4,7 @@ part 'payment_element_change_event.freezed.dart'; part 'payment_element_change_event.g.dart'; @freezed -class PaymentElementChangeEvent with _$PaymentElementChangeEvent { +abstract class PaymentElementChangeEvent with _$PaymentElementChangeEvent { const factory PaymentElementChangeEvent({ required String elementType, required bool empty, @@ -18,10 +18,10 @@ class PaymentElementChangeEvent with _$PaymentElementChangeEvent { } @freezed -class PaymentElementChangeEventValue with _$PaymentElementChangeEventValue { - const factory PaymentElementChangeEventValue({ - required String? type, - }) = _PaymentElementChangeEventValue; +abstract class PaymentElementChangeEventValue + with _$PaymentElementChangeEventValue { + const factory PaymentElementChangeEventValue({required String? type}) = + _PaymentElementChangeEventValue; factory PaymentElementChangeEventValue.fromJson(Map json) => _$PaymentElementChangeEventValueFromJson(json); diff --git a/packages/stripe_js/lib/src/api/elements/payment_element_change_event.freezed.dart b/packages/stripe_js/lib/src/api/elements/payment_element_change_event.freezed.dart index 04dc65212..0763af1a6 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_element_change_event.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_element_change_event.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,435 +9,568 @@ part of 'payment_element_change_event.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentElementChangeEvent _$PaymentElementChangeEventFromJson( - Map json) { - return _PaymentElementChangeEvent.fromJson(json); -} - /// @nodoc mixin _$PaymentElementChangeEvent { - String get elementType => throw _privateConstructorUsedError; - bool get empty => throw _privateConstructorUsedError; - bool get complete => throw _privateConstructorUsedError; - bool get collapsed => throw _privateConstructorUsedError; - PaymentElementChangeEventValue? get value => - throw _privateConstructorUsedError; + + String get elementType; bool get empty; bool get complete; bool get collapsed; PaymentElementChangeEventValue? get value; +/// Create a copy of PaymentElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementChangeEventCopyWith get copyWith => _$PaymentElementChangeEventCopyWithImpl(this as PaymentElementChangeEvent, _$identity); /// Serializes this PaymentElementChangeEvent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PaymentElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementChangeEventCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementChangeEvent&&(identical(other.elementType, elementType) || other.elementType == elementType)&&(identical(other.empty, empty) || other.empty == empty)&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.collapsed, collapsed) || other.collapsed == collapsed)&&(identical(other.value, value) || other.value == value)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elementType,empty,complete,collapsed,value); + +@override +String toString() { + return 'PaymentElementChangeEvent(elementType: $elementType, empty: $empty, complete: $complete, collapsed: $collapsed, value: $value)'; } -/// @nodoc -abstract class $PaymentElementChangeEventCopyWith<$Res> { - factory $PaymentElementChangeEventCopyWith(PaymentElementChangeEvent value, - $Res Function(PaymentElementChangeEvent) then) = - _$PaymentElementChangeEventCopyWithImpl<$Res, PaymentElementChangeEvent>; - @useResult - $Res call( - {String elementType, - bool empty, - bool complete, - bool collapsed, - PaymentElementChangeEventValue? value}); - $PaymentElementChangeEventValueCopyWith<$Res>? get value; } /// @nodoc -class _$PaymentElementChangeEventCopyWithImpl<$Res, - $Val extends PaymentElementChangeEvent> +abstract mixin class $PaymentElementChangeEventCopyWith<$Res> { + factory $PaymentElementChangeEventCopyWith(PaymentElementChangeEvent value, $Res Function(PaymentElementChangeEvent) _then) = _$PaymentElementChangeEventCopyWithImpl; +@useResult +$Res call({ + String elementType, bool empty, bool complete, bool collapsed, PaymentElementChangeEventValue? value +}); + + +$PaymentElementChangeEventValueCopyWith<$Res>? get value; + +} +/// @nodoc +class _$PaymentElementChangeEventCopyWithImpl<$Res> implements $PaymentElementChangeEventCopyWith<$Res> { - _$PaymentElementChangeEventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elementType = null, - Object? empty = null, - Object? complete = null, - Object? collapsed = null, - Object? value = freezed, - }) { - return _then(_value.copyWith( - elementType: null == elementType - ? _value.elementType - : elementType // ignore: cast_nullable_to_non_nullable - as String, - empty: null == empty - ? _value.empty - : empty // ignore: cast_nullable_to_non_nullable - as bool, - complete: null == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as bool, - collapsed: null == collapsed - ? _value.collapsed - : collapsed // ignore: cast_nullable_to_non_nullable - as bool, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as PaymentElementChangeEventValue?, - ) as $Val); + _$PaymentElementChangeEventCopyWithImpl(this._self, this._then); + + final PaymentElementChangeEvent _self; + final $Res Function(PaymentElementChangeEvent) _then; + +/// Create a copy of PaymentElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? elementType = null,Object? empty = null,Object? complete = null,Object? collapsed = null,Object? value = freezed,}) { + return _then(_self.copyWith( +elementType: null == elementType ? _self.elementType : elementType // ignore: cast_nullable_to_non_nullable +as String,empty: null == empty ? _self.empty : empty // ignore: cast_nullable_to_non_nullable +as bool,complete: null == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as bool,collapsed: null == collapsed ? _self.collapsed : collapsed // ignore: cast_nullable_to_non_nullable +as bool,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as PaymentElementChangeEventValue?, + )); +} +/// Create a copy of PaymentElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementChangeEventValueCopyWith<$Res>? get value { + if (_self.value == null) { + return null; } - /// Create a copy of PaymentElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementChangeEventValueCopyWith<$Res>? get value { - if (_value.value == null) { - return null; - } - - return $PaymentElementChangeEventValueCopyWith<$Res>(_value.value!, - (value) { - return _then(_value.copyWith(value: value) as $Val); - }); - } + return $PaymentElementChangeEventValueCopyWith<$Res>(_self.value!, (value) { + return _then(_self.copyWith(value: value)); + }); +} } -/// @nodoc -abstract class _$$PaymentElementChangeEventImplCopyWith<$Res> - implements $PaymentElementChangeEventCopyWith<$Res> { - factory _$$PaymentElementChangeEventImplCopyWith( - _$PaymentElementChangeEventImpl value, - $Res Function(_$PaymentElementChangeEventImpl) then) = - __$$PaymentElementChangeEventImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String elementType, - bool empty, - bool complete, - bool collapsed, - PaymentElementChangeEventValue? value}); - - @override - $PaymentElementChangeEventValueCopyWith<$Res>? get value; + +/// Adds pattern-matching-related methods to [PaymentElementChangeEvent]. +extension PaymentElementChangeEventPatterns on PaymentElementChangeEvent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementChangeEvent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementChangeEvent value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementChangeEvent value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String elementType, bool empty, bool complete, bool collapsed, PaymentElementChangeEventValue? value)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that.elementType,_that.empty,_that.complete,_that.collapsed,_that.value);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String elementType, bool empty, bool complete, bool collapsed, PaymentElementChangeEventValue? value) $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent(): +return $default(_that.elementType,_that.empty,_that.complete,_that.collapsed,_that.value);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String elementType, bool empty, bool complete, bool collapsed, PaymentElementChangeEventValue? value)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEvent() when $default != null: +return $default(_that.elementType,_that.empty,_that.complete,_that.collapsed,_that.value);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementChangeEventImplCopyWithImpl<$Res> - extends _$PaymentElementChangeEventCopyWithImpl<$Res, - _$PaymentElementChangeEventImpl> - implements _$$PaymentElementChangeEventImplCopyWith<$Res> { - __$$PaymentElementChangeEventImplCopyWithImpl( - _$PaymentElementChangeEventImpl _value, - $Res Function(_$PaymentElementChangeEventImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elementType = null, - Object? empty = null, - Object? complete = null, - Object? collapsed = null, - Object? value = freezed, - }) { - return _then(_$PaymentElementChangeEventImpl( - elementType: null == elementType - ? _value.elementType - : elementType // ignore: cast_nullable_to_non_nullable - as String, - empty: null == empty - ? _value.empty - : empty // ignore: cast_nullable_to_non_nullable - as bool, - complete: null == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as bool, - collapsed: null == collapsed - ? _value.collapsed - : collapsed // ignore: cast_nullable_to_non_nullable - as bool, - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as PaymentElementChangeEventValue?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementChangeEventImpl implements _PaymentElementChangeEvent { - const _$PaymentElementChangeEventImpl( - {required this.elementType, - required this.empty, - required this.complete, - required this.collapsed, - this.value}); - - factory _$PaymentElementChangeEventImpl.fromJson(Map json) => - _$$PaymentElementChangeEventImplFromJson(json); - - @override - final String elementType; - @override - final bool empty; - @override - final bool complete; - @override - final bool collapsed; - @override - final PaymentElementChangeEventValue? value; - - @override - String toString() { - return 'PaymentElementChangeEvent(elementType: $elementType, empty: $empty, complete: $complete, collapsed: $collapsed, value: $value)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementChangeEventImpl && - (identical(other.elementType, elementType) || - other.elementType == elementType) && - (identical(other.empty, empty) || other.empty == empty) && - (identical(other.complete, complete) || - other.complete == complete) && - (identical(other.collapsed, collapsed) || - other.collapsed == collapsed) && - (identical(other.value, value) || other.value == value)); - } +class _PaymentElementChangeEvent implements PaymentElementChangeEvent { + const _PaymentElementChangeEvent({required this.elementType, required this.empty, required this.complete, required this.collapsed, this.value}); + factory _PaymentElementChangeEvent.fromJson(Map json) => _$PaymentElementChangeEventFromJson(json); + +@override final String elementType; +@override final bool empty; +@override final bool complete; +@override final bool collapsed; +@override final PaymentElementChangeEventValue? value; + +/// Create a copy of PaymentElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementChangeEventCopyWith<_PaymentElementChangeEvent> get copyWith => __$PaymentElementChangeEventCopyWithImpl<_PaymentElementChangeEvent>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementChangeEventToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementChangeEvent&&(identical(other.elementType, elementType) || other.elementType == elementType)&&(identical(other.empty, empty) || other.empty == empty)&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.collapsed, collapsed) || other.collapsed == collapsed)&&(identical(other.value, value) || other.value == value)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elementType,empty,complete,collapsed,value); + +@override +String toString() { + return 'PaymentElementChangeEvent(elementType: $elementType, empty: $empty, complete: $complete, collapsed: $collapsed, value: $value)'; +} + - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, elementType, empty, complete, collapsed, value); - - /// Create a copy of PaymentElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementChangeEventImplCopyWith<_$PaymentElementChangeEventImpl> - get copyWith => __$$PaymentElementChangeEventImplCopyWithImpl< - _$PaymentElementChangeEventImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementChangeEventImplToJson( - this, - ); - } } -abstract class _PaymentElementChangeEvent implements PaymentElementChangeEvent { - const factory _PaymentElementChangeEvent( - {required final String elementType, - required final bool empty, - required final bool complete, - required final bool collapsed, - final PaymentElementChangeEventValue? value}) = - _$PaymentElementChangeEventImpl; +/// @nodoc +abstract mixin class _$PaymentElementChangeEventCopyWith<$Res> implements $PaymentElementChangeEventCopyWith<$Res> { + factory _$PaymentElementChangeEventCopyWith(_PaymentElementChangeEvent value, $Res Function(_PaymentElementChangeEvent) _then) = __$PaymentElementChangeEventCopyWithImpl; +@override @useResult +$Res call({ + String elementType, bool empty, bool complete, bool collapsed, PaymentElementChangeEventValue? value +}); - factory _PaymentElementChangeEvent.fromJson(Map json) = - _$PaymentElementChangeEventImpl.fromJson; - @override - String get elementType; - @override - bool get empty; - @override - bool get complete; - @override - bool get collapsed; - @override - PaymentElementChangeEventValue? get value; +@override $PaymentElementChangeEventValueCopyWith<$Res>? get value; - /// Create a copy of PaymentElementChangeEvent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementChangeEventImplCopyWith<_$PaymentElementChangeEventImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$PaymentElementChangeEventCopyWithImpl<$Res> + implements _$PaymentElementChangeEventCopyWith<$Res> { + __$PaymentElementChangeEventCopyWithImpl(this._self, this._then); + + final _PaymentElementChangeEvent _self; + final $Res Function(_PaymentElementChangeEvent) _then; + +/// Create a copy of PaymentElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? elementType = null,Object? empty = null,Object? complete = null,Object? collapsed = null,Object? value = freezed,}) { + return _then(_PaymentElementChangeEvent( +elementType: null == elementType ? _self.elementType : elementType // ignore: cast_nullable_to_non_nullable +as String,empty: null == empty ? _self.empty : empty // ignore: cast_nullable_to_non_nullable +as bool,complete: null == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as bool,collapsed: null == collapsed ? _self.collapsed : collapsed // ignore: cast_nullable_to_non_nullable +as bool,value: freezed == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as PaymentElementChangeEventValue?, + )); } -PaymentElementChangeEventValue _$PaymentElementChangeEventValueFromJson( - Map json) { - return _PaymentElementChangeEventValue.fromJson(json); +/// Create a copy of PaymentElementChangeEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementChangeEventValueCopyWith<$Res>? get value { + if (_self.value == null) { + return null; + } + + return $PaymentElementChangeEventValueCopyWith<$Res>(_self.value!, (value) { + return _then(_self.copyWith(value: value)); + }); +} } + /// @nodoc mixin _$PaymentElementChangeEventValue { - String? get type => throw _privateConstructorUsedError; + + String? get type; +/// Create a copy of PaymentElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementChangeEventValueCopyWith get copyWith => _$PaymentElementChangeEventValueCopyWithImpl(this as PaymentElementChangeEventValue, _$identity); /// Serializes this PaymentElementChangeEventValue to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PaymentElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementChangeEventValueCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementChangeEventValue&&(identical(other.type, type) || other.type == type)); } -/// @nodoc -abstract class $PaymentElementChangeEventValueCopyWith<$Res> { - factory $PaymentElementChangeEventValueCopyWith( - PaymentElementChangeEventValue value, - $Res Function(PaymentElementChangeEventValue) then) = - _$PaymentElementChangeEventValueCopyWithImpl<$Res, - PaymentElementChangeEventValue>; - @useResult - $Res call({String? type}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type); + +@override +String toString() { + return 'PaymentElementChangeEventValue(type: $type)'; } -/// @nodoc -class _$PaymentElementChangeEventValueCopyWithImpl<$Res, - $Val extends PaymentElementChangeEventValue> - implements $PaymentElementChangeEventValueCopyWith<$Res> { - _$PaymentElementChangeEventValueCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = freezed, - }) { - return _then(_value.copyWith( - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$PaymentElementChangeEventValueImplCopyWith<$Res> +abstract mixin class $PaymentElementChangeEventValueCopyWith<$Res> { + factory $PaymentElementChangeEventValueCopyWith(PaymentElementChangeEventValue value, $Res Function(PaymentElementChangeEventValue) _then) = _$PaymentElementChangeEventValueCopyWithImpl; +@useResult +$Res call({ + String? type +}); + + + + +} +/// @nodoc +class _$PaymentElementChangeEventValueCopyWithImpl<$Res> implements $PaymentElementChangeEventValueCopyWith<$Res> { - factory _$$PaymentElementChangeEventValueImplCopyWith( - _$PaymentElementChangeEventValueImpl value, - $Res Function(_$PaymentElementChangeEventValueImpl) then) = - __$$PaymentElementChangeEventValueImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? type}); + _$PaymentElementChangeEventValueCopyWithImpl(this._self, this._then); + + final PaymentElementChangeEventValue _self; + final $Res Function(PaymentElementChangeEventValue) _then; + +/// Create a copy of PaymentElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = freezed,}) { + return _then(_self.copyWith( +type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementChangeEventValue]. +extension PaymentElementChangeEventValuePatterns on PaymentElementChangeEventValue { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementChangeEventValue value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEventValue() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementChangeEventValue value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEventValue(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementChangeEventValue value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementChangeEventValue() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? type)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementChangeEventValue() when $default != null: +return $default(_that.type);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? type) $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEventValue(): +return $default(_that.type);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? type)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementChangeEventValue() when $default != null: +return $default(_that.type);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementChangeEventValueImplCopyWithImpl<$Res> - extends _$PaymentElementChangeEventValueCopyWithImpl<$Res, - _$PaymentElementChangeEventValueImpl> - implements _$$PaymentElementChangeEventValueImplCopyWith<$Res> { - __$$PaymentElementChangeEventValueImplCopyWithImpl( - _$PaymentElementChangeEventValueImpl _value, - $Res Function(_$PaymentElementChangeEventValueImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = freezed, - }) { - return _then(_$PaymentElementChangeEventValueImpl( - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementChangeEventValueImpl - implements _PaymentElementChangeEventValue { - const _$PaymentElementChangeEventValueImpl({required this.type}); - factory _$PaymentElementChangeEventValueImpl.fromJson( - Map json) => - _$$PaymentElementChangeEventValueImplFromJson(json); +class _PaymentElementChangeEventValue implements PaymentElementChangeEventValue { + const _PaymentElementChangeEventValue({required this.type}); + factory _PaymentElementChangeEventValue.fromJson(Map json) => _$PaymentElementChangeEventValueFromJson(json); - @override - final String? type; +@override final String? type; - @override - String toString() { - return 'PaymentElementChangeEventValue(type: $type)'; - } +/// Create a copy of PaymentElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementChangeEventValueCopyWith<_PaymentElementChangeEventValue> get copyWith => __$PaymentElementChangeEventValueCopyWithImpl<_PaymentElementChangeEventValue>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementChangeEventValueImpl && - (identical(other.type, type) || other.type == type)); - } +@override +Map toJson() { + return _$PaymentElementChangeEventValueToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, type); - - /// Create a copy of PaymentElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementChangeEventValueImplCopyWith< - _$PaymentElementChangeEventValueImpl> - get copyWith => __$$PaymentElementChangeEventValueImplCopyWithImpl< - _$PaymentElementChangeEventValueImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementChangeEventValueImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementChangeEventValue&&(identical(other.type, type) || other.type == type)); } -abstract class _PaymentElementChangeEventValue - implements PaymentElementChangeEventValue { - const factory _PaymentElementChangeEventValue({required final String? type}) = - _$PaymentElementChangeEventValueImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type); + +@override +String toString() { + return 'PaymentElementChangeEventValue(type: $type)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementChangeEventValueCopyWith<$Res> implements $PaymentElementChangeEventValueCopyWith<$Res> { + factory _$PaymentElementChangeEventValueCopyWith(_PaymentElementChangeEventValue value, $Res Function(_PaymentElementChangeEventValue) _then) = __$PaymentElementChangeEventValueCopyWithImpl; +@override @useResult +$Res call({ + String? type +}); - factory _PaymentElementChangeEventValue.fromJson(Map json) = - _$PaymentElementChangeEventValueImpl.fromJson; - @override - String? get type; - /// Create a copy of PaymentElementChangeEventValue - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementChangeEventValueImplCopyWith< - _$PaymentElementChangeEventValueImpl> - get copyWith => throw _privateConstructorUsedError; + +} +/// @nodoc +class __$PaymentElementChangeEventValueCopyWithImpl<$Res> + implements _$PaymentElementChangeEventValueCopyWith<$Res> { + __$PaymentElementChangeEventValueCopyWithImpl(this._self, this._then); + + final _PaymentElementChangeEventValue _self; + final $Res Function(_PaymentElementChangeEventValue) _then; + +/// Create a copy of PaymentElementChangeEventValue +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = freezed,}) { + return _then(_PaymentElementChangeEventValue( +type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?, + )); } + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/payment_element_change_event.g.dart b/packages/stripe_js/lib/src/api/elements/payment_element_change_event.g.dart index f4c73afda..f5d107b8c 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_element_change_event.g.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_element_change_event.g.dart @@ -6,9 +6,8 @@ part of 'payment_element_change_event.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentElementChangeEventImpl _$$PaymentElementChangeEventImplFromJson( - Map json) => - _$PaymentElementChangeEventImpl( +_PaymentElementChangeEvent _$PaymentElementChangeEventFromJson(Map json) => + _PaymentElementChangeEvent( elementType: json['elementType'] as String, empty: json['empty'] as bool, complete: json['complete'] as bool, @@ -16,44 +15,24 @@ _$PaymentElementChangeEventImpl _$$PaymentElementChangeEventImplFromJson( value: json['value'] == null ? null : PaymentElementChangeEventValue.fromJson( - Map.from(json['value'] as Map)), + Map.from(json['value'] as Map), + ), ); -Map _$$PaymentElementChangeEventImplToJson( - _$PaymentElementChangeEventImpl instance) { - final val = { - 'elementType': instance.elementType, - 'empty': instance.empty, - 'complete': instance.complete, - 'collapsed': instance.collapsed, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('value', instance.value?.toJson()); - return val; -} - -_$PaymentElementChangeEventValueImpl - _$$PaymentElementChangeEventValueImplFromJson(Map json) => - _$PaymentElementChangeEventValueImpl( - type: json['type'] as String?, - ); - -Map _$$PaymentElementChangeEventValueImplToJson( - _$PaymentElementChangeEventValueImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('type', instance.type); - return val; -} +Map _$PaymentElementChangeEventToJson( + _PaymentElementChangeEvent instance, +) => { + 'elementType': instance.elementType, + 'empty': instance.empty, + 'complete': instance.complete, + 'collapsed': instance.collapsed, + 'value': ?instance.value?.toJson(), +}; + +_PaymentElementChangeEventValue _$PaymentElementChangeEventValueFromJson( + Map json, +) => _PaymentElementChangeEventValue(type: json['type'] as String?); + +Map _$PaymentElementChangeEventValueToJson( + _PaymentElementChangeEventValue instance, +) => {'type': ?instance.type}; diff --git a/packages/stripe_js/lib/src/api/elements/payment_element_options.dart b/packages/stripe_js/lib/src/api/elements/payment_element_options.dart index cc766611d..adf8c74f1 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_element_options.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_element_options.dart @@ -6,7 +6,7 @@ part 'payment_element_options.g.dart'; enum PaymentElementLayoutType { accordion, tabs } @freezed -class PaymentElementOptions with _$PaymentElementOptions { +abstract class PaymentElementOptions with _$PaymentElementOptions { const factory PaymentElementOptions({ PaymentElementLayout? layout, @@ -35,7 +35,6 @@ class PaymentElementOptions with _$PaymentElementOptions { /// If you disable the collection of a certain field with the fields option, /// you must pass that same data to stripe.confirmPayment or the payment will /// be rejected. - PaymentElementFields? fields, bool? readOnly, PaymentElementOptionsTerms? terms, @@ -56,7 +55,7 @@ class PaymentElementOptions with _$PaymentElementOptions { /// An PaymentElementLayout can also be passed to specify the layout /// with additional configuration. @freezed -class PaymentElementLayout with _$PaymentElementLayout { +abstract class PaymentElementLayout with _$PaymentElementLayout { const factory PaymentElementLayout({ /// Defines the layout to render the Payment Element. required PaymentElementLayoutType type, @@ -87,15 +86,16 @@ class PaymentElementLayout with _$PaymentElementLayout { int? visibleAccordionItemsCount, }) = _PaymentElementLayout; static const tabs = PaymentElementLayout(type: PaymentElementLayoutType.tabs); - static const accordion = - PaymentElementLayout(type: PaymentElementLayoutType.accordion); + static const accordion = PaymentElementLayout( + type: PaymentElementLayoutType.accordion, + ); factory PaymentElementLayout.fromJson(Map json) => _$PaymentElementLayoutFromJson(json); } @freezed -class PaymentElementDefaultValues with _$PaymentElementDefaultValues { +abstract class PaymentElementDefaultValues with _$PaymentElementDefaultValues { const factory PaymentElementDefaultValues({ /// Specify customer's billing details, which lets you pre-fill a /// customer’s name, email, phone number and address if required by @@ -114,7 +114,7 @@ class PaymentElementDefaultValues with _$PaymentElementDefaultValues { } @freezed -class PaymentElementPaymentMethodDefaults +abstract class PaymentElementPaymentMethodDefaults with _$PaymentElementPaymentMethodDefaults { const factory PaymentElementPaymentMethodDefaults({ /// Defaults for ideal @@ -125,17 +125,16 @@ class PaymentElementPaymentMethodDefaults }) = _PaymentElementPaymentMethodDefaults; factory PaymentElementPaymentMethodDefaults.fromJson( - Map json) => - _$PaymentElementPaymentMethodDefaultsFromJson(json); + Map json, + ) => _$PaymentElementPaymentMethodDefaultsFromJson(json); } @freezed - /// By default, the Payment Element will display all the payment methods that the underlying Payment Intent was created with. /// However, wallets like Apple Pay and Google Pay are not payment methods per the Payment Intent API. They will show when the Payment Intent has the card payment method and the customer is using a supported platform and have an active card in their account. /// This is the auto behavior, and it is the default for choice for all wallets. /// If you do not want to show a given wallet as a payment option, you can set its property in wallets to never. -class PaymentElementWalletOptions with _$PaymentElementWalletOptions { +abstract class PaymentElementWalletOptions with _$PaymentElementWalletOptions { const factory PaymentElementWalletOptions({ /// Apple pay required options PaymentElementFieldRequired? applePay, @@ -149,7 +148,7 @@ class PaymentElementWalletOptions with _$PaymentElementWalletOptions { } @freezed -class PaymentElementIdealDefaults with _$PaymentElementIdealDefaults { +abstract class PaymentElementIdealDefaults with _$PaymentElementIdealDefaults { const factory PaymentElementIdealDefaults({ /// The customer’s bank name. /// @@ -163,7 +162,7 @@ class PaymentElementIdealDefaults with _$PaymentElementIdealDefaults { } @freezed -class PaymentElementCardDefaults with _$PaymentElementCardDefaults { +abstract class PaymentElementCardDefaults with _$PaymentElementCardDefaults { const factory PaymentElementCardDefaults({ /// The specified network prferences for card brand choice. The first network in the array /// that matches a network on the enetered cobranded card will be selected by default @@ -176,7 +175,8 @@ class PaymentElementCardDefaults with _$PaymentElementCardDefaults { } @freezed -class PaymentElementBillingDetails with _$PaymentElementBillingDetails { +abstract class PaymentElementBillingDetails + with _$PaymentElementBillingDetails { const factory PaymentElementBillingDetails({ String? name, String? email, @@ -189,7 +189,7 @@ class PaymentElementBillingDetails with _$PaymentElementBillingDetails { } @freezed -class PaymentElementBillingDetailsAddress +abstract class PaymentElementBillingDetailsAddress with _$PaymentElementBillingDetailsAddress { const factory PaymentElementBillingDetailsAddress({ /// Address line 1 (e.g., street, PO Box, or company name). @@ -212,15 +212,14 @@ class PaymentElementBillingDetailsAddress }) = _PaymentElementBillingDetailsAddress; factory PaymentElementBillingDetailsAddress.fromJson( - Map json) => - _$PaymentElementBillingDetailsAddressFromJson(json); + Map json, + ) => _$PaymentElementBillingDetailsAddressFromJson(json); } @freezed -class PaymentElementBusiness with _$PaymentElementBusiness { - const factory PaymentElementBusiness({ - String? name, - }) = _PaymentElementBusiness; +abstract class PaymentElementBusiness with _$PaymentElementBusiness { + const factory PaymentElementBusiness({String? name}) = + _PaymentElementBusiness; factory PaymentElementBusiness.fromJson(Map json) => _$PaymentElementBusinessFromJson(json); @@ -231,7 +230,7 @@ enum PaymentElementFieldRequired { never, auto } enum PaymentElementShowTerms { never, auto, always } @freezed -class PaymentElementFields with _$PaymentElementFields { +abstract class PaymentElementFields with _$PaymentElementFields { const factory PaymentElementFields({ /// Specify never to avoid collecting all billing details in the /// Payment Element. @@ -247,7 +246,7 @@ class PaymentElementFields with _$PaymentElementFields { } @freezed -class BillingDetailsFields with _$BillingDetailsFields { +abstract class BillingDetailsFields with _$BillingDetailsFields { const factory BillingDetailsFields({ @Default(PaymentElementFieldRequired.auto) PaymentElementFieldRequired name, @Default(PaymentElementFieldRequired.auto) @@ -265,7 +264,7 @@ class BillingDetailsFields with _$BillingDetailsFields { } @freezed -class PaymentElementAddressFields with _$PaymentElementAddressFields { +abstract class PaymentElementAddressFields with _$PaymentElementAddressFields { const factory PaymentElementAddressFields({ @Default(PaymentElementFieldRequired.auto) PaymentElementFieldRequired line1, @@ -287,10 +286,9 @@ class PaymentElementAddressFields with _$PaymentElementAddressFields { } @freezed - ///Control how mandates or other legal agreements are displayed in the Payment Element. /// The default setting is auto, which causes legal agreements to only be shown when necessary. -class PaymentElementOptionsTerms with _$PaymentElementOptionsTerms { +abstract class PaymentElementOptionsTerms with _$PaymentElementOptionsTerms { const factory PaymentElementOptionsTerms({ /// Terms for apple pay PaymentElementShowTerms? applePay, @@ -331,7 +329,8 @@ class PaymentElementOptionsTerms with _$PaymentElementOptionsTerms { } @freezed -class PaymentElementApplePayOptions with _$PaymentElementApplePayOptions { +abstract class PaymentElementApplePayOptions + with _$PaymentElementApplePayOptions { const factory PaymentElementApplePayOptions({ /// Information about a recurring payment with ApplePay PaymentElementAppleRecurringRequest? recurringPaymentRequest, @@ -341,7 +340,7 @@ class PaymentElementApplePayOptions with _$PaymentElementApplePayOptions { /// Information about an auto reload payment with ApplePay PaymentElementApplePayAutoReloadPaymentRequest? - automaticReloadPaymentRequest, + automaticReloadPaymentRequest, }) = _PaymentElementApplePayOptions; factory PaymentElementApplePayOptions.fromJson(Map json) => @@ -349,7 +348,7 @@ class PaymentElementApplePayOptions with _$PaymentElementApplePayOptions { } @freezed -class PaymentElementAppleRecurringRequest +abstract class PaymentElementAppleRecurringRequest with _$PaymentElementAppleRecurringRequest { const factory PaymentElementAppleRecurringRequest({ /// The description of the payment @@ -366,12 +365,12 @@ class PaymentElementAppleRecurringRequest }) = _PaymentElementAppleRecurringRequest; factory PaymentElementAppleRecurringRequest.fromJson( - Map json) => - _$PaymentElementAppleRecurringRequestFromJson(json); + Map json, + ) => _$PaymentElementAppleRecurringRequestFromJson(json); } @freezed -class PaymentElementRecurringPaymentProperties +abstract class PaymentElementRecurringPaymentProperties with _$PaymentElementRecurringPaymentProperties { const factory PaymentElementRecurringPaymentProperties({ /// The amount of the payment @@ -394,12 +393,12 @@ class PaymentElementRecurringPaymentProperties }) = _PaymentElementRecurringPaymentProperties; factory PaymentElementRecurringPaymentProperties.fromJson( - Map json) => - _$PaymentElementRecurringPaymentPropertiesFromJson(json); + Map json, + ) => _$PaymentElementRecurringPaymentPropertiesFromJson(json); } @freezed -class PaymentElementApplePayDeferredPaymentRequest +abstract class PaymentElementApplePayDeferredPaymentRequest with _$PaymentElementApplePayDeferredPaymentRequest { const factory PaymentElementApplePayDeferredPaymentRequest({ /// The description of the payment @@ -422,12 +421,12 @@ class PaymentElementApplePayDeferredPaymentRequest }) = _PaymentElementApplePayDeferredPaymentRequest; factory PaymentElementApplePayDeferredPaymentRequest.fromJson( - Map json) => - _$PaymentElementApplePayDeferredPaymentRequestFromJson(json); + Map json, + ) => _$PaymentElementApplePayDeferredPaymentRequestFromJson(json); } @freezed -class PaymentElementApplePayDeferredPaymentProperties +abstract class PaymentElementApplePayDeferredPaymentProperties with _$PaymentElementApplePayDeferredPaymentProperties { const factory PaymentElementApplePayDeferredPaymentProperties({ /// The amount of the payment @@ -441,12 +440,12 @@ class PaymentElementApplePayDeferredPaymentProperties }) = _PaymentElementApplePayDeferredPaymentProperties; factory PaymentElementApplePayDeferredPaymentProperties.fromJson( - Map json) => - _$PaymentElementApplePayDeferredPaymentPropertiesFromJson(json); + Map json, + ) => _$PaymentElementApplePayDeferredPaymentPropertiesFromJson(json); } @freezed -class PaymentElementApplePayAutoReloadPaymentRequest +abstract class PaymentElementApplePayAutoReloadPaymentRequest with _$PaymentElementApplePayAutoReloadPaymentRequest { const factory PaymentElementApplePayAutoReloadPaymentRequest({ /// The description of the payment @@ -457,16 +456,16 @@ class PaymentElementApplePayAutoReloadPaymentRequest /// Billing information of the deffered payment required PaymentElementApplePayReloadPaymentProperties - automaticReloadBilling, + automaticReloadBilling, }) = _PaymentElementApplePayAutoReloadPaymentRequest; factory PaymentElementApplePayAutoReloadPaymentRequest.fromJson( - Map json) => - _$PaymentElementApplePayAutoReloadPaymentRequestFromJson(json); + Map json, + ) => _$PaymentElementApplePayAutoReloadPaymentRequestFromJson(json); } @freezed -class PaymentElementApplePayReloadPaymentProperties +abstract class PaymentElementApplePayReloadPaymentProperties with _$PaymentElementApplePayReloadPaymentProperties { const factory PaymentElementApplePayReloadPaymentProperties({ /// The amount of the payment @@ -480,8 +479,8 @@ class PaymentElementApplePayReloadPaymentProperties }) = _PaymentElementApplePayReloadPaymentProperties; factory PaymentElementApplePayReloadPaymentProperties.fromJson( - Map json) => - _$PaymentElementApplePayReloadPaymentPropertiesFromJson(json); + Map json, + ) => _$PaymentElementApplePayReloadPaymentPropertiesFromJson(json); } enum ApplePayRecurringPaymentTimeInterVal { year, month, day, hour, minute } diff --git a/packages/stripe_js/lib/src/api/elements/payment_element_options.freezed.dart b/packages/stripe_js/lib/src/api/elements/payment_element_options.freezed.dart index 91ada2d5e..f2e927286 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_element_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_element_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,5712 +9,6420 @@ part of 'payment_element_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentElementOptions _$PaymentElementOptionsFromJson( - Map json) { - return _PaymentElementOptions.fromJson(json); -} - /// @nodoc mixin _$PaymentElementOptions { - PaymentElementLayout? get layout => throw _privateConstructorUsedError; - - /// Provide initial customer information that will be displayed - /// in the Payment Element. - /// The form will render with empty fields if not provided. - PaymentElementDefaultValues? get defaultValues => - throw _privateConstructorUsedError; - - /// Provide information about your business that will - /// be displayed in the Payment Element. - /// This information will be retrieved from your Stripe account - /// if not provided. - PaymentElementBusiness? get business => throw _privateConstructorUsedError; - dynamic get paymentMethodOrder => throw _privateConstructorUsedError; - - /// By default, the Payment Element will collect all necessary details to - /// complete a payment. - /// - /// For some payment methods, this means that the Payment Element will - /// collect details like name or email that you may have already collected - /// from the user. - /// - /// If this is the case, you can prevent the Payment Element from collecting - /// these data by using the fields option. - /// - /// If you disable the collection of a certain field with the fields option, - /// you must pass that same data to stripe.confirmPayment or the payment will - /// be rejected. - PaymentElementFields? get fields => throw _privateConstructorUsedError; - bool? get readOnly => throw _privateConstructorUsedError; - PaymentElementOptionsTerms? get terms => throw _privateConstructorUsedError; - PaymentElementWalletOptions? get wallets => - throw _privateConstructorUsedError; - PaymentElementApplePayOptions? get applePay => - throw _privateConstructorUsedError; + + PaymentElementLayout? get layout;/// Provide initial customer information that will be displayed +/// in the Payment Element. +/// The form will render with empty fields if not provided. + PaymentElementDefaultValues? get defaultValues;/// Provide information about your business that will +/// be displayed in the Payment Element. +/// This information will be retrieved from your Stripe account +/// if not provided. + PaymentElementBusiness? get business; dynamic get paymentMethodOrder;/// By default, the Payment Element will collect all necessary details to +/// complete a payment. +/// +/// For some payment methods, this means that the Payment Element will +/// collect details like name or email that you may have already collected +/// from the user. +/// +/// If this is the case, you can prevent the Payment Element from collecting +/// these data by using the fields option. +/// +/// If you disable the collection of a certain field with the fields option, +/// you must pass that same data to stripe.confirmPayment or the payment will +/// be rejected. + PaymentElementFields? get fields; bool? get readOnly; PaymentElementOptionsTerms? get terms; PaymentElementWalletOptions? get wallets; PaymentElementApplePayOptions? get applePay; +/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementOptionsCopyWith get copyWith => _$PaymentElementOptionsCopyWithImpl(this as PaymentElementOptions, _$identity); /// Serializes this PaymentElementOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementOptions&&(identical(other.layout, layout) || other.layout == layout)&&(identical(other.defaultValues, defaultValues) || other.defaultValues == defaultValues)&&(identical(other.business, business) || other.business == business)&&const DeepCollectionEquality().equals(other.paymentMethodOrder, paymentMethodOrder)&&(identical(other.fields, fields) || other.fields == fields)&&(identical(other.readOnly, readOnly) || other.readOnly == readOnly)&&(identical(other.terms, terms) || other.terms == terms)&&(identical(other.wallets, wallets) || other.wallets == wallets)&&(identical(other.applePay, applePay) || other.applePay == applePay)); } -/// @nodoc -abstract class $PaymentElementOptionsCopyWith<$Res> { - factory $PaymentElementOptionsCopyWith(PaymentElementOptions value, - $Res Function(PaymentElementOptions) then) = - _$PaymentElementOptionsCopyWithImpl<$Res, PaymentElementOptions>; - @useResult - $Res call( - {PaymentElementLayout? layout, - PaymentElementDefaultValues? defaultValues, - PaymentElementBusiness? business, - dynamic paymentMethodOrder, - PaymentElementFields? fields, - bool? readOnly, - PaymentElementOptionsTerms? terms, - PaymentElementWalletOptions? wallets, - PaymentElementApplePayOptions? applePay}); - - $PaymentElementLayoutCopyWith<$Res>? get layout; - $PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues; - $PaymentElementBusinessCopyWith<$Res>? get business; - $PaymentElementFieldsCopyWith<$Res>? get fields; - $PaymentElementOptionsTermsCopyWith<$Res>? get terms; - $PaymentElementWalletOptionsCopyWith<$Res>? get wallets; - $PaymentElementApplePayOptionsCopyWith<$Res>? get applePay; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,layout,defaultValues,business,const DeepCollectionEquality().hash(paymentMethodOrder),fields,readOnly,terms,wallets,applePay); + +@override +String toString() { + return 'PaymentElementOptions(layout: $layout, defaultValues: $defaultValues, business: $business, paymentMethodOrder: $paymentMethodOrder, fields: $fields, readOnly: $readOnly, terms: $terms, wallets: $wallets, applePay: $applePay)'; +} + + } /// @nodoc -class _$PaymentElementOptionsCopyWithImpl<$Res, - $Val extends PaymentElementOptions> +abstract mixin class $PaymentElementOptionsCopyWith<$Res> { + factory $PaymentElementOptionsCopyWith(PaymentElementOptions value, $Res Function(PaymentElementOptions) _then) = _$PaymentElementOptionsCopyWithImpl; +@useResult +$Res call({ + PaymentElementLayout? layout, PaymentElementDefaultValues? defaultValues, PaymentElementBusiness? business, dynamic paymentMethodOrder, PaymentElementFields? fields, bool? readOnly, PaymentElementOptionsTerms? terms, PaymentElementWalletOptions? wallets, PaymentElementApplePayOptions? applePay +}); + + +$PaymentElementLayoutCopyWith<$Res>? get layout;$PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues;$PaymentElementBusinessCopyWith<$Res>? get business;$PaymentElementFieldsCopyWith<$Res>? get fields;$PaymentElementOptionsTermsCopyWith<$Res>? get terms;$PaymentElementWalletOptionsCopyWith<$Res>? get wallets;$PaymentElementApplePayOptionsCopyWith<$Res>? get applePay; + +} +/// @nodoc +class _$PaymentElementOptionsCopyWithImpl<$Res> implements $PaymentElementOptionsCopyWith<$Res> { - _$PaymentElementOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? layout = freezed, - Object? defaultValues = freezed, - Object? business = freezed, - Object? paymentMethodOrder = freezed, - Object? fields = freezed, - Object? readOnly = freezed, - Object? terms = freezed, - Object? wallets = freezed, - Object? applePay = freezed, - }) { - return _then(_value.copyWith( - layout: freezed == layout - ? _value.layout - : layout // ignore: cast_nullable_to_non_nullable - as PaymentElementLayout?, - defaultValues: freezed == defaultValues - ? _value.defaultValues - : defaultValues // ignore: cast_nullable_to_non_nullable - as PaymentElementDefaultValues?, - business: freezed == business - ? _value.business - : business // ignore: cast_nullable_to_non_nullable - as PaymentElementBusiness?, - paymentMethodOrder: freezed == paymentMethodOrder - ? _value.paymentMethodOrder - : paymentMethodOrder // ignore: cast_nullable_to_non_nullable - as dynamic, - fields: freezed == fields - ? _value.fields - : fields // ignore: cast_nullable_to_non_nullable - as PaymentElementFields?, - readOnly: freezed == readOnly - ? _value.readOnly - : readOnly // ignore: cast_nullable_to_non_nullable - as bool?, - terms: freezed == terms - ? _value.terms - : terms // ignore: cast_nullable_to_non_nullable - as PaymentElementOptionsTerms?, - wallets: freezed == wallets - ? _value.wallets - : wallets // ignore: cast_nullable_to_non_nullable - as PaymentElementWalletOptions?, - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayOptions?, - ) as $Val); + _$PaymentElementOptionsCopyWithImpl(this._self, this._then); + + final PaymentElementOptions _self; + final $Res Function(PaymentElementOptions) _then; + +/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? layout = freezed,Object? defaultValues = freezed,Object? business = freezed,Object? paymentMethodOrder = freezed,Object? fields = freezed,Object? readOnly = freezed,Object? terms = freezed,Object? wallets = freezed,Object? applePay = freezed,}) { + return _then(_self.copyWith( +layout: freezed == layout ? _self.layout : layout // ignore: cast_nullable_to_non_nullable +as PaymentElementLayout?,defaultValues: freezed == defaultValues ? _self.defaultValues : defaultValues // ignore: cast_nullable_to_non_nullable +as PaymentElementDefaultValues?,business: freezed == business ? _self.business : business // ignore: cast_nullable_to_non_nullable +as PaymentElementBusiness?,paymentMethodOrder: freezed == paymentMethodOrder ? _self.paymentMethodOrder : paymentMethodOrder // ignore: cast_nullable_to_non_nullable +as dynamic,fields: freezed == fields ? _self.fields : fields // ignore: cast_nullable_to_non_nullable +as PaymentElementFields?,readOnly: freezed == readOnly ? _self.readOnly : readOnly // ignore: cast_nullable_to_non_nullable +as bool?,terms: freezed == terms ? _self.terms : terms // ignore: cast_nullable_to_non_nullable +as PaymentElementOptionsTerms?,wallets: freezed == wallets ? _self.wallets : wallets // ignore: cast_nullable_to_non_nullable +as PaymentElementWalletOptions?,applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayOptions?, + )); +} +/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementLayoutCopyWith<$Res>? get layout { + if (_self.layout == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementLayoutCopyWith<$Res>? get layout { - if (_value.layout == null) { - return null; - } - - return $PaymentElementLayoutCopyWith<$Res>(_value.layout!, (value) { - return _then(_value.copyWith(layout: value) as $Val); - }); + return $PaymentElementLayoutCopyWith<$Res>(_self.layout!, (value) { + return _then(_self.copyWith(layout: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues { + if (_self.defaultValues == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues { - if (_value.defaultValues == null) { - return null; - } - - return $PaymentElementDefaultValuesCopyWith<$Res>(_value.defaultValues!, - (value) { - return _then(_value.copyWith(defaultValues: value) as $Val); - }); + return $PaymentElementDefaultValuesCopyWith<$Res>(_self.defaultValues!, (value) { + return _then(_self.copyWith(defaultValues: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementBusinessCopyWith<$Res>? get business { + if (_self.business == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementBusinessCopyWith<$Res>? get business { - if (_value.business == null) { - return null; - } - - return $PaymentElementBusinessCopyWith<$Res>(_value.business!, (value) { - return _then(_value.copyWith(business: value) as $Val); - }); + return $PaymentElementBusinessCopyWith<$Res>(_self.business!, (value) { + return _then(_self.copyWith(business: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementFieldsCopyWith<$Res>? get fields { + if (_self.fields == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementFieldsCopyWith<$Res>? get fields { - if (_value.fields == null) { - return null; - } - - return $PaymentElementFieldsCopyWith<$Res>(_value.fields!, (value) { - return _then(_value.copyWith(fields: value) as $Val); - }); + return $PaymentElementFieldsCopyWith<$Res>(_self.fields!, (value) { + return _then(_self.copyWith(fields: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementOptionsTermsCopyWith<$Res>? get terms { + if (_self.terms == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementOptionsTermsCopyWith<$Res>? get terms { - if (_value.terms == null) { - return null; - } - - return $PaymentElementOptionsTermsCopyWith<$Res>(_value.terms!, (value) { - return _then(_value.copyWith(terms: value) as $Val); - }); + return $PaymentElementOptionsTermsCopyWith<$Res>(_self.terms!, (value) { + return _then(_self.copyWith(terms: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementWalletOptionsCopyWith<$Res>? get wallets { + if (_self.wallets == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementWalletOptionsCopyWith<$Res>? get wallets { - if (_value.wallets == null) { - return null; - } - - return $PaymentElementWalletOptionsCopyWith<$Res>(_value.wallets!, (value) { - return _then(_value.copyWith(wallets: value) as $Val); - }); + return $PaymentElementWalletOptionsCopyWith<$Res>(_self.wallets!, (value) { + return _then(_self.copyWith(wallets: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayOptionsCopyWith<$Res>? get applePay { + if (_self.applePay == null) { + return null; } - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementApplePayOptionsCopyWith<$Res>? get applePay { - if (_value.applePay == null) { - return null; - } - - return $PaymentElementApplePayOptionsCopyWith<$Res>(_value.applePay!, - (value) { - return _then(_value.copyWith(applePay: value) as $Val); - }); - } -} + return $PaymentElementApplePayOptionsCopyWith<$Res>(_self.applePay!, (value) { + return _then(_self.copyWith(applePay: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementOptions]. +extension PaymentElementOptionsPatterns on PaymentElementOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementOptions value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementOptions value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementLayout? layout, PaymentElementDefaultValues? defaultValues, PaymentElementBusiness? business, dynamic paymentMethodOrder, PaymentElementFields? fields, bool? readOnly, PaymentElementOptionsTerms? terms, PaymentElementWalletOptions? wallets, PaymentElementApplePayOptions? applePay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementOptions() when $default != null: +return $default(_that.layout,_that.defaultValues,_that.business,_that.paymentMethodOrder,_that.fields,_that.readOnly,_that.terms,_that.wallets,_that.applePay);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementLayout? layout, PaymentElementDefaultValues? defaultValues, PaymentElementBusiness? business, dynamic paymentMethodOrder, PaymentElementFields? fields, bool? readOnly, PaymentElementOptionsTerms? terms, PaymentElementWalletOptions? wallets, PaymentElementApplePayOptions? applePay) $default,) {final _that = this; +switch (_that) { +case _PaymentElementOptions(): +return $default(_that.layout,_that.defaultValues,_that.business,_that.paymentMethodOrder,_that.fields,_that.readOnly,_that.terms,_that.wallets,_that.applePay);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementLayout? layout, PaymentElementDefaultValues? defaultValues, PaymentElementBusiness? business, dynamic paymentMethodOrder, PaymentElementFields? fields, bool? readOnly, PaymentElementOptionsTerms? terms, PaymentElementWalletOptions? wallets, PaymentElementApplePayOptions? applePay)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementOptions() when $default != null: +return $default(_that.layout,_that.defaultValues,_that.business,_that.paymentMethodOrder,_that.fields,_that.readOnly,_that.terms,_that.wallets,_that.applePay);case _: + return null; -/// @nodoc -abstract class _$$PaymentElementOptionsImplCopyWith<$Res> - implements $PaymentElementOptionsCopyWith<$Res> { - factory _$$PaymentElementOptionsImplCopyWith( - _$PaymentElementOptionsImpl value, - $Res Function(_$PaymentElementOptionsImpl) then) = - __$$PaymentElementOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementLayout? layout, - PaymentElementDefaultValues? defaultValues, - PaymentElementBusiness? business, - dynamic paymentMethodOrder, - PaymentElementFields? fields, - bool? readOnly, - PaymentElementOptionsTerms? terms, - PaymentElementWalletOptions? wallets, - PaymentElementApplePayOptions? applePay}); - - @override - $PaymentElementLayoutCopyWith<$Res>? get layout; - @override - $PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues; - @override - $PaymentElementBusinessCopyWith<$Res>? get business; - @override - $PaymentElementFieldsCopyWith<$Res>? get fields; - @override - $PaymentElementOptionsTermsCopyWith<$Res>? get terms; - @override - $PaymentElementWalletOptionsCopyWith<$Res>? get wallets; - @override - $PaymentElementApplePayOptionsCopyWith<$Res>? get applePay; +} } -/// @nodoc -class __$$PaymentElementOptionsImplCopyWithImpl<$Res> - extends _$PaymentElementOptionsCopyWithImpl<$Res, - _$PaymentElementOptionsImpl> - implements _$$PaymentElementOptionsImplCopyWith<$Res> { - __$$PaymentElementOptionsImplCopyWithImpl(_$PaymentElementOptionsImpl _value, - $Res Function(_$PaymentElementOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? layout = freezed, - Object? defaultValues = freezed, - Object? business = freezed, - Object? paymentMethodOrder = freezed, - Object? fields = freezed, - Object? readOnly = freezed, - Object? terms = freezed, - Object? wallets = freezed, - Object? applePay = freezed, - }) { - return _then(_$PaymentElementOptionsImpl( - layout: freezed == layout - ? _value.layout - : layout // ignore: cast_nullable_to_non_nullable - as PaymentElementLayout?, - defaultValues: freezed == defaultValues - ? _value.defaultValues - : defaultValues // ignore: cast_nullable_to_non_nullable - as PaymentElementDefaultValues?, - business: freezed == business - ? _value.business - : business // ignore: cast_nullable_to_non_nullable - as PaymentElementBusiness?, - paymentMethodOrder: freezed == paymentMethodOrder - ? _value.paymentMethodOrder - : paymentMethodOrder // ignore: cast_nullable_to_non_nullable - as dynamic, - fields: freezed == fields - ? _value.fields - : fields // ignore: cast_nullable_to_non_nullable - as PaymentElementFields?, - readOnly: freezed == readOnly - ? _value.readOnly - : readOnly // ignore: cast_nullable_to_non_nullable - as bool?, - terms: freezed == terms - ? _value.terms - : terms // ignore: cast_nullable_to_non_nullable - as PaymentElementOptionsTerms?, - wallets: freezed == wallets - ? _value.wallets - : wallets // ignore: cast_nullable_to_non_nullable - as PaymentElementWalletOptions?, - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayOptions?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementOptionsImpl implements _PaymentElementOptions { - const _$PaymentElementOptionsImpl( - {this.layout, - this.defaultValues, - this.business, - this.paymentMethodOrder, - this.fields, - this.readOnly, - this.terms, - this.wallets, - this.applePay}); - - factory _$PaymentElementOptionsImpl.fromJson(Map json) => - _$$PaymentElementOptionsImplFromJson(json); - - @override - final PaymentElementLayout? layout; - - /// Provide initial customer information that will be displayed - /// in the Payment Element. - /// The form will render with empty fields if not provided. - @override - final PaymentElementDefaultValues? defaultValues; - - /// Provide information about your business that will - /// be displayed in the Payment Element. - /// This information will be retrieved from your Stripe account - /// if not provided. - @override - final PaymentElementBusiness? business; - @override - final dynamic paymentMethodOrder; - - /// By default, the Payment Element will collect all necessary details to - /// complete a payment. - /// - /// For some payment methods, this means that the Payment Element will - /// collect details like name or email that you may have already collected - /// from the user. - /// - /// If this is the case, you can prevent the Payment Element from collecting - /// these data by using the fields option. - /// - /// If you disable the collection of a certain field with the fields option, - /// you must pass that same data to stripe.confirmPayment or the payment will - /// be rejected. - @override - final PaymentElementFields? fields; - @override - final bool? readOnly; - @override - final PaymentElementOptionsTerms? terms; - @override - final PaymentElementWalletOptions? wallets; - @override - final PaymentElementApplePayOptions? applePay; - - @override - String toString() { - return 'PaymentElementOptions(layout: $layout, defaultValues: $defaultValues, business: $business, paymentMethodOrder: $paymentMethodOrder, fields: $fields, readOnly: $readOnly, terms: $terms, wallets: $wallets, applePay: $applePay)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementOptionsImpl && - (identical(other.layout, layout) || other.layout == layout) && - (identical(other.defaultValues, defaultValues) || - other.defaultValues == defaultValues) && - (identical(other.business, business) || - other.business == business) && - const DeepCollectionEquality() - .equals(other.paymentMethodOrder, paymentMethodOrder) && - (identical(other.fields, fields) || other.fields == fields) && - (identical(other.readOnly, readOnly) || - other.readOnly == readOnly) && - (identical(other.terms, terms) || other.terms == terms) && - (identical(other.wallets, wallets) || other.wallets == wallets) && - (identical(other.applePay, applePay) || - other.applePay == applePay)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - layout, - defaultValues, - business, - const DeepCollectionEquality().hash(paymentMethodOrder), - fields, - readOnly, - terms, - wallets, - applePay); - - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementOptionsImplCopyWith<_$PaymentElementOptionsImpl> - get copyWith => __$$PaymentElementOptionsImplCopyWithImpl< - _$PaymentElementOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementOptionsImplToJson( - this, - ); - } +class _PaymentElementOptions implements PaymentElementOptions { + const _PaymentElementOptions({this.layout, this.defaultValues, this.business, this.paymentMethodOrder, this.fields, this.readOnly, this.terms, this.wallets, this.applePay}); + factory _PaymentElementOptions.fromJson(Map json) => _$PaymentElementOptionsFromJson(json); + +@override final PaymentElementLayout? layout; +/// Provide initial customer information that will be displayed +/// in the Payment Element. +/// The form will render with empty fields if not provided. +@override final PaymentElementDefaultValues? defaultValues; +/// Provide information about your business that will +/// be displayed in the Payment Element. +/// This information will be retrieved from your Stripe account +/// if not provided. +@override final PaymentElementBusiness? business; +@override final dynamic paymentMethodOrder; +/// By default, the Payment Element will collect all necessary details to +/// complete a payment. +/// +/// For some payment methods, this means that the Payment Element will +/// collect details like name or email that you may have already collected +/// from the user. +/// +/// If this is the case, you can prevent the Payment Element from collecting +/// these data by using the fields option. +/// +/// If you disable the collection of a certain field with the fields option, +/// you must pass that same data to stripe.confirmPayment or the payment will +/// be rejected. +@override final PaymentElementFields? fields; +@override final bool? readOnly; +@override final PaymentElementOptionsTerms? terms; +@override final PaymentElementWalletOptions? wallets; +@override final PaymentElementApplePayOptions? applePay; + +/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementOptionsCopyWith<_PaymentElementOptions> get copyWith => __$PaymentElementOptionsCopyWithImpl<_PaymentElementOptions>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementOptions&&(identical(other.layout, layout) || other.layout == layout)&&(identical(other.defaultValues, defaultValues) || other.defaultValues == defaultValues)&&(identical(other.business, business) || other.business == business)&&const DeepCollectionEquality().equals(other.paymentMethodOrder, paymentMethodOrder)&&(identical(other.fields, fields) || other.fields == fields)&&(identical(other.readOnly, readOnly) || other.readOnly == readOnly)&&(identical(other.terms, terms) || other.terms == terms)&&(identical(other.wallets, wallets) || other.wallets == wallets)&&(identical(other.applePay, applePay) || other.applePay == applePay)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,layout,defaultValues,business,const DeepCollectionEquality().hash(paymentMethodOrder),fields,readOnly,terms,wallets,applePay); + +@override +String toString() { + return 'PaymentElementOptions(layout: $layout, defaultValues: $defaultValues, business: $business, paymentMethodOrder: $paymentMethodOrder, fields: $fields, readOnly: $readOnly, terms: $terms, wallets: $wallets, applePay: $applePay)'; } -abstract class _PaymentElementOptions implements PaymentElementOptions { - const factory _PaymentElementOptions( - {final PaymentElementLayout? layout, - final PaymentElementDefaultValues? defaultValues, - final PaymentElementBusiness? business, - final dynamic paymentMethodOrder, - final PaymentElementFields? fields, - final bool? readOnly, - final PaymentElementOptionsTerms? terms, - final PaymentElementWalletOptions? wallets, - final PaymentElementApplePayOptions? applePay}) = - _$PaymentElementOptionsImpl; - - factory _PaymentElementOptions.fromJson(Map json) = - _$PaymentElementOptionsImpl.fromJson; - - @override - PaymentElementLayout? get layout; - - /// Provide initial customer information that will be displayed - /// in the Payment Element. - /// The form will render with empty fields if not provided. - @override - PaymentElementDefaultValues? get defaultValues; - - /// Provide information about your business that will - /// be displayed in the Payment Element. - /// This information will be retrieved from your Stripe account - /// if not provided. - @override - PaymentElementBusiness? get business; - @override - dynamic get paymentMethodOrder; - - /// By default, the Payment Element will collect all necessary details to - /// complete a payment. - /// - /// For some payment methods, this means that the Payment Element will - /// collect details like name or email that you may have already collected - /// from the user. - /// - /// If this is the case, you can prevent the Payment Element from collecting - /// these data by using the fields option. - /// - /// If you disable the collection of a certain field with the fields option, - /// you must pass that same data to stripe.confirmPayment or the payment will - /// be rejected. - @override - PaymentElementFields? get fields; - @override - bool? get readOnly; - @override - PaymentElementOptionsTerms? get terms; - @override - PaymentElementWalletOptions? get wallets; - @override - PaymentElementApplePayOptions? get applePay; - - /// Create a copy of PaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementOptionsImplCopyWith<_$PaymentElementOptionsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -PaymentElementLayout _$PaymentElementLayoutFromJson(Map json) { - return _PaymentElementLayout.fromJson(json); + } /// @nodoc -mixin _$PaymentElementLayout { - /// Defines the layout to render the Payment Element. - PaymentElementLayoutType get type => throw _privateConstructorUsedError; - - /// Controls if the Payment Element renders in a collapsed state - /// (where no payment method is selected by default). - /// When you leave this `undefined``, - /// Stripe renders the experience that it determines - /// will have the best conversion. - bool? get defaultCollapsed => throw _privateConstructorUsedError; - - /// Renders each Payment Method with a radio input next to its logo. - /// The radios visually indicate the current selection of the Payment - /// Element. - /// - /// This property is only applicable to the accordion layout. - bool? get radios => throw _privateConstructorUsedError; - - /// When true, the Payment Methods renders as standalone buttons - /// with space in between them. - /// This property is only applicable to the accordion layout. - bool? get spacedAccordionItems => throw _privateConstructorUsedError; - - /// Sets the max number of Payment Methods visible before using the "More" - /// button to hide additional Payment Methods. Set this value to 0 to - /// disable the "More" button and render all available Payment Methods. - /// Default is 5. This property is only applicable to the accordion layout. - int? get visibleAccordionItemsCount => throw _privateConstructorUsedError; +abstract mixin class _$PaymentElementOptionsCopyWith<$Res> implements $PaymentElementOptionsCopyWith<$Res> { + factory _$PaymentElementOptionsCopyWith(_PaymentElementOptions value, $Res Function(_PaymentElementOptions) _then) = __$PaymentElementOptionsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementLayout? layout, PaymentElementDefaultValues? defaultValues, PaymentElementBusiness? business, dynamic paymentMethodOrder, PaymentElementFields? fields, bool? readOnly, PaymentElementOptionsTerms? terms, PaymentElementWalletOptions? wallets, PaymentElementApplePayOptions? applePay +}); - /// Serializes this PaymentElementLayout to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementLayout - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementLayoutCopyWith get copyWith => - throw _privateConstructorUsedError; -} +@override $PaymentElementLayoutCopyWith<$Res>? get layout;@override $PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues;@override $PaymentElementBusinessCopyWith<$Res>? get business;@override $PaymentElementFieldsCopyWith<$Res>? get fields;@override $PaymentElementOptionsTermsCopyWith<$Res>? get terms;@override $PaymentElementWalletOptionsCopyWith<$Res>? get wallets;@override $PaymentElementApplePayOptionsCopyWith<$Res>? get applePay; -/// @nodoc -abstract class $PaymentElementLayoutCopyWith<$Res> { - factory $PaymentElementLayoutCopyWith(PaymentElementLayout value, - $Res Function(PaymentElementLayout) then) = - _$PaymentElementLayoutCopyWithImpl<$Res, PaymentElementLayout>; - @useResult - $Res call( - {PaymentElementLayoutType type, - bool? defaultCollapsed, - bool? radios, - bool? spacedAccordionItems, - int? visibleAccordionItemsCount}); } - /// @nodoc -class _$PaymentElementLayoutCopyWithImpl<$Res, - $Val extends PaymentElementLayout> - implements $PaymentElementLayoutCopyWith<$Res> { - _$PaymentElementLayoutCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementLayout - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? defaultCollapsed = freezed, - Object? radios = freezed, - Object? spacedAccordionItems = freezed, - Object? visibleAccordionItemsCount = freezed, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as PaymentElementLayoutType, - defaultCollapsed: freezed == defaultCollapsed - ? _value.defaultCollapsed - : defaultCollapsed // ignore: cast_nullable_to_non_nullable - as bool?, - radios: freezed == radios - ? _value.radios - : radios // ignore: cast_nullable_to_non_nullable - as bool?, - spacedAccordionItems: freezed == spacedAccordionItems - ? _value.spacedAccordionItems - : spacedAccordionItems // ignore: cast_nullable_to_non_nullable - as bool?, - visibleAccordionItemsCount: freezed == visibleAccordionItemsCount - ? _value.visibleAccordionItemsCount - : visibleAccordionItemsCount // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); +class __$PaymentElementOptionsCopyWithImpl<$Res> + implements _$PaymentElementOptionsCopyWith<$Res> { + __$PaymentElementOptionsCopyWithImpl(this._self, this._then); + + final _PaymentElementOptions _self; + final $Res Function(_PaymentElementOptions) _then; + +/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? layout = freezed,Object? defaultValues = freezed,Object? business = freezed,Object? paymentMethodOrder = freezed,Object? fields = freezed,Object? readOnly = freezed,Object? terms = freezed,Object? wallets = freezed,Object? applePay = freezed,}) { + return _then(_PaymentElementOptions( +layout: freezed == layout ? _self.layout : layout // ignore: cast_nullable_to_non_nullable +as PaymentElementLayout?,defaultValues: freezed == defaultValues ? _self.defaultValues : defaultValues // ignore: cast_nullable_to_non_nullable +as PaymentElementDefaultValues?,business: freezed == business ? _self.business : business // ignore: cast_nullable_to_non_nullable +as PaymentElementBusiness?,paymentMethodOrder: freezed == paymentMethodOrder ? _self.paymentMethodOrder : paymentMethodOrder // ignore: cast_nullable_to_non_nullable +as dynamic,fields: freezed == fields ? _self.fields : fields // ignore: cast_nullable_to_non_nullable +as PaymentElementFields?,readOnly: freezed == readOnly ? _self.readOnly : readOnly // ignore: cast_nullable_to_non_nullable +as bool?,terms: freezed == terms ? _self.terms : terms // ignore: cast_nullable_to_non_nullable +as PaymentElementOptionsTerms?,wallets: freezed == wallets ? _self.wallets : wallets // ignore: cast_nullable_to_non_nullable +as PaymentElementWalletOptions?,applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayOptions?, + )); +} + +/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementLayoutCopyWith<$Res>? get layout { + if (_self.layout == null) { + return null; } -} -/// @nodoc -abstract class _$$PaymentElementLayoutImplCopyWith<$Res> - implements $PaymentElementLayoutCopyWith<$Res> { - factory _$$PaymentElementLayoutImplCopyWith(_$PaymentElementLayoutImpl value, - $Res Function(_$PaymentElementLayoutImpl) then) = - __$$PaymentElementLayoutImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementLayoutType type, - bool? defaultCollapsed, - bool? radios, - bool? spacedAccordionItems, - int? visibleAccordionItemsCount}); -} + return $PaymentElementLayoutCopyWith<$Res>(_self.layout!, (value) { + return _then(_self.copyWith(layout: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementDefaultValuesCopyWith<$Res>? get defaultValues { + if (_self.defaultValues == null) { + return null; + } -/// @nodoc -class __$$PaymentElementLayoutImplCopyWithImpl<$Res> - extends _$PaymentElementLayoutCopyWithImpl<$Res, _$PaymentElementLayoutImpl> - implements _$$PaymentElementLayoutImplCopyWith<$Res> { - __$$PaymentElementLayoutImplCopyWithImpl(_$PaymentElementLayoutImpl _value, - $Res Function(_$PaymentElementLayoutImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementLayout - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? defaultCollapsed = freezed, - Object? radios = freezed, - Object? spacedAccordionItems = freezed, - Object? visibleAccordionItemsCount = freezed, - }) { - return _then(_$PaymentElementLayoutImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as PaymentElementLayoutType, - defaultCollapsed: freezed == defaultCollapsed - ? _value.defaultCollapsed - : defaultCollapsed // ignore: cast_nullable_to_non_nullable - as bool?, - radios: freezed == radios - ? _value.radios - : radios // ignore: cast_nullable_to_non_nullable - as bool?, - spacedAccordionItems: freezed == spacedAccordionItems - ? _value.spacedAccordionItems - : spacedAccordionItems // ignore: cast_nullable_to_non_nullable - as bool?, - visibleAccordionItemsCount: freezed == visibleAccordionItemsCount - ? _value.visibleAccordionItemsCount - : visibleAccordionItemsCount // ignore: cast_nullable_to_non_nullable - as int?, - )); + return $PaymentElementDefaultValuesCopyWith<$Res>(_self.defaultValues!, (value) { + return _then(_self.copyWith(defaultValues: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementBusinessCopyWith<$Res>? get business { + if (_self.business == null) { + return null; } -} -/// @nodoc -@JsonSerializable() -class _$PaymentElementLayoutImpl implements _PaymentElementLayout { - const _$PaymentElementLayoutImpl( - {required this.type, - this.defaultCollapsed, - this.radios, - this.spacedAccordionItems, - this.visibleAccordionItemsCount}); - - factory _$PaymentElementLayoutImpl.fromJson(Map json) => - _$$PaymentElementLayoutImplFromJson(json); - - /// Defines the layout to render the Payment Element. - @override - final PaymentElementLayoutType type; - - /// Controls if the Payment Element renders in a collapsed state - /// (where no payment method is selected by default). - /// When you leave this `undefined``, - /// Stripe renders the experience that it determines - /// will have the best conversion. - @override - final bool? defaultCollapsed; - - /// Renders each Payment Method with a radio input next to its logo. - /// The radios visually indicate the current selection of the Payment - /// Element. - /// - /// This property is only applicable to the accordion layout. - @override - final bool? radios; - - /// When true, the Payment Methods renders as standalone buttons - /// with space in between them. - /// This property is only applicable to the accordion layout. - @override - final bool? spacedAccordionItems; - - /// Sets the max number of Payment Methods visible before using the "More" - /// button to hide additional Payment Methods. Set this value to 0 to - /// disable the "More" button and render all available Payment Methods. - /// Default is 5. This property is only applicable to the accordion layout. - @override - final int? visibleAccordionItemsCount; - - @override - String toString() { - return 'PaymentElementLayout(type: $type, defaultCollapsed: $defaultCollapsed, radios: $radios, spacedAccordionItems: $spacedAccordionItems, visibleAccordionItemsCount: $visibleAccordionItemsCount)'; + return $PaymentElementBusinessCopyWith<$Res>(_self.business!, (value) { + return _then(_self.copyWith(business: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementFieldsCopyWith<$Res>? get fields { + if (_self.fields == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementLayoutImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.defaultCollapsed, defaultCollapsed) || - other.defaultCollapsed == defaultCollapsed) && - (identical(other.radios, radios) || other.radios == radios) && - (identical(other.spacedAccordionItems, spacedAccordionItems) || - other.spacedAccordionItems == spacedAccordionItems) && - (identical(other.visibleAccordionItemsCount, - visibleAccordionItemsCount) || - other.visibleAccordionItemsCount == - visibleAccordionItemsCount)); + return $PaymentElementFieldsCopyWith<$Res>(_self.fields!, (value) { + return _then(_self.copyWith(fields: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementOptionsTermsCopyWith<$Res>? get terms { + if (_self.terms == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, type, defaultCollapsed, radios, - spacedAccordionItems, visibleAccordionItemsCount); - - /// Create a copy of PaymentElementLayout - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementLayoutImplCopyWith<_$PaymentElementLayoutImpl> - get copyWith => - __$$PaymentElementLayoutImplCopyWithImpl<_$PaymentElementLayoutImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementLayoutImplToJson( - this, - ); + return $PaymentElementOptionsTermsCopyWith<$Res>(_self.terms!, (value) { + return _then(_self.copyWith(terms: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementWalletOptionsCopyWith<$Res>? get wallets { + if (_self.wallets == null) { + return null; + } + + return $PaymentElementWalletOptionsCopyWith<$Res>(_self.wallets!, (value) { + return _then(_self.copyWith(wallets: value)); + }); +}/// Create a copy of PaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayOptionsCopyWith<$Res>? get applePay { + if (_self.applePay == null) { + return null; } -} -abstract class _PaymentElementLayout implements PaymentElementLayout { - const factory _PaymentElementLayout( - {required final PaymentElementLayoutType type, - final bool? defaultCollapsed, - final bool? radios, - final bool? spacedAccordionItems, - final int? visibleAccordionItemsCount}) = _$PaymentElementLayoutImpl; - - factory _PaymentElementLayout.fromJson(Map json) = - _$PaymentElementLayoutImpl.fromJson; - - /// Defines the layout to render the Payment Element. - @override - PaymentElementLayoutType get type; - - /// Controls if the Payment Element renders in a collapsed state - /// (where no payment method is selected by default). - /// When you leave this `undefined``, - /// Stripe renders the experience that it determines - /// will have the best conversion. - @override - bool? get defaultCollapsed; - - /// Renders each Payment Method with a radio input next to its logo. - /// The radios visually indicate the current selection of the Payment - /// Element. - /// - /// This property is only applicable to the accordion layout. - @override - bool? get radios; - - /// When true, the Payment Methods renders as standalone buttons - /// with space in between them. - /// This property is only applicable to the accordion layout. - @override - bool? get spacedAccordionItems; - - /// Sets the max number of Payment Methods visible before using the "More" - /// button to hide additional Payment Methods. Set this value to 0 to - /// disable the "More" button and render all available Payment Methods. - /// Default is 5. This property is only applicable to the accordion layout. - @override - int? get visibleAccordionItemsCount; - - /// Create a copy of PaymentElementLayout - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementLayoutImplCopyWith<_$PaymentElementLayoutImpl> - get copyWith => throw _privateConstructorUsedError; -} - -PaymentElementDefaultValues _$PaymentElementDefaultValuesFromJson( - Map json) { - return _PaymentElementDefaultValues.fromJson(json); + return $PaymentElementApplePayOptionsCopyWith<$Res>(_self.applePay!, (value) { + return _then(_self.copyWith(applePay: value)); + }); +} } + /// @nodoc -mixin _$PaymentElementDefaultValues { - /// Specify customer's billing details, which lets you pre-fill a - /// customer’s name, email, phone number and address if required by - /// payment method. - /// Pre-filling as much information as possible streamlines - /// the checkout process. - PaymentElementBillingDetails? get billingDetails => - throw _privateConstructorUsedError; - - /// Specify customer's default information for different payment methods. - /// Pre-filling as much information as possible streamlines the checkout process. - PaymentElementPaymentMethodDefaults? get paymentMethods => - throw _privateConstructorUsedError; +mixin _$PaymentElementLayout { - /// Serializes this PaymentElementDefaultValues to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Defines the layout to render the Payment Element. + PaymentElementLayoutType get type;/// Controls if the Payment Element renders in a collapsed state +/// (where no payment method is selected by default). +/// When you leave this `undefined``, +/// Stripe renders the experience that it determines +/// will have the best conversion. + bool? get defaultCollapsed;/// Renders each Payment Method with a radio input next to its logo. +/// The radios visually indicate the current selection of the Payment +/// Element. +/// +/// This property is only applicable to the accordion layout. + bool? get radios;/// When true, the Payment Methods renders as standalone buttons +/// with space in between them. +/// This property is only applicable to the accordion layout. + bool? get spacedAccordionItems;/// Sets the max number of Payment Methods visible before using the "More" +/// button to hide additional Payment Methods. Set this value to 0 to +/// disable the "More" button and render all available Payment Methods. +/// Default is 5. This property is only applicable to the accordion layout. + int? get visibleAccordionItemsCount; +/// Create a copy of PaymentElementLayout +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementLayoutCopyWith get copyWith => _$PaymentElementLayoutCopyWithImpl(this as PaymentElementLayout, _$identity); - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementDefaultValuesCopyWith - get copyWith => throw _privateConstructorUsedError; + /// Serializes this PaymentElementLayout to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementLayout&&(identical(other.type, type) || other.type == type)&&(identical(other.defaultCollapsed, defaultCollapsed) || other.defaultCollapsed == defaultCollapsed)&&(identical(other.radios, radios) || other.radios == radios)&&(identical(other.spacedAccordionItems, spacedAccordionItems) || other.spacedAccordionItems == spacedAccordionItems)&&(identical(other.visibleAccordionItemsCount, visibleAccordionItemsCount) || other.visibleAccordionItemsCount == visibleAccordionItemsCount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,defaultCollapsed,radios,spacedAccordionItems,visibleAccordionItemsCount); + +@override +String toString() { + return 'PaymentElementLayout(type: $type, defaultCollapsed: $defaultCollapsed, radios: $radios, spacedAccordionItems: $spacedAccordionItems, visibleAccordionItemsCount: $visibleAccordionItemsCount)'; } -/// @nodoc -abstract class $PaymentElementDefaultValuesCopyWith<$Res> { - factory $PaymentElementDefaultValuesCopyWith( - PaymentElementDefaultValues value, - $Res Function(PaymentElementDefaultValues) then) = - _$PaymentElementDefaultValuesCopyWithImpl<$Res, - PaymentElementDefaultValues>; - @useResult - $Res call( - {PaymentElementBillingDetails? billingDetails, - PaymentElementPaymentMethodDefaults? paymentMethods}); - $PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails; - $PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods; } /// @nodoc -class _$PaymentElementDefaultValuesCopyWithImpl<$Res, - $Val extends PaymentElementDefaultValues> - implements $PaymentElementDefaultValuesCopyWith<$Res> { - _$PaymentElementDefaultValuesCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - Object? paymentMethods = freezed, - }) { - return _then(_value.copyWith( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as PaymentElementBillingDetails?, - paymentMethods: freezed == paymentMethods - ? _value.paymentMethods - : paymentMethods // ignore: cast_nullable_to_non_nullable - as PaymentElementPaymentMethodDefaults?, - ) as $Val); - } +abstract mixin class $PaymentElementLayoutCopyWith<$Res> { + factory $PaymentElementLayoutCopyWith(PaymentElementLayout value, $Res Function(PaymentElementLayout) _then) = _$PaymentElementLayoutCopyWithImpl; +@useResult +$Res call({ + PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount +}); - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $PaymentElementBillingDetailsCopyWith<$Res>(_value.billingDetails!, - (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods { - if (_value.paymentMethods == null) { - return null; - } - - return $PaymentElementPaymentMethodDefaultsCopyWith<$Res>( - _value.paymentMethods!, (value) { - return _then(_value.copyWith(paymentMethods: value) as $Val); - }); - } -} + +} /// @nodoc -abstract class _$$PaymentElementDefaultValuesImplCopyWith<$Res> - implements $PaymentElementDefaultValuesCopyWith<$Res> { - factory _$$PaymentElementDefaultValuesImplCopyWith( - _$PaymentElementDefaultValuesImpl value, - $Res Function(_$PaymentElementDefaultValuesImpl) then) = - __$$PaymentElementDefaultValuesImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementBillingDetails? billingDetails, - PaymentElementPaymentMethodDefaults? paymentMethods}); - - @override - $PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails; - @override - $PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods; +class _$PaymentElementLayoutCopyWithImpl<$Res> + implements $PaymentElementLayoutCopyWith<$Res> { + _$PaymentElementLayoutCopyWithImpl(this._self, this._then); + + final PaymentElementLayout _self; + final $Res Function(PaymentElementLayout) _then; + +/// Create a copy of PaymentElementLayout +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? defaultCollapsed = freezed,Object? radios = freezed,Object? spacedAccordionItems = freezed,Object? visibleAccordionItemsCount = freezed,}) { + return _then(_self.copyWith( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as PaymentElementLayoutType,defaultCollapsed: freezed == defaultCollapsed ? _self.defaultCollapsed : defaultCollapsed // ignore: cast_nullable_to_non_nullable +as bool?,radios: freezed == radios ? _self.radios : radios // ignore: cast_nullable_to_non_nullable +as bool?,spacedAccordionItems: freezed == spacedAccordionItems ? _self.spacedAccordionItems : spacedAccordionItems // ignore: cast_nullable_to_non_nullable +as bool?,visibleAccordionItemsCount: freezed == visibleAccordionItemsCount ? _self.visibleAccordionItemsCount : visibleAccordionItemsCount // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementLayout]. +extension PaymentElementLayoutPatterns on PaymentElementLayout { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementLayout value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementLayout() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementLayout value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementLayout(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementLayout value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementLayout() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementLayout() when $default != null: +return $default(_that.type,_that.defaultCollapsed,_that.radios,_that.spacedAccordionItems,_that.visibleAccordionItemsCount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount) $default,) {final _that = this; +switch (_that) { +case _PaymentElementLayout(): +return $default(_that.type,_that.defaultCollapsed,_that.radios,_that.spacedAccordionItems,_that.visibleAccordionItemsCount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementLayout() when $default != null: +return $default(_that.type,_that.defaultCollapsed,_that.radios,_that.spacedAccordionItems,_that.visibleAccordionItemsCount);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementDefaultValuesImplCopyWithImpl<$Res> - extends _$PaymentElementDefaultValuesCopyWithImpl<$Res, - _$PaymentElementDefaultValuesImpl> - implements _$$PaymentElementDefaultValuesImplCopyWith<$Res> { - __$$PaymentElementDefaultValuesImplCopyWithImpl( - _$PaymentElementDefaultValuesImpl _value, - $Res Function(_$PaymentElementDefaultValuesImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - Object? paymentMethods = freezed, - }) { - return _then(_$PaymentElementDefaultValuesImpl( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as PaymentElementBillingDetails?, - paymentMethods: freezed == paymentMethods - ? _value.paymentMethods - : paymentMethods // ignore: cast_nullable_to_non_nullable - as PaymentElementPaymentMethodDefaults?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementDefaultValuesImpl - implements _PaymentElementDefaultValues { - const _$PaymentElementDefaultValuesImpl( - {this.billingDetails, this.paymentMethods}); - - factory _$PaymentElementDefaultValuesImpl.fromJson( - Map json) => - _$$PaymentElementDefaultValuesImplFromJson(json); - - /// Specify customer's billing details, which lets you pre-fill a - /// customer’s name, email, phone number and address if required by - /// payment method. - /// Pre-filling as much information as possible streamlines - /// the checkout process. - @override - final PaymentElementBillingDetails? billingDetails; - - /// Specify customer's default information for different payment methods. - /// Pre-filling as much information as possible streamlines the checkout process. - @override - final PaymentElementPaymentMethodDefaults? paymentMethods; - - @override - String toString() { - return 'PaymentElementDefaultValues(billingDetails: $billingDetails, paymentMethods: $paymentMethods)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementDefaultValuesImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.paymentMethods, paymentMethods) || - other.paymentMethods == paymentMethods)); - } +class _PaymentElementLayout implements PaymentElementLayout { + const _PaymentElementLayout({required this.type, this.defaultCollapsed, this.radios, this.spacedAccordionItems, this.visibleAccordionItemsCount}); + factory _PaymentElementLayout.fromJson(Map json) => _$PaymentElementLayoutFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails, paymentMethods); - - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementDefaultValuesImplCopyWith<_$PaymentElementDefaultValuesImpl> - get copyWith => __$$PaymentElementDefaultValuesImplCopyWithImpl< - _$PaymentElementDefaultValuesImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementDefaultValuesImplToJson( - this, - ); - } -} +/// Defines the layout to render the Payment Element. +@override final PaymentElementLayoutType type; +/// Controls if the Payment Element renders in a collapsed state +/// (where no payment method is selected by default). +/// When you leave this `undefined``, +/// Stripe renders the experience that it determines +/// will have the best conversion. +@override final bool? defaultCollapsed; +/// Renders each Payment Method with a radio input next to its logo. +/// The radios visually indicate the current selection of the Payment +/// Element. +/// +/// This property is only applicable to the accordion layout. +@override final bool? radios; +/// When true, the Payment Methods renders as standalone buttons +/// with space in between them. +/// This property is only applicable to the accordion layout. +@override final bool? spacedAccordionItems; +/// Sets the max number of Payment Methods visible before using the "More" +/// button to hide additional Payment Methods. Set this value to 0 to +/// disable the "More" button and render all available Payment Methods. +/// Default is 5. This property is only applicable to the accordion layout. +@override final int? visibleAccordionItemsCount; -abstract class _PaymentElementDefaultValues - implements PaymentElementDefaultValues { - const factory _PaymentElementDefaultValues( - {final PaymentElementBillingDetails? billingDetails, - final PaymentElementPaymentMethodDefaults? paymentMethods}) = - _$PaymentElementDefaultValuesImpl; +/// Create a copy of PaymentElementLayout +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementLayoutCopyWith<_PaymentElementLayout> get copyWith => __$PaymentElementLayoutCopyWithImpl<_PaymentElementLayout>(this, _$identity); - factory _PaymentElementDefaultValues.fromJson(Map json) = - _$PaymentElementDefaultValuesImpl.fromJson; +@override +Map toJson() { + return _$PaymentElementLayoutToJson(this, ); +} - /// Specify customer's billing details, which lets you pre-fill a - /// customer’s name, email, phone number and address if required by - /// payment method. - /// Pre-filling as much information as possible streamlines - /// the checkout process. - @override - PaymentElementBillingDetails? get billingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementLayout&&(identical(other.type, type) || other.type == type)&&(identical(other.defaultCollapsed, defaultCollapsed) || other.defaultCollapsed == defaultCollapsed)&&(identical(other.radios, radios) || other.radios == radios)&&(identical(other.spacedAccordionItems, spacedAccordionItems) || other.spacedAccordionItems == spacedAccordionItems)&&(identical(other.visibleAccordionItemsCount, visibleAccordionItemsCount) || other.visibleAccordionItemsCount == visibleAccordionItemsCount)); +} - /// Specify customer's default information for different payment methods. - /// Pre-filling as much information as possible streamlines the checkout process. - @override - PaymentElementPaymentMethodDefaults? get paymentMethods; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,defaultCollapsed,radios,spacedAccordionItems,visibleAccordionItemsCount); - /// Create a copy of PaymentElementDefaultValues - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementDefaultValuesImplCopyWith<_$PaymentElementDefaultValuesImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementLayout(type: $type, defaultCollapsed: $defaultCollapsed, radios: $radios, spacedAccordionItems: $spacedAccordionItems, visibleAccordionItemsCount: $visibleAccordionItemsCount)'; } -PaymentElementPaymentMethodDefaults - _$PaymentElementPaymentMethodDefaultsFromJson(Map json) { - return _PaymentElementPaymentMethodDefaults.fromJson(json); + } /// @nodoc -mixin _$PaymentElementPaymentMethodDefaults { - /// Defaults for ideal - PaymentElementIdealDefaults? get ideal => throw _privateConstructorUsedError; +abstract mixin class _$PaymentElementLayoutCopyWith<$Res> implements $PaymentElementLayoutCopyWith<$Res> { + factory _$PaymentElementLayoutCopyWith(_PaymentElementLayout value, $Res Function(_PaymentElementLayout) _then) = __$PaymentElementLayoutCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount +}); - /// Defaults for card payment method - PaymentElementCardDefaults? get card => throw _privateConstructorUsedError; - /// Serializes this PaymentElementPaymentMethodDefaults to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementPaymentMethodDefaultsCopyWith< - PaymentElementPaymentMethodDefaults> - get copyWith => throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $PaymentElementPaymentMethodDefaultsCopyWith<$Res> { - factory $PaymentElementPaymentMethodDefaultsCopyWith( - PaymentElementPaymentMethodDefaults value, - $Res Function(PaymentElementPaymentMethodDefaults) then) = - _$PaymentElementPaymentMethodDefaultsCopyWithImpl<$Res, - PaymentElementPaymentMethodDefaults>; - @useResult - $Res call( - {PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card}); - $PaymentElementIdealDefaultsCopyWith<$Res>? get ideal; - $PaymentElementCardDefaultsCopyWith<$Res>? get card; } - /// @nodoc -class _$PaymentElementPaymentMethodDefaultsCopyWithImpl<$Res, - $Val extends PaymentElementPaymentMethodDefaults> - implements $PaymentElementPaymentMethodDefaultsCopyWith<$Res> { - _$PaymentElementPaymentMethodDefaultsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ideal = freezed, - Object? card = freezed, - }) { - return _then(_value.copyWith( - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as PaymentElementIdealDefaults?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as PaymentElementCardDefaults?, - ) as $Val); - } +class __$PaymentElementLayoutCopyWithImpl<$Res> + implements _$PaymentElementLayoutCopyWith<$Res> { + __$PaymentElementLayoutCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementIdealDefaultsCopyWith<$Res>? get ideal { - if (_value.ideal == null) { - return null; - } - - return $PaymentElementIdealDefaultsCopyWith<$Res>(_value.ideal!, (value) { - return _then(_value.copyWith(ideal: value) as $Val); - }); - } + final _PaymentElementLayout _self; + final $Res Function(_PaymentElementLayout) _then; - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementCardDefaultsCopyWith<$Res>? get card { - if (_value.card == null) { - return null; - } - - return $PaymentElementCardDefaultsCopyWith<$Res>(_value.card!, (value) { - return _then(_value.copyWith(card: value) as $Val); - }); - } +/// Create a copy of PaymentElementLayout +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? defaultCollapsed = freezed,Object? radios = freezed,Object? spacedAccordionItems = freezed,Object? visibleAccordionItemsCount = freezed,}) { + return _then(_PaymentElementLayout( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as PaymentElementLayoutType,defaultCollapsed: freezed == defaultCollapsed ? _self.defaultCollapsed : defaultCollapsed // ignore: cast_nullable_to_non_nullable +as bool?,radios: freezed == radios ? _self.radios : radios // ignore: cast_nullable_to_non_nullable +as bool?,spacedAccordionItems: freezed == spacedAccordionItems ? _self.spacedAccordionItems : spacedAccordionItems // ignore: cast_nullable_to_non_nullable +as bool?,visibleAccordionItemsCount: freezed == visibleAccordionItemsCount ? _self.visibleAccordionItemsCount : visibleAccordionItemsCount // ignore: cast_nullable_to_non_nullable +as int?, + )); } -/// @nodoc -abstract class _$$PaymentElementPaymentMethodDefaultsImplCopyWith<$Res> - implements $PaymentElementPaymentMethodDefaultsCopyWith<$Res> { - factory _$$PaymentElementPaymentMethodDefaultsImplCopyWith( - _$PaymentElementPaymentMethodDefaultsImpl value, - $Res Function(_$PaymentElementPaymentMethodDefaultsImpl) then) = - __$$PaymentElementPaymentMethodDefaultsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card}); - @override - $PaymentElementIdealDefaultsCopyWith<$Res>? get ideal; - @override - $PaymentElementCardDefaultsCopyWith<$Res>? get card; } -/// @nodoc -class __$$PaymentElementPaymentMethodDefaultsImplCopyWithImpl<$Res> - extends _$PaymentElementPaymentMethodDefaultsCopyWithImpl<$Res, - _$PaymentElementPaymentMethodDefaultsImpl> - implements _$$PaymentElementPaymentMethodDefaultsImplCopyWith<$Res> { - __$$PaymentElementPaymentMethodDefaultsImplCopyWithImpl( - _$PaymentElementPaymentMethodDefaultsImpl _value, - $Res Function(_$PaymentElementPaymentMethodDefaultsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ideal = freezed, - Object? card = freezed, - }) { - return _then(_$PaymentElementPaymentMethodDefaultsImpl( - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as PaymentElementIdealDefaults?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as PaymentElementCardDefaults?, - )); - } -} /// @nodoc -@JsonSerializable() -class _$PaymentElementPaymentMethodDefaultsImpl - implements _PaymentElementPaymentMethodDefaults { - const _$PaymentElementPaymentMethodDefaultsImpl({this.ideal, this.card}); - - factory _$PaymentElementPaymentMethodDefaultsImpl.fromJson( - Map json) => - _$$PaymentElementPaymentMethodDefaultsImplFromJson(json); - - /// Defaults for ideal - @override - final PaymentElementIdealDefaults? ideal; +mixin _$PaymentElementDefaultValues { - /// Defaults for card payment method - @override - final PaymentElementCardDefaults? card; +/// Specify customer's billing details, which lets you pre-fill a +/// customer’s name, email, phone number and address if required by +/// payment method. +/// Pre-filling as much information as possible streamlines +/// the checkout process. + PaymentElementBillingDetails? get billingDetails;/// Specify customer's default information for different payment methods. +/// Pre-filling as much information as possible streamlines the checkout process. + PaymentElementPaymentMethodDefaults? get paymentMethods; +/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementDefaultValuesCopyWith get copyWith => _$PaymentElementDefaultValuesCopyWithImpl(this as PaymentElementDefaultValues, _$identity); - @override - String toString() { - return 'PaymentElementPaymentMethodDefaults(ideal: $ideal, card: $card)'; - } + /// Serializes this PaymentElementDefaultValues to a JSON map. + Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementPaymentMethodDefaultsImpl && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.card, card) || other.card == card)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, ideal, card); - - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementPaymentMethodDefaultsImplCopyWith< - _$PaymentElementPaymentMethodDefaultsImpl> - get copyWith => __$$PaymentElementPaymentMethodDefaultsImplCopyWithImpl< - _$PaymentElementPaymentMethodDefaultsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementPaymentMethodDefaultsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementDefaultValues&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.paymentMethods, paymentMethods) || other.paymentMethods == paymentMethods)); } -abstract class _PaymentElementPaymentMethodDefaults - implements PaymentElementPaymentMethodDefaults { - const factory _PaymentElementPaymentMethodDefaults( - {final PaymentElementIdealDefaults? ideal, - final PaymentElementCardDefaults? card}) = - _$PaymentElementPaymentMethodDefaultsImpl; - - factory _PaymentElementPaymentMethodDefaults.fromJson( - Map json) = - _$PaymentElementPaymentMethodDefaultsImpl.fromJson; - - /// Defaults for ideal - @override - PaymentElementIdealDefaults? get ideal; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,paymentMethods); - /// Defaults for card payment method - @override - PaymentElementCardDefaults? get card; - - /// Create a copy of PaymentElementPaymentMethodDefaults - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementPaymentMethodDefaultsImplCopyWith< - _$PaymentElementPaymentMethodDefaultsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementDefaultValues(billingDetails: $billingDetails, paymentMethods: $paymentMethods)'; } -PaymentElementWalletOptions _$PaymentElementWalletOptionsFromJson( - Map json) { - return _PaymentElementWalletOptions.fromJson(json); + } /// @nodoc -mixin _$PaymentElementWalletOptions { - /// Apple pay required options - PaymentElementFieldRequired? get applePay => - throw _privateConstructorUsedError; +abstract mixin class $PaymentElementDefaultValuesCopyWith<$Res> { + factory $PaymentElementDefaultValuesCopyWith(PaymentElementDefaultValues value, $Res Function(PaymentElementDefaultValues) _then) = _$PaymentElementDefaultValuesCopyWithImpl; +@useResult +$Res call({ + PaymentElementBillingDetails? billingDetails, PaymentElementPaymentMethodDefaults? paymentMethods +}); - /// Google pay required options - PaymentElementFieldRequired? get googlePay => - throw _privateConstructorUsedError; - /// Serializes this PaymentElementWalletOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +$PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails;$PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods; - /// Create a copy of PaymentElementWalletOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementWalletOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentElementWalletOptionsCopyWith<$Res> { - factory $PaymentElementWalletOptionsCopyWith( - PaymentElementWalletOptions value, - $Res Function(PaymentElementWalletOptions) then) = - _$PaymentElementWalletOptionsCopyWithImpl<$Res, - PaymentElementWalletOptions>; - @useResult - $Res call( - {PaymentElementFieldRequired? applePay, - PaymentElementFieldRequired? googlePay}); -} +class _$PaymentElementDefaultValuesCopyWithImpl<$Res> + implements $PaymentElementDefaultValuesCopyWith<$Res> { + _$PaymentElementDefaultValuesCopyWithImpl(this._self, this._then); + + final PaymentElementDefaultValues _self; + final $Res Function(PaymentElementDefaultValues) _then; + +/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = freezed,Object? paymentMethods = freezed,}) { + return _then(_self.copyWith( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as PaymentElementBillingDetails?,paymentMethods: freezed == paymentMethods ? _self.paymentMethods : paymentMethods // ignore: cast_nullable_to_non_nullable +as PaymentElementPaymentMethodDefaults?, + )); +} +/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } -/// @nodoc -class _$PaymentElementWalletOptionsCopyWithImpl<$Res, - $Val extends PaymentElementWalletOptions> - implements $PaymentElementWalletOptionsCopyWith<$Res> { - _$PaymentElementWalletOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementWalletOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - }) { - return _then(_value.copyWith( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired?, - ) as $Val); + return $PaymentElementBillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods { + if (_self.paymentMethods == null) { + return null; } -} -/// @nodoc -abstract class _$$PaymentElementWalletOptionsImplCopyWith<$Res> - implements $PaymentElementWalletOptionsCopyWith<$Res> { - factory _$$PaymentElementWalletOptionsImplCopyWith( - _$PaymentElementWalletOptionsImpl value, - $Res Function(_$PaymentElementWalletOptionsImpl) then) = - __$$PaymentElementWalletOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementFieldRequired? applePay, - PaymentElementFieldRequired? googlePay}); + return $PaymentElementPaymentMethodDefaultsCopyWith<$Res>(_self.paymentMethods!, (value) { + return _then(_self.copyWith(paymentMethods: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementDefaultValues]. +extension PaymentElementDefaultValuesPatterns on PaymentElementDefaultValues { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementDefaultValues value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementDefaultValues() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementDefaultValues value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementDefaultValues(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementDefaultValues value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementDefaultValues() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementBillingDetails? billingDetails, PaymentElementPaymentMethodDefaults? paymentMethods)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementDefaultValues() when $default != null: +return $default(_that.billingDetails,_that.paymentMethods);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementBillingDetails? billingDetails, PaymentElementPaymentMethodDefaults? paymentMethods) $default,) {final _that = this; +switch (_that) { +case _PaymentElementDefaultValues(): +return $default(_that.billingDetails,_that.paymentMethods);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementBillingDetails? billingDetails, PaymentElementPaymentMethodDefaults? paymentMethods)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementDefaultValues() when $default != null: +return $default(_that.billingDetails,_that.paymentMethods);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementWalletOptionsImplCopyWithImpl<$Res> - extends _$PaymentElementWalletOptionsCopyWithImpl<$Res, - _$PaymentElementWalletOptionsImpl> - implements _$$PaymentElementWalletOptionsImplCopyWith<$Res> { - __$$PaymentElementWalletOptionsImplCopyWithImpl( - _$PaymentElementWalletOptionsImpl _value, - $Res Function(_$PaymentElementWalletOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementWalletOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? googlePay = freezed, - }) { - return _then(_$PaymentElementWalletOptionsImpl( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementWalletOptionsImpl - implements _PaymentElementWalletOptions { - const _$PaymentElementWalletOptionsImpl({this.applePay, this.googlePay}); - - factory _$PaymentElementWalletOptionsImpl.fromJson( - Map json) => - _$$PaymentElementWalletOptionsImplFromJson(json); - /// Apple pay required options - @override - final PaymentElementFieldRequired? applePay; +class _PaymentElementDefaultValues implements PaymentElementDefaultValues { + const _PaymentElementDefaultValues({this.billingDetails, this.paymentMethods}); + factory _PaymentElementDefaultValues.fromJson(Map json) => _$PaymentElementDefaultValuesFromJson(json); - /// Google pay required options - @override - final PaymentElementFieldRequired? googlePay; - - @override - String toString() { - return 'PaymentElementWalletOptions(applePay: $applePay, googlePay: $googlePay)'; - } +/// Specify customer's billing details, which lets you pre-fill a +/// customer’s name, email, phone number and address if required by +/// payment method. +/// Pre-filling as much information as possible streamlines +/// the checkout process. +@override final PaymentElementBillingDetails? billingDetails; +/// Specify customer's default information for different payment methods. +/// Pre-filling as much information as possible streamlines the checkout process. +@override final PaymentElementPaymentMethodDefaults? paymentMethods; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementWalletOptionsImpl && - (identical(other.applePay, applePay) || - other.applePay == applePay) && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay)); - } +/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementDefaultValuesCopyWith<_PaymentElementDefaultValues> get copyWith => __$PaymentElementDefaultValuesCopyWithImpl<_PaymentElementDefaultValues>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, applePay, googlePay); - - /// Create a copy of PaymentElementWalletOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementWalletOptionsImplCopyWith<_$PaymentElementWalletOptionsImpl> - get copyWith => __$$PaymentElementWalletOptionsImplCopyWithImpl< - _$PaymentElementWalletOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementWalletOptionsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PaymentElementDefaultValuesToJson(this, ); } -abstract class _PaymentElementWalletOptions - implements PaymentElementWalletOptions { - const factory _PaymentElementWalletOptions( - {final PaymentElementFieldRequired? applePay, - final PaymentElementFieldRequired? googlePay}) = - _$PaymentElementWalletOptionsImpl; - - factory _PaymentElementWalletOptions.fromJson(Map json) = - _$PaymentElementWalletOptionsImpl.fromJson; - - /// Apple pay required options - @override - PaymentElementFieldRequired? get applePay; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementDefaultValues&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.paymentMethods, paymentMethods) || other.paymentMethods == paymentMethods)); +} - /// Google pay required options - @override - PaymentElementFieldRequired? get googlePay; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,paymentMethods); - /// Create a copy of PaymentElementWalletOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementWalletOptionsImplCopyWith<_$PaymentElementWalletOptionsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementDefaultValues(billingDetails: $billingDetails, paymentMethods: $paymentMethods)'; } -PaymentElementIdealDefaults _$PaymentElementIdealDefaultsFromJson( - Map json) { - return _PaymentElementIdealDefaults.fromJson(json); + } /// @nodoc -mixin _$PaymentElementIdealDefaults { - /// The customer’s bank name. - /// - /// See https://docs.stripe.com/payments/ideal/accept-a-payment?ui=element#bank-reference - /// for all options. - String? get bank => throw _privateConstructorUsedError; +abstract mixin class _$PaymentElementDefaultValuesCopyWith<$Res> implements $PaymentElementDefaultValuesCopyWith<$Res> { + factory _$PaymentElementDefaultValuesCopyWith(_PaymentElementDefaultValues value, $Res Function(_PaymentElementDefaultValues) _then) = __$PaymentElementDefaultValuesCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementBillingDetails? billingDetails, PaymentElementPaymentMethodDefaults? paymentMethods +}); - /// Serializes this PaymentElementIdealDefaults to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementIdealDefaults - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementIdealDefaultsCopyWith - get copyWith => throw _privateConstructorUsedError; -} +@override $PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails;@override $PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods; -/// @nodoc -abstract class $PaymentElementIdealDefaultsCopyWith<$Res> { - factory $PaymentElementIdealDefaultsCopyWith( - PaymentElementIdealDefaults value, - $Res Function(PaymentElementIdealDefaults) then) = - _$PaymentElementIdealDefaultsCopyWithImpl<$Res, - PaymentElementIdealDefaults>; - @useResult - $Res call({String? bank}); } - /// @nodoc -class _$PaymentElementIdealDefaultsCopyWithImpl<$Res, - $Val extends PaymentElementIdealDefaults> - implements $PaymentElementIdealDefaultsCopyWith<$Res> { - _$PaymentElementIdealDefaultsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementIdealDefaults - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - }) { - return _then(_value.copyWith( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); +class __$PaymentElementDefaultValuesCopyWithImpl<$Res> + implements _$PaymentElementDefaultValuesCopyWith<$Res> { + __$PaymentElementDefaultValuesCopyWithImpl(this._self, this._then); + + final _PaymentElementDefaultValues _self; + final $Res Function(_PaymentElementDefaultValues) _then; + +/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = freezed,Object? paymentMethods = freezed,}) { + return _then(_PaymentElementDefaultValues( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as PaymentElementBillingDetails?,paymentMethods: freezed == paymentMethods ? _self.paymentMethods : paymentMethods // ignore: cast_nullable_to_non_nullable +as PaymentElementPaymentMethodDefaults?, + )); +} + +/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementBillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } -} - -/// @nodoc -abstract class _$$PaymentElementIdealDefaultsImplCopyWith<$Res> - implements $PaymentElementIdealDefaultsCopyWith<$Res> { - factory _$$PaymentElementIdealDefaultsImplCopyWith( - _$PaymentElementIdealDefaultsImpl value, - $Res Function(_$PaymentElementIdealDefaultsImpl) then) = - __$$PaymentElementIdealDefaultsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? bank}); -} -/// @nodoc -class __$$PaymentElementIdealDefaultsImplCopyWithImpl<$Res> - extends _$PaymentElementIdealDefaultsCopyWithImpl<$Res, - _$PaymentElementIdealDefaultsImpl> - implements _$$PaymentElementIdealDefaultsImplCopyWith<$Res> { - __$$PaymentElementIdealDefaultsImplCopyWithImpl( - _$PaymentElementIdealDefaultsImpl _value, - $Res Function(_$PaymentElementIdealDefaultsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementIdealDefaults - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - }) { - return _then(_$PaymentElementIdealDefaultsImpl( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - )); + return $PaymentElementBillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentElementDefaultValues +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementPaymentMethodDefaultsCopyWith<$Res>? get paymentMethods { + if (_self.paymentMethods == null) { + return null; } + + return $PaymentElementPaymentMethodDefaultsCopyWith<$Res>(_self.paymentMethods!, (value) { + return _then(_self.copyWith(paymentMethods: value)); + }); +} } + /// @nodoc -@JsonSerializable() -class _$PaymentElementIdealDefaultsImpl - implements _PaymentElementIdealDefaults { - const _$PaymentElementIdealDefaultsImpl({this.bank}); - - factory _$PaymentElementIdealDefaultsImpl.fromJson( - Map json) => - _$$PaymentElementIdealDefaultsImplFromJson(json); - - /// The customer’s bank name. - /// - /// See https://docs.stripe.com/payments/ideal/accept-a-payment?ui=element#bank-reference - /// for all options. - @override - final String? bank; - - @override - String toString() { - return 'PaymentElementIdealDefaults(bank: $bank)'; - } +mixin _$PaymentElementPaymentMethodDefaults { - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementIdealDefaultsImpl && - (identical(other.bank, bank) || other.bank == bank)); - } +/// Defaults for ideal + PaymentElementIdealDefaults? get ideal;/// Defaults for card payment method + PaymentElementCardDefaults? get card; +/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementPaymentMethodDefaultsCopyWith get copyWith => _$PaymentElementPaymentMethodDefaultsCopyWithImpl(this as PaymentElementPaymentMethodDefaults, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, bank); - - /// Create a copy of PaymentElementIdealDefaults - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementIdealDefaultsImplCopyWith<_$PaymentElementIdealDefaultsImpl> - get copyWith => __$$PaymentElementIdealDefaultsImplCopyWithImpl< - _$PaymentElementIdealDefaultsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementIdealDefaultsImplToJson( - this, - ); - } -} + /// Serializes this PaymentElementPaymentMethodDefaults to a JSON map. + Map toJson(); -abstract class _PaymentElementIdealDefaults - implements PaymentElementIdealDefaults { - const factory _PaymentElementIdealDefaults({final String? bank}) = - _$PaymentElementIdealDefaultsImpl; - factory _PaymentElementIdealDefaults.fromJson(Map json) = - _$PaymentElementIdealDefaultsImpl.fromJson; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementPaymentMethodDefaults&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.card, card) || other.card == card)); +} - /// The customer’s bank name. - /// - /// See https://docs.stripe.com/payments/ideal/accept-a-payment?ui=element#bank-reference - /// for all options. - @override - String? get bank; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,ideal,card); - /// Create a copy of PaymentElementIdealDefaults - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementIdealDefaultsImplCopyWith<_$PaymentElementIdealDefaultsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementPaymentMethodDefaults(ideal: $ideal, card: $card)'; } -PaymentElementCardDefaults _$PaymentElementCardDefaultsFromJson( - Map json) { - return _PaymentElementCardDefaults.fromJson(json); + } /// @nodoc -mixin _$PaymentElementCardDefaults { - /// The specified network prferences for card brand choice. The first network in the array - /// that matches a network on the enetered cobranded card will be selected by default - /// in the card brand choice. - List? get network => throw _privateConstructorUsedError; +abstract mixin class $PaymentElementPaymentMethodDefaultsCopyWith<$Res> { + factory $PaymentElementPaymentMethodDefaultsCopyWith(PaymentElementPaymentMethodDefaults value, $Res Function(PaymentElementPaymentMethodDefaults) _then) = _$PaymentElementPaymentMethodDefaultsCopyWithImpl; +@useResult +$Res call({ + PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card +}); - /// Serializes this PaymentElementCardDefaults to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementCardDefaults - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementCardDefaultsCopyWith - get copyWith => throw _privateConstructorUsedError; -} +$PaymentElementIdealDefaultsCopyWith<$Res>? get ideal;$PaymentElementCardDefaultsCopyWith<$Res>? get card; -/// @nodoc -abstract class $PaymentElementCardDefaultsCopyWith<$Res> { - factory $PaymentElementCardDefaultsCopyWith(PaymentElementCardDefaults value, - $Res Function(PaymentElementCardDefaults) then) = - _$PaymentElementCardDefaultsCopyWithImpl<$Res, - PaymentElementCardDefaults>; - @useResult - $Res call({List? network}); } - /// @nodoc -class _$PaymentElementCardDefaultsCopyWithImpl<$Res, - $Val extends PaymentElementCardDefaults> - implements $PaymentElementCardDefaultsCopyWith<$Res> { - _$PaymentElementCardDefaultsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementCardDefaults - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? network = freezed, - }) { - return _then(_value.copyWith( - network: freezed == network - ? _value.network - : network // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); +class _$PaymentElementPaymentMethodDefaultsCopyWithImpl<$Res> + implements $PaymentElementPaymentMethodDefaultsCopyWith<$Res> { + _$PaymentElementPaymentMethodDefaultsCopyWithImpl(this._self, this._then); + + final PaymentElementPaymentMethodDefaults _self; + final $Res Function(PaymentElementPaymentMethodDefaults) _then; + +/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? ideal = freezed,Object? card = freezed,}) { + return _then(_self.copyWith( +ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as PaymentElementIdealDefaults?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as PaymentElementCardDefaults?, + )); +} +/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementIdealDefaultsCopyWith<$Res>? get ideal { + if (_self.ideal == null) { + return null; } -} -/// @nodoc -abstract class _$$PaymentElementCardDefaultsImplCopyWith<$Res> - implements $PaymentElementCardDefaultsCopyWith<$Res> { - factory _$$PaymentElementCardDefaultsImplCopyWith( - _$PaymentElementCardDefaultsImpl value, - $Res Function(_$PaymentElementCardDefaultsImpl) then) = - __$$PaymentElementCardDefaultsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({List? network}); + return $PaymentElementIdealDefaultsCopyWith<$Res>(_self.ideal!, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementCardDefaultsCopyWith<$Res>? get card { + if (_self.card == null) { + return null; + } + + return $PaymentElementCardDefaultsCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementPaymentMethodDefaults]. +extension PaymentElementPaymentMethodDefaultsPatterns on PaymentElementPaymentMethodDefaults { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementPaymentMethodDefaults value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementPaymentMethodDefaults() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementPaymentMethodDefaults value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementPaymentMethodDefaults(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementPaymentMethodDefaults value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementPaymentMethodDefaults() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementPaymentMethodDefaults() when $default != null: +return $default(_that.ideal,_that.card);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card) $default,) {final _that = this; +switch (_that) { +case _PaymentElementPaymentMethodDefaults(): +return $default(_that.ideal,_that.card);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementPaymentMethodDefaults() when $default != null: +return $default(_that.ideal,_that.card);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementCardDefaultsImplCopyWithImpl<$Res> - extends _$PaymentElementCardDefaultsCopyWithImpl<$Res, - _$PaymentElementCardDefaultsImpl> - implements _$$PaymentElementCardDefaultsImplCopyWith<$Res> { - __$$PaymentElementCardDefaultsImplCopyWithImpl( - _$PaymentElementCardDefaultsImpl _value, - $Res Function(_$PaymentElementCardDefaultsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementCardDefaults - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? network = freezed, - }) { - return _then(_$PaymentElementCardDefaultsImpl( - network: freezed == network - ? _value._network - : network // ignore: cast_nullable_to_non_nullable - as List?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementCardDefaultsImpl implements _PaymentElementCardDefaults { - const _$PaymentElementCardDefaultsImpl({final List? network}) - : _network = network; - - factory _$PaymentElementCardDefaultsImpl.fromJson( - Map json) => - _$$PaymentElementCardDefaultsImplFromJson(json); - - /// The specified network prferences for card brand choice. The first network in the array - /// that matches a network on the enetered cobranded card will be selected by default - /// in the card brand choice. - final List? _network; - - /// The specified network prferences for card brand choice. The first network in the array - /// that matches a network on the enetered cobranded card will be selected by default - /// in the card brand choice. - @override - List? get network { - final value = _network; - if (value == null) return null; - if (_network is EqualUnmodifiableListView) return _network; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - @override - String toString() { - return 'PaymentElementCardDefaults(network: $network)'; - } +class _PaymentElementPaymentMethodDefaults implements PaymentElementPaymentMethodDefaults { + const _PaymentElementPaymentMethodDefaults({this.ideal, this.card}); + factory _PaymentElementPaymentMethodDefaults.fromJson(Map json) => _$PaymentElementPaymentMethodDefaultsFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementCardDefaultsImpl && - const DeepCollectionEquality().equals(other._network, _network)); - } +/// Defaults for ideal +@override final PaymentElementIdealDefaults? ideal; +/// Defaults for card payment method +@override final PaymentElementCardDefaults? card; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(_network)); - - /// Create a copy of PaymentElementCardDefaults - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementCardDefaultsImplCopyWith<_$PaymentElementCardDefaultsImpl> - get copyWith => __$$PaymentElementCardDefaultsImplCopyWithImpl< - _$PaymentElementCardDefaultsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementCardDefaultsImplToJson( - this, - ); - } -} +/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementPaymentMethodDefaultsCopyWith<_PaymentElementPaymentMethodDefaults> get copyWith => __$PaymentElementPaymentMethodDefaultsCopyWithImpl<_PaymentElementPaymentMethodDefaults>(this, _$identity); -abstract class _PaymentElementCardDefaults - implements PaymentElementCardDefaults { - const factory _PaymentElementCardDefaults({final List? network}) = - _$PaymentElementCardDefaultsImpl; +@override +Map toJson() { + return _$PaymentElementPaymentMethodDefaultsToJson(this, ); +} - factory _PaymentElementCardDefaults.fromJson(Map json) = - _$PaymentElementCardDefaultsImpl.fromJson; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementPaymentMethodDefaults&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.card, card) || other.card == card)); +} - /// The specified network prferences for card brand choice. The first network in the array - /// that matches a network on the enetered cobranded card will be selected by default - /// in the card brand choice. - @override - List? get network; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,ideal,card); - /// Create a copy of PaymentElementCardDefaults - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementCardDefaultsImplCopyWith<_$PaymentElementCardDefaultsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementPaymentMethodDefaults(ideal: $ideal, card: $card)'; } -PaymentElementBillingDetails _$PaymentElementBillingDetailsFromJson( - Map json) { - return _PaymentElementBillingDetails.fromJson(json); + } /// @nodoc -mixin _$PaymentElementBillingDetails { - String? get name => throw _privateConstructorUsedError; - String? get email => throw _privateConstructorUsedError; - String? get phone => throw _privateConstructorUsedError; - PaymentElementBillingDetailsAddress? get address => - throw _privateConstructorUsedError; +abstract mixin class _$PaymentElementPaymentMethodDefaultsCopyWith<$Res> implements $PaymentElementPaymentMethodDefaultsCopyWith<$Res> { + factory _$PaymentElementPaymentMethodDefaultsCopyWith(_PaymentElementPaymentMethodDefaults value, $Res Function(_PaymentElementPaymentMethodDefaults) _then) = __$PaymentElementPaymentMethodDefaultsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementIdealDefaults? ideal, PaymentElementCardDefaults? card +}); - /// Serializes this PaymentElementBillingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementBillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementBillingDetailsCopyWith - get copyWith => throw _privateConstructorUsedError; -} +@override $PaymentElementIdealDefaultsCopyWith<$Res>? get ideal;@override $PaymentElementCardDefaultsCopyWith<$Res>? get card; -/// @nodoc -abstract class $PaymentElementBillingDetailsCopyWith<$Res> { - factory $PaymentElementBillingDetailsCopyWith( - PaymentElementBillingDetails value, - $Res Function(PaymentElementBillingDetails) then) = - _$PaymentElementBillingDetailsCopyWithImpl<$Res, - PaymentElementBillingDetails>; - @useResult - $Res call( - {String? name, - String? email, - String? phone, - PaymentElementBillingDetailsAddress? address}); - - $PaymentElementBillingDetailsAddressCopyWith<$Res>? get address; } - /// @nodoc -class _$PaymentElementBillingDetailsCopyWithImpl<$Res, - $Val extends PaymentElementBillingDetails> - implements $PaymentElementBillingDetailsCopyWith<$Res> { - _$PaymentElementBillingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementBillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? email = freezed, - Object? phone = freezed, - Object? address = freezed, - }) { - return _then(_value.copyWith( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as PaymentElementBillingDetailsAddress?, - ) as $Val); +class __$PaymentElementPaymentMethodDefaultsCopyWithImpl<$Res> + implements _$PaymentElementPaymentMethodDefaultsCopyWith<$Res> { + __$PaymentElementPaymentMethodDefaultsCopyWithImpl(this._self, this._then); + + final _PaymentElementPaymentMethodDefaults _self; + final $Res Function(_PaymentElementPaymentMethodDefaults) _then; + +/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? ideal = freezed,Object? card = freezed,}) { + return _then(_PaymentElementPaymentMethodDefaults( +ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as PaymentElementIdealDefaults?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as PaymentElementCardDefaults?, + )); +} + +/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementIdealDefaultsCopyWith<$Res>? get ideal { + if (_self.ideal == null) { + return null; } - /// Create a copy of PaymentElementBillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementBillingDetailsAddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $PaymentElementBillingDetailsAddressCopyWith<$Res>(_value.address!, - (value) { - return _then(_value.copyWith(address: value) as $Val); - }); + return $PaymentElementIdealDefaultsCopyWith<$Res>(_self.ideal!, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of PaymentElementPaymentMethodDefaults +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementCardDefaultsCopyWith<$Res>? get card { + if (_self.card == null) { + return null; } -} -/// @nodoc -abstract class _$$PaymentElementBillingDetailsImplCopyWith<$Res> - implements $PaymentElementBillingDetailsCopyWith<$Res> { - factory _$$PaymentElementBillingDetailsImplCopyWith( - _$PaymentElementBillingDetailsImpl value, - $Res Function(_$PaymentElementBillingDetailsImpl) then) = - __$$PaymentElementBillingDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? name, - String? email, - String? phone, - PaymentElementBillingDetailsAddress? address}); - - @override - $PaymentElementBillingDetailsAddressCopyWith<$Res>? get address; + return $PaymentElementCardDefaultsCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); } - -/// @nodoc -class __$$PaymentElementBillingDetailsImplCopyWithImpl<$Res> - extends _$PaymentElementBillingDetailsCopyWithImpl<$Res, - _$PaymentElementBillingDetailsImpl> - implements _$$PaymentElementBillingDetailsImplCopyWith<$Res> { - __$$PaymentElementBillingDetailsImplCopyWithImpl( - _$PaymentElementBillingDetailsImpl _value, - $Res Function(_$PaymentElementBillingDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementBillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? email = freezed, - Object? phone = freezed, - Object? address = freezed, - }) { - return _then(_$PaymentElementBillingDetailsImpl( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as PaymentElementBillingDetailsAddress?, - )); - } } + /// @nodoc -@JsonSerializable() -class _$PaymentElementBillingDetailsImpl - implements _PaymentElementBillingDetails { - const _$PaymentElementBillingDetailsImpl( - {this.name, this.email, this.phone, this.address}); - - factory _$PaymentElementBillingDetailsImpl.fromJson( - Map json) => - _$$PaymentElementBillingDetailsImplFromJson(json); - - @override - final String? name; - @override - final String? email; - @override - final String? phone; - @override - final PaymentElementBillingDetailsAddress? address; - - @override - String toString() { - return 'PaymentElementBillingDetails(name: $name, email: $email, phone: $phone, address: $address)'; - } +mixin _$PaymentElementWalletOptions { - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementBillingDetailsImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.email, email) || other.email == email) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.address, address) || other.address == address)); - } +/// Apple pay required options + PaymentElementFieldRequired? get applePay;/// Google pay required options + PaymentElementFieldRequired? get googlePay; +/// Create a copy of PaymentElementWalletOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementWalletOptionsCopyWith get copyWith => _$PaymentElementWalletOptionsCopyWithImpl(this as PaymentElementWalletOptions, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, email, phone, address); - - /// Create a copy of PaymentElementBillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementBillingDetailsImplCopyWith< - _$PaymentElementBillingDetailsImpl> - get copyWith => __$$PaymentElementBillingDetailsImplCopyWithImpl< - _$PaymentElementBillingDetailsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementBillingDetailsImplToJson( - this, - ); - } -} + /// Serializes this PaymentElementWalletOptions to a JSON map. + Map toJson(); -abstract class _PaymentElementBillingDetails - implements PaymentElementBillingDetails { - const factory _PaymentElementBillingDetails( - {final String? name, - final String? email, - final String? phone, - final PaymentElementBillingDetailsAddress? address}) = - _$PaymentElementBillingDetailsImpl; - factory _PaymentElementBillingDetails.fromJson(Map json) = - _$PaymentElementBillingDetailsImpl.fromJson; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementWalletOptions&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)); +} - @override - String? get name; - @override - String? get email; - @override - String? get phone; - @override - PaymentElementBillingDetailsAddress? get address; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay); - /// Create a copy of PaymentElementBillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementBillingDetailsImplCopyWith< - _$PaymentElementBillingDetailsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementWalletOptions(applePay: $applePay, googlePay: $googlePay)'; } -PaymentElementBillingDetailsAddress - _$PaymentElementBillingDetailsAddressFromJson(Map json) { - return _PaymentElementBillingDetailsAddress.fromJson(json); + } /// @nodoc -mixin _$PaymentElementBillingDetailsAddress { - /// Address line 1 (e.g., street, PO Box, or company name). - String? get line1 => throw _privateConstructorUsedError; - - /// Address line 2 (e.g., apartment, suite, unit, or building). - String? get line2 => throw _privateConstructorUsedError; - - /// City, district, suburb, town, or village. - String? get city => throw _privateConstructorUsedError; - - /// State, county, province, or region. - String? get state => throw _privateConstructorUsedError; +abstract mixin class $PaymentElementWalletOptionsCopyWith<$Res> { + factory $PaymentElementWalletOptionsCopyWith(PaymentElementWalletOptions value, $Res Function(PaymentElementWalletOptions) _then) = _$PaymentElementWalletOptionsCopyWithImpl; +@useResult +$Res call({ + PaymentElementFieldRequired? applePay, PaymentElementFieldRequired? googlePay +}); - /// Two-letter country code (ISO 3166-1 alpha-2). - String? get country => throw _privateConstructorUsedError; - /// ZIP or postal code. - @JsonKey(name: 'postal_code') - String? get postalCode => throw _privateConstructorUsedError; - /// Serializes this PaymentElementBillingDetailsAddress to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementBillingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementBillingDetailsAddressCopyWith< - PaymentElementBillingDetailsAddress> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentElementBillingDetailsAddressCopyWith<$Res> { - factory $PaymentElementBillingDetailsAddressCopyWith( - PaymentElementBillingDetailsAddress value, - $Res Function(PaymentElementBillingDetailsAddress) then) = - _$PaymentElementBillingDetailsAddressCopyWithImpl<$Res, - PaymentElementBillingDetailsAddress>; - @useResult - $Res call( - {String? line1, - String? line2, - String? city, - String? state, - String? country, - @JsonKey(name: 'postal_code') String? postalCode}); -} +class _$PaymentElementWalletOptionsCopyWithImpl<$Res> + implements $PaymentElementWalletOptionsCopyWith<$Res> { + _$PaymentElementWalletOptionsCopyWithImpl(this._self, this._then); + + final PaymentElementWalletOptions _self; + final $Res Function(PaymentElementWalletOptions) _then; + +/// Create a copy of PaymentElementWalletOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? applePay = freezed,Object? googlePay = freezed,}) { + return _then(_self.copyWith( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementWalletOptions]. +extension PaymentElementWalletOptionsPatterns on PaymentElementWalletOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementWalletOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementWalletOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementWalletOptions value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementWalletOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementWalletOptions value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementWalletOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementFieldRequired? applePay, PaymentElementFieldRequired? googlePay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementWalletOptions() when $default != null: +return $default(_that.applePay,_that.googlePay);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementFieldRequired? applePay, PaymentElementFieldRequired? googlePay) $default,) {final _that = this; +switch (_that) { +case _PaymentElementWalletOptions(): +return $default(_that.applePay,_that.googlePay);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementFieldRequired? applePay, PaymentElementFieldRequired? googlePay)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementWalletOptions() when $default != null: +return $default(_that.applePay,_that.googlePay);case _: + return null; -/// @nodoc -class _$PaymentElementBillingDetailsAddressCopyWithImpl<$Res, - $Val extends PaymentElementBillingDetailsAddress> - implements $PaymentElementBillingDetailsAddressCopyWith<$Res> { - _$PaymentElementBillingDetailsAddressCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementBillingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = freezed, - Object? line2 = freezed, - Object? city = freezed, - Object? state = freezed, - Object? country = freezed, - Object? postalCode = freezed, - }) { - return _then(_value.copyWith( - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } } - -/// @nodoc -abstract class _$$PaymentElementBillingDetailsAddressImplCopyWith<$Res> - implements $PaymentElementBillingDetailsAddressCopyWith<$Res> { - factory _$$PaymentElementBillingDetailsAddressImplCopyWith( - _$PaymentElementBillingDetailsAddressImpl value, - $Res Function(_$PaymentElementBillingDetailsAddressImpl) then) = - __$$PaymentElementBillingDetailsAddressImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? line1, - String? line2, - String? city, - String? state, - String? country, - @JsonKey(name: 'postal_code') String? postalCode}); } -/// @nodoc -class __$$PaymentElementBillingDetailsAddressImplCopyWithImpl<$Res> - extends _$PaymentElementBillingDetailsAddressCopyWithImpl<$Res, - _$PaymentElementBillingDetailsAddressImpl> - implements _$$PaymentElementBillingDetailsAddressImplCopyWith<$Res> { - __$$PaymentElementBillingDetailsAddressImplCopyWithImpl( - _$PaymentElementBillingDetailsAddressImpl _value, - $Res Function(_$PaymentElementBillingDetailsAddressImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementBillingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = freezed, - Object? line2 = freezed, - Object? city = freezed, - Object? state = freezed, - Object? country = freezed, - Object? postalCode = freezed, - }) { - return _then(_$PaymentElementBillingDetailsAddressImpl( - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementBillingDetailsAddressImpl - implements _PaymentElementBillingDetailsAddress { - const _$PaymentElementBillingDetailsAddressImpl( - {this.line1, - this.line2, - this.city, - this.state, - this.country, - @JsonKey(name: 'postal_code') this.postalCode}); - - factory _$PaymentElementBillingDetailsAddressImpl.fromJson( - Map json) => - _$$PaymentElementBillingDetailsAddressImplFromJson(json); - - /// Address line 1 (e.g., street, PO Box, or company name). - @override - final String? line1; - - /// Address line 2 (e.g., apartment, suite, unit, or building). - @override - final String? line2; - - /// City, district, suburb, town, or village. - @override - final String? city; - - /// State, county, province, or region. - @override - final String? state; - - /// Two-letter country code (ISO 3166-1 alpha-2). - @override - final String? country; - - /// ZIP or postal code. - @override - @JsonKey(name: 'postal_code') - final String? postalCode; - - @override - String toString() { - return 'PaymentElementBillingDetailsAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementBillingDetailsAddressImpl && - (identical(other.line1, line1) || other.line1 == line1) && - (identical(other.line2, line2) || other.line2 == line2) && - (identical(other.city, city) || other.city == city) && - (identical(other.state, state) || other.state == state) && - (identical(other.country, country) || other.country == country) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode)); - } +class _PaymentElementWalletOptions implements PaymentElementWalletOptions { + const _PaymentElementWalletOptions({this.applePay, this.googlePay}); + factory _PaymentElementWalletOptions.fromJson(Map json) => _$PaymentElementWalletOptionsFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, line1, line2, city, state, country, postalCode); - - /// Create a copy of PaymentElementBillingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementBillingDetailsAddressImplCopyWith< - _$PaymentElementBillingDetailsAddressImpl> - get copyWith => __$$PaymentElementBillingDetailsAddressImplCopyWithImpl< - _$PaymentElementBillingDetailsAddressImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementBillingDetailsAddressImplToJson( - this, - ); - } +/// Apple pay required options +@override final PaymentElementFieldRequired? applePay; +/// Google pay required options +@override final PaymentElementFieldRequired? googlePay; + +/// Create a copy of PaymentElementWalletOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementWalletOptionsCopyWith<_PaymentElementWalletOptions> get copyWith => __$PaymentElementWalletOptionsCopyWithImpl<_PaymentElementWalletOptions>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementWalletOptionsToJson(this, ); } -abstract class _PaymentElementBillingDetailsAddress - implements PaymentElementBillingDetailsAddress { - const factory _PaymentElementBillingDetailsAddress( - {final String? line1, - final String? line2, - final String? city, - final String? state, - final String? country, - @JsonKey(name: 'postal_code') final String? postalCode}) = - _$PaymentElementBillingDetailsAddressImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementWalletOptions&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)); +} - factory _PaymentElementBillingDetailsAddress.fromJson( - Map json) = - _$PaymentElementBillingDetailsAddressImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,googlePay); - /// Address line 1 (e.g., street, PO Box, or company name). - @override - String? get line1; +@override +String toString() { + return 'PaymentElementWalletOptions(applePay: $applePay, googlePay: $googlePay)'; +} - /// Address line 2 (e.g., apartment, suite, unit, or building). - @override - String? get line2; - /// City, district, suburb, town, or village. - @override - String? get city; +} - /// State, county, province, or region. - @override - String? get state; +/// @nodoc +abstract mixin class _$PaymentElementWalletOptionsCopyWith<$Res> implements $PaymentElementWalletOptionsCopyWith<$Res> { + factory _$PaymentElementWalletOptionsCopyWith(_PaymentElementWalletOptions value, $Res Function(_PaymentElementWalletOptions) _then) = __$PaymentElementWalletOptionsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementFieldRequired? applePay, PaymentElementFieldRequired? googlePay +}); - /// Two-letter country code (ISO 3166-1 alpha-2). - @override - String? get country; - /// ZIP or postal code. - @override - @JsonKey(name: 'postal_code') - String? get postalCode; - /// Create a copy of PaymentElementBillingDetailsAddress - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementBillingDetailsAddressImplCopyWith< - _$PaymentElementBillingDetailsAddressImpl> - get copyWith => throw _privateConstructorUsedError; -} -PaymentElementBusiness _$PaymentElementBusinessFromJson( - Map json) { - return _PaymentElementBusiness.fromJson(json); } - /// @nodoc -mixin _$PaymentElementBusiness { - String? get name => throw _privateConstructorUsedError; +class __$PaymentElementWalletOptionsCopyWithImpl<$Res> + implements _$PaymentElementWalletOptionsCopyWith<$Res> { + __$PaymentElementWalletOptionsCopyWithImpl(this._self, this._then); - /// Serializes this PaymentElementBusiness to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PaymentElementBusiness - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementBusinessCopyWith get copyWith => - throw _privateConstructorUsedError; -} + final _PaymentElementWalletOptions _self; + final $Res Function(_PaymentElementWalletOptions) _then; -/// @nodoc -abstract class $PaymentElementBusinessCopyWith<$Res> { - factory $PaymentElementBusinessCopyWith(PaymentElementBusiness value, - $Res Function(PaymentElementBusiness) then) = - _$PaymentElementBusinessCopyWithImpl<$Res, PaymentElementBusiness>; - @useResult - $Res call({String? name}); +/// Create a copy of PaymentElementWalletOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? applePay = freezed,Object? googlePay = freezed,}) { + return _then(_PaymentElementWalletOptions( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired?, + )); } -/// @nodoc -class _$PaymentElementBusinessCopyWithImpl<$Res, - $Val extends PaymentElementBusiness> - implements $PaymentElementBusinessCopyWith<$Res> { - _$PaymentElementBusinessCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementBusiness - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - }) { - return _then(_value.copyWith( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} -/// @nodoc -abstract class _$$PaymentElementBusinessImplCopyWith<$Res> - implements $PaymentElementBusinessCopyWith<$Res> { - factory _$$PaymentElementBusinessImplCopyWith( - _$PaymentElementBusinessImpl value, - $Res Function(_$PaymentElementBusinessImpl) then) = - __$$PaymentElementBusinessImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? name}); } -/// @nodoc -class __$$PaymentElementBusinessImplCopyWithImpl<$Res> - extends _$PaymentElementBusinessCopyWithImpl<$Res, - _$PaymentElementBusinessImpl> - implements _$$PaymentElementBusinessImplCopyWith<$Res> { - __$$PaymentElementBusinessImplCopyWithImpl( - _$PaymentElementBusinessImpl _value, - $Res Function(_$PaymentElementBusinessImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementBusiness - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - }) { - return _then(_$PaymentElementBusinessImpl( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} /// @nodoc -@JsonSerializable() -class _$PaymentElementBusinessImpl implements _PaymentElementBusiness { - const _$PaymentElementBusinessImpl({this.name}); - - factory _$PaymentElementBusinessImpl.fromJson(Map json) => - _$$PaymentElementBusinessImplFromJson(json); +mixin _$PaymentElementIdealDefaults { - @override - final String? name; +/// The customer’s bank name. +/// +/// See https://docs.stripe.com/payments/ideal/accept-a-payment?ui=element#bank-reference +/// for all options. + String? get bank; +/// Create a copy of PaymentElementIdealDefaults +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementIdealDefaultsCopyWith get copyWith => _$PaymentElementIdealDefaultsCopyWithImpl(this as PaymentElementIdealDefaults, _$identity); - @override - String toString() { - return 'PaymentElementBusiness(name: $name)'; - } + /// Serializes this PaymentElementIdealDefaults to a JSON map. + Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementBusinessImpl && - (identical(other.name, name) || other.name == name)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name); - - /// Create a copy of PaymentElementBusiness - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementBusinessImplCopyWith<_$PaymentElementBusinessImpl> - get copyWith => __$$PaymentElementBusinessImplCopyWithImpl< - _$PaymentElementBusinessImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementBusinessImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementIdealDefaults&&(identical(other.bank, bank) || other.bank == bank)); } -abstract class _PaymentElementBusiness implements PaymentElementBusiness { - const factory _PaymentElementBusiness({final String? name}) = - _$PaymentElementBusinessImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank); - factory _PaymentElementBusiness.fromJson(Map json) = - _$PaymentElementBusinessImpl.fromJson; - - @override - String? get name; - - /// Create a copy of PaymentElementBusiness - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementBusinessImplCopyWith<_$PaymentElementBusinessImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementIdealDefaults(bank: $bank)'; } -PaymentElementFields _$PaymentElementFieldsFromJson(Map json) { - return _PaymentElementFields.fromJson(json); + } /// @nodoc -mixin _$PaymentElementFields { - /// Specify never to avoid collecting all billing details in the - /// Payment Element. - /// If you would like to disable only certain billing details, - /// pass an BillingDetailsFields specifying which fields you would like - /// to disable collection for. - /// The default setting for each field is auto. - BillingDetailsFields get billingDetails => throw _privateConstructorUsedError; +abstract mixin class $PaymentElementIdealDefaultsCopyWith<$Res> { + factory $PaymentElementIdealDefaultsCopyWith(PaymentElementIdealDefaults value, $Res Function(PaymentElementIdealDefaults) _then) = _$PaymentElementIdealDefaultsCopyWithImpl; +@useResult +$Res call({ + String? bank +}); - /// Serializes this PaymentElementFields to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementFieldsCopyWith get copyWith => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $PaymentElementFieldsCopyWith<$Res> { - factory $PaymentElementFieldsCopyWith(PaymentElementFields value, - $Res Function(PaymentElementFields) then) = - _$PaymentElementFieldsCopyWithImpl<$Res, PaymentElementFields>; - @useResult - $Res call({BillingDetailsFields billingDetails}); - $BillingDetailsFieldsCopyWith<$Res> get billingDetails; } - /// @nodoc -class _$PaymentElementFieldsCopyWithImpl<$Res, - $Val extends PaymentElementFields> - implements $PaymentElementFieldsCopyWith<$Res> { - _$PaymentElementFieldsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - }) { - return _then(_value.copyWith( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetailsFields, - ) as $Val); +class _$PaymentElementIdealDefaultsCopyWithImpl<$Res> + implements $PaymentElementIdealDefaultsCopyWith<$Res> { + _$PaymentElementIdealDefaultsCopyWithImpl(this._self, this._then); + + final PaymentElementIdealDefaults _self; + final $Res Function(PaymentElementIdealDefaults) _then; + +/// Create a copy of PaymentElementIdealDefaults +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bank = freezed,}) { + return _then(_self.copyWith( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementIdealDefaults]. +extension PaymentElementIdealDefaultsPatterns on PaymentElementIdealDefaults { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementIdealDefaults value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementIdealDefaults() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementIdealDefaults value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementIdealDefaults(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementIdealDefaults value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementIdealDefaults() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bank)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementIdealDefaults() when $default != null: +return $default(_that.bank);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bank) $default,) {final _that = this; +switch (_that) { +case _PaymentElementIdealDefaults(): +return $default(_that.bank);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bank)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementIdealDefaults() when $default != null: +return $default(_that.bank);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementIdealDefaults implements PaymentElementIdealDefaults { + const _PaymentElementIdealDefaults({this.bank}); + factory _PaymentElementIdealDefaults.fromJson(Map json) => _$PaymentElementIdealDefaultsFromJson(json); + +/// The customer’s bank name. +/// +/// See https://docs.stripe.com/payments/ideal/accept-a-payment?ui=element#bank-reference +/// for all options. +@override final String? bank; + +/// Create a copy of PaymentElementIdealDefaults +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementIdealDefaultsCopyWith<_PaymentElementIdealDefaults> get copyWith => __$PaymentElementIdealDefaultsCopyWithImpl<_PaymentElementIdealDefaults>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementIdealDefaultsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementIdealDefaults&&(identical(other.bank, bank) || other.bank == bank)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank); + +@override +String toString() { + return 'PaymentElementIdealDefaults(bank: $bank)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementIdealDefaultsCopyWith<$Res> implements $PaymentElementIdealDefaultsCopyWith<$Res> { + factory _$PaymentElementIdealDefaultsCopyWith(_PaymentElementIdealDefaults value, $Res Function(_PaymentElementIdealDefaults) _then) = __$PaymentElementIdealDefaultsCopyWithImpl; +@override @useResult +$Res call({ + String? bank +}); + + + + +} +/// @nodoc +class __$PaymentElementIdealDefaultsCopyWithImpl<$Res> + implements _$PaymentElementIdealDefaultsCopyWith<$Res> { + __$PaymentElementIdealDefaultsCopyWithImpl(this._self, this._then); + + final _PaymentElementIdealDefaults _self; + final $Res Function(_PaymentElementIdealDefaults) _then; + +/// Create a copy of PaymentElementIdealDefaults +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bank = freezed,}) { + return _then(_PaymentElementIdealDefaults( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentElementCardDefaults { + +/// The specified network prferences for card brand choice. The first network in the array +/// that matches a network on the enetered cobranded card will be selected by default +/// in the card brand choice. + List? get network; +/// Create a copy of PaymentElementCardDefaults +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementCardDefaultsCopyWith get copyWith => _$PaymentElementCardDefaultsCopyWithImpl(this as PaymentElementCardDefaults, _$identity); + + /// Serializes this PaymentElementCardDefaults to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementCardDefaults&&const DeepCollectionEquality().equals(other.network, network)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(network)); + +@override +String toString() { + return 'PaymentElementCardDefaults(network: $network)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementCardDefaultsCopyWith<$Res> { + factory $PaymentElementCardDefaultsCopyWith(PaymentElementCardDefaults value, $Res Function(PaymentElementCardDefaults) _then) = _$PaymentElementCardDefaultsCopyWithImpl; +@useResult +$Res call({ + List? network +}); + + + + +} +/// @nodoc +class _$PaymentElementCardDefaultsCopyWithImpl<$Res> + implements $PaymentElementCardDefaultsCopyWith<$Res> { + _$PaymentElementCardDefaultsCopyWithImpl(this._self, this._then); + + final PaymentElementCardDefaults _self; + final $Res Function(PaymentElementCardDefaults) _then; + +/// Create a copy of PaymentElementCardDefaults +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? network = freezed,}) { + return _then(_self.copyWith( +network: freezed == network ? _self.network : network // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementCardDefaults]. +extension PaymentElementCardDefaultsPatterns on PaymentElementCardDefaults { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementCardDefaults value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementCardDefaults() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementCardDefaults value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementCardDefaults(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementCardDefaults value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementCardDefaults() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( List? network)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementCardDefaults() when $default != null: +return $default(_that.network);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( List? network) $default,) {final _that = this; +switch (_that) { +case _PaymentElementCardDefaults(): +return $default(_that.network);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( List? network)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementCardDefaults() when $default != null: +return $default(_that.network);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementCardDefaults implements PaymentElementCardDefaults { + const _PaymentElementCardDefaults({final List? network}): _network = network; + factory _PaymentElementCardDefaults.fromJson(Map json) => _$PaymentElementCardDefaultsFromJson(json); + +/// The specified network prferences for card brand choice. The first network in the array +/// that matches a network on the enetered cobranded card will be selected by default +/// in the card brand choice. + final List? _network; +/// The specified network prferences for card brand choice. The first network in the array +/// that matches a network on the enetered cobranded card will be selected by default +/// in the card brand choice. +@override List? get network { + final value = _network; + if (value == null) return null; + if (_network is EqualUnmodifiableListView) return _network; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of PaymentElementCardDefaults +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementCardDefaultsCopyWith<_PaymentElementCardDefaults> get copyWith => __$PaymentElementCardDefaultsCopyWithImpl<_PaymentElementCardDefaults>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementCardDefaultsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementCardDefaults&&const DeepCollectionEquality().equals(other._network, _network)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_network)); + +@override +String toString() { + return 'PaymentElementCardDefaults(network: $network)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementCardDefaultsCopyWith<$Res> implements $PaymentElementCardDefaultsCopyWith<$Res> { + factory _$PaymentElementCardDefaultsCopyWith(_PaymentElementCardDefaults value, $Res Function(_PaymentElementCardDefaults) _then) = __$PaymentElementCardDefaultsCopyWithImpl; +@override @useResult +$Res call({ + List? network +}); + + + + +} +/// @nodoc +class __$PaymentElementCardDefaultsCopyWithImpl<$Res> + implements _$PaymentElementCardDefaultsCopyWith<$Res> { + __$PaymentElementCardDefaultsCopyWithImpl(this._self, this._then); + + final _PaymentElementCardDefaults _self; + final $Res Function(_PaymentElementCardDefaults) _then; + +/// Create a copy of PaymentElementCardDefaults +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? network = freezed,}) { + return _then(_PaymentElementCardDefaults( +network: freezed == network ? _self._network : network // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentElementBillingDetails { + + String? get name; String? get email; String? get phone; PaymentElementBillingDetailsAddress? get address; +/// Create a copy of PaymentElementBillingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementBillingDetailsCopyWith get copyWith => _$PaymentElementBillingDetailsCopyWithImpl(this as PaymentElementBillingDetails, _$identity); + + /// Serializes this PaymentElementBillingDetails to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementBillingDetails&&(identical(other.name, name) || other.name == name)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.address, address) || other.address == address)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,email,phone,address); + +@override +String toString() { + return 'PaymentElementBillingDetails(name: $name, email: $email, phone: $phone, address: $address)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementBillingDetailsCopyWith<$Res> { + factory $PaymentElementBillingDetailsCopyWith(PaymentElementBillingDetails value, $Res Function(PaymentElementBillingDetails) _then) = _$PaymentElementBillingDetailsCopyWithImpl; +@useResult +$Res call({ + String? name, String? email, String? phone, PaymentElementBillingDetailsAddress? address +}); + + +$PaymentElementBillingDetailsAddressCopyWith<$Res>? get address; + +} +/// @nodoc +class _$PaymentElementBillingDetailsCopyWithImpl<$Res> + implements $PaymentElementBillingDetailsCopyWith<$Res> { + _$PaymentElementBillingDetailsCopyWithImpl(this._self, this._then); + + final PaymentElementBillingDetails _self; + final $Res Function(PaymentElementBillingDetails) _then; + +/// Create a copy of PaymentElementBillingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? email = freezed,Object? phone = freezed,Object? address = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as PaymentElementBillingDetailsAddress?, + )); +} +/// Create a copy of PaymentElementBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementBillingDetailsAddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $PaymentElementBillingDetailsAddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementBillingDetails]. +extension PaymentElementBillingDetailsPatterns on PaymentElementBillingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementBillingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementBillingDetails value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementBillingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name, String? email, String? phone, PaymentElementBillingDetailsAddress? address)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetails() when $default != null: +return $default(_that.name,_that.email,_that.phone,_that.address);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name, String? email, String? phone, PaymentElementBillingDetailsAddress? address) $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetails(): +return $default(_that.name,_that.email,_that.phone,_that.address);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name, String? email, String? phone, PaymentElementBillingDetailsAddress? address)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetails() when $default != null: +return $default(_that.name,_that.email,_that.phone,_that.address);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementBillingDetails implements PaymentElementBillingDetails { + const _PaymentElementBillingDetails({this.name, this.email, this.phone, this.address}); + factory _PaymentElementBillingDetails.fromJson(Map json) => _$PaymentElementBillingDetailsFromJson(json); + +@override final String? name; +@override final String? email; +@override final String? phone; +@override final PaymentElementBillingDetailsAddress? address; + +/// Create a copy of PaymentElementBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementBillingDetailsCopyWith<_PaymentElementBillingDetails> get copyWith => __$PaymentElementBillingDetailsCopyWithImpl<_PaymentElementBillingDetails>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementBillingDetailsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementBillingDetails&&(identical(other.name, name) || other.name == name)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.address, address) || other.address == address)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,email,phone,address); + +@override +String toString() { + return 'PaymentElementBillingDetails(name: $name, email: $email, phone: $phone, address: $address)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementBillingDetailsCopyWith<$Res> implements $PaymentElementBillingDetailsCopyWith<$Res> { + factory _$PaymentElementBillingDetailsCopyWith(_PaymentElementBillingDetails value, $Res Function(_PaymentElementBillingDetails) _then) = __$PaymentElementBillingDetailsCopyWithImpl; +@override @useResult +$Res call({ + String? name, String? email, String? phone, PaymentElementBillingDetailsAddress? address +}); + + +@override $PaymentElementBillingDetailsAddressCopyWith<$Res>? get address; + +} +/// @nodoc +class __$PaymentElementBillingDetailsCopyWithImpl<$Res> + implements _$PaymentElementBillingDetailsCopyWith<$Res> { + __$PaymentElementBillingDetailsCopyWithImpl(this._self, this._then); + + final _PaymentElementBillingDetails _self; + final $Res Function(_PaymentElementBillingDetails) _then; + +/// Create a copy of PaymentElementBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? email = freezed,Object? phone = freezed,Object? address = freezed,}) { + return _then(_PaymentElementBillingDetails( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as PaymentElementBillingDetailsAddress?, + )); +} + +/// Create a copy of PaymentElementBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementBillingDetailsAddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - /// Create a copy of PaymentElementFields - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsFieldsCopyWith<$Res> get billingDetails { - return $BillingDetailsFieldsCopyWith<$Res>(_value.billingDetails, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } + return $PaymentElementBillingDetailsAddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// @nodoc +mixin _$PaymentElementBillingDetailsAddress { + +/// Address line 1 (e.g., street, PO Box, or company name). + String? get line1;/// Address line 2 (e.g., apartment, suite, unit, or building). + String? get line2;/// City, district, suburb, town, or village. + String? get city;/// State, county, province, or region. + String? get state;/// Two-letter country code (ISO 3166-1 alpha-2). + String? get country;/// ZIP or postal code. +@JsonKey(name: 'postal_code') String? get postalCode; +/// Create a copy of PaymentElementBillingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementBillingDetailsAddressCopyWith get copyWith => _$PaymentElementBillingDetailsAddressCopyWithImpl(this as PaymentElementBillingDetailsAddress, _$identity); + + /// Serializes this PaymentElementBillingDetailsAddress to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementBillingDetailsAddress&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); + +@override +String toString() { + return 'PaymentElementBillingDetailsAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementBillingDetailsAddressCopyWith<$Res> { + factory $PaymentElementBillingDetailsAddressCopyWith(PaymentElementBillingDetailsAddress value, $Res Function(PaymentElementBillingDetailsAddress) _then) = _$PaymentElementBillingDetailsAddressCopyWithImpl; +@useResult +$Res call({ + String? line1, String? line2, String? city, String? state, String? country,@JsonKey(name: 'postal_code') String? postalCode +}); + + + + +} +/// @nodoc +class _$PaymentElementBillingDetailsAddressCopyWithImpl<$Res> + implements $PaymentElementBillingDetailsAddressCopyWith<$Res> { + _$PaymentElementBillingDetailsAddressCopyWithImpl(this._self, this._then); + + final PaymentElementBillingDetailsAddress _self; + final $Res Function(PaymentElementBillingDetailsAddress) _then; + +/// Create a copy of PaymentElementBillingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? line1 = freezed,Object? line2 = freezed,Object? city = freezed,Object? state = freezed,Object? country = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementBillingDetailsAddress]. +extension PaymentElementBillingDetailsAddressPatterns on PaymentElementBillingDetailsAddress { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementBillingDetailsAddress value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementBillingDetailsAddress value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementBillingDetailsAddress value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode) $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress(): +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? line1, String? line2, String? city, String? state, String? country, @JsonKey(name: 'postal_code') String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementBillingDetailsAddress() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementBillingDetailsAddress implements PaymentElementBillingDetailsAddress { + const _PaymentElementBillingDetailsAddress({this.line1, this.line2, this.city, this.state, this.country, @JsonKey(name: 'postal_code') this.postalCode}); + factory _PaymentElementBillingDetailsAddress.fromJson(Map json) => _$PaymentElementBillingDetailsAddressFromJson(json); + +/// Address line 1 (e.g., street, PO Box, or company name). +@override final String? line1; +/// Address line 2 (e.g., apartment, suite, unit, or building). +@override final String? line2; +/// City, district, suburb, town, or village. +@override final String? city; +/// State, county, province, or region. +@override final String? state; +/// Two-letter country code (ISO 3166-1 alpha-2). +@override final String? country; +/// ZIP or postal code. +@override@JsonKey(name: 'postal_code') final String? postalCode; + +/// Create a copy of PaymentElementBillingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementBillingDetailsAddressCopyWith<_PaymentElementBillingDetailsAddress> get copyWith => __$PaymentElementBillingDetailsAddressCopyWithImpl<_PaymentElementBillingDetailsAddress>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementBillingDetailsAddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementBillingDetailsAddress&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); + +@override +String toString() { + return 'PaymentElementBillingDetailsAddress(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementBillingDetailsAddressCopyWith<$Res> implements $PaymentElementBillingDetailsAddressCopyWith<$Res> { + factory _$PaymentElementBillingDetailsAddressCopyWith(_PaymentElementBillingDetailsAddress value, $Res Function(_PaymentElementBillingDetailsAddress) _then) = __$PaymentElementBillingDetailsAddressCopyWithImpl; +@override @useResult +$Res call({ + String? line1, String? line2, String? city, String? state, String? country,@JsonKey(name: 'postal_code') String? postalCode +}); + + + + +} +/// @nodoc +class __$PaymentElementBillingDetailsAddressCopyWithImpl<$Res> + implements _$PaymentElementBillingDetailsAddressCopyWith<$Res> { + __$PaymentElementBillingDetailsAddressCopyWithImpl(this._self, this._then); + + final _PaymentElementBillingDetailsAddress _self; + final $Res Function(_PaymentElementBillingDetailsAddress) _then; + +/// Create a copy of PaymentElementBillingDetailsAddress +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? line1 = freezed,Object? line2 = freezed,Object? city = freezed,Object? state = freezed,Object? country = freezed,Object? postalCode = freezed,}) { + return _then(_PaymentElementBillingDetailsAddress( +line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentElementBusiness { + + String? get name; +/// Create a copy of PaymentElementBusiness +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementBusinessCopyWith get copyWith => _$PaymentElementBusinessCopyWithImpl(this as PaymentElementBusiness, _$identity); + + /// Serializes this PaymentElementBusiness to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementBusiness&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'PaymentElementBusiness(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementBusinessCopyWith<$Res> { + factory $PaymentElementBusinessCopyWith(PaymentElementBusiness value, $Res Function(PaymentElementBusiness) _then) = _$PaymentElementBusinessCopyWithImpl; +@useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class _$PaymentElementBusinessCopyWithImpl<$Res> + implements $PaymentElementBusinessCopyWith<$Res> { + _$PaymentElementBusinessCopyWithImpl(this._self, this._then); + + final PaymentElementBusiness _self; + final $Res Function(PaymentElementBusiness) _then; + +/// Create a copy of PaymentElementBusiness +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementBusiness]. +extension PaymentElementBusinessPatterns on PaymentElementBusiness { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementBusiness value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementBusiness() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementBusiness value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBusiness(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementBusiness value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementBusiness() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementBusiness() when $default != null: +return $default(_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name) $default,) {final _that = this; +switch (_that) { +case _PaymentElementBusiness(): +return $default(_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementBusiness() when $default != null: +return $default(_that.name);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementBusiness implements PaymentElementBusiness { + const _PaymentElementBusiness({this.name}); + factory _PaymentElementBusiness.fromJson(Map json) => _$PaymentElementBusinessFromJson(json); + +@override final String? name; + +/// Create a copy of PaymentElementBusiness +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementBusinessCopyWith<_PaymentElementBusiness> get copyWith => __$PaymentElementBusinessCopyWithImpl<_PaymentElementBusiness>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementBusinessToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementBusiness&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'PaymentElementBusiness(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementBusinessCopyWith<$Res> implements $PaymentElementBusinessCopyWith<$Res> { + factory _$PaymentElementBusinessCopyWith(_PaymentElementBusiness value, $Res Function(_PaymentElementBusiness) _then) = __$PaymentElementBusinessCopyWithImpl; +@override @useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class __$PaymentElementBusinessCopyWithImpl<$Res> + implements _$PaymentElementBusinessCopyWith<$Res> { + __$PaymentElementBusinessCopyWithImpl(this._self, this._then); + + final _PaymentElementBusiness _self; + final $Res Function(_PaymentElementBusiness) _then; + +/// Create a copy of PaymentElementBusiness +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,}) { + return _then(_PaymentElementBusiness( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentElementFields { + +/// Specify never to avoid collecting all billing details in the +/// Payment Element. +/// If you would like to disable only certain billing details, +/// pass an BillingDetailsFields specifying which fields you would like +/// to disable collection for. +/// The default setting for each field is auto. + BillingDetailsFields get billingDetails; +/// Create a copy of PaymentElementFields +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementFieldsCopyWith get copyWith => _$PaymentElementFieldsCopyWithImpl(this as PaymentElementFields, _$identity); + + /// Serializes this PaymentElementFields to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementFields&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails); + +@override +String toString() { + return 'PaymentElementFields(billingDetails: $billingDetails)'; } + +} + +/// @nodoc +abstract mixin class $PaymentElementFieldsCopyWith<$Res> { + factory $PaymentElementFieldsCopyWith(PaymentElementFields value, $Res Function(PaymentElementFields) _then) = _$PaymentElementFieldsCopyWithImpl; +@useResult +$Res call({ + BillingDetailsFields billingDetails +}); + + +$BillingDetailsFieldsCopyWith<$Res> get billingDetails; + +} /// @nodoc -abstract class _$$PaymentElementFieldsImplCopyWith<$Res> +class _$PaymentElementFieldsCopyWithImpl<$Res> implements $PaymentElementFieldsCopyWith<$Res> { - factory _$$PaymentElementFieldsImplCopyWith(_$PaymentElementFieldsImpl value, - $Res Function(_$PaymentElementFieldsImpl) then) = - __$$PaymentElementFieldsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({BillingDetailsFields billingDetails}); + _$PaymentElementFieldsCopyWithImpl(this._self, this._then); + + final PaymentElementFields _self; + final $Res Function(PaymentElementFields) _then; + +/// Create a copy of PaymentElementFields +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = null,}) { + return _then(_self.copyWith( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetailsFields, + )); +} +/// Create a copy of PaymentElementFields +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsFieldsCopyWith<$Res> get billingDetails { + + return $BillingDetailsFieldsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementFields]. +extension PaymentElementFieldsPatterns on PaymentElementFields { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementFields value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementFields() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementFields value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementFields(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementFields value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementFields() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BillingDetailsFields billingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementFields() when $default != null: +return $default(_that.billingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BillingDetailsFields billingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentElementFields(): +return $default(_that.billingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BillingDetailsFields billingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementFields() when $default != null: +return $default(_that.billingDetails);case _: + return null; - @override - $BillingDetailsFieldsCopyWith<$Res> get billingDetails; +} } -/// @nodoc -class __$$PaymentElementFieldsImplCopyWithImpl<$Res> - extends _$PaymentElementFieldsCopyWithImpl<$Res, _$PaymentElementFieldsImpl> - implements _$$PaymentElementFieldsImplCopyWith<$Res> { - __$$PaymentElementFieldsImplCopyWithImpl(_$PaymentElementFieldsImpl _value, - $Res Function(_$PaymentElementFieldsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - }) { - return _then(_$PaymentElementFieldsImpl( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetailsFields, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementFieldsImpl implements _PaymentElementFields { - const _$PaymentElementFieldsImpl( - {this.billingDetails = BillingDetailsFields.auto}); - - factory _$PaymentElementFieldsImpl.fromJson(Map json) => - _$$PaymentElementFieldsImplFromJson(json); - - /// Specify never to avoid collecting all billing details in the - /// Payment Element. - /// If you would like to disable only certain billing details, - /// pass an BillingDetailsFields specifying which fields you would like - /// to disable collection for. - /// The default setting for each field is auto. - @override - @JsonKey() - final BillingDetailsFields billingDetails; - - @override - String toString() { - return 'PaymentElementFields(billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementFieldsImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _PaymentElementFields implements PaymentElementFields { + const _PaymentElementFields({this.billingDetails = BillingDetailsFields.auto}); + factory _PaymentElementFields.fromJson(Map json) => _$PaymentElementFieldsFromJson(json); + +/// Specify never to avoid collecting all billing details in the +/// Payment Element. +/// If you would like to disable only certain billing details, +/// pass an BillingDetailsFields specifying which fields you would like +/// to disable collection for. +/// The default setting for each field is auto. +@override@JsonKey() final BillingDetailsFields billingDetails; + +/// Create a copy of PaymentElementFields +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementFieldsCopyWith<_PaymentElementFields> get copyWith => __$PaymentElementFieldsCopyWithImpl<_PaymentElementFields>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementFieldsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementFields&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails); + +@override +String toString() { + return 'PaymentElementFields(billingDetails: $billingDetails)'; +} + - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails); - - /// Create a copy of PaymentElementFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementFieldsImplCopyWith<_$PaymentElementFieldsImpl> - get copyWith => - __$$PaymentElementFieldsImplCopyWithImpl<_$PaymentElementFieldsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementFieldsImplToJson( - this, - ); - } } -abstract class _PaymentElementFields implements PaymentElementFields { - const factory _PaymentElementFields( - {final BillingDetailsFields billingDetails}) = _$PaymentElementFieldsImpl; +/// @nodoc +abstract mixin class _$PaymentElementFieldsCopyWith<$Res> implements $PaymentElementFieldsCopyWith<$Res> { + factory _$PaymentElementFieldsCopyWith(_PaymentElementFields value, $Res Function(_PaymentElementFields) _then) = __$PaymentElementFieldsCopyWithImpl; +@override @useResult +$Res call({ + BillingDetailsFields billingDetails +}); + - factory _PaymentElementFields.fromJson(Map json) = - _$PaymentElementFieldsImpl.fromJson; +@override $BillingDetailsFieldsCopyWith<$Res> get billingDetails; + +} +/// @nodoc +class __$PaymentElementFieldsCopyWithImpl<$Res> + implements _$PaymentElementFieldsCopyWith<$Res> { + __$PaymentElementFieldsCopyWithImpl(this._self, this._then); - /// Specify never to avoid collecting all billing details in the - /// Payment Element. - /// If you would like to disable only certain billing details, - /// pass an BillingDetailsFields specifying which fields you would like - /// to disable collection for. - /// The default setting for each field is auto. - @override - BillingDetailsFields get billingDetails; + final _PaymentElementFields _self; + final $Res Function(_PaymentElementFields) _then; - /// Create a copy of PaymentElementFields - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementFieldsImplCopyWith<_$PaymentElementFieldsImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentElementFields +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = null,}) { + return _then(_PaymentElementFields( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetailsFields, + )); } -BillingDetailsFields _$BillingDetailsFieldsFromJson(Map json) { - return _BillingDetailsFields.fromJson(json); +/// Create a copy of PaymentElementFields +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsFieldsCopyWith<$Res> get billingDetails { + + return $BillingDetailsFieldsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } + /// @nodoc mixin _$BillingDetailsFields { - PaymentElementFieldRequired get name => throw _privateConstructorUsedError; - PaymentElementFieldRequired get email => throw _privateConstructorUsedError; - PaymentElementFieldRequired get phone => throw _privateConstructorUsedError; - PaymentElementAddressFields get address => throw _privateConstructorUsedError; + + PaymentElementFieldRequired get name; PaymentElementFieldRequired get email; PaymentElementFieldRequired get phone; PaymentElementAddressFields get address; +/// Create a copy of BillingDetailsFields +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BillingDetailsFieldsCopyWith get copyWith => _$BillingDetailsFieldsCopyWithImpl(this as BillingDetailsFields, _$identity); /// Serializes this BillingDetailsFields to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of BillingDetailsFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BillingDetailsFieldsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BillingDetailsFields&&(identical(other.name, name) || other.name == name)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.address, address) || other.address == address)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,email,phone,address); + +@override +String toString() { + return 'BillingDetailsFields(name: $name, email: $email, phone: $phone, address: $address)'; } -/// @nodoc -abstract class $BillingDetailsFieldsCopyWith<$Res> { - factory $BillingDetailsFieldsCopyWith(BillingDetailsFields value, - $Res Function(BillingDetailsFields) then) = - _$BillingDetailsFieldsCopyWithImpl<$Res, BillingDetailsFields>; - @useResult - $Res call( - {PaymentElementFieldRequired name, - PaymentElementFieldRequired email, - PaymentElementFieldRequired phone, - PaymentElementAddressFields address}); - $PaymentElementAddressFieldsCopyWith<$Res> get address; } /// @nodoc -class _$BillingDetailsFieldsCopyWithImpl<$Res, - $Val extends BillingDetailsFields> +abstract mixin class $BillingDetailsFieldsCopyWith<$Res> { + factory $BillingDetailsFieldsCopyWith(BillingDetailsFields value, $Res Function(BillingDetailsFields) _then) = _$BillingDetailsFieldsCopyWithImpl; +@useResult +$Res call({ + PaymentElementFieldRequired name, PaymentElementFieldRequired email, PaymentElementFieldRequired phone, PaymentElementAddressFields address +}); + + +$PaymentElementAddressFieldsCopyWith<$Res> get address; + +} +/// @nodoc +class _$BillingDetailsFieldsCopyWithImpl<$Res> implements $BillingDetailsFieldsCopyWith<$Res> { - _$BillingDetailsFieldsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BillingDetailsFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = null, - Object? email = null, - Object? phone = null, - Object? address = null, - }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - email: null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - phone: null == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as PaymentElementAddressFields, - ) as $Val); - } + _$BillingDetailsFieldsCopyWithImpl(this._self, this._then); + + final BillingDetailsFields _self; + final $Res Function(BillingDetailsFields) _then; + +/// Create a copy of BillingDetailsFields +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? email = null,Object? phone = null,Object? address = null,}) { + return _then(_self.copyWith( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,email: null == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as PaymentElementAddressFields, + )); +} +/// Create a copy of BillingDetailsFields +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementAddressFieldsCopyWith<$Res> get address { + + return $PaymentElementAddressFieldsCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [BillingDetailsFields]. +extension BillingDetailsFieldsPatterns on BillingDetailsFields { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BillingDetailsFields value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BillingDetailsFields() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BillingDetailsFields value) $default,){ +final _that = this; +switch (_that) { +case _BillingDetailsFields(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BillingDetailsFields value)? $default,){ +final _that = this; +switch (_that) { +case _BillingDetailsFields() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementFieldRequired name, PaymentElementFieldRequired email, PaymentElementFieldRequired phone, PaymentElementAddressFields address)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BillingDetailsFields() when $default != null: +return $default(_that.name,_that.email,_that.phone,_that.address);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementFieldRequired name, PaymentElementFieldRequired email, PaymentElementFieldRequired phone, PaymentElementAddressFields address) $default,) {final _that = this; +switch (_that) { +case _BillingDetailsFields(): +return $default(_that.name,_that.email,_that.phone,_that.address);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementFieldRequired name, PaymentElementFieldRequired email, PaymentElementFieldRequired phone, PaymentElementAddressFields address)? $default,) {final _that = this; +switch (_that) { +case _BillingDetailsFields() when $default != null: +return $default(_that.name,_that.email,_that.phone,_that.address);case _: + return null; + +} +} - /// Create a copy of BillingDetailsFields - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementAddressFieldsCopyWith<$Res> get address { - return $PaymentElementAddressFieldsCopyWith<$Res>(_value.address, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } } /// @nodoc -abstract class _$$BillingDetailsFieldsImplCopyWith<$Res> - implements $BillingDetailsFieldsCopyWith<$Res> { - factory _$$BillingDetailsFieldsImplCopyWith(_$BillingDetailsFieldsImpl value, - $Res Function(_$BillingDetailsFieldsImpl) then) = - __$$BillingDetailsFieldsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementFieldRequired name, - PaymentElementFieldRequired email, - PaymentElementFieldRequired phone, - PaymentElementAddressFields address}); +@JsonSerializable() + +class _BillingDetailsFields implements BillingDetailsFields { + const _BillingDetailsFields({this.name = PaymentElementFieldRequired.auto, this.email = PaymentElementFieldRequired.auto, this.phone = PaymentElementFieldRequired.auto, this.address = PaymentElementAddressFields.auto}); + factory _BillingDetailsFields.fromJson(Map json) => _$BillingDetailsFieldsFromJson(json); + +@override@JsonKey() final PaymentElementFieldRequired name; +@override@JsonKey() final PaymentElementFieldRequired email; +@override@JsonKey() final PaymentElementFieldRequired phone; +@override@JsonKey() final PaymentElementAddressFields address; + +/// Create a copy of BillingDetailsFields +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BillingDetailsFieldsCopyWith<_BillingDetailsFields> get copyWith => __$BillingDetailsFieldsCopyWithImpl<_BillingDetailsFields>(this, _$identity); + +@override +Map toJson() { + return _$BillingDetailsFieldsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BillingDetailsFields&&(identical(other.name, name) || other.name == name)&&(identical(other.email, email) || other.email == email)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.address, address) || other.address == address)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,email,phone,address); + +@override +String toString() { + return 'BillingDetailsFields(name: $name, email: $email, phone: $phone, address: $address)'; +} + + +} + +/// @nodoc +abstract mixin class _$BillingDetailsFieldsCopyWith<$Res> implements $BillingDetailsFieldsCopyWith<$Res> { + factory _$BillingDetailsFieldsCopyWith(_BillingDetailsFields value, $Res Function(_BillingDetailsFields) _then) = __$BillingDetailsFieldsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementFieldRequired name, PaymentElementFieldRequired email, PaymentElementFieldRequired phone, PaymentElementAddressFields address +}); + + +@override $PaymentElementAddressFieldsCopyWith<$Res> get address; + +} +/// @nodoc +class __$BillingDetailsFieldsCopyWithImpl<$Res> + implements _$BillingDetailsFieldsCopyWith<$Res> { + __$BillingDetailsFieldsCopyWithImpl(this._self, this._then); + + final _BillingDetailsFields _self; + final $Res Function(_BillingDetailsFields) _then; + +/// Create a copy of BillingDetailsFields +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? email = null,Object? phone = null,Object? address = null,}) { + return _then(_BillingDetailsFields( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,email: null == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as PaymentElementAddressFields, + )); +} + +/// Create a copy of BillingDetailsFields +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementAddressFieldsCopyWith<$Res> get address { + + return $PaymentElementAddressFieldsCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// @nodoc +mixin _$PaymentElementAddressFields { + + PaymentElementFieldRequired get line1; PaymentElementFieldRequired get line2; PaymentElementFieldRequired get city; PaymentElementFieldRequired get state; PaymentElementFieldRequired get country; PaymentElementFieldRequired get postalCode; +/// Create a copy of PaymentElementAddressFields +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementAddressFieldsCopyWith get copyWith => _$PaymentElementAddressFieldsCopyWithImpl(this as PaymentElementAddressFields, _$identity); + + /// Serializes this PaymentElementAddressFields to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementAddressFields&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); + +@override +String toString() { + return 'PaymentElementAddressFields(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementAddressFieldsCopyWith<$Res> { + factory $PaymentElementAddressFieldsCopyWith(PaymentElementAddressFields value, $Res Function(PaymentElementAddressFields) _then) = _$PaymentElementAddressFieldsCopyWithImpl; +@useResult +$Res call({ + PaymentElementFieldRequired line1, PaymentElementFieldRequired line2, PaymentElementFieldRequired city, PaymentElementFieldRequired state, PaymentElementFieldRequired country, PaymentElementFieldRequired postalCode +}); + + + + +} +/// @nodoc +class _$PaymentElementAddressFieldsCopyWithImpl<$Res> + implements $PaymentElementAddressFieldsCopyWith<$Res> { + _$PaymentElementAddressFieldsCopyWithImpl(this._self, this._then); + + final PaymentElementAddressFields _self; + final $Res Function(PaymentElementAddressFields) _then; + +/// Create a copy of PaymentElementAddressFields +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? line1 = null,Object? line2 = null,Object? city = null,Object? state = null,Object? country = null,Object? postalCode = null,}) { + return _then(_self.copyWith( +line1: null == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,line2: null == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,city: null == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,postalCode: null == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementAddressFields]. +extension PaymentElementAddressFieldsPatterns on PaymentElementAddressFields { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementAddressFields value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementAddressFields() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementAddressFields value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementAddressFields(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementAddressFields value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementAddressFields() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementFieldRequired line1, PaymentElementFieldRequired line2, PaymentElementFieldRequired city, PaymentElementFieldRequired state, PaymentElementFieldRequired country, PaymentElementFieldRequired postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementAddressFields() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementFieldRequired line1, PaymentElementFieldRequired line2, PaymentElementFieldRequired city, PaymentElementFieldRequired state, PaymentElementFieldRequired country, PaymentElementFieldRequired postalCode) $default,) {final _that = this; +switch (_that) { +case _PaymentElementAddressFields(): +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementFieldRequired line1, PaymentElementFieldRequired line2, PaymentElementFieldRequired city, PaymentElementFieldRequired state, PaymentElementFieldRequired country, PaymentElementFieldRequired postalCode)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementAddressFields() when $default != null: +return $default(_that.line1,_that.line2,_that.city,_that.state,_that.country,_that.postalCode);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementAddressFields implements PaymentElementAddressFields { + const _PaymentElementAddressFields({this.line1 = PaymentElementFieldRequired.auto, this.line2 = PaymentElementFieldRequired.auto, this.city = PaymentElementFieldRequired.auto, this.state = PaymentElementFieldRequired.auto, this.country = PaymentElementFieldRequired.auto, this.postalCode = PaymentElementFieldRequired.auto}); + factory _PaymentElementAddressFields.fromJson(Map json) => _$PaymentElementAddressFieldsFromJson(json); + +@override@JsonKey() final PaymentElementFieldRequired line1; +@override@JsonKey() final PaymentElementFieldRequired line2; +@override@JsonKey() final PaymentElementFieldRequired city; +@override@JsonKey() final PaymentElementFieldRequired state; +@override@JsonKey() final PaymentElementFieldRequired country; +@override@JsonKey() final PaymentElementFieldRequired postalCode; + +/// Create a copy of PaymentElementAddressFields +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementAddressFieldsCopyWith<_PaymentElementAddressFields> get copyWith => __$PaymentElementAddressFieldsCopyWithImpl<_PaymentElementAddressFields>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementAddressFieldsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementAddressFields&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.city, city) || other.city == city)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,line1,line2,city,state,country,postalCode); - @override - $PaymentElementAddressFieldsCopyWith<$Res> get address; +@override +String toString() { + return 'PaymentElementAddressFields(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; } + +} + +/// @nodoc +abstract mixin class _$PaymentElementAddressFieldsCopyWith<$Res> implements $PaymentElementAddressFieldsCopyWith<$Res> { + factory _$PaymentElementAddressFieldsCopyWith(_PaymentElementAddressFields value, $Res Function(_PaymentElementAddressFields) _then) = __$PaymentElementAddressFieldsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementFieldRequired line1, PaymentElementFieldRequired line2, PaymentElementFieldRequired city, PaymentElementFieldRequired state, PaymentElementFieldRequired country, PaymentElementFieldRequired postalCode +}); + + + + +} +/// @nodoc +class __$PaymentElementAddressFieldsCopyWithImpl<$Res> + implements _$PaymentElementAddressFieldsCopyWith<$Res> { + __$PaymentElementAddressFieldsCopyWithImpl(this._self, this._then); + + final _PaymentElementAddressFields _self; + final $Res Function(_PaymentElementAddressFields) _then; + +/// Create a copy of PaymentElementAddressFields +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? line1 = null,Object? line2 = null,Object? city = null,Object? state = null,Object? country = null,Object? postalCode = null,}) { + return _then(_PaymentElementAddressFields( +line1: null == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,line2: null == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,city: null == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired,postalCode: null == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as PaymentElementFieldRequired, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentElementOptionsTerms { + +/// Terms for apple pay + PaymentElementShowTerms? get applePay;/// Terms for aubecs debit + PaymentElementShowTerms? get auBecsDebit;/// Terms for bancontact + PaymentElementShowTerms? get bancontact;/// Terms for card + PaymentElementShowTerms? get card;/// Terms for cashapp + PaymentElementShowTerms? get cashApp;/// Terms for googlePay + PaymentElementShowTerms? get googlePay;/// Terms for ideal + PaymentElementShowTerms? get ideal;/// Terms for paypal + PaymentElementShowTerms? get payPal;/// Terms for sepa debit + PaymentElementShowTerms? get sepaDebit;/// Terms for sofort + PaymentElementShowTerms? get sofort;/// Terms for usBankAccount + PaymentElementShowTerms? get usBankAccount; +/// Create a copy of PaymentElementOptionsTerms +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementOptionsTermsCopyWith get copyWith => _$PaymentElementOptionsTermsCopyWithImpl(this as PaymentElementOptionsTerms, _$identity); + + /// Serializes this PaymentElementOptionsTerms to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementOptionsTerms&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.bancontact, bancontact) || other.bancontact == bancontact)&&(identical(other.card, card) || other.card == card)&&(identical(other.cashApp, cashApp) || other.cashApp == cashApp)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.payPal, payPal) || other.payPal == payPal)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.sofort, sofort) || other.sofort == sofort)&&(identical(other.usBankAccount, usBankAccount) || other.usBankAccount == usBankAccount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,auBecsDebit,bancontact,card,cashApp,googlePay,ideal,payPal,sepaDebit,sofort,usBankAccount); + +@override +String toString() { + return 'PaymentElementOptionsTerms(applePay: $applePay, auBecsDebit: $auBecsDebit, bancontact: $bancontact, card: $card, cashApp: $cashApp, googlePay: $googlePay, ideal: $ideal, payPal: $payPal, sepaDebit: $sepaDebit, sofort: $sofort, usBankAccount: $usBankAccount)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementOptionsTermsCopyWith<$Res> { + factory $PaymentElementOptionsTermsCopyWith(PaymentElementOptionsTerms value, $Res Function(PaymentElementOptionsTerms) _then) = _$PaymentElementOptionsTermsCopyWithImpl; +@useResult +$Res call({ + PaymentElementShowTerms? applePay, PaymentElementShowTerms? auBecsDebit, PaymentElementShowTerms? bancontact, PaymentElementShowTerms? card, PaymentElementShowTerms? cashApp, PaymentElementShowTerms? googlePay, PaymentElementShowTerms? ideal, PaymentElementShowTerms? payPal, PaymentElementShowTerms? sepaDebit, PaymentElementShowTerms? sofort, PaymentElementShowTerms? usBankAccount +}); + + + + +} +/// @nodoc +class _$PaymentElementOptionsTermsCopyWithImpl<$Res> + implements $PaymentElementOptionsTermsCopyWith<$Res> { + _$PaymentElementOptionsTermsCopyWithImpl(this._self, this._then); + + final PaymentElementOptionsTerms _self; + final $Res Function(PaymentElementOptionsTerms) _then; + +/// Create a copy of PaymentElementOptionsTerms +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? applePay = freezed,Object? auBecsDebit = freezed,Object? bancontact = freezed,Object? card = freezed,Object? cashApp = freezed,Object? googlePay = freezed,Object? ideal = freezed,Object? payPal = freezed,Object? sepaDebit = freezed,Object? sofort = freezed,Object? usBankAccount = freezed,}) { + return _then(_self.copyWith( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,auBecsDebit: freezed == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,bancontact: freezed == bancontact ? _self.bancontact : bancontact // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,cashApp: freezed == cashApp ? _self.cashApp : cashApp // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,payPal: freezed == payPal ? _self.payPal : payPal // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,sepaDebit: freezed == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,sofort: freezed == sofort ? _self.sofort : sofort // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,usBankAccount: freezed == usBankAccount ? _self.usBankAccount : usBankAccount // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementOptionsTerms]. +extension PaymentElementOptionsTermsPatterns on PaymentElementOptionsTerms { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementOptionsTerms value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementOptionsTerms() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementOptionsTerms value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementOptionsTerms(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementOptionsTerms value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementOptionsTerms() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementShowTerms? applePay, PaymentElementShowTerms? auBecsDebit, PaymentElementShowTerms? bancontact, PaymentElementShowTerms? card, PaymentElementShowTerms? cashApp, PaymentElementShowTerms? googlePay, PaymentElementShowTerms? ideal, PaymentElementShowTerms? payPal, PaymentElementShowTerms? sepaDebit, PaymentElementShowTerms? sofort, PaymentElementShowTerms? usBankAccount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementOptionsTerms() when $default != null: +return $default(_that.applePay,_that.auBecsDebit,_that.bancontact,_that.card,_that.cashApp,_that.googlePay,_that.ideal,_that.payPal,_that.sepaDebit,_that.sofort,_that.usBankAccount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementShowTerms? applePay, PaymentElementShowTerms? auBecsDebit, PaymentElementShowTerms? bancontact, PaymentElementShowTerms? card, PaymentElementShowTerms? cashApp, PaymentElementShowTerms? googlePay, PaymentElementShowTerms? ideal, PaymentElementShowTerms? payPal, PaymentElementShowTerms? sepaDebit, PaymentElementShowTerms? sofort, PaymentElementShowTerms? usBankAccount) $default,) {final _that = this; +switch (_that) { +case _PaymentElementOptionsTerms(): +return $default(_that.applePay,_that.auBecsDebit,_that.bancontact,_that.card,_that.cashApp,_that.googlePay,_that.ideal,_that.payPal,_that.sepaDebit,_that.sofort,_that.usBankAccount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementShowTerms? applePay, PaymentElementShowTerms? auBecsDebit, PaymentElementShowTerms? bancontact, PaymentElementShowTerms? card, PaymentElementShowTerms? cashApp, PaymentElementShowTerms? googlePay, PaymentElementShowTerms? ideal, PaymentElementShowTerms? payPal, PaymentElementShowTerms? sepaDebit, PaymentElementShowTerms? sofort, PaymentElementShowTerms? usBankAccount)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementOptionsTerms() when $default != null: +return $default(_that.applePay,_that.auBecsDebit,_that.bancontact,_that.card,_that.cashApp,_that.googlePay,_that.ideal,_that.payPal,_that.sepaDebit,_that.sofort,_that.usBankAccount);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentElementOptionsTerms implements PaymentElementOptionsTerms { + const _PaymentElementOptionsTerms({this.applePay, this.auBecsDebit, this.bancontact, this.card, this.cashApp, this.googlePay, this.ideal, this.payPal, this.sepaDebit, this.sofort, this.usBankAccount}); + factory _PaymentElementOptionsTerms.fromJson(Map json) => _$PaymentElementOptionsTermsFromJson(json); + +/// Terms for apple pay +@override final PaymentElementShowTerms? applePay; +/// Terms for aubecs debit +@override final PaymentElementShowTerms? auBecsDebit; +/// Terms for bancontact +@override final PaymentElementShowTerms? bancontact; +/// Terms for card +@override final PaymentElementShowTerms? card; +/// Terms for cashapp +@override final PaymentElementShowTerms? cashApp; +/// Terms for googlePay +@override final PaymentElementShowTerms? googlePay; +/// Terms for ideal +@override final PaymentElementShowTerms? ideal; +/// Terms for paypal +@override final PaymentElementShowTerms? payPal; +/// Terms for sepa debit +@override final PaymentElementShowTerms? sepaDebit; +/// Terms for sofort +@override final PaymentElementShowTerms? sofort; +/// Terms for usBankAccount +@override final PaymentElementShowTerms? usBankAccount; + +/// Create a copy of PaymentElementOptionsTerms +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementOptionsTermsCopyWith<_PaymentElementOptionsTerms> get copyWith => __$PaymentElementOptionsTermsCopyWithImpl<_PaymentElementOptionsTerms>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementOptionsTermsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementOptionsTerms&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.bancontact, bancontact) || other.bancontact == bancontact)&&(identical(other.card, card) || other.card == card)&&(identical(other.cashApp, cashApp) || other.cashApp == cashApp)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.payPal, payPal) || other.payPal == payPal)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.sofort, sofort) || other.sofort == sofort)&&(identical(other.usBankAccount, usBankAccount) || other.usBankAccount == usBankAccount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay,auBecsDebit,bancontact,card,cashApp,googlePay,ideal,payPal,sepaDebit,sofort,usBankAccount); + +@override +String toString() { + return 'PaymentElementOptionsTerms(applePay: $applePay, auBecsDebit: $auBecsDebit, bancontact: $bancontact, card: $card, cashApp: $cashApp, googlePay: $googlePay, ideal: $ideal, payPal: $payPal, sepaDebit: $sepaDebit, sofort: $sofort, usBankAccount: $usBankAccount)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementOptionsTermsCopyWith<$Res> implements $PaymentElementOptionsTermsCopyWith<$Res> { + factory _$PaymentElementOptionsTermsCopyWith(_PaymentElementOptionsTerms value, $Res Function(_PaymentElementOptionsTerms) _then) = __$PaymentElementOptionsTermsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementShowTerms? applePay, PaymentElementShowTerms? auBecsDebit, PaymentElementShowTerms? bancontact, PaymentElementShowTerms? card, PaymentElementShowTerms? cashApp, PaymentElementShowTerms? googlePay, PaymentElementShowTerms? ideal, PaymentElementShowTerms? payPal, PaymentElementShowTerms? sepaDebit, PaymentElementShowTerms? sofort, PaymentElementShowTerms? usBankAccount +}); + + + + +} +/// @nodoc +class __$PaymentElementOptionsTermsCopyWithImpl<$Res> + implements _$PaymentElementOptionsTermsCopyWith<$Res> { + __$PaymentElementOptionsTermsCopyWithImpl(this._self, this._then); + + final _PaymentElementOptionsTerms _self; + final $Res Function(_PaymentElementOptionsTerms) _then; + +/// Create a copy of PaymentElementOptionsTerms +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? applePay = freezed,Object? auBecsDebit = freezed,Object? bancontact = freezed,Object? card = freezed,Object? cashApp = freezed,Object? googlePay = freezed,Object? ideal = freezed,Object? payPal = freezed,Object? sepaDebit = freezed,Object? sofort = freezed,Object? usBankAccount = freezed,}) { + return _then(_PaymentElementOptionsTerms( +applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,auBecsDebit: freezed == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,bancontact: freezed == bancontact ? _self.bancontact : bancontact // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,cashApp: freezed == cashApp ? _self.cashApp : cashApp // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,payPal: freezed == payPal ? _self.payPal : payPal // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,sepaDebit: freezed == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,sofort: freezed == sofort ? _self.sofort : sofort // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?,usBankAccount: freezed == usBankAccount ? _self.usBankAccount : usBankAccount // ignore: cast_nullable_to_non_nullable +as PaymentElementShowTerms?, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentElementApplePayOptions { + +/// Information about a recurring payment with ApplePay + PaymentElementAppleRecurringRequest? get recurringPaymentRequest;/// Information about a deferred payment with ApplePay + PaymentElementApplePayDeferredPaymentRequest? get deferredPaymentRequest;/// Information about an auto reload payment with ApplePay + PaymentElementApplePayAutoReloadPaymentRequest? get automaticReloadPaymentRequest; +/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementApplePayOptionsCopyWith get copyWith => _$PaymentElementApplePayOptionsCopyWithImpl(this as PaymentElementApplePayOptions, _$identity); + + /// Serializes this PaymentElementApplePayOptions to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementApplePayOptions&&(identical(other.recurringPaymentRequest, recurringPaymentRequest) || other.recurringPaymentRequest == recurringPaymentRequest)&&(identical(other.deferredPaymentRequest, deferredPaymentRequest) || other.deferredPaymentRequest == deferredPaymentRequest)&&(identical(other.automaticReloadPaymentRequest, automaticReloadPaymentRequest) || other.automaticReloadPaymentRequest == automaticReloadPaymentRequest)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,recurringPaymentRequest,deferredPaymentRequest,automaticReloadPaymentRequest); + +@override +String toString() { + return 'PaymentElementApplePayOptions(recurringPaymentRequest: $recurringPaymentRequest, deferredPaymentRequest: $deferredPaymentRequest, automaticReloadPaymentRequest: $automaticReloadPaymentRequest)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentElementApplePayOptionsCopyWith<$Res> { + factory $PaymentElementApplePayOptionsCopyWith(PaymentElementApplePayOptions value, $Res Function(PaymentElementApplePayOptions) _then) = _$PaymentElementApplePayOptionsCopyWithImpl; +@useResult +$Res call({ + PaymentElementAppleRecurringRequest? recurringPaymentRequest, PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, PaymentElementApplePayAutoReloadPaymentRequest? automaticReloadPaymentRequest +}); + + +$PaymentElementAppleRecurringRequestCopyWith<$Res>? get recurringPaymentRequest;$PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? get deferredPaymentRequest;$PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? get automaticReloadPaymentRequest; + +} /// @nodoc -class __$$BillingDetailsFieldsImplCopyWithImpl<$Res> - extends _$BillingDetailsFieldsCopyWithImpl<$Res, _$BillingDetailsFieldsImpl> - implements _$$BillingDetailsFieldsImplCopyWith<$Res> { - __$$BillingDetailsFieldsImplCopyWithImpl(_$BillingDetailsFieldsImpl _value, - $Res Function(_$BillingDetailsFieldsImpl) _then) - : super(_value, _then); - - /// Create a copy of BillingDetailsFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = null, - Object? email = null, - Object? phone = null, - Object? address = null, - }) { - return _then(_$BillingDetailsFieldsImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - email: null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - phone: null == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as PaymentElementAddressFields, - )); +class _$PaymentElementApplePayOptionsCopyWithImpl<$Res> + implements $PaymentElementApplePayOptionsCopyWith<$Res> { + _$PaymentElementApplePayOptionsCopyWithImpl(this._self, this._then); + + final PaymentElementApplePayOptions _self; + final $Res Function(PaymentElementApplePayOptions) _then; + +/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? recurringPaymentRequest = freezed,Object? deferredPaymentRequest = freezed,Object? automaticReloadPaymentRequest = freezed,}) { + return _then(_self.copyWith( +recurringPaymentRequest: freezed == recurringPaymentRequest ? _self.recurringPaymentRequest : recurringPaymentRequest // ignore: cast_nullable_to_non_nullable +as PaymentElementAppleRecurringRequest?,deferredPaymentRequest: freezed == deferredPaymentRequest ? _self.deferredPaymentRequest : deferredPaymentRequest // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayDeferredPaymentRequest?,automaticReloadPaymentRequest: freezed == automaticReloadPaymentRequest ? _self.automaticReloadPaymentRequest : automaticReloadPaymentRequest // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayAutoReloadPaymentRequest?, + )); +} +/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementAppleRecurringRequestCopyWith<$Res>? get recurringPaymentRequest { + if (_self.recurringPaymentRequest == null) { + return null; + } + + return $PaymentElementAppleRecurringRequestCopyWith<$Res>(_self.recurringPaymentRequest!, (value) { + return _then(_self.copyWith(recurringPaymentRequest: value)); + }); +}/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? get deferredPaymentRequest { + if (_self.deferredPaymentRequest == null) { + return null; + } + + return $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>(_self.deferredPaymentRequest!, (value) { + return _then(_self.copyWith(deferredPaymentRequest: value)); + }); +}/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? get automaticReloadPaymentRequest { + if (_self.automaticReloadPaymentRequest == null) { + return null; } + + return $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>(_self.automaticReloadPaymentRequest!, (value) { + return _then(_self.copyWith(automaticReloadPaymentRequest: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementApplePayOptions]. +extension PaymentElementApplePayOptionsPatterns on PaymentElementApplePayOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementApplePayOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementApplePayOptions value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementApplePayOptions value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentElementAppleRecurringRequest? recurringPaymentRequest, PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, PaymentElementApplePayAutoReloadPaymentRequest? automaticReloadPaymentRequest)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementApplePayOptions() when $default != null: +return $default(_that.recurringPaymentRequest,_that.deferredPaymentRequest,_that.automaticReloadPaymentRequest);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentElementAppleRecurringRequest? recurringPaymentRequest, PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, PaymentElementApplePayAutoReloadPaymentRequest? automaticReloadPaymentRequest) $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayOptions(): +return $default(_that.recurringPaymentRequest,_that.deferredPaymentRequest,_that.automaticReloadPaymentRequest);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentElementAppleRecurringRequest? recurringPaymentRequest, PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, PaymentElementApplePayAutoReloadPaymentRequest? automaticReloadPaymentRequest)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayOptions() when $default != null: +return $default(_that.recurringPaymentRequest,_that.deferredPaymentRequest,_that.automaticReloadPaymentRequest);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() -class _$BillingDetailsFieldsImpl implements _BillingDetailsFields { - const _$BillingDetailsFieldsImpl( - {this.name = PaymentElementFieldRequired.auto, - this.email = PaymentElementFieldRequired.auto, - this.phone = PaymentElementFieldRequired.auto, - this.address = PaymentElementAddressFields.auto}); - - factory _$BillingDetailsFieldsImpl.fromJson(Map json) => - _$$BillingDetailsFieldsImplFromJson(json); - - @override - @JsonKey() - final PaymentElementFieldRequired name; - @override - @JsonKey() - final PaymentElementFieldRequired email; - @override - @JsonKey() - final PaymentElementFieldRequired phone; - @override - @JsonKey() - final PaymentElementAddressFields address; - - @override - String toString() { - return 'BillingDetailsFields(name: $name, email: $email, phone: $phone, address: $address)'; + +class _PaymentElementApplePayOptions implements PaymentElementApplePayOptions { + const _PaymentElementApplePayOptions({this.recurringPaymentRequest, this.deferredPaymentRequest, this.automaticReloadPaymentRequest}); + factory _PaymentElementApplePayOptions.fromJson(Map json) => _$PaymentElementApplePayOptionsFromJson(json); + +/// Information about a recurring payment with ApplePay +@override final PaymentElementAppleRecurringRequest? recurringPaymentRequest; +/// Information about a deferred payment with ApplePay +@override final PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest; +/// Information about an auto reload payment with ApplePay +@override final PaymentElementApplePayAutoReloadPaymentRequest? automaticReloadPaymentRequest; + +/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementApplePayOptionsCopyWith<_PaymentElementApplePayOptions> get copyWith => __$PaymentElementApplePayOptionsCopyWithImpl<_PaymentElementApplePayOptions>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementApplePayOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementApplePayOptions&&(identical(other.recurringPaymentRequest, recurringPaymentRequest) || other.recurringPaymentRequest == recurringPaymentRequest)&&(identical(other.deferredPaymentRequest, deferredPaymentRequest) || other.deferredPaymentRequest == deferredPaymentRequest)&&(identical(other.automaticReloadPaymentRequest, automaticReloadPaymentRequest) || other.automaticReloadPaymentRequest == automaticReloadPaymentRequest)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,recurringPaymentRequest,deferredPaymentRequest,automaticReloadPaymentRequest); + +@override +String toString() { + return 'PaymentElementApplePayOptions(recurringPaymentRequest: $recurringPaymentRequest, deferredPaymentRequest: $deferredPaymentRequest, automaticReloadPaymentRequest: $automaticReloadPaymentRequest)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentElementApplePayOptionsCopyWith<$Res> implements $PaymentElementApplePayOptionsCopyWith<$Res> { + factory _$PaymentElementApplePayOptionsCopyWith(_PaymentElementApplePayOptions value, $Res Function(_PaymentElementApplePayOptions) _then) = __$PaymentElementApplePayOptionsCopyWithImpl; +@override @useResult +$Res call({ + PaymentElementAppleRecurringRequest? recurringPaymentRequest, PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, PaymentElementApplePayAutoReloadPaymentRequest? automaticReloadPaymentRequest +}); + + +@override $PaymentElementAppleRecurringRequestCopyWith<$Res>? get recurringPaymentRequest;@override $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? get deferredPaymentRequest;@override $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? get automaticReloadPaymentRequest; + +} +/// @nodoc +class __$PaymentElementApplePayOptionsCopyWithImpl<$Res> + implements _$PaymentElementApplePayOptionsCopyWith<$Res> { + __$PaymentElementApplePayOptionsCopyWithImpl(this._self, this._then); + + final _PaymentElementApplePayOptions _self; + final $Res Function(_PaymentElementApplePayOptions) _then; + +/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? recurringPaymentRequest = freezed,Object? deferredPaymentRequest = freezed,Object? automaticReloadPaymentRequest = freezed,}) { + return _then(_PaymentElementApplePayOptions( +recurringPaymentRequest: freezed == recurringPaymentRequest ? _self.recurringPaymentRequest : recurringPaymentRequest // ignore: cast_nullable_to_non_nullable +as PaymentElementAppleRecurringRequest?,deferredPaymentRequest: freezed == deferredPaymentRequest ? _self.deferredPaymentRequest : deferredPaymentRequest // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayDeferredPaymentRequest?,automaticReloadPaymentRequest: freezed == automaticReloadPaymentRequest ? _self.automaticReloadPaymentRequest : automaticReloadPaymentRequest // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayAutoReloadPaymentRequest?, + )); +} + +/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementAppleRecurringRequestCopyWith<$Res>? get recurringPaymentRequest { + if (_self.recurringPaymentRequest == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BillingDetailsFieldsImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.email, email) || other.email == email) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.address, address) || other.address == address)); + return $PaymentElementAppleRecurringRequestCopyWith<$Res>(_self.recurringPaymentRequest!, (value) { + return _then(_self.copyWith(recurringPaymentRequest: value)); + }); +}/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? get deferredPaymentRequest { + if (_self.deferredPaymentRequest == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, email, phone, address); - - /// Create a copy of BillingDetailsFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BillingDetailsFieldsImplCopyWith<_$BillingDetailsFieldsImpl> - get copyWith => - __$$BillingDetailsFieldsImplCopyWithImpl<_$BillingDetailsFieldsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$BillingDetailsFieldsImplToJson( - this, - ); + return $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>(_self.deferredPaymentRequest!, (value) { + return _then(_self.copyWith(deferredPaymentRequest: value)); + }); +}/// Create a copy of PaymentElementApplePayOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? get automaticReloadPaymentRequest { + if (_self.automaticReloadPaymentRequest == null) { + return null; } + + return $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>(_self.automaticReloadPaymentRequest!, (value) { + return _then(_self.copyWith(automaticReloadPaymentRequest: value)); + }); +} } -abstract class _BillingDetailsFields implements BillingDetailsFields { - const factory _BillingDetailsFields( - {final PaymentElementFieldRequired name, - final PaymentElementFieldRequired email, - final PaymentElementFieldRequired phone, - final PaymentElementAddressFields address}) = _$BillingDetailsFieldsImpl; - factory _BillingDetailsFields.fromJson(Map json) = - _$BillingDetailsFieldsImpl.fromJson; +/// @nodoc +mixin _$PaymentElementAppleRecurringRequest { - @override - PaymentElementFieldRequired get name; - @override - PaymentElementFieldRequired get email; - @override - PaymentElementFieldRequired get phone; - @override - PaymentElementAddressFields get address; +/// The description of the payment + String get paymentDescription;/// Management url + String get managementUrl;/// Information in case of a trial billing + PaymentElementRecurringPaymentProperties? get trialBilling;/// Information in case of a regular billing + PaymentElementRecurringPaymentProperties? get regularBilling; +/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementAppleRecurringRequestCopyWith get copyWith => _$PaymentElementAppleRecurringRequestCopyWithImpl(this as PaymentElementAppleRecurringRequest, _$identity); - /// Create a copy of BillingDetailsFields - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BillingDetailsFieldsImplCopyWith<_$BillingDetailsFieldsImpl> - get copyWith => throw _privateConstructorUsedError; -} + /// Serializes this PaymentElementAppleRecurringRequest to a JSON map. + Map toJson(); -PaymentElementAddressFields _$PaymentElementAddressFieldsFromJson( - Map json) { - return _PaymentElementAddressFields.fromJson(json); -} -/// @nodoc -mixin _$PaymentElementAddressFields { - PaymentElementFieldRequired get line1 => throw _privateConstructorUsedError; - PaymentElementFieldRequired get line2 => throw _privateConstructorUsedError; - PaymentElementFieldRequired get city => throw _privateConstructorUsedError; - PaymentElementFieldRequired get state => throw _privateConstructorUsedError; - PaymentElementFieldRequired get country => throw _privateConstructorUsedError; - PaymentElementFieldRequired get postalCode => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementAppleRecurringRequest&&(identical(other.paymentDescription, paymentDescription) || other.paymentDescription == paymentDescription)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.trialBilling, trialBilling) || other.trialBilling == trialBilling)&&(identical(other.regularBilling, regularBilling) || other.regularBilling == regularBilling)); +} - /// Serializes this PaymentElementAddressFields to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentDescription,managementUrl,trialBilling,regularBilling); - /// Create a copy of PaymentElementAddressFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementAddressFieldsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementAppleRecurringRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, trialBilling: $trialBilling, regularBilling: $regularBilling)'; } -/// @nodoc -abstract class $PaymentElementAddressFieldsCopyWith<$Res> { - factory $PaymentElementAddressFieldsCopyWith( - PaymentElementAddressFields value, - $Res Function(PaymentElementAddressFields) then) = - _$PaymentElementAddressFieldsCopyWithImpl<$Res, - PaymentElementAddressFields>; - @useResult - $Res call( - {PaymentElementFieldRequired line1, - PaymentElementFieldRequired line2, - PaymentElementFieldRequired city, - PaymentElementFieldRequired state, - PaymentElementFieldRequired country, - PaymentElementFieldRequired postalCode}); -} -/// @nodoc -class _$PaymentElementAddressFieldsCopyWithImpl<$Res, - $Val extends PaymentElementAddressFields> - implements $PaymentElementAddressFieldsCopyWith<$Res> { - _$PaymentElementAddressFieldsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementAddressFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = null, - Object? line2 = null, - Object? city = null, - Object? state = null, - Object? country = null, - Object? postalCode = null, - }) { - return _then(_value.copyWith( - line1: null == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - line2: null == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - city: null == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - postalCode: null == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - ) as $Val); - } } /// @nodoc -abstract class _$$PaymentElementAddressFieldsImplCopyWith<$Res> - implements $PaymentElementAddressFieldsCopyWith<$Res> { - factory _$$PaymentElementAddressFieldsImplCopyWith( - _$PaymentElementAddressFieldsImpl value, - $Res Function(_$PaymentElementAddressFieldsImpl) then) = - __$$PaymentElementAddressFieldsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementFieldRequired line1, - PaymentElementFieldRequired line2, - PaymentElementFieldRequired city, - PaymentElementFieldRequired state, - PaymentElementFieldRequired country, - PaymentElementFieldRequired postalCode}); -} +abstract mixin class $PaymentElementAppleRecurringRequestCopyWith<$Res> { + factory $PaymentElementAppleRecurringRequestCopyWith(PaymentElementAppleRecurringRequest value, $Res Function(PaymentElementAppleRecurringRequest) _then) = _$PaymentElementAppleRecurringRequestCopyWithImpl; +@useResult +$Res call({ + String paymentDescription, String managementUrl, PaymentElementRecurringPaymentProperties? trialBilling, PaymentElementRecurringPaymentProperties? regularBilling +}); -/// @nodoc -class __$$PaymentElementAddressFieldsImplCopyWithImpl<$Res> - extends _$PaymentElementAddressFieldsCopyWithImpl<$Res, - _$PaymentElementAddressFieldsImpl> - implements _$$PaymentElementAddressFieldsImplCopyWith<$Res> { - __$$PaymentElementAddressFieldsImplCopyWithImpl( - _$PaymentElementAddressFieldsImpl _value, - $Res Function(_$PaymentElementAddressFieldsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementAddressFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? line1 = null, - Object? line2 = null, - Object? city = null, - Object? state = null, - Object? country = null, - Object? postalCode = null, - }) { - return _then(_$PaymentElementAddressFieldsImpl( - line1: null == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - line2: null == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - city: null == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - state: null == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - postalCode: null == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as PaymentElementFieldRequired, - )); - } -} +$PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling;$PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling; + +} /// @nodoc -@JsonSerializable() -class _$PaymentElementAddressFieldsImpl - implements _PaymentElementAddressFields { - const _$PaymentElementAddressFieldsImpl( - {this.line1 = PaymentElementFieldRequired.auto, - this.line2 = PaymentElementFieldRequired.auto, - this.city = PaymentElementFieldRequired.auto, - this.state = PaymentElementFieldRequired.auto, - this.country = PaymentElementFieldRequired.auto, - this.postalCode = PaymentElementFieldRequired.auto}); - - factory _$PaymentElementAddressFieldsImpl.fromJson( - Map json) => - _$$PaymentElementAddressFieldsImplFromJson(json); - - @override - @JsonKey() - final PaymentElementFieldRequired line1; - @override - @JsonKey() - final PaymentElementFieldRequired line2; - @override - @JsonKey() - final PaymentElementFieldRequired city; - @override - @JsonKey() - final PaymentElementFieldRequired state; - @override - @JsonKey() - final PaymentElementFieldRequired country; - @override - @JsonKey() - final PaymentElementFieldRequired postalCode; - - @override - String toString() { - return 'PaymentElementAddressFields(line1: $line1, line2: $line2, city: $city, state: $state, country: $country, postalCode: $postalCode)'; +class _$PaymentElementAppleRecurringRequestCopyWithImpl<$Res> + implements $PaymentElementAppleRecurringRequestCopyWith<$Res> { + _$PaymentElementAppleRecurringRequestCopyWithImpl(this._self, this._then); + + final PaymentElementAppleRecurringRequest _self; + final $Res Function(PaymentElementAppleRecurringRequest) _then; + +/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentDescription = null,Object? managementUrl = null,Object? trialBilling = freezed,Object? regularBilling = freezed,}) { + return _then(_self.copyWith( +paymentDescription: null == paymentDescription ? _self.paymentDescription : paymentDescription // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,trialBilling: freezed == trialBilling ? _self.trialBilling : trialBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementRecurringPaymentProperties?,regularBilling: freezed == regularBilling ? _self.regularBilling : regularBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementRecurringPaymentProperties?, + )); +} +/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling { + if (_self.trialBilling == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementAddressFieldsImpl && - (identical(other.line1, line1) || other.line1 == line1) && - (identical(other.line2, line2) || other.line2 == line2) && - (identical(other.city, city) || other.city == city) && - (identical(other.state, state) || other.state == state) && - (identical(other.country, country) || other.country == country) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode)); + return $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>(_self.trialBilling!, (value) { + return _then(_self.copyWith(trialBilling: value)); + }); +}/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling { + if (_self.regularBilling == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, line1, line2, city, state, country, postalCode); - - /// Create a copy of PaymentElementAddressFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementAddressFieldsImplCopyWith<_$PaymentElementAddressFieldsImpl> - get copyWith => __$$PaymentElementAddressFieldsImplCopyWithImpl< - _$PaymentElementAddressFieldsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementAddressFieldsImplToJson( - this, - ); - } + return $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>(_self.regularBilling!, (value) { + return _then(_self.copyWith(regularBilling: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementAppleRecurringRequest]. +extension PaymentElementAppleRecurringRequestPatterns on PaymentElementAppleRecurringRequest { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementAppleRecurringRequest value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementAppleRecurringRequest() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementAppleRecurringRequest value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementAppleRecurringRequest(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementAppleRecurringRequest value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementAppleRecurringRequest() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String paymentDescription, String managementUrl, PaymentElementRecurringPaymentProperties? trialBilling, PaymentElementRecurringPaymentProperties? regularBilling)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementAppleRecurringRequest() when $default != null: +return $default(_that.paymentDescription,_that.managementUrl,_that.trialBilling,_that.regularBilling);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String paymentDescription, String managementUrl, PaymentElementRecurringPaymentProperties? trialBilling, PaymentElementRecurringPaymentProperties? regularBilling) $default,) {final _that = this; +switch (_that) { +case _PaymentElementAppleRecurringRequest(): +return $default(_that.paymentDescription,_that.managementUrl,_that.trialBilling,_that.regularBilling);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String paymentDescription, String managementUrl, PaymentElementRecurringPaymentProperties? trialBilling, PaymentElementRecurringPaymentProperties? regularBilling)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementAppleRecurringRequest() when $default != null: +return $default(_that.paymentDescription,_that.managementUrl,_that.trialBilling,_that.regularBilling);case _: + return null; + +} } -abstract class _PaymentElementAddressFields - implements PaymentElementAddressFields { - const factory _PaymentElementAddressFields( - {final PaymentElementFieldRequired line1, - final PaymentElementFieldRequired line2, - final PaymentElementFieldRequired city, - final PaymentElementFieldRequired state, - final PaymentElementFieldRequired country, - final PaymentElementFieldRequired postalCode}) = - _$PaymentElementAddressFieldsImpl; - - factory _PaymentElementAddressFields.fromJson(Map json) = - _$PaymentElementAddressFieldsImpl.fromJson; - - @override - PaymentElementFieldRequired get line1; - @override - PaymentElementFieldRequired get line2; - @override - PaymentElementFieldRequired get city; - @override - PaymentElementFieldRequired get state; - @override - PaymentElementFieldRequired get country; - @override - PaymentElementFieldRequired get postalCode; - - /// Create a copy of PaymentElementAddressFields - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementAddressFieldsImplCopyWith<_$PaymentElementAddressFieldsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -PaymentElementOptionsTerms _$PaymentElementOptionsTermsFromJson( - Map json) { - return _PaymentElementOptionsTerms.fromJson(json); } /// @nodoc -mixin _$PaymentElementOptionsTerms { - /// Terms for apple pay - PaymentElementShowTerms? get applePay => throw _privateConstructorUsedError; - - /// Terms for aubecs debit - PaymentElementShowTerms? get auBecsDebit => - throw _privateConstructorUsedError; - - /// Terms for bancontact - PaymentElementShowTerms? get bancontact => throw _privateConstructorUsedError; - - /// Terms for card - PaymentElementShowTerms? get card => throw _privateConstructorUsedError; +@JsonSerializable() - /// Terms for cashapp - PaymentElementShowTerms? get cashApp => throw _privateConstructorUsedError; +class _PaymentElementAppleRecurringRequest implements PaymentElementAppleRecurringRequest { + const _PaymentElementAppleRecurringRequest({required this.paymentDescription, required this.managementUrl, this.trialBilling, this.regularBilling}); + factory _PaymentElementAppleRecurringRequest.fromJson(Map json) => _$PaymentElementAppleRecurringRequestFromJson(json); - /// Terms for googlePay - PaymentElementShowTerms? get googlePay => throw _privateConstructorUsedError; +/// The description of the payment +@override final String paymentDescription; +/// Management url +@override final String managementUrl; +/// Information in case of a trial billing +@override final PaymentElementRecurringPaymentProperties? trialBilling; +/// Information in case of a regular billing +@override final PaymentElementRecurringPaymentProperties? regularBilling; - /// Terms for ideal - PaymentElementShowTerms? get ideal => throw _privateConstructorUsedError; +/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementAppleRecurringRequestCopyWith<_PaymentElementAppleRecurringRequest> get copyWith => __$PaymentElementAppleRecurringRequestCopyWithImpl<_PaymentElementAppleRecurringRequest>(this, _$identity); - /// Terms for paypal - PaymentElementShowTerms? get payPal => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentElementAppleRecurringRequestToJson(this, ); +} - /// Terms for sepa debit - PaymentElementShowTerms? get sepaDebit => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementAppleRecurringRequest&&(identical(other.paymentDescription, paymentDescription) || other.paymentDescription == paymentDescription)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.trialBilling, trialBilling) || other.trialBilling == trialBilling)&&(identical(other.regularBilling, regularBilling) || other.regularBilling == regularBilling)); +} - /// Terms for sofort - PaymentElementShowTerms? get sofort => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentDescription,managementUrl,trialBilling,regularBilling); - /// Terms for usBankAccount - PaymentElementShowTerms? get usBankAccount => - throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementAppleRecurringRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, trialBilling: $trialBilling, regularBilling: $regularBilling)'; +} - /// Serializes this PaymentElementOptionsTerms to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentElementOptionsTerms - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementOptionsTermsCopyWith - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentElementOptionsTermsCopyWith<$Res> { - factory $PaymentElementOptionsTermsCopyWith(PaymentElementOptionsTerms value, - $Res Function(PaymentElementOptionsTerms) then) = - _$PaymentElementOptionsTermsCopyWithImpl<$Res, - PaymentElementOptionsTerms>; - @useResult - $Res call( - {PaymentElementShowTerms? applePay, - PaymentElementShowTerms? auBecsDebit, - PaymentElementShowTerms? bancontact, - PaymentElementShowTerms? card, - PaymentElementShowTerms? cashApp, - PaymentElementShowTerms? googlePay, - PaymentElementShowTerms? ideal, - PaymentElementShowTerms? payPal, - PaymentElementShowTerms? sepaDebit, - PaymentElementShowTerms? sofort, - PaymentElementShowTerms? usBankAccount}); -} +abstract mixin class _$PaymentElementAppleRecurringRequestCopyWith<$Res> implements $PaymentElementAppleRecurringRequestCopyWith<$Res> { + factory _$PaymentElementAppleRecurringRequestCopyWith(_PaymentElementAppleRecurringRequest value, $Res Function(_PaymentElementAppleRecurringRequest) _then) = __$PaymentElementAppleRecurringRequestCopyWithImpl; +@override @useResult +$Res call({ + String paymentDescription, String managementUrl, PaymentElementRecurringPaymentProperties? trialBilling, PaymentElementRecurringPaymentProperties? regularBilling +}); -/// @nodoc -class _$PaymentElementOptionsTermsCopyWithImpl<$Res, - $Val extends PaymentElementOptionsTerms> - implements $PaymentElementOptionsTermsCopyWith<$Res> { - _$PaymentElementOptionsTermsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementOptionsTerms - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? auBecsDebit = freezed, - Object? bancontact = freezed, - Object? card = freezed, - Object? cashApp = freezed, - Object? googlePay = freezed, - Object? ideal = freezed, - Object? payPal = freezed, - Object? sepaDebit = freezed, - Object? sofort = freezed, - Object? usBankAccount = freezed, - }) { - return _then(_value.copyWith( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - auBecsDebit: freezed == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - bancontact: freezed == bancontact - ? _value.bancontact - : bancontact // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - cashApp: freezed == cashApp - ? _value.cashApp - : cashApp // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - payPal: freezed == payPal - ? _value.payPal - : payPal // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - sepaDebit: freezed == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - sofort: freezed == sofort - ? _value.sofort - : sofort // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - usBankAccount: freezed == usBankAccount - ? _value.usBankAccount - : usBankAccount // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - ) as $Val); - } -} -/// @nodoc -abstract class _$$PaymentElementOptionsTermsImplCopyWith<$Res> - implements $PaymentElementOptionsTermsCopyWith<$Res> { - factory _$$PaymentElementOptionsTermsImplCopyWith( - _$PaymentElementOptionsTermsImpl value, - $Res Function(_$PaymentElementOptionsTermsImpl) then) = - __$$PaymentElementOptionsTermsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementShowTerms? applePay, - PaymentElementShowTerms? auBecsDebit, - PaymentElementShowTerms? bancontact, - PaymentElementShowTerms? card, - PaymentElementShowTerms? cashApp, - PaymentElementShowTerms? googlePay, - PaymentElementShowTerms? ideal, - PaymentElementShowTerms? payPal, - PaymentElementShowTerms? sepaDebit, - PaymentElementShowTerms? sofort, - PaymentElementShowTerms? usBankAccount}); -} +@override $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling;@override $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling; -/// @nodoc -class __$$PaymentElementOptionsTermsImplCopyWithImpl<$Res> - extends _$PaymentElementOptionsTermsCopyWithImpl<$Res, - _$PaymentElementOptionsTermsImpl> - implements _$$PaymentElementOptionsTermsImplCopyWith<$Res> { - __$$PaymentElementOptionsTermsImplCopyWithImpl( - _$PaymentElementOptionsTermsImpl _value, - $Res Function(_$PaymentElementOptionsTermsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementOptionsTerms - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = freezed, - Object? auBecsDebit = freezed, - Object? bancontact = freezed, - Object? card = freezed, - Object? cashApp = freezed, - Object? googlePay = freezed, - Object? ideal = freezed, - Object? payPal = freezed, - Object? sepaDebit = freezed, - Object? sofort = freezed, - Object? usBankAccount = freezed, - }) { - return _then(_$PaymentElementOptionsTermsImpl( - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - auBecsDebit: freezed == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - bancontact: freezed == bancontact - ? _value.bancontact - : bancontact // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - cashApp: freezed == cashApp - ? _value.cashApp - : cashApp // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - payPal: freezed == payPal - ? _value.payPal - : payPal // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - sepaDebit: freezed == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - sofort: freezed == sofort - ? _value.sofort - : sofort // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - usBankAccount: freezed == usBankAccount - ? _value.usBankAccount - : usBankAccount // ignore: cast_nullable_to_non_nullable - as PaymentElementShowTerms?, - )); - } } - /// @nodoc -@JsonSerializable() -class _$PaymentElementOptionsTermsImpl implements _PaymentElementOptionsTerms { - const _$PaymentElementOptionsTermsImpl( - {this.applePay, - this.auBecsDebit, - this.bancontact, - this.card, - this.cashApp, - this.googlePay, - this.ideal, - this.payPal, - this.sepaDebit, - this.sofort, - this.usBankAccount}); - - factory _$PaymentElementOptionsTermsImpl.fromJson( - Map json) => - _$$PaymentElementOptionsTermsImplFromJson(json); - - /// Terms for apple pay - @override - final PaymentElementShowTerms? applePay; - - /// Terms for aubecs debit - @override - final PaymentElementShowTerms? auBecsDebit; - - /// Terms for bancontact - @override - final PaymentElementShowTerms? bancontact; - - /// Terms for card - @override - final PaymentElementShowTerms? card; - - /// Terms for cashapp - @override - final PaymentElementShowTerms? cashApp; - - /// Terms for googlePay - @override - final PaymentElementShowTerms? googlePay; - - /// Terms for ideal - @override - final PaymentElementShowTerms? ideal; - - /// Terms for paypal - @override - final PaymentElementShowTerms? payPal; - - /// Terms for sepa debit - @override - final PaymentElementShowTerms? sepaDebit; - - /// Terms for sofort - @override - final PaymentElementShowTerms? sofort; - - /// Terms for usBankAccount - @override - final PaymentElementShowTerms? usBankAccount; - - @override - String toString() { - return 'PaymentElementOptionsTerms(applePay: $applePay, auBecsDebit: $auBecsDebit, bancontact: $bancontact, card: $card, cashApp: $cashApp, googlePay: $googlePay, ideal: $ideal, payPal: $payPal, sepaDebit: $sepaDebit, sofort: $sofort, usBankAccount: $usBankAccount)'; +class __$PaymentElementAppleRecurringRequestCopyWithImpl<$Res> + implements _$PaymentElementAppleRecurringRequestCopyWith<$Res> { + __$PaymentElementAppleRecurringRequestCopyWithImpl(this._self, this._then); + + final _PaymentElementAppleRecurringRequest _self; + final $Res Function(_PaymentElementAppleRecurringRequest) _then; + +/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentDescription = null,Object? managementUrl = null,Object? trialBilling = freezed,Object? regularBilling = freezed,}) { + return _then(_PaymentElementAppleRecurringRequest( +paymentDescription: null == paymentDescription ? _self.paymentDescription : paymentDescription // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,trialBilling: freezed == trialBilling ? _self.trialBilling : trialBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementRecurringPaymentProperties?,regularBilling: freezed == regularBilling ? _self.regularBilling : regularBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementRecurringPaymentProperties?, + )); +} + +/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling { + if (_self.trialBilling == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementOptionsTermsImpl && - (identical(other.applePay, applePay) || - other.applePay == applePay) && - (identical(other.auBecsDebit, auBecsDebit) || - other.auBecsDebit == auBecsDebit) && - (identical(other.bancontact, bancontact) || - other.bancontact == bancontact) && - (identical(other.card, card) || other.card == card) && - (identical(other.cashApp, cashApp) || other.cashApp == cashApp) && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay) && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.payPal, payPal) || other.payPal == payPal) && - (identical(other.sepaDebit, sepaDebit) || - other.sepaDebit == sepaDebit) && - (identical(other.sofort, sofort) || other.sofort == sofort) && - (identical(other.usBankAccount, usBankAccount) || - other.usBankAccount == usBankAccount)); + return $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>(_self.trialBilling!, (value) { + return _then(_self.copyWith(trialBilling: value)); + }); +}/// Create a copy of PaymentElementAppleRecurringRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling { + if (_self.regularBilling == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - applePay, - auBecsDebit, - bancontact, - card, - cashApp, - googlePay, - ideal, - payPal, - sepaDebit, - sofort, - usBankAccount); - - /// Create a copy of PaymentElementOptionsTerms - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementOptionsTermsImplCopyWith<_$PaymentElementOptionsTermsImpl> - get copyWith => __$$PaymentElementOptionsTermsImplCopyWithImpl< - _$PaymentElementOptionsTermsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementOptionsTermsImplToJson( - this, - ); - } + return $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>(_self.regularBilling!, (value) { + return _then(_self.copyWith(regularBilling: value)); + }); } +} + -abstract class _PaymentElementOptionsTerms - implements PaymentElementOptionsTerms { - const factory _PaymentElementOptionsTerms( - {final PaymentElementShowTerms? applePay, - final PaymentElementShowTerms? auBecsDebit, - final PaymentElementShowTerms? bancontact, - final PaymentElementShowTerms? card, - final PaymentElementShowTerms? cashApp, - final PaymentElementShowTerms? googlePay, - final PaymentElementShowTerms? ideal, - final PaymentElementShowTerms? payPal, - final PaymentElementShowTerms? sepaDebit, - final PaymentElementShowTerms? sofort, - final PaymentElementShowTerms? usBankAccount}) = - _$PaymentElementOptionsTermsImpl; +/// @nodoc +mixin _$PaymentElementRecurringPaymentProperties { - factory _PaymentElementOptionsTerms.fromJson(Map json) = - _$PaymentElementOptionsTermsImpl.fromJson; +/// The amount of the payment + double get amount;/// Description label + String get label;/// The startdate of the recurring payment + DateTime? get recurringPaymentStartDate;/// The enddate of the recurring payment + DateTime? get recurringPaymentEndDate;/// The interval of payment + ApplePayRecurringPaymentTimeInterVal? get recurringPaymentIntervalUnit;/// The amount of intervals + int? get recurringPaymentIntervalCount; +/// Create a copy of PaymentElementRecurringPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementRecurringPaymentPropertiesCopyWith get copyWith => _$PaymentElementRecurringPaymentPropertiesCopyWithImpl(this as PaymentElementRecurringPaymentProperties, _$identity); + + /// Serializes this PaymentElementRecurringPaymentProperties to a JSON map. + Map toJson(); - /// Terms for apple pay - @override - PaymentElementShowTerms? get applePay; - /// Terms for aubecs debit - @override - PaymentElementShowTerms? get auBecsDebit; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementRecurringPaymentProperties&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.recurringPaymentStartDate, recurringPaymentStartDate) || other.recurringPaymentStartDate == recurringPaymentStartDate)&&(identical(other.recurringPaymentEndDate, recurringPaymentEndDate) || other.recurringPaymentEndDate == recurringPaymentEndDate)&&(identical(other.recurringPaymentIntervalUnit, recurringPaymentIntervalUnit) || other.recurringPaymentIntervalUnit == recurringPaymentIntervalUnit)&&(identical(other.recurringPaymentIntervalCount, recurringPaymentIntervalCount) || other.recurringPaymentIntervalCount == recurringPaymentIntervalCount)); +} - /// Terms for bancontact - @override - PaymentElementShowTerms? get bancontact; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,recurringPaymentStartDate,recurringPaymentEndDate,recurringPaymentIntervalUnit,recurringPaymentIntervalCount); - /// Terms for card - @override - PaymentElementShowTerms? get card; +@override +String toString() { + return 'PaymentElementRecurringPaymentProperties(amount: $amount, label: $label, recurringPaymentStartDate: $recurringPaymentStartDate, recurringPaymentEndDate: $recurringPaymentEndDate, recurringPaymentIntervalUnit: $recurringPaymentIntervalUnit, recurringPaymentIntervalCount: $recurringPaymentIntervalCount)'; +} - /// Terms for cashapp - @override - PaymentElementShowTerms? get cashApp; - /// Terms for googlePay - @override - PaymentElementShowTerms? get googlePay; +} - /// Terms for ideal - @override - PaymentElementShowTerms? get ideal; +/// @nodoc +abstract mixin class $PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { + factory $PaymentElementRecurringPaymentPropertiesCopyWith(PaymentElementRecurringPaymentProperties value, $Res Function(PaymentElementRecurringPaymentProperties) _then) = _$PaymentElementRecurringPaymentPropertiesCopyWithImpl; +@useResult +$Res call({ + double amount, String label, DateTime? recurringPaymentStartDate, DateTime? recurringPaymentEndDate, ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, int? recurringPaymentIntervalCount +}); - /// Terms for paypal - @override - PaymentElementShowTerms? get payPal; - /// Terms for sepa debit - @override - PaymentElementShowTerms? get sepaDebit; - /// Terms for sofort - @override - PaymentElementShowTerms? get sofort; - /// Terms for usBankAccount - @override - PaymentElementShowTerms? get usBankAccount; +} +/// @nodoc +class _$PaymentElementRecurringPaymentPropertiesCopyWithImpl<$Res> + implements $PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { + _$PaymentElementRecurringPaymentPropertiesCopyWithImpl(this._self, this._then); + + final PaymentElementRecurringPaymentProperties _self; + final $Res Function(PaymentElementRecurringPaymentProperties) _then; + +/// Create a copy of PaymentElementRecurringPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? amount = null,Object? label = null,Object? recurringPaymentStartDate = freezed,Object? recurringPaymentEndDate = freezed,Object? recurringPaymentIntervalUnit = freezed,Object? recurringPaymentIntervalCount = freezed,}) { + return _then(_self.copyWith( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,recurringPaymentStartDate: freezed == recurringPaymentStartDate ? _self.recurringPaymentStartDate : recurringPaymentStartDate // ignore: cast_nullable_to_non_nullable +as DateTime?,recurringPaymentEndDate: freezed == recurringPaymentEndDate ? _self.recurringPaymentEndDate : recurringPaymentEndDate // ignore: cast_nullable_to_non_nullable +as DateTime?,recurringPaymentIntervalUnit: freezed == recurringPaymentIntervalUnit ? _self.recurringPaymentIntervalUnit : recurringPaymentIntervalUnit // ignore: cast_nullable_to_non_nullable +as ApplePayRecurringPaymentTimeInterVal?,recurringPaymentIntervalCount: freezed == recurringPaymentIntervalCount ? _self.recurringPaymentIntervalCount : recurringPaymentIntervalCount // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementRecurringPaymentProperties]. +extension PaymentElementRecurringPaymentPropertiesPatterns on PaymentElementRecurringPaymentProperties { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementRecurringPaymentProperties value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementRecurringPaymentProperties() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementRecurringPaymentProperties value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementRecurringPaymentProperties(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementRecurringPaymentProperties value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementRecurringPaymentProperties() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double amount, String label, DateTime? recurringPaymentStartDate, DateTime? recurringPaymentEndDate, ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, int? recurringPaymentIntervalCount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementRecurringPaymentProperties() when $default != null: +return $default(_that.amount,_that.label,_that.recurringPaymentStartDate,_that.recurringPaymentEndDate,_that.recurringPaymentIntervalUnit,_that.recurringPaymentIntervalCount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double amount, String label, DateTime? recurringPaymentStartDate, DateTime? recurringPaymentEndDate, ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, int? recurringPaymentIntervalCount) $default,) {final _that = this; +switch (_that) { +case _PaymentElementRecurringPaymentProperties(): +return $default(_that.amount,_that.label,_that.recurringPaymentStartDate,_that.recurringPaymentEndDate,_that.recurringPaymentIntervalUnit,_that.recurringPaymentIntervalCount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double amount, String label, DateTime? recurringPaymentStartDate, DateTime? recurringPaymentEndDate, ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, int? recurringPaymentIntervalCount)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementRecurringPaymentProperties() when $default != null: +return $default(_that.amount,_that.label,_that.recurringPaymentStartDate,_that.recurringPaymentEndDate,_that.recurringPaymentIntervalUnit,_that.recurringPaymentIntervalCount);case _: + return null; - /// Create a copy of PaymentElementOptionsTerms - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementOptionsTermsImplCopyWith<_$PaymentElementOptionsTermsImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentElementApplePayOptions _$PaymentElementApplePayOptionsFromJson( - Map json) { - return _PaymentElementApplePayOptions.fromJson(json); } /// @nodoc -mixin _$PaymentElementApplePayOptions { - /// Information about a recurring payment with ApplePay - PaymentElementAppleRecurringRequest? get recurringPaymentRequest => - throw _privateConstructorUsedError; +@JsonSerializable() - /// Information about a deferred payment with ApplePay - PaymentElementApplePayDeferredPaymentRequest? get deferredPaymentRequest => - throw _privateConstructorUsedError; +class _PaymentElementRecurringPaymentProperties implements PaymentElementRecurringPaymentProperties { + const _PaymentElementRecurringPaymentProperties({required this.amount, required this.label, this.recurringPaymentStartDate, this.recurringPaymentEndDate, this.recurringPaymentIntervalUnit, this.recurringPaymentIntervalCount}); + factory _PaymentElementRecurringPaymentProperties.fromJson(Map json) => _$PaymentElementRecurringPaymentPropertiesFromJson(json); - /// Information about an auto reload payment with ApplePay - PaymentElementApplePayAutoReloadPaymentRequest? - get automaticReloadPaymentRequest => throw _privateConstructorUsedError; +/// The amount of the payment +@override final double amount; +/// Description label +@override final String label; +/// The startdate of the recurring payment +@override final DateTime? recurringPaymentStartDate; +/// The enddate of the recurring payment +@override final DateTime? recurringPaymentEndDate; +/// The interval of payment +@override final ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit; +/// The amount of intervals +@override final int? recurringPaymentIntervalCount; - /// Serializes this PaymentElementApplePayOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of PaymentElementRecurringPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementRecurringPaymentPropertiesCopyWith<_PaymentElementRecurringPaymentProperties> get copyWith => __$PaymentElementRecurringPaymentPropertiesCopyWithImpl<_PaymentElementRecurringPaymentProperties>(this, _$identity); - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementApplePayOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentElementRecurringPaymentPropertiesToJson(this, ); } -/// @nodoc -abstract class $PaymentElementApplePayOptionsCopyWith<$Res> { - factory $PaymentElementApplePayOptionsCopyWith( - PaymentElementApplePayOptions value, - $Res Function(PaymentElementApplePayOptions) then) = - _$PaymentElementApplePayOptionsCopyWithImpl<$Res, - PaymentElementApplePayOptions>; - @useResult - $Res call( - {PaymentElementAppleRecurringRequest? recurringPaymentRequest, - PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, - PaymentElementApplePayAutoReloadPaymentRequest? - automaticReloadPaymentRequest}); - - $PaymentElementAppleRecurringRequestCopyWith<$Res>? - get recurringPaymentRequest; - $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? - get deferredPaymentRequest; - $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? - get automaticReloadPaymentRequest; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementRecurringPaymentProperties&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.recurringPaymentStartDate, recurringPaymentStartDate) || other.recurringPaymentStartDate == recurringPaymentStartDate)&&(identical(other.recurringPaymentEndDate, recurringPaymentEndDate) || other.recurringPaymentEndDate == recurringPaymentEndDate)&&(identical(other.recurringPaymentIntervalUnit, recurringPaymentIntervalUnit) || other.recurringPaymentIntervalUnit == recurringPaymentIntervalUnit)&&(identical(other.recurringPaymentIntervalCount, recurringPaymentIntervalCount) || other.recurringPaymentIntervalCount == recurringPaymentIntervalCount)); } -/// @nodoc -class _$PaymentElementApplePayOptionsCopyWithImpl<$Res, - $Val extends PaymentElementApplePayOptions> - implements $PaymentElementApplePayOptionsCopyWith<$Res> { - _$PaymentElementApplePayOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? recurringPaymentRequest = freezed, - Object? deferredPaymentRequest = freezed, - Object? automaticReloadPaymentRequest = freezed, - }) { - return _then(_value.copyWith( - recurringPaymentRequest: freezed == recurringPaymentRequest - ? _value.recurringPaymentRequest - : recurringPaymentRequest // ignore: cast_nullable_to_non_nullable - as PaymentElementAppleRecurringRequest?, - deferredPaymentRequest: freezed == deferredPaymentRequest - ? _value.deferredPaymentRequest - : deferredPaymentRequest // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayDeferredPaymentRequest?, - automaticReloadPaymentRequest: freezed == automaticReloadPaymentRequest - ? _value.automaticReloadPaymentRequest - : automaticReloadPaymentRequest // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayAutoReloadPaymentRequest?, - ) as $Val); - } - - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementAppleRecurringRequestCopyWith<$Res>? - get recurringPaymentRequest { - if (_value.recurringPaymentRequest == null) { - return null; - } - - return $PaymentElementAppleRecurringRequestCopyWith<$Res>( - _value.recurringPaymentRequest!, (value) { - return _then(_value.copyWith(recurringPaymentRequest: value) as $Val); - }); - } - - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? - get deferredPaymentRequest { - if (_value.deferredPaymentRequest == null) { - return null; - } - - return $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>( - _value.deferredPaymentRequest!, (value) { - return _then(_value.copyWith(deferredPaymentRequest: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,recurringPaymentStartDate,recurringPaymentEndDate,recurringPaymentIntervalUnit,recurringPaymentIntervalCount); - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? - get automaticReloadPaymentRequest { - if (_value.automaticReloadPaymentRequest == null) { - return null; - } - - return $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>( - _value.automaticReloadPaymentRequest!, (value) { - return _then( - _value.copyWith(automaticReloadPaymentRequest: value) as $Val); - }); - } +@override +String toString() { + return 'PaymentElementRecurringPaymentProperties(amount: $amount, label: $label, recurringPaymentStartDate: $recurringPaymentStartDate, recurringPaymentEndDate: $recurringPaymentEndDate, recurringPaymentIntervalUnit: $recurringPaymentIntervalUnit, recurringPaymentIntervalCount: $recurringPaymentIntervalCount)'; } -/// @nodoc -abstract class _$$PaymentElementApplePayOptionsImplCopyWith<$Res> - implements $PaymentElementApplePayOptionsCopyWith<$Res> { - factory _$$PaymentElementApplePayOptionsImplCopyWith( - _$PaymentElementApplePayOptionsImpl value, - $Res Function(_$PaymentElementApplePayOptionsImpl) then) = - __$$PaymentElementApplePayOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentElementAppleRecurringRequest? recurringPaymentRequest, - PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest, - PaymentElementApplePayAutoReloadPaymentRequest? - automaticReloadPaymentRequest}); - - @override - $PaymentElementAppleRecurringRequestCopyWith<$Res>? - get recurringPaymentRequest; - @override - $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res>? - get deferredPaymentRequest; - @override - $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res>? - get automaticReloadPaymentRequest; -} -/// @nodoc -class __$$PaymentElementApplePayOptionsImplCopyWithImpl<$Res> - extends _$PaymentElementApplePayOptionsCopyWithImpl<$Res, - _$PaymentElementApplePayOptionsImpl> - implements _$$PaymentElementApplePayOptionsImplCopyWith<$Res> { - __$$PaymentElementApplePayOptionsImplCopyWithImpl( - _$PaymentElementApplePayOptionsImpl _value, - $Res Function(_$PaymentElementApplePayOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? recurringPaymentRequest = freezed, - Object? deferredPaymentRequest = freezed, - Object? automaticReloadPaymentRequest = freezed, - }) { - return _then(_$PaymentElementApplePayOptionsImpl( - recurringPaymentRequest: freezed == recurringPaymentRequest - ? _value.recurringPaymentRequest - : recurringPaymentRequest // ignore: cast_nullable_to_non_nullable - as PaymentElementAppleRecurringRequest?, - deferredPaymentRequest: freezed == deferredPaymentRequest - ? _value.deferredPaymentRequest - : deferredPaymentRequest // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayDeferredPaymentRequest?, - automaticReloadPaymentRequest: freezed == automaticReloadPaymentRequest - ? _value.automaticReloadPaymentRequest - : automaticReloadPaymentRequest // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayAutoReloadPaymentRequest?, - )); - } } /// @nodoc -@JsonSerializable() -class _$PaymentElementApplePayOptionsImpl - implements _PaymentElementApplePayOptions { - const _$PaymentElementApplePayOptionsImpl( - {this.recurringPaymentRequest, - this.deferredPaymentRequest, - this.automaticReloadPaymentRequest}); - - factory _$PaymentElementApplePayOptionsImpl.fromJson( - Map json) => - _$$PaymentElementApplePayOptionsImplFromJson(json); - - /// Information about a recurring payment with ApplePay - @override - final PaymentElementAppleRecurringRequest? recurringPaymentRequest; - - /// Information about a deferred payment with ApplePay - @override - final PaymentElementApplePayDeferredPaymentRequest? deferredPaymentRequest; - - /// Information about an auto reload payment with ApplePay - @override - final PaymentElementApplePayAutoReloadPaymentRequest? - automaticReloadPaymentRequest; - - @override - String toString() { - return 'PaymentElementApplePayOptions(recurringPaymentRequest: $recurringPaymentRequest, deferredPaymentRequest: $deferredPaymentRequest, automaticReloadPaymentRequest: $automaticReloadPaymentRequest)'; - } +abstract mixin class _$PaymentElementRecurringPaymentPropertiesCopyWith<$Res> implements $PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { + factory _$PaymentElementRecurringPaymentPropertiesCopyWith(_PaymentElementRecurringPaymentProperties value, $Res Function(_PaymentElementRecurringPaymentProperties) _then) = __$PaymentElementRecurringPaymentPropertiesCopyWithImpl; +@override @useResult +$Res call({ + double amount, String label, DateTime? recurringPaymentStartDate, DateTime? recurringPaymentEndDate, ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, int? recurringPaymentIntervalCount +}); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementApplePayOptionsImpl && - (identical( - other.recurringPaymentRequest, recurringPaymentRequest) || - other.recurringPaymentRequest == recurringPaymentRequest) && - (identical(other.deferredPaymentRequest, deferredPaymentRequest) || - other.deferredPaymentRequest == deferredPaymentRequest) && - (identical(other.automaticReloadPaymentRequest, - automaticReloadPaymentRequest) || - other.automaticReloadPaymentRequest == - automaticReloadPaymentRequest)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, recurringPaymentRequest, - deferredPaymentRequest, automaticReloadPaymentRequest); - - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementApplePayOptionsImplCopyWith< - _$PaymentElementApplePayOptionsImpl> - get copyWith => __$$PaymentElementApplePayOptionsImplCopyWithImpl< - _$PaymentElementApplePayOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementApplePayOptionsImplToJson( - this, - ); - } -} -abstract class _PaymentElementApplePayOptions - implements PaymentElementApplePayOptions { - const factory _PaymentElementApplePayOptions( - {final PaymentElementAppleRecurringRequest? recurringPaymentRequest, - final PaymentElementApplePayDeferredPaymentRequest? - deferredPaymentRequest, - final PaymentElementApplePayAutoReloadPaymentRequest? - automaticReloadPaymentRequest}) = _$PaymentElementApplePayOptionsImpl; - factory _PaymentElementApplePayOptions.fromJson(Map json) = - _$PaymentElementApplePayOptionsImpl.fromJson; +} +/// @nodoc +class __$PaymentElementRecurringPaymentPropertiesCopyWithImpl<$Res> + implements _$PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { + __$PaymentElementRecurringPaymentPropertiesCopyWithImpl(this._self, this._then); - /// Information about a recurring payment with ApplePay - @override - PaymentElementAppleRecurringRequest? get recurringPaymentRequest; + final _PaymentElementRecurringPaymentProperties _self; + final $Res Function(_PaymentElementRecurringPaymentProperties) _then; - /// Information about a deferred payment with ApplePay - @override - PaymentElementApplePayDeferredPaymentRequest? get deferredPaymentRequest; +/// Create a copy of PaymentElementRecurringPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? amount = null,Object? label = null,Object? recurringPaymentStartDate = freezed,Object? recurringPaymentEndDate = freezed,Object? recurringPaymentIntervalUnit = freezed,Object? recurringPaymentIntervalCount = freezed,}) { + return _then(_PaymentElementRecurringPaymentProperties( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,recurringPaymentStartDate: freezed == recurringPaymentStartDate ? _self.recurringPaymentStartDate : recurringPaymentStartDate // ignore: cast_nullable_to_non_nullable +as DateTime?,recurringPaymentEndDate: freezed == recurringPaymentEndDate ? _self.recurringPaymentEndDate : recurringPaymentEndDate // ignore: cast_nullable_to_non_nullable +as DateTime?,recurringPaymentIntervalUnit: freezed == recurringPaymentIntervalUnit ? _self.recurringPaymentIntervalUnit : recurringPaymentIntervalUnit // ignore: cast_nullable_to_non_nullable +as ApplePayRecurringPaymentTimeInterVal?,recurringPaymentIntervalCount: freezed == recurringPaymentIntervalCount ? _self.recurringPaymentIntervalCount : recurringPaymentIntervalCount // ignore: cast_nullable_to_non_nullable +as int?, + )); +} - /// Information about an auto reload payment with ApplePay - @override - PaymentElementApplePayAutoReloadPaymentRequest? - get automaticReloadPaymentRequest; - /// Create a copy of PaymentElementApplePayOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementApplePayOptionsImplCopyWith< - _$PaymentElementApplePayOptionsImpl> - get copyWith => throw _privateConstructorUsedError; } -PaymentElementAppleRecurringRequest - _$PaymentElementAppleRecurringRequestFromJson(Map json) { - return _PaymentElementAppleRecurringRequest.fromJson(json); -} /// @nodoc -mixin _$PaymentElementAppleRecurringRequest { - /// The description of the payment - String get paymentDescription => throw _privateConstructorUsedError; +mixin _$PaymentElementApplePayDeferredPaymentRequest { - /// Management url - String get managementUrl => throw _privateConstructorUsedError; +/// The description of the payment + String get paymentDescription;/// Management url + String get managementUrl;/// Billing agreement label + String? get billingAgreement;/// The date when you can cancel for free + DateTime? get freeCancellationDate;/// The timezone of the free cancellation date + String? get freeCancellationTimezone;/// Billing information of the deffered payment + PaymentElementApplePayDeferredPaymentProperties get deferredBilling; +/// Create a copy of PaymentElementApplePayDeferredPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementApplePayDeferredPaymentRequestCopyWith get copyWith => _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl(this as PaymentElementApplePayDeferredPaymentRequest, _$identity); - /// Information in case of a trial billing - PaymentElementRecurringPaymentProperties? get trialBilling => - throw _privateConstructorUsedError; + /// Serializes this PaymentElementApplePayDeferredPaymentRequest to a JSON map. + Map toJson(); - /// Information in case of a regular billing - PaymentElementRecurringPaymentProperties? get regularBilling => - throw _privateConstructorUsedError; - /// Serializes this PaymentElementAppleRecurringRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementApplePayDeferredPaymentRequest&&(identical(other.paymentDescription, paymentDescription) || other.paymentDescription == paymentDescription)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.billingAgreement, billingAgreement) || other.billingAgreement == billingAgreement)&&(identical(other.freeCancellationDate, freeCancellationDate) || other.freeCancellationDate == freeCancellationDate)&&(identical(other.freeCancellationTimezone, freeCancellationTimezone) || other.freeCancellationTimezone == freeCancellationTimezone)&&(identical(other.deferredBilling, deferredBilling) || other.deferredBilling == deferredBilling)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentDescription,managementUrl,billingAgreement,freeCancellationDate,freeCancellationTimezone,deferredBilling); - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementAppleRecurringRequestCopyWith< - PaymentElementAppleRecurringRequest> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementApplePayDeferredPaymentRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, billingAgreement: $billingAgreement, freeCancellationDate: $freeCancellationDate, freeCancellationTimezone: $freeCancellationTimezone, deferredBilling: $deferredBilling)'; } -/// @nodoc -abstract class $PaymentElementAppleRecurringRequestCopyWith<$Res> { - factory $PaymentElementAppleRecurringRequestCopyWith( - PaymentElementAppleRecurringRequest value, - $Res Function(PaymentElementAppleRecurringRequest) then) = - _$PaymentElementAppleRecurringRequestCopyWithImpl<$Res, - PaymentElementAppleRecurringRequest>; - @useResult - $Res call( - {String paymentDescription, - String managementUrl, - PaymentElementRecurringPaymentProperties? trialBilling, - PaymentElementRecurringPaymentProperties? regularBilling}); - - $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling; - $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling; + } /// @nodoc -class _$PaymentElementAppleRecurringRequestCopyWithImpl<$Res, - $Val extends PaymentElementAppleRecurringRequest> - implements $PaymentElementAppleRecurringRequestCopyWith<$Res> { - _$PaymentElementAppleRecurringRequestCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentDescription = null, - Object? managementUrl = null, - Object? trialBilling = freezed, - Object? regularBilling = freezed, - }) { - return _then(_value.copyWith( - paymentDescription: null == paymentDescription - ? _value.paymentDescription - : paymentDescription // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - trialBilling: freezed == trialBilling - ? _value.trialBilling - : trialBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementRecurringPaymentProperties?, - regularBilling: freezed == regularBilling - ? _value.regularBilling - : regularBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementRecurringPaymentProperties?, - ) as $Val); - } +abstract mixin class $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { + factory $PaymentElementApplePayDeferredPaymentRequestCopyWith(PaymentElementApplePayDeferredPaymentRequest value, $Res Function(PaymentElementApplePayDeferredPaymentRequest) _then) = _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl; +@useResult +$Res call({ + String paymentDescription, String managementUrl, String? billingAgreement, DateTime? freeCancellationDate, String? freeCancellationTimezone, PaymentElementApplePayDeferredPaymentProperties deferredBilling +}); - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling { - if (_value.trialBilling == null) { - return null; - } - - return $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>( - _value.trialBilling!, (value) { - return _then(_value.copyWith(trialBilling: value) as $Val); - }); - } - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling { - if (_value.regularBilling == null) { - return null; - } - - return $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>( - _value.regularBilling!, (value) { - return _then(_value.copyWith(regularBilling: value) as $Val); - }); - } -} +$PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> get deferredBilling; +} /// @nodoc -abstract class _$$PaymentElementAppleRecurringRequestImplCopyWith<$Res> - implements $PaymentElementAppleRecurringRequestCopyWith<$Res> { - factory _$$PaymentElementAppleRecurringRequestImplCopyWith( - _$PaymentElementAppleRecurringRequestImpl value, - $Res Function(_$PaymentElementAppleRecurringRequestImpl) then) = - __$$PaymentElementAppleRecurringRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String paymentDescription, - String managementUrl, - PaymentElementRecurringPaymentProperties? trialBilling, - PaymentElementRecurringPaymentProperties? regularBilling}); - - @override - $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get trialBilling; - @override - $PaymentElementRecurringPaymentPropertiesCopyWith<$Res>? get regularBilling; +class _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl<$Res> + implements $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { + _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl(this._self, this._then); + + final PaymentElementApplePayDeferredPaymentRequest _self; + final $Res Function(PaymentElementApplePayDeferredPaymentRequest) _then; + +/// Create a copy of PaymentElementApplePayDeferredPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentDescription = null,Object? managementUrl = null,Object? billingAgreement = freezed,Object? freeCancellationDate = freezed,Object? freeCancellationTimezone = freezed,Object? deferredBilling = null,}) { + return _then(_self.copyWith( +paymentDescription: null == paymentDescription ? _self.paymentDescription : paymentDescription // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,billingAgreement: freezed == billingAgreement ? _self.billingAgreement : billingAgreement // ignore: cast_nullable_to_non_nullable +as String?,freeCancellationDate: freezed == freeCancellationDate ? _self.freeCancellationDate : freeCancellationDate // ignore: cast_nullable_to_non_nullable +as DateTime?,freeCancellationTimezone: freezed == freeCancellationTimezone ? _self.freeCancellationTimezone : freeCancellationTimezone // ignore: cast_nullable_to_non_nullable +as String?,deferredBilling: null == deferredBilling ? _self.deferredBilling : deferredBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayDeferredPaymentProperties, + )); +} +/// Create a copy of PaymentElementApplePayDeferredPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> get deferredBilling { + + return $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res>(_self.deferredBilling, (value) { + return _then(_self.copyWith(deferredBilling: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementApplePayDeferredPaymentRequest]. +extension PaymentElementApplePayDeferredPaymentRequestPatterns on PaymentElementApplePayDeferredPaymentRequest { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementApplePayDeferredPaymentRequest value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentRequest() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementApplePayDeferredPaymentRequest value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentRequest(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementApplePayDeferredPaymentRequest value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentRequest() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String paymentDescription, String managementUrl, String? billingAgreement, DateTime? freeCancellationDate, String? freeCancellationTimezone, PaymentElementApplePayDeferredPaymentProperties deferredBilling)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentRequest() when $default != null: +return $default(_that.paymentDescription,_that.managementUrl,_that.billingAgreement,_that.freeCancellationDate,_that.freeCancellationTimezone,_that.deferredBilling);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String paymentDescription, String managementUrl, String? billingAgreement, DateTime? freeCancellationDate, String? freeCancellationTimezone, PaymentElementApplePayDeferredPaymentProperties deferredBilling) $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentRequest(): +return $default(_that.paymentDescription,_that.managementUrl,_that.billingAgreement,_that.freeCancellationDate,_that.freeCancellationTimezone,_that.deferredBilling);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String paymentDescription, String managementUrl, String? billingAgreement, DateTime? freeCancellationDate, String? freeCancellationTimezone, PaymentElementApplePayDeferredPaymentProperties deferredBilling)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentRequest() when $default != null: +return $default(_that.paymentDescription,_that.managementUrl,_that.billingAgreement,_that.freeCancellationDate,_that.freeCancellationTimezone,_that.deferredBilling);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementAppleRecurringRequestImplCopyWithImpl<$Res> - extends _$PaymentElementAppleRecurringRequestCopyWithImpl<$Res, - _$PaymentElementAppleRecurringRequestImpl> - implements _$$PaymentElementAppleRecurringRequestImplCopyWith<$Res> { - __$$PaymentElementAppleRecurringRequestImplCopyWithImpl( - _$PaymentElementAppleRecurringRequestImpl _value, - $Res Function(_$PaymentElementAppleRecurringRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentDescription = null, - Object? managementUrl = null, - Object? trialBilling = freezed, - Object? regularBilling = freezed, - }) { - return _then(_$PaymentElementAppleRecurringRequestImpl( - paymentDescription: null == paymentDescription - ? _value.paymentDescription - : paymentDescription // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - trialBilling: freezed == trialBilling - ? _value.trialBilling - : trialBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementRecurringPaymentProperties?, - regularBilling: freezed == regularBilling - ? _value.regularBilling - : regularBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementRecurringPaymentProperties?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementAppleRecurringRequestImpl - implements _PaymentElementAppleRecurringRequest { - const _$PaymentElementAppleRecurringRequestImpl( - {required this.paymentDescription, - required this.managementUrl, - this.trialBilling, - this.regularBilling}); - - factory _$PaymentElementAppleRecurringRequestImpl.fromJson( - Map json) => - _$$PaymentElementAppleRecurringRequestImplFromJson(json); - - /// The description of the payment - @override - final String paymentDescription; - - /// Management url - @override - final String managementUrl; - - /// Information in case of a trial billing - @override - final PaymentElementRecurringPaymentProperties? trialBilling; - - /// Information in case of a regular billing - @override - final PaymentElementRecurringPaymentProperties? regularBilling; - - @override - String toString() { - return 'PaymentElementAppleRecurringRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, trialBilling: $trialBilling, regularBilling: $regularBilling)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementAppleRecurringRequestImpl && - (identical(other.paymentDescription, paymentDescription) || - other.paymentDescription == paymentDescription) && - (identical(other.managementUrl, managementUrl) || - other.managementUrl == managementUrl) && - (identical(other.trialBilling, trialBilling) || - other.trialBilling == trialBilling) && - (identical(other.regularBilling, regularBilling) || - other.regularBilling == regularBilling)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentDescription, - managementUrl, trialBilling, regularBilling); - - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementAppleRecurringRequestImplCopyWith< - _$PaymentElementAppleRecurringRequestImpl> - get copyWith => __$$PaymentElementAppleRecurringRequestImplCopyWithImpl< - _$PaymentElementAppleRecurringRequestImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementAppleRecurringRequestImplToJson( - this, - ); - } -} -abstract class _PaymentElementAppleRecurringRequest - implements PaymentElementAppleRecurringRequest { - const factory _PaymentElementAppleRecurringRequest( - {required final String paymentDescription, - required final String managementUrl, - final PaymentElementRecurringPaymentProperties? trialBilling, - final PaymentElementRecurringPaymentProperties? regularBilling}) = - _$PaymentElementAppleRecurringRequestImpl; +class _PaymentElementApplePayDeferredPaymentRequest implements PaymentElementApplePayDeferredPaymentRequest { + const _PaymentElementApplePayDeferredPaymentRequest({required this.paymentDescription, required this.managementUrl, this.billingAgreement, this.freeCancellationDate, this.freeCancellationTimezone, required this.deferredBilling}); + factory _PaymentElementApplePayDeferredPaymentRequest.fromJson(Map json) => _$PaymentElementApplePayDeferredPaymentRequestFromJson(json); - factory _PaymentElementAppleRecurringRequest.fromJson( - Map json) = - _$PaymentElementAppleRecurringRequestImpl.fromJson; +/// The description of the payment +@override final String paymentDescription; +/// Management url +@override final String managementUrl; +/// Billing agreement label +@override final String? billingAgreement; +/// The date when you can cancel for free +@override final DateTime? freeCancellationDate; +/// The timezone of the free cancellation date +@override final String? freeCancellationTimezone; +/// Billing information of the deffered payment +@override final PaymentElementApplePayDeferredPaymentProperties deferredBilling; - /// The description of the payment - @override - String get paymentDescription; +/// Create a copy of PaymentElementApplePayDeferredPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementApplePayDeferredPaymentRequestCopyWith<_PaymentElementApplePayDeferredPaymentRequest> get copyWith => __$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl<_PaymentElementApplePayDeferredPaymentRequest>(this, _$identity); - /// Management url - @override - String get managementUrl; +@override +Map toJson() { + return _$PaymentElementApplePayDeferredPaymentRequestToJson(this, ); +} - /// Information in case of a trial billing - @override - PaymentElementRecurringPaymentProperties? get trialBilling; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementApplePayDeferredPaymentRequest&&(identical(other.paymentDescription, paymentDescription) || other.paymentDescription == paymentDescription)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.billingAgreement, billingAgreement) || other.billingAgreement == billingAgreement)&&(identical(other.freeCancellationDate, freeCancellationDate) || other.freeCancellationDate == freeCancellationDate)&&(identical(other.freeCancellationTimezone, freeCancellationTimezone) || other.freeCancellationTimezone == freeCancellationTimezone)&&(identical(other.deferredBilling, deferredBilling) || other.deferredBilling == deferredBilling)); +} - /// Information in case of a regular billing - @override - PaymentElementRecurringPaymentProperties? get regularBilling; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentDescription,managementUrl,billingAgreement,freeCancellationDate,freeCancellationTimezone,deferredBilling); - /// Create a copy of PaymentElementAppleRecurringRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementAppleRecurringRequestImplCopyWith< - _$PaymentElementAppleRecurringRequestImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementApplePayDeferredPaymentRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, billingAgreement: $billingAgreement, freeCancellationDate: $freeCancellationDate, freeCancellationTimezone: $freeCancellationTimezone, deferredBilling: $deferredBilling)'; } -PaymentElementRecurringPaymentProperties - _$PaymentElementRecurringPaymentPropertiesFromJson( - Map json) { - return _PaymentElementRecurringPaymentProperties.fromJson(json); + } /// @nodoc -mixin _$PaymentElementRecurringPaymentProperties { - /// The amount of the payment - double get amount => throw _privateConstructorUsedError; +abstract mixin class _$PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> implements $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { + factory _$PaymentElementApplePayDeferredPaymentRequestCopyWith(_PaymentElementApplePayDeferredPaymentRequest value, $Res Function(_PaymentElementApplePayDeferredPaymentRequest) _then) = __$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl; +@override @useResult +$Res call({ + String paymentDescription, String managementUrl, String? billingAgreement, DateTime? freeCancellationDate, String? freeCancellationTimezone, PaymentElementApplePayDeferredPaymentProperties deferredBilling +}); - /// Description label - String get label => throw _privateConstructorUsedError; - /// The startdate of the recurring payment - DateTime? get recurringPaymentStartDate => throw _privateConstructorUsedError; +@override $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> get deferredBilling; - /// The enddate of the recurring payment - DateTime? get recurringPaymentEndDate => throw _privateConstructorUsedError; - - /// The interval of payment - ApplePayRecurringPaymentTimeInterVal? get recurringPaymentIntervalUnit => - throw _privateConstructorUsedError; - - /// The amount of intervals - int? get recurringPaymentIntervalCount => throw _privateConstructorUsedError; +} +/// @nodoc +class __$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl<$Res> + implements _$PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { + __$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl(this._self, this._then); - /// Serializes this PaymentElementRecurringPaymentProperties to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + final _PaymentElementApplePayDeferredPaymentRequest _self; + final $Res Function(_PaymentElementApplePayDeferredPaymentRequest) _then; - /// Create a copy of PaymentElementRecurringPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementRecurringPaymentPropertiesCopyWith< - PaymentElementRecurringPaymentProperties> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentElementApplePayDeferredPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentDescription = null,Object? managementUrl = null,Object? billingAgreement = freezed,Object? freeCancellationDate = freezed,Object? freeCancellationTimezone = freezed,Object? deferredBilling = null,}) { + return _then(_PaymentElementApplePayDeferredPaymentRequest( +paymentDescription: null == paymentDescription ? _self.paymentDescription : paymentDescription // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,billingAgreement: freezed == billingAgreement ? _self.billingAgreement : billingAgreement // ignore: cast_nullable_to_non_nullable +as String?,freeCancellationDate: freezed == freeCancellationDate ? _self.freeCancellationDate : freeCancellationDate // ignore: cast_nullable_to_non_nullable +as DateTime?,freeCancellationTimezone: freezed == freeCancellationTimezone ? _self.freeCancellationTimezone : freeCancellationTimezone // ignore: cast_nullable_to_non_nullable +as String?,deferredBilling: null == deferredBilling ? _self.deferredBilling : deferredBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayDeferredPaymentProperties, + )); } -/// @nodoc -abstract class $PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { - factory $PaymentElementRecurringPaymentPropertiesCopyWith( - PaymentElementRecurringPaymentProperties value, - $Res Function(PaymentElementRecurringPaymentProperties) then) = - _$PaymentElementRecurringPaymentPropertiesCopyWithImpl<$Res, - PaymentElementRecurringPaymentProperties>; - @useResult - $Res call( - {double amount, - String label, - DateTime? recurringPaymentStartDate, - DateTime? recurringPaymentEndDate, - ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, - int? recurringPaymentIntervalCount}); +/// Create a copy of PaymentElementApplePayDeferredPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> get deferredBilling { + + return $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res>(_self.deferredBilling, (value) { + return _then(_self.copyWith(deferredBilling: value)); + }); } - -/// @nodoc -class _$PaymentElementRecurringPaymentPropertiesCopyWithImpl<$Res, - $Val extends PaymentElementRecurringPaymentProperties> - implements $PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { - _$PaymentElementRecurringPaymentPropertiesCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementRecurringPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? recurringPaymentStartDate = freezed, - Object? recurringPaymentEndDate = freezed, - Object? recurringPaymentIntervalUnit = freezed, - Object? recurringPaymentIntervalCount = freezed, - }) { - return _then(_value.copyWith( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - recurringPaymentStartDate: freezed == recurringPaymentStartDate - ? _value.recurringPaymentStartDate - : recurringPaymentStartDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - recurringPaymentEndDate: freezed == recurringPaymentEndDate - ? _value.recurringPaymentEndDate - : recurringPaymentEndDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - recurringPaymentIntervalUnit: freezed == recurringPaymentIntervalUnit - ? _value.recurringPaymentIntervalUnit - : recurringPaymentIntervalUnit // ignore: cast_nullable_to_non_nullable - as ApplePayRecurringPaymentTimeInterVal?, - recurringPaymentIntervalCount: freezed == recurringPaymentIntervalCount - ? _value.recurringPaymentIntervalCount - : recurringPaymentIntervalCount // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } } -/// @nodoc -abstract class _$$PaymentElementRecurringPaymentPropertiesImplCopyWith<$Res> - implements $PaymentElementRecurringPaymentPropertiesCopyWith<$Res> { - factory _$$PaymentElementRecurringPaymentPropertiesImplCopyWith( - _$PaymentElementRecurringPaymentPropertiesImpl value, - $Res Function(_$PaymentElementRecurringPaymentPropertiesImpl) then) = - __$$PaymentElementRecurringPaymentPropertiesImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {double amount, - String label, - DateTime? recurringPaymentStartDate, - DateTime? recurringPaymentEndDate, - ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, - int? recurringPaymentIntervalCount}); -} /// @nodoc -class __$$PaymentElementRecurringPaymentPropertiesImplCopyWithImpl<$Res> - extends _$PaymentElementRecurringPaymentPropertiesCopyWithImpl<$Res, - _$PaymentElementRecurringPaymentPropertiesImpl> - implements _$$PaymentElementRecurringPaymentPropertiesImplCopyWith<$Res> { - __$$PaymentElementRecurringPaymentPropertiesImplCopyWithImpl( - _$PaymentElementRecurringPaymentPropertiesImpl _value, - $Res Function(_$PaymentElementRecurringPaymentPropertiesImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementRecurringPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? recurringPaymentStartDate = freezed, - Object? recurringPaymentEndDate = freezed, - Object? recurringPaymentIntervalUnit = freezed, - Object? recurringPaymentIntervalCount = freezed, - }) { - return _then(_$PaymentElementRecurringPaymentPropertiesImpl( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - recurringPaymentStartDate: freezed == recurringPaymentStartDate - ? _value.recurringPaymentStartDate - : recurringPaymentStartDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - recurringPaymentEndDate: freezed == recurringPaymentEndDate - ? _value.recurringPaymentEndDate - : recurringPaymentEndDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - recurringPaymentIntervalUnit: freezed == recurringPaymentIntervalUnit - ? _value.recurringPaymentIntervalUnit - : recurringPaymentIntervalUnit // ignore: cast_nullable_to_non_nullable - as ApplePayRecurringPaymentTimeInterVal?, - recurringPaymentIntervalCount: freezed == recurringPaymentIntervalCount - ? _value.recurringPaymentIntervalCount - : recurringPaymentIntervalCount // ignore: cast_nullable_to_non_nullable - as int?, - )); - } -} +mixin _$PaymentElementApplePayDeferredPaymentProperties { -/// @nodoc -@JsonSerializable() -class _$PaymentElementRecurringPaymentPropertiesImpl - implements _PaymentElementRecurringPaymentProperties { - const _$PaymentElementRecurringPaymentPropertiesImpl( - {required this.amount, - required this.label, - this.recurringPaymentStartDate, - this.recurringPaymentEndDate, - this.recurringPaymentIntervalUnit, - this.recurringPaymentIntervalCount}); - - factory _$PaymentElementRecurringPaymentPropertiesImpl.fromJson( - Map json) => - _$$PaymentElementRecurringPaymentPropertiesImplFromJson(json); - - /// The amount of the payment - @override - final double amount; - - /// Description label - @override - final String label; - - /// The startdate of the recurring payment - @override - final DateTime? recurringPaymentStartDate; - - /// The enddate of the recurring payment - @override - final DateTime? recurringPaymentEndDate; - - /// The interval of payment - @override - final ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit; - - /// The amount of intervals - @override - final int? recurringPaymentIntervalCount; - - @override - String toString() { - return 'PaymentElementRecurringPaymentProperties(amount: $amount, label: $label, recurringPaymentStartDate: $recurringPaymentStartDate, recurringPaymentEndDate: $recurringPaymentEndDate, recurringPaymentIntervalUnit: $recurringPaymentIntervalUnit, recurringPaymentIntervalCount: $recurringPaymentIntervalCount)'; - } +/// The amount of the payment + double get amount;/// Description label + String get label;/// The date when the payment will be processed + DateTime get deferredPaymentDate; +/// Create a copy of PaymentElementApplePayDeferredPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementApplePayDeferredPaymentPropertiesCopyWith get copyWith => _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl(this as PaymentElementApplePayDeferredPaymentProperties, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementRecurringPaymentPropertiesImpl && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.label, label) || other.label == label) && - (identical(other.recurringPaymentStartDate, - recurringPaymentStartDate) || - other.recurringPaymentStartDate == recurringPaymentStartDate) && - (identical( - other.recurringPaymentEndDate, recurringPaymentEndDate) || - other.recurringPaymentEndDate == recurringPaymentEndDate) && - (identical(other.recurringPaymentIntervalUnit, - recurringPaymentIntervalUnit) || - other.recurringPaymentIntervalUnit == - recurringPaymentIntervalUnit) && - (identical(other.recurringPaymentIntervalCount, - recurringPaymentIntervalCount) || - other.recurringPaymentIntervalCount == - recurringPaymentIntervalCount)); - } + /// Serializes this PaymentElementApplePayDeferredPaymentProperties to a JSON map. + Map toJson(); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - amount, - label, - recurringPaymentStartDate, - recurringPaymentEndDate, - recurringPaymentIntervalUnit, - recurringPaymentIntervalCount); - - /// Create a copy of PaymentElementRecurringPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementRecurringPaymentPropertiesImplCopyWith< - _$PaymentElementRecurringPaymentPropertiesImpl> - get copyWith => - __$$PaymentElementRecurringPaymentPropertiesImplCopyWithImpl< - _$PaymentElementRecurringPaymentPropertiesImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementRecurringPaymentPropertiesImplToJson( - this, - ); - } + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementApplePayDeferredPaymentProperties&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.deferredPaymentDate, deferredPaymentDate) || other.deferredPaymentDate == deferredPaymentDate)); } -abstract class _PaymentElementRecurringPaymentProperties - implements PaymentElementRecurringPaymentProperties { - const factory _PaymentElementRecurringPaymentProperties( - {required final double amount, - required final String label, - final DateTime? recurringPaymentStartDate, - final DateTime? recurringPaymentEndDate, - final ApplePayRecurringPaymentTimeInterVal? recurringPaymentIntervalUnit, - final int? recurringPaymentIntervalCount}) = - _$PaymentElementRecurringPaymentPropertiesImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,deferredPaymentDate); + +@override +String toString() { + return 'PaymentElementApplePayDeferredPaymentProperties(amount: $amount, label: $label, deferredPaymentDate: $deferredPaymentDate)'; +} - factory _PaymentElementRecurringPaymentProperties.fromJson( - Map json) = - _$PaymentElementRecurringPaymentPropertiesImpl.fromJson; - /// The amount of the payment - @override - double get amount; +} - /// Description label - @override - String get label; +/// @nodoc +abstract mixin class $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { + factory $PaymentElementApplePayDeferredPaymentPropertiesCopyWith(PaymentElementApplePayDeferredPaymentProperties value, $Res Function(PaymentElementApplePayDeferredPaymentProperties) _then) = _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl; +@useResult +$Res call({ + double amount, String label, DateTime deferredPaymentDate +}); - /// The startdate of the recurring payment - @override - DateTime? get recurringPaymentStartDate; - /// The enddate of the recurring payment - @override - DateTime? get recurringPaymentEndDate; - /// The interval of payment - @override - ApplePayRecurringPaymentTimeInterVal? get recurringPaymentIntervalUnit; - /// The amount of intervals - @override - int? get recurringPaymentIntervalCount; +} +/// @nodoc +class _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl<$Res> + implements $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { + _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl(this._self, this._then); + + final PaymentElementApplePayDeferredPaymentProperties _self; + final $Res Function(PaymentElementApplePayDeferredPaymentProperties) _then; + +/// Create a copy of PaymentElementApplePayDeferredPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? amount = null,Object? label = null,Object? deferredPaymentDate = null,}) { + return _then(_self.copyWith( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,deferredPaymentDate: null == deferredPaymentDate ? _self.deferredPaymentDate : deferredPaymentDate // ignore: cast_nullable_to_non_nullable +as DateTime, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementApplePayDeferredPaymentProperties]. +extension PaymentElementApplePayDeferredPaymentPropertiesPatterns on PaymentElementApplePayDeferredPaymentProperties { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementApplePayDeferredPaymentProperties value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentProperties() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementApplePayDeferredPaymentProperties value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentProperties(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementApplePayDeferredPaymentProperties value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentProperties() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double amount, String label, DateTime deferredPaymentDate)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentProperties() when $default != null: +return $default(_that.amount,_that.label,_that.deferredPaymentDate);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double amount, String label, DateTime deferredPaymentDate) $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentProperties(): +return $default(_that.amount,_that.label,_that.deferredPaymentDate);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double amount, String label, DateTime deferredPaymentDate)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayDeferredPaymentProperties() when $default != null: +return $default(_that.amount,_that.label,_that.deferredPaymentDate);case _: + return null; - /// Create a copy of PaymentElementRecurringPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementRecurringPaymentPropertiesImplCopyWith< - _$PaymentElementRecurringPaymentPropertiesImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentElementApplePayDeferredPaymentRequest - _$PaymentElementApplePayDeferredPaymentRequestFromJson( - Map json) { - return _PaymentElementApplePayDeferredPaymentRequest.fromJson(json); } /// @nodoc -mixin _$PaymentElementApplePayDeferredPaymentRequest { - /// The description of the payment - String get paymentDescription => throw _privateConstructorUsedError; +@JsonSerializable() - /// Management url - String get managementUrl => throw _privateConstructorUsedError; +class _PaymentElementApplePayDeferredPaymentProperties implements PaymentElementApplePayDeferredPaymentProperties { + const _PaymentElementApplePayDeferredPaymentProperties({required this.amount, required this.label, required this.deferredPaymentDate}); + factory _PaymentElementApplePayDeferredPaymentProperties.fromJson(Map json) => _$PaymentElementApplePayDeferredPaymentPropertiesFromJson(json); - /// Billing agreement label - String? get billingAgreement => throw _privateConstructorUsedError; +/// The amount of the payment +@override final double amount; +/// Description label +@override final String label; +/// The date when the payment will be processed +@override final DateTime deferredPaymentDate; - /// The date when you can cancel for free - DateTime? get freeCancellationDate => throw _privateConstructorUsedError; +/// Create a copy of PaymentElementApplePayDeferredPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementApplePayDeferredPaymentPropertiesCopyWith<_PaymentElementApplePayDeferredPaymentProperties> get copyWith => __$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl<_PaymentElementApplePayDeferredPaymentProperties>(this, _$identity); - /// The timezone of the free cancellation date - String? get freeCancellationTimezone => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentElementApplePayDeferredPaymentPropertiesToJson(this, ); +} - /// Billing information of the deffered payment - PaymentElementApplePayDeferredPaymentProperties get deferredBilling => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementApplePayDeferredPaymentProperties&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.deferredPaymentDate, deferredPaymentDate) || other.deferredPaymentDate == deferredPaymentDate)); +} - /// Serializes this PaymentElementApplePayDeferredPaymentRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,deferredPaymentDate); - /// Create a copy of PaymentElementApplePayDeferredPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementApplePayDeferredPaymentRequestCopyWith< - PaymentElementApplePayDeferredPaymentRequest> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementApplePayDeferredPaymentProperties(amount: $amount, label: $label, deferredPaymentDate: $deferredPaymentDate)'; } -/// @nodoc -abstract class $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { - factory $PaymentElementApplePayDeferredPaymentRequestCopyWith( - PaymentElementApplePayDeferredPaymentRequest value, - $Res Function(PaymentElementApplePayDeferredPaymentRequest) then) = - _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl<$Res, - PaymentElementApplePayDeferredPaymentRequest>; - @useResult - $Res call( - {String paymentDescription, - String managementUrl, - String? billingAgreement, - DateTime? freeCancellationDate, - String? freeCancellationTimezone, - PaymentElementApplePayDeferredPaymentProperties deferredBilling}); - - $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> - get deferredBilling; + } /// @nodoc -class _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl<$Res, - $Val extends PaymentElementApplePayDeferredPaymentRequest> - implements $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { - _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementApplePayDeferredPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentDescription = null, - Object? managementUrl = null, - Object? billingAgreement = freezed, - Object? freeCancellationDate = freezed, - Object? freeCancellationTimezone = freezed, - Object? deferredBilling = null, - }) { - return _then(_value.copyWith( - paymentDescription: null == paymentDescription - ? _value.paymentDescription - : paymentDescription // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - billingAgreement: freezed == billingAgreement - ? _value.billingAgreement - : billingAgreement // ignore: cast_nullable_to_non_nullable - as String?, - freeCancellationDate: freezed == freeCancellationDate - ? _value.freeCancellationDate - : freeCancellationDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - freeCancellationTimezone: freezed == freeCancellationTimezone - ? _value.freeCancellationTimezone - : freeCancellationTimezone // ignore: cast_nullable_to_non_nullable - as String?, - deferredBilling: null == deferredBilling - ? _value.deferredBilling - : deferredBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayDeferredPaymentProperties, - ) as $Val); - } +abstract mixin class _$PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> implements $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { + factory _$PaymentElementApplePayDeferredPaymentPropertiesCopyWith(_PaymentElementApplePayDeferredPaymentProperties value, $Res Function(_PaymentElementApplePayDeferredPaymentProperties) _then) = __$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl; +@override @useResult +$Res call({ + double amount, String label, DateTime deferredPaymentDate +}); - /// Create a copy of PaymentElementApplePayDeferredPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> - get deferredBilling { - return $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res>( - _value.deferredBilling, (value) { - return _then(_value.copyWith(deferredBilling: value) as $Val); - }); - } -} -/// @nodoc -abstract class _$$PaymentElementApplePayDeferredPaymentRequestImplCopyWith<$Res> - implements $PaymentElementApplePayDeferredPaymentRequestCopyWith<$Res> { - factory _$$PaymentElementApplePayDeferredPaymentRequestImplCopyWith( - _$PaymentElementApplePayDeferredPaymentRequestImpl value, - $Res Function(_$PaymentElementApplePayDeferredPaymentRequestImpl) - then) = - __$$PaymentElementApplePayDeferredPaymentRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String paymentDescription, - String managementUrl, - String? billingAgreement, - DateTime? freeCancellationDate, - String? freeCancellationTimezone, - PaymentElementApplePayDeferredPaymentProperties deferredBilling}); - - @override - $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> - get deferredBilling; -} -/// @nodoc -class __$$PaymentElementApplePayDeferredPaymentRequestImplCopyWithImpl<$Res> - extends _$PaymentElementApplePayDeferredPaymentRequestCopyWithImpl<$Res, - _$PaymentElementApplePayDeferredPaymentRequestImpl> - implements - _$$PaymentElementApplePayDeferredPaymentRequestImplCopyWith<$Res> { - __$$PaymentElementApplePayDeferredPaymentRequestImplCopyWithImpl( - _$PaymentElementApplePayDeferredPaymentRequestImpl _value, - $Res Function(_$PaymentElementApplePayDeferredPaymentRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementApplePayDeferredPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentDescription = null, - Object? managementUrl = null, - Object? billingAgreement = freezed, - Object? freeCancellationDate = freezed, - Object? freeCancellationTimezone = freezed, - Object? deferredBilling = null, - }) { - return _then(_$PaymentElementApplePayDeferredPaymentRequestImpl( - paymentDescription: null == paymentDescription - ? _value.paymentDescription - : paymentDescription // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - billingAgreement: freezed == billingAgreement - ? _value.billingAgreement - : billingAgreement // ignore: cast_nullable_to_non_nullable - as String?, - freeCancellationDate: freezed == freeCancellationDate - ? _value.freeCancellationDate - : freeCancellationDate // ignore: cast_nullable_to_non_nullable - as DateTime?, - freeCancellationTimezone: freezed == freeCancellationTimezone - ? _value.freeCancellationTimezone - : freeCancellationTimezone // ignore: cast_nullable_to_non_nullable - as String?, - deferredBilling: null == deferredBilling - ? _value.deferredBilling - : deferredBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayDeferredPaymentProperties, - )); - } -} +} /// @nodoc -@JsonSerializable() -class _$PaymentElementApplePayDeferredPaymentRequestImpl - implements _PaymentElementApplePayDeferredPaymentRequest { - const _$PaymentElementApplePayDeferredPaymentRequestImpl( - {required this.paymentDescription, - required this.managementUrl, - this.billingAgreement, - this.freeCancellationDate, - this.freeCancellationTimezone, - required this.deferredBilling}); - - factory _$PaymentElementApplePayDeferredPaymentRequestImpl.fromJson( - Map json) => - _$$PaymentElementApplePayDeferredPaymentRequestImplFromJson(json); - - /// The description of the payment - @override - final String paymentDescription; - - /// Management url - @override - final String managementUrl; - - /// Billing agreement label - @override - final String? billingAgreement; - - /// The date when you can cancel for free - @override - final DateTime? freeCancellationDate; - - /// The timezone of the free cancellation date - @override - final String? freeCancellationTimezone; - - /// Billing information of the deffered payment - @override - final PaymentElementApplePayDeferredPaymentProperties deferredBilling; - - @override - String toString() { - return 'PaymentElementApplePayDeferredPaymentRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, billingAgreement: $billingAgreement, freeCancellationDate: $freeCancellationDate, freeCancellationTimezone: $freeCancellationTimezone, deferredBilling: $deferredBilling)'; - } +class __$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl<$Res> + implements _$PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { + __$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl(this._self, this._then); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementApplePayDeferredPaymentRequestImpl && - (identical(other.paymentDescription, paymentDescription) || - other.paymentDescription == paymentDescription) && - (identical(other.managementUrl, managementUrl) || - other.managementUrl == managementUrl) && - (identical(other.billingAgreement, billingAgreement) || - other.billingAgreement == billingAgreement) && - (identical(other.freeCancellationDate, freeCancellationDate) || - other.freeCancellationDate == freeCancellationDate) && - (identical( - other.freeCancellationTimezone, freeCancellationTimezone) || - other.freeCancellationTimezone == freeCancellationTimezone) && - (identical(other.deferredBilling, deferredBilling) || - other.deferredBilling == deferredBilling)); - } + final _PaymentElementApplePayDeferredPaymentProperties _self; + final $Res Function(_PaymentElementApplePayDeferredPaymentProperties) _then; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - paymentDescription, - managementUrl, - billingAgreement, - freeCancellationDate, - freeCancellationTimezone, - deferredBilling); - - /// Create a copy of PaymentElementApplePayDeferredPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementApplePayDeferredPaymentRequestImplCopyWith< - _$PaymentElementApplePayDeferredPaymentRequestImpl> - get copyWith => - __$$PaymentElementApplePayDeferredPaymentRequestImplCopyWithImpl< - _$PaymentElementApplePayDeferredPaymentRequestImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementApplePayDeferredPaymentRequestImplToJson( - this, - ); - } +/// Create a copy of PaymentElementApplePayDeferredPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? amount = null,Object? label = null,Object? deferredPaymentDate = null,}) { + return _then(_PaymentElementApplePayDeferredPaymentProperties( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,deferredPaymentDate: null == deferredPaymentDate ? _self.deferredPaymentDate : deferredPaymentDate // ignore: cast_nullable_to_non_nullable +as DateTime, + )); } -abstract class _PaymentElementApplePayDeferredPaymentRequest - implements PaymentElementApplePayDeferredPaymentRequest { - const factory _PaymentElementApplePayDeferredPaymentRequest( - {required final String paymentDescription, - required final String managementUrl, - final String? billingAgreement, - final DateTime? freeCancellationDate, - final String? freeCancellationTimezone, - required final PaymentElementApplePayDeferredPaymentProperties - deferredBilling}) = - _$PaymentElementApplePayDeferredPaymentRequestImpl; - factory _PaymentElementApplePayDeferredPaymentRequest.fromJson( - Map json) = - _$PaymentElementApplePayDeferredPaymentRequestImpl.fromJson; +} + - /// The description of the payment - @override - String get paymentDescription; +/// @nodoc +mixin _$PaymentElementApplePayAutoReloadPaymentRequest { - /// Management url - @override - String get managementUrl; +/// The description of the payment + String get paymentDescription;/// Management url + String get managementUrl;/// Billing information of the deffered payment + PaymentElementApplePayReloadPaymentProperties get automaticReloadBilling; +/// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementApplePayAutoReloadPaymentRequestCopyWith get copyWith => _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl(this as PaymentElementApplePayAutoReloadPaymentRequest, _$identity); - /// Billing agreement label - @override - String? get billingAgreement; + /// Serializes this PaymentElementApplePayAutoReloadPaymentRequest to a JSON map. + Map toJson(); - /// The date when you can cancel for free - @override - DateTime? get freeCancellationDate; - /// The timezone of the free cancellation date - @override - String? get freeCancellationTimezone; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementApplePayAutoReloadPaymentRequest&&(identical(other.paymentDescription, paymentDescription) || other.paymentDescription == paymentDescription)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.automaticReloadBilling, automaticReloadBilling) || other.automaticReloadBilling == automaticReloadBilling)); +} - /// Billing information of the deffered payment - @override - PaymentElementApplePayDeferredPaymentProperties get deferredBilling; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentDescription,managementUrl,automaticReloadBilling); - /// Create a copy of PaymentElementApplePayDeferredPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementApplePayDeferredPaymentRequestImplCopyWith< - _$PaymentElementApplePayDeferredPaymentRequestImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementApplePayAutoReloadPaymentRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, automaticReloadBilling: $automaticReloadBilling)'; } -PaymentElementApplePayDeferredPaymentProperties - _$PaymentElementApplePayDeferredPaymentPropertiesFromJson( - Map json) { - return _PaymentElementApplePayDeferredPaymentProperties.fromJson(json); + } /// @nodoc -mixin _$PaymentElementApplePayDeferredPaymentProperties { - /// The amount of the payment - double get amount => throw _privateConstructorUsedError; - - /// Description label - String get label => throw _privateConstructorUsedError; +abstract mixin class $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { + factory $PaymentElementApplePayAutoReloadPaymentRequestCopyWith(PaymentElementApplePayAutoReloadPaymentRequest value, $Res Function(PaymentElementApplePayAutoReloadPaymentRequest) _then) = _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl; +@useResult +$Res call({ + String paymentDescription, String managementUrl, PaymentElementApplePayReloadPaymentProperties automaticReloadBilling +}); - /// The date when the payment will be processed - DateTime get deferredPaymentDate => throw _privateConstructorUsedError; - /// Serializes this PaymentElementApplePayDeferredPaymentProperties to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +$PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> get automaticReloadBilling; - /// Create a copy of PaymentElementApplePayDeferredPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementApplePayDeferredPaymentPropertiesCopyWith< - PaymentElementApplePayDeferredPaymentProperties> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { - factory $PaymentElementApplePayDeferredPaymentPropertiesCopyWith( - PaymentElementApplePayDeferredPaymentProperties value, - $Res Function(PaymentElementApplePayDeferredPaymentProperties) then) = - _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl<$Res, - PaymentElementApplePayDeferredPaymentProperties>; - @useResult - $Res call({double amount, String label, DateTime deferredPaymentDate}); -} +class _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl<$Res> + implements $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { + _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl(this._self, this._then); + + final PaymentElementApplePayAutoReloadPaymentRequest _self; + final $Res Function(PaymentElementApplePayAutoReloadPaymentRequest) _then; + +/// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentDescription = null,Object? managementUrl = null,Object? automaticReloadBilling = null,}) { + return _then(_self.copyWith( +paymentDescription: null == paymentDescription ? _self.paymentDescription : paymentDescription // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,automaticReloadBilling: null == automaticReloadBilling ? _self.automaticReloadBilling : automaticReloadBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayReloadPaymentProperties, + )); +} +/// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> get automaticReloadBilling { + + return $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res>(_self.automaticReloadBilling, (value) { + return _then(_self.copyWith(automaticReloadBilling: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentElementApplePayAutoReloadPaymentRequest]. +extension PaymentElementApplePayAutoReloadPaymentRequestPatterns on PaymentElementApplePayAutoReloadPaymentRequest { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementApplePayAutoReloadPaymentRequest value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayAutoReloadPaymentRequest() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementApplePayAutoReloadPaymentRequest value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayAutoReloadPaymentRequest(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementApplePayAutoReloadPaymentRequest value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayAutoReloadPaymentRequest() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String paymentDescription, String managementUrl, PaymentElementApplePayReloadPaymentProperties automaticReloadBilling)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementApplePayAutoReloadPaymentRequest() when $default != null: +return $default(_that.paymentDescription,_that.managementUrl,_that.automaticReloadBilling);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String paymentDescription, String managementUrl, PaymentElementApplePayReloadPaymentProperties automaticReloadBilling) $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayAutoReloadPaymentRequest(): +return $default(_that.paymentDescription,_that.managementUrl,_that.automaticReloadBilling);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String paymentDescription, String managementUrl, PaymentElementApplePayReloadPaymentProperties automaticReloadBilling)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayAutoReloadPaymentRequest() when $default != null: +return $default(_that.paymentDescription,_that.managementUrl,_that.automaticReloadBilling);case _: + return null; -/// @nodoc -class _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl<$Res, - $Val extends PaymentElementApplePayDeferredPaymentProperties> - implements $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { - _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementApplePayDeferredPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? deferredPaymentDate = null, - }) { - return _then(_value.copyWith( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - deferredPaymentDate: null == deferredPaymentDate - ? _value.deferredPaymentDate - : deferredPaymentDate // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); - } } - -/// @nodoc -abstract class _$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWith< - $Res> - implements $PaymentElementApplePayDeferredPaymentPropertiesCopyWith<$Res> { - factory _$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWith( - _$PaymentElementApplePayDeferredPaymentPropertiesImpl value, - $Res Function(_$PaymentElementApplePayDeferredPaymentPropertiesImpl) - then) = - __$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({double amount, String label, DateTime deferredPaymentDate}); } -/// @nodoc -class __$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWithImpl<$Res> - extends _$PaymentElementApplePayDeferredPaymentPropertiesCopyWithImpl<$Res, - _$PaymentElementApplePayDeferredPaymentPropertiesImpl> - implements - _$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWith<$Res> { - __$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWithImpl( - _$PaymentElementApplePayDeferredPaymentPropertiesImpl _value, - $Res Function(_$PaymentElementApplePayDeferredPaymentPropertiesImpl) - _then) - : super(_value, _then); - - /// Create a copy of PaymentElementApplePayDeferredPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? deferredPaymentDate = null, - }) { - return _then(_$PaymentElementApplePayDeferredPaymentPropertiesImpl( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - deferredPaymentDate: null == deferredPaymentDate - ? _value.deferredPaymentDate - : deferredPaymentDate // ignore: cast_nullable_to_non_nullable - as DateTime, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementApplePayDeferredPaymentPropertiesImpl - implements _PaymentElementApplePayDeferredPaymentProperties { - const _$PaymentElementApplePayDeferredPaymentPropertiesImpl( - {required this.amount, - required this.label, - required this.deferredPaymentDate}); - - factory _$PaymentElementApplePayDeferredPaymentPropertiesImpl.fromJson( - Map json) => - _$$PaymentElementApplePayDeferredPaymentPropertiesImplFromJson(json); - - /// The amount of the payment - @override - final double amount; - - /// Description label - @override - final String label; - - /// The date when the payment will be processed - @override - final DateTime deferredPaymentDate; - - @override - String toString() { - return 'PaymentElementApplePayDeferredPaymentProperties(amount: $amount, label: $label, deferredPaymentDate: $deferredPaymentDate)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementApplePayDeferredPaymentPropertiesImpl && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.label, label) || other.label == label) && - (identical(other.deferredPaymentDate, deferredPaymentDate) || - other.deferredPaymentDate == deferredPaymentDate)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, amount, label, deferredPaymentDate); - - /// Create a copy of PaymentElementApplePayDeferredPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWith< - _$PaymentElementApplePayDeferredPaymentPropertiesImpl> - get copyWith => - __$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWithImpl< - _$PaymentElementApplePayDeferredPaymentPropertiesImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementApplePayDeferredPaymentPropertiesImplToJson( - this, - ); - } -} +class _PaymentElementApplePayAutoReloadPaymentRequest implements PaymentElementApplePayAutoReloadPaymentRequest { + const _PaymentElementApplePayAutoReloadPaymentRequest({required this.paymentDescription, required this.managementUrl, required this.automaticReloadBilling}); + factory _PaymentElementApplePayAutoReloadPaymentRequest.fromJson(Map json) => _$PaymentElementApplePayAutoReloadPaymentRequestFromJson(json); -abstract class _PaymentElementApplePayDeferredPaymentProperties - implements PaymentElementApplePayDeferredPaymentProperties { - const factory _PaymentElementApplePayDeferredPaymentProperties( - {required final double amount, - required final String label, - required final DateTime deferredPaymentDate}) = - _$PaymentElementApplePayDeferredPaymentPropertiesImpl; +/// The description of the payment +@override final String paymentDescription; +/// Management url +@override final String managementUrl; +/// Billing information of the deffered payment +@override final PaymentElementApplePayReloadPaymentProperties automaticReloadBilling; - factory _PaymentElementApplePayDeferredPaymentProperties.fromJson( - Map json) = - _$PaymentElementApplePayDeferredPaymentPropertiesImpl.fromJson; +/// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementApplePayAutoReloadPaymentRequestCopyWith<_PaymentElementApplePayAutoReloadPaymentRequest> get copyWith => __$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl<_PaymentElementApplePayAutoReloadPaymentRequest>(this, _$identity); - /// The amount of the payment - @override - double get amount; +@override +Map toJson() { + return _$PaymentElementApplePayAutoReloadPaymentRequestToJson(this, ); +} - /// Description label - @override - String get label; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementApplePayAutoReloadPaymentRequest&&(identical(other.paymentDescription, paymentDescription) || other.paymentDescription == paymentDescription)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.automaticReloadBilling, automaticReloadBilling) || other.automaticReloadBilling == automaticReloadBilling)); +} - /// The date when the payment will be processed - @override - DateTime get deferredPaymentDate; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentDescription,managementUrl,automaticReloadBilling); - /// Create a copy of PaymentElementApplePayDeferredPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementApplePayDeferredPaymentPropertiesImplCopyWith< - _$PaymentElementApplePayDeferredPaymentPropertiesImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentElementApplePayAutoReloadPaymentRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, automaticReloadBilling: $automaticReloadBilling)'; } -PaymentElementApplePayAutoReloadPaymentRequest - _$PaymentElementApplePayAutoReloadPaymentRequestFromJson( - Map json) { - return _PaymentElementApplePayAutoReloadPaymentRequest.fromJson(json); + } /// @nodoc -mixin _$PaymentElementApplePayAutoReloadPaymentRequest { - /// The description of the payment - String get paymentDescription => throw _privateConstructorUsedError; - - /// Management url - String get managementUrl => throw _privateConstructorUsedError; +abstract mixin class _$PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> implements $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { + factory _$PaymentElementApplePayAutoReloadPaymentRequestCopyWith(_PaymentElementApplePayAutoReloadPaymentRequest value, $Res Function(_PaymentElementApplePayAutoReloadPaymentRequest) _then) = __$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl; +@override @useResult +$Res call({ + String paymentDescription, String managementUrl, PaymentElementApplePayReloadPaymentProperties automaticReloadBilling +}); - /// Billing information of the deffered payment - PaymentElementApplePayReloadPaymentProperties get automaticReloadBilling => - throw _privateConstructorUsedError; - /// Serializes this PaymentElementApplePayAutoReloadPaymentRequest to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> get automaticReloadBilling; - /// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementApplePayAutoReloadPaymentRequestCopyWith< - PaymentElementApplePayAutoReloadPaymentRequest> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { - factory $PaymentElementApplePayAutoReloadPaymentRequestCopyWith( - PaymentElementApplePayAutoReloadPaymentRequest value, - $Res Function(PaymentElementApplePayAutoReloadPaymentRequest) then) = - _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl<$Res, - PaymentElementApplePayAutoReloadPaymentRequest>; - @useResult - $Res call( - {String paymentDescription, - String managementUrl, - PaymentElementApplePayReloadPaymentProperties automaticReloadBilling}); - - $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> - get automaticReloadBilling; -} +class __$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl<$Res> + implements _$PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { + __$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl(this._self, this._then); -/// @nodoc -class _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl<$Res, - $Val extends PaymentElementApplePayAutoReloadPaymentRequest> - implements $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { - _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentDescription = null, - Object? managementUrl = null, - Object? automaticReloadBilling = null, - }) { - return _then(_value.copyWith( - paymentDescription: null == paymentDescription - ? _value.paymentDescription - : paymentDescription // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - automaticReloadBilling: null == automaticReloadBilling - ? _value.automaticReloadBilling - : automaticReloadBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayReloadPaymentProperties, - ) as $Val); - } + final _PaymentElementApplePayAutoReloadPaymentRequest _self; + final $Res Function(_PaymentElementApplePayAutoReloadPaymentRequest) _then; - /// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> - get automaticReloadBilling { - return $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res>( - _value.automaticReloadBilling, (value) { - return _then(_value.copyWith(automaticReloadBilling: value) as $Val); - }); - } +/// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentDescription = null,Object? managementUrl = null,Object? automaticReloadBilling = null,}) { + return _then(_PaymentElementApplePayAutoReloadPaymentRequest( +paymentDescription: null == paymentDescription ? _self.paymentDescription : paymentDescription // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,automaticReloadBilling: null == automaticReloadBilling ? _self.automaticReloadBilling : automaticReloadBilling // ignore: cast_nullable_to_non_nullable +as PaymentElementApplePayReloadPaymentProperties, + )); } -/// @nodoc -abstract class _$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWith< - $Res> - implements $PaymentElementApplePayAutoReloadPaymentRequestCopyWith<$Res> { - factory _$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWith( - _$PaymentElementApplePayAutoReloadPaymentRequestImpl value, - $Res Function(_$PaymentElementApplePayAutoReloadPaymentRequestImpl) - then) = - __$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String paymentDescription, - String managementUrl, - PaymentElementApplePayReloadPaymentProperties automaticReloadBilling}); - - @override - $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> - get automaticReloadBilling; +/// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> get automaticReloadBilling { + + return $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res>(_self.automaticReloadBilling, (value) { + return _then(_self.copyWith(automaticReloadBilling: value)); + }); +} } + /// @nodoc -class __$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWithImpl<$Res> - extends _$PaymentElementApplePayAutoReloadPaymentRequestCopyWithImpl<$Res, - _$PaymentElementApplePayAutoReloadPaymentRequestImpl> - implements - _$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWith<$Res> { - __$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWithImpl( - _$PaymentElementApplePayAutoReloadPaymentRequestImpl _value, - $Res Function(_$PaymentElementApplePayAutoReloadPaymentRequestImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentDescription = null, - Object? managementUrl = null, - Object? automaticReloadBilling = null, - }) { - return _then(_$PaymentElementApplePayAutoReloadPaymentRequestImpl( - paymentDescription: null == paymentDescription - ? _value.paymentDescription - : paymentDescription // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - automaticReloadBilling: null == automaticReloadBilling - ? _value.automaticReloadBilling - : automaticReloadBilling // ignore: cast_nullable_to_non_nullable - as PaymentElementApplePayReloadPaymentProperties, - )); - } +mixin _$PaymentElementApplePayReloadPaymentProperties { + +/// The amount of the payment + double get amount;/// Description label + String get label;/// The date when the threshold amount will be reached + DateTime get automaticReloadPaymentThresholdAmount; +/// Create a copy of PaymentElementApplePayReloadPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementApplePayReloadPaymentPropertiesCopyWith get copyWith => _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl(this as PaymentElementApplePayReloadPaymentProperties, _$identity); + + /// Serializes this PaymentElementApplePayReloadPaymentProperties to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementApplePayReloadPaymentProperties&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.automaticReloadPaymentThresholdAmount, automaticReloadPaymentThresholdAmount) || other.automaticReloadPaymentThresholdAmount == automaticReloadPaymentThresholdAmount)); } -/// @nodoc -@JsonSerializable() -class _$PaymentElementApplePayAutoReloadPaymentRequestImpl - implements _PaymentElementApplePayAutoReloadPaymentRequest { - const _$PaymentElementApplePayAutoReloadPaymentRequestImpl( - {required this.paymentDescription, - required this.managementUrl, - required this.automaticReloadBilling}); - - factory _$PaymentElementApplePayAutoReloadPaymentRequestImpl.fromJson( - Map json) => - _$$PaymentElementApplePayAutoReloadPaymentRequestImplFromJson(json); - - /// The description of the payment - @override - final String paymentDescription; - - /// Management url - @override - final String managementUrl; - - /// Billing information of the deffered payment - @override - final PaymentElementApplePayReloadPaymentProperties automaticReloadBilling; - - @override - String toString() { - return 'PaymentElementApplePayAutoReloadPaymentRequest(paymentDescription: $paymentDescription, managementUrl: $managementUrl, automaticReloadBilling: $automaticReloadBilling)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,automaticReloadPaymentThresholdAmount); + +@override +String toString() { + return 'PaymentElementApplePayReloadPaymentProperties(amount: $amount, label: $label, automaticReloadPaymentThresholdAmount: $automaticReloadPaymentThresholdAmount)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementApplePayAutoReloadPaymentRequestImpl && - (identical(other.paymentDescription, paymentDescription) || - other.paymentDescription == paymentDescription) && - (identical(other.managementUrl, managementUrl) || - other.managementUrl == managementUrl) && - (identical(other.automaticReloadBilling, automaticReloadBilling) || - other.automaticReloadBilling == automaticReloadBilling)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, paymentDescription, managementUrl, automaticReloadBilling); - - /// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWith< - _$PaymentElementApplePayAutoReloadPaymentRequestImpl> - get copyWith => - __$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWithImpl< - _$PaymentElementApplePayAutoReloadPaymentRequestImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementApplePayAutoReloadPaymentRequestImplToJson( - this, - ); - } } -abstract class _PaymentElementApplePayAutoReloadPaymentRequest - implements PaymentElementApplePayAutoReloadPaymentRequest { - const factory _PaymentElementApplePayAutoReloadPaymentRequest( - {required final String paymentDescription, - required final String managementUrl, - required final PaymentElementApplePayReloadPaymentProperties - automaticReloadBilling}) = - _$PaymentElementApplePayAutoReloadPaymentRequestImpl; +/// @nodoc +abstract mixin class $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { + factory $PaymentElementApplePayReloadPaymentPropertiesCopyWith(PaymentElementApplePayReloadPaymentProperties value, $Res Function(PaymentElementApplePayReloadPaymentProperties) _then) = _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl; +@useResult +$Res call({ + double amount, String label, DateTime automaticReloadPaymentThresholdAmount +}); - factory _PaymentElementApplePayAutoReloadPaymentRequest.fromJson( - Map json) = - _$PaymentElementApplePayAutoReloadPaymentRequestImpl.fromJson; - /// The description of the payment - @override - String get paymentDescription; - /// Management url - @override - String get managementUrl; - /// Billing information of the deffered payment - @override - PaymentElementApplePayReloadPaymentProperties get automaticReloadBilling; +} +/// @nodoc +class _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl<$Res> + implements $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { + _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl(this._self, this._then); + + final PaymentElementApplePayReloadPaymentProperties _self; + final $Res Function(PaymentElementApplePayReloadPaymentProperties) _then; + +/// Create a copy of PaymentElementApplePayReloadPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? amount = null,Object? label = null,Object? automaticReloadPaymentThresholdAmount = null,}) { + return _then(_self.copyWith( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,automaticReloadPaymentThresholdAmount: null == automaticReloadPaymentThresholdAmount ? _self.automaticReloadPaymentThresholdAmount : automaticReloadPaymentThresholdAmount // ignore: cast_nullable_to_non_nullable +as DateTime, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementApplePayReloadPaymentProperties]. +extension PaymentElementApplePayReloadPaymentPropertiesPatterns on PaymentElementApplePayReloadPaymentProperties { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementApplePayReloadPaymentProperties value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayReloadPaymentProperties() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementApplePayReloadPaymentProperties value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayReloadPaymentProperties(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementApplePayReloadPaymentProperties value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementApplePayReloadPaymentProperties() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double amount, String label, DateTime automaticReloadPaymentThresholdAmount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementApplePayReloadPaymentProperties() when $default != null: +return $default(_that.amount,_that.label,_that.automaticReloadPaymentThresholdAmount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double amount, String label, DateTime automaticReloadPaymentThresholdAmount) $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayReloadPaymentProperties(): +return $default(_that.amount,_that.label,_that.automaticReloadPaymentThresholdAmount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double amount, String label, DateTime automaticReloadPaymentThresholdAmount)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementApplePayReloadPaymentProperties() when $default != null: +return $default(_that.amount,_that.label,_that.automaticReloadPaymentThresholdAmount);case _: + return null; - /// Create a copy of PaymentElementApplePayAutoReloadPaymentRequest - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementApplePayAutoReloadPaymentRequestImplCopyWith< - _$PaymentElementApplePayAutoReloadPaymentRequestImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentElementApplePayReloadPaymentProperties - _$PaymentElementApplePayReloadPaymentPropertiesFromJson( - Map json) { - return _PaymentElementApplePayReloadPaymentProperties.fromJson(json); } /// @nodoc -mixin _$PaymentElementApplePayReloadPaymentProperties { - /// The amount of the payment - double get amount => throw _privateConstructorUsedError; +@JsonSerializable() - /// Description label - String get label => throw _privateConstructorUsedError; +class _PaymentElementApplePayReloadPaymentProperties implements PaymentElementApplePayReloadPaymentProperties { + const _PaymentElementApplePayReloadPaymentProperties({required this.amount, required this.label, required this.automaticReloadPaymentThresholdAmount}); + factory _PaymentElementApplePayReloadPaymentProperties.fromJson(Map json) => _$PaymentElementApplePayReloadPaymentPropertiesFromJson(json); - /// The date when the threshold amount will be reached - DateTime get automaticReloadPaymentThresholdAmount => - throw _privateConstructorUsedError; +/// The amount of the payment +@override final double amount; +/// Description label +@override final String label; +/// The date when the threshold amount will be reached +@override final DateTime automaticReloadPaymentThresholdAmount; - /// Serializes this PaymentElementApplePayReloadPaymentProperties to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of PaymentElementApplePayReloadPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementApplePayReloadPaymentPropertiesCopyWith<_PaymentElementApplePayReloadPaymentProperties> get copyWith => __$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl<_PaymentElementApplePayReloadPaymentProperties>(this, _$identity); - /// Create a copy of PaymentElementApplePayReloadPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementApplePayReloadPaymentPropertiesCopyWith< - PaymentElementApplePayReloadPaymentProperties> - get copyWith => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentElementApplePayReloadPaymentPropertiesToJson(this, ); } -/// @nodoc -abstract class $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { - factory $PaymentElementApplePayReloadPaymentPropertiesCopyWith( - PaymentElementApplePayReloadPaymentProperties value, - $Res Function(PaymentElementApplePayReloadPaymentProperties) then) = - _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl<$Res, - PaymentElementApplePayReloadPaymentProperties>; - @useResult - $Res call( - {double amount, - String label, - DateTime automaticReloadPaymentThresholdAmount}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementApplePayReloadPaymentProperties&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.automaticReloadPaymentThresholdAmount, automaticReloadPaymentThresholdAmount) || other.automaticReloadPaymentThresholdAmount == automaticReloadPaymentThresholdAmount)); } -/// @nodoc -class _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl<$Res, - $Val extends PaymentElementApplePayReloadPaymentProperties> - implements $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { - _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementApplePayReloadPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? automaticReloadPaymentThresholdAmount = null, - }) { - return _then(_value.copyWith( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - automaticReloadPaymentThresholdAmount: null == - automaticReloadPaymentThresholdAmount - ? _value.automaticReloadPaymentThresholdAmount - : automaticReloadPaymentThresholdAmount // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); - } -} +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,automaticReloadPaymentThresholdAmount); -/// @nodoc -abstract class _$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWith< - $Res> - implements $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { - factory _$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWith( - _$PaymentElementApplePayReloadPaymentPropertiesImpl value, - $Res Function(_$PaymentElementApplePayReloadPaymentPropertiesImpl) - then) = - __$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {double amount, - String label, - DateTime automaticReloadPaymentThresholdAmount}); +@override +String toString() { + return 'PaymentElementApplePayReloadPaymentProperties(amount: $amount, label: $label, automaticReloadPaymentThresholdAmount: $automaticReloadPaymentThresholdAmount)'; } -/// @nodoc -class __$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWithImpl<$Res> - extends _$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl<$Res, - _$PaymentElementApplePayReloadPaymentPropertiesImpl> - implements - _$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWith<$Res> { - __$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWithImpl( - _$PaymentElementApplePayReloadPaymentPropertiesImpl _value, - $Res Function(_$PaymentElementApplePayReloadPaymentPropertiesImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementApplePayReloadPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? automaticReloadPaymentThresholdAmount = null, - }) { - return _then(_$PaymentElementApplePayReloadPaymentPropertiesImpl( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - automaticReloadPaymentThresholdAmount: null == - automaticReloadPaymentThresholdAmount - ? _value.automaticReloadPaymentThresholdAmount - : automaticReloadPaymentThresholdAmount // ignore: cast_nullable_to_non_nullable - as DateTime, - )); - } + } /// @nodoc -@JsonSerializable() -class _$PaymentElementApplePayReloadPaymentPropertiesImpl - implements _PaymentElementApplePayReloadPaymentProperties { - const _$PaymentElementApplePayReloadPaymentPropertiesImpl( - {required this.amount, - required this.label, - required this.automaticReloadPaymentThresholdAmount}); - - factory _$PaymentElementApplePayReloadPaymentPropertiesImpl.fromJson( - Map json) => - _$$PaymentElementApplePayReloadPaymentPropertiesImplFromJson(json); - - /// The amount of the payment - @override - final double amount; - - /// Description label - @override - final String label; - - /// The date when the threshold amount will be reached - @override - final DateTime automaticReloadPaymentThresholdAmount; - - @override - String toString() { - return 'PaymentElementApplePayReloadPaymentProperties(amount: $amount, label: $label, automaticReloadPaymentThresholdAmount: $automaticReloadPaymentThresholdAmount)'; - } +abstract mixin class _$PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> implements $PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { + factory _$PaymentElementApplePayReloadPaymentPropertiesCopyWith(_PaymentElementApplePayReloadPaymentProperties value, $Res Function(_PaymentElementApplePayReloadPaymentProperties) _then) = __$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl; +@override @useResult +$Res call({ + double amount, String label, DateTime automaticReloadPaymentThresholdAmount +}); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementApplePayReloadPaymentPropertiesImpl && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.label, label) || other.label == label) && - (identical(other.automaticReloadPaymentThresholdAmount, - automaticReloadPaymentThresholdAmount) || - other.automaticReloadPaymentThresholdAmount == - automaticReloadPaymentThresholdAmount)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, amount, label, automaticReloadPaymentThresholdAmount); - - /// Create a copy of PaymentElementApplePayReloadPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWith< - _$PaymentElementApplePayReloadPaymentPropertiesImpl> - get copyWith => - __$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWithImpl< - _$PaymentElementApplePayReloadPaymentPropertiesImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementApplePayReloadPaymentPropertiesImplToJson( - this, - ); - } -} -abstract class _PaymentElementApplePayReloadPaymentProperties - implements PaymentElementApplePayReloadPaymentProperties { - const factory _PaymentElementApplePayReloadPaymentProperties( - {required final double amount, - required final String label, - required final DateTime automaticReloadPaymentThresholdAmount}) = - _$PaymentElementApplePayReloadPaymentPropertiesImpl; - factory _PaymentElementApplePayReloadPaymentProperties.fromJson( - Map json) = - _$PaymentElementApplePayReloadPaymentPropertiesImpl.fromJson; +} +/// @nodoc +class __$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl<$Res> + implements _$PaymentElementApplePayReloadPaymentPropertiesCopyWith<$Res> { + __$PaymentElementApplePayReloadPaymentPropertiesCopyWithImpl(this._self, this._then); - /// The amount of the payment - @override - double get amount; + final _PaymentElementApplePayReloadPaymentProperties _self; + final $Res Function(_PaymentElementApplePayReloadPaymentProperties) _then; - /// Description label - @override - String get label; +/// Create a copy of PaymentElementApplePayReloadPaymentProperties +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? amount = null,Object? label = null,Object? automaticReloadPaymentThresholdAmount = null,}) { + return _then(_PaymentElementApplePayReloadPaymentProperties( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,automaticReloadPaymentThresholdAmount: null == automaticReloadPaymentThresholdAmount ? _self.automaticReloadPaymentThresholdAmount : automaticReloadPaymentThresholdAmount // ignore: cast_nullable_to_non_nullable +as DateTime, + )); +} - /// The date when the threshold amount will be reached - @override - DateTime get automaticReloadPaymentThresholdAmount; - /// Create a copy of PaymentElementApplePayReloadPaymentProperties - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementApplePayReloadPaymentPropertiesImplCopyWith< - _$PaymentElementApplePayReloadPaymentPropertiesImpl> - get copyWith => throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/payment_element_options.g.dart b/packages/stripe_js/lib/src/api/elements/payment_element_options.g.dart index 2b5f79878..fb4acafb1 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_element_options.g.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_element_options.g.dart @@ -6,431 +6,374 @@ part of 'payment_element_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentElementOptionsImpl _$$PaymentElementOptionsImplFromJson(Map json) => - _$PaymentElementOptionsImpl( +_PaymentElementOptions _$PaymentElementOptionsFromJson(Map json) => + _PaymentElementOptions( layout: json['layout'] == null ? null : PaymentElementLayout.fromJson( - Map.from(json['layout'] as Map)), + Map.from(json['layout'] as Map), + ), defaultValues: json['defaultValues'] == null ? null : PaymentElementDefaultValues.fromJson( - Map.from(json['defaultValues'] as Map)), + Map.from(json['defaultValues'] as Map), + ), business: json['business'] == null ? null : PaymentElementBusiness.fromJson( - Map.from(json['business'] as Map)), + Map.from(json['business'] as Map), + ), paymentMethodOrder: json['paymentMethodOrder'], fields: json['fields'] == null ? null : PaymentElementFields.fromJson( - Map.from(json['fields'] as Map)), + Map.from(json['fields'] as Map), + ), readOnly: json['readOnly'] as bool?, terms: json['terms'] == null ? null : PaymentElementOptionsTerms.fromJson( - Map.from(json['terms'] as Map)), + Map.from(json['terms'] as Map), + ), wallets: json['wallets'] == null ? null : PaymentElementWalletOptions.fromJson( - Map.from(json['wallets'] as Map)), + Map.from(json['wallets'] as Map), + ), applePay: json['applePay'] == null ? null : PaymentElementApplePayOptions.fromJson( - Map.from(json['applePay'] as Map)), + Map.from(json['applePay'] as Map), + ), ); -Map _$$PaymentElementOptionsImplToJson( - _$PaymentElementOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('layout', instance.layout?.toJson()); - writeNotNull('defaultValues', instance.defaultValues?.toJson()); - writeNotNull('business', instance.business?.toJson()); - writeNotNull('paymentMethodOrder', instance.paymentMethodOrder); - writeNotNull('fields', instance.fields?.toJson()); - writeNotNull('readOnly', instance.readOnly); - writeNotNull('terms', instance.terms?.toJson()); - writeNotNull('wallets', instance.wallets?.toJson()); - writeNotNull('applePay', instance.applePay?.toJson()); - return val; -} - -_$PaymentElementLayoutImpl _$$PaymentElementLayoutImplFromJson(Map json) => - _$PaymentElementLayoutImpl( +Map _$PaymentElementOptionsToJson( + _PaymentElementOptions instance, +) => { + 'layout': ?instance.layout?.toJson(), + 'defaultValues': ?instance.defaultValues?.toJson(), + 'business': ?instance.business?.toJson(), + 'paymentMethodOrder': ?instance.paymentMethodOrder, + 'fields': ?instance.fields?.toJson(), + 'readOnly': ?instance.readOnly, + 'terms': ?instance.terms?.toJson(), + 'wallets': ?instance.wallets?.toJson(), + 'applePay': ?instance.applePay?.toJson(), +}; + +_PaymentElementLayout _$PaymentElementLayoutFromJson(Map json) => + _PaymentElementLayout( type: $enumDecode(_$PaymentElementLayoutTypeEnumMap, json['type']), defaultCollapsed: json['defaultCollapsed'] as bool?, radios: json['radios'] as bool?, spacedAccordionItems: json['spacedAccordionItems'] as bool?, - visibleAccordionItemsCount: - (json['visibleAccordionItemsCount'] as num?)?.toInt(), + visibleAccordionItemsCount: (json['visibleAccordionItemsCount'] as num?) + ?.toInt(), ); -Map _$$PaymentElementLayoutImplToJson( - _$PaymentElementLayoutImpl instance) { - final val = { - 'type': _$PaymentElementLayoutTypeEnumMap[instance.type]!, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('defaultCollapsed', instance.defaultCollapsed); - writeNotNull('radios', instance.radios); - writeNotNull('spacedAccordionItems', instance.spacedAccordionItems); - writeNotNull( - 'visibleAccordionItemsCount', instance.visibleAccordionItemsCount); - return val; -} +Map _$PaymentElementLayoutToJson( + _PaymentElementLayout instance, +) => { + 'type': _$PaymentElementLayoutTypeEnumMap[instance.type]!, + 'defaultCollapsed': ?instance.defaultCollapsed, + 'radios': ?instance.radios, + 'spacedAccordionItems': ?instance.spacedAccordionItems, + 'visibleAccordionItemsCount': ?instance.visibleAccordionItemsCount, +}; const _$PaymentElementLayoutTypeEnumMap = { PaymentElementLayoutType.accordion: 'accordion', PaymentElementLayoutType.tabs: 'tabs', }; -_$PaymentElementDefaultValuesImpl _$$PaymentElementDefaultValuesImplFromJson( - Map json) => - _$PaymentElementDefaultValuesImpl( +_PaymentElementDefaultValues _$PaymentElementDefaultValuesFromJson(Map json) => + _PaymentElementDefaultValues( billingDetails: json['billingDetails'] == null ? null : PaymentElementBillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), paymentMethods: json['paymentMethods'] == null ? null : PaymentElementPaymentMethodDefaults.fromJson( - Map.from(json['paymentMethods'] as Map)), + Map.from(json['paymentMethods'] as Map), + ), ); -Map _$$PaymentElementDefaultValuesImplToJson( - _$PaymentElementDefaultValuesImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('paymentMethods', instance.paymentMethods?.toJson()); - return val; -} - -_$PaymentElementPaymentMethodDefaultsImpl - _$$PaymentElementPaymentMethodDefaultsImplFromJson(Map json) => - _$PaymentElementPaymentMethodDefaultsImpl( - ideal: json['ideal'] == null - ? null - : PaymentElementIdealDefaults.fromJson( - Map.from(json['ideal'] as Map)), - card: json['card'] == null - ? null - : PaymentElementCardDefaults.fromJson( - Map.from(json['card'] as Map)), - ); - -Map _$$PaymentElementPaymentMethodDefaultsImplToJson( - _$PaymentElementPaymentMethodDefaultsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('ideal', instance.ideal?.toJson()); - writeNotNull('card', instance.card?.toJson()); - return val; -} - -_$PaymentElementWalletOptionsImpl _$$PaymentElementWalletOptionsImplFromJson( - Map json) => - _$PaymentElementWalletOptionsImpl( - applePay: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['applePay']), - googlePay: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['googlePay']), +Map _$PaymentElementDefaultValuesToJson( + _PaymentElementDefaultValues instance, +) => { + 'billingDetails': ?instance.billingDetails?.toJson(), + 'paymentMethods': ?instance.paymentMethods?.toJson(), +}; + +_PaymentElementPaymentMethodDefaults +_$PaymentElementPaymentMethodDefaultsFromJson(Map json) => + _PaymentElementPaymentMethodDefaults( + ideal: json['ideal'] == null + ? null + : PaymentElementIdealDefaults.fromJson( + Map.from(json['ideal'] as Map), + ), + card: json['card'] == null + ? null + : PaymentElementCardDefaults.fromJson( + Map.from(json['card'] as Map), + ), ); -Map _$$PaymentElementWalletOptionsImplToJson( - _$PaymentElementWalletOptionsImpl instance) { - final val = {}; +Map _$PaymentElementPaymentMethodDefaultsToJson( + _PaymentElementPaymentMethodDefaults instance, +) => { + 'ideal': ?instance.ideal?.toJson(), + 'card': ?instance.card?.toJson(), +}; - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +_PaymentElementWalletOptions _$PaymentElementWalletOptionsFromJson(Map json) => + _PaymentElementWalletOptions( + applePay: $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['applePay'], + ), + googlePay: $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['googlePay'], + ), + ); - writeNotNull( - 'applePay', _$PaymentElementFieldRequiredEnumMap[instance.applePay]); - writeNotNull( - 'googlePay', _$PaymentElementFieldRequiredEnumMap[instance.googlePay]); - return val; -} +Map _$PaymentElementWalletOptionsToJson( + _PaymentElementWalletOptions instance, +) => { + 'applePay': ?_$PaymentElementFieldRequiredEnumMap[instance.applePay], + 'googlePay': ?_$PaymentElementFieldRequiredEnumMap[instance.googlePay], +}; const _$PaymentElementFieldRequiredEnumMap = { PaymentElementFieldRequired.never: 'never', PaymentElementFieldRequired.auto: 'auto', }; -_$PaymentElementIdealDefaultsImpl _$$PaymentElementIdealDefaultsImplFromJson( - Map json) => - _$PaymentElementIdealDefaultsImpl( - bank: json['bank'] as String?, - ); +_PaymentElementIdealDefaults _$PaymentElementIdealDefaultsFromJson(Map json) => + _PaymentElementIdealDefaults(bank: json['bank'] as String?); -Map _$$PaymentElementIdealDefaultsImplToJson( - _$PaymentElementIdealDefaultsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('bank', instance.bank); - return val; -} - -_$PaymentElementCardDefaultsImpl _$$PaymentElementCardDefaultsImplFromJson( - Map json) => - _$PaymentElementCardDefaultsImpl( - network: - (json['network'] as List?)?.map((e) => e as String).toList(), - ); +Map _$PaymentElementIdealDefaultsToJson( + _PaymentElementIdealDefaults instance, +) => {'bank': ?instance.bank}; -Map _$$PaymentElementCardDefaultsImplToJson( - _$PaymentElementCardDefaultsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('network', instance.network); - return val; -} - -_$PaymentElementBillingDetailsImpl _$$PaymentElementBillingDetailsImplFromJson( - Map json) => - _$PaymentElementBillingDetailsImpl( - name: json['name'] as String?, - email: json['email'] as String?, - phone: json['phone'] as String?, - address: json['address'] == null - ? null - : PaymentElementBillingDetailsAddress.fromJson( - Map.from(json['address'] as Map)), +_PaymentElementCardDefaults _$PaymentElementCardDefaultsFromJson(Map json) => + _PaymentElementCardDefaults( + network: (json['network'] as List?) + ?.map((e) => e as String) + .toList(), ); -Map _$$PaymentElementBillingDetailsImplToJson( - _$PaymentElementBillingDetailsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('name', instance.name); - writeNotNull('email', instance.email); - writeNotNull('phone', instance.phone); - writeNotNull('address', instance.address?.toJson()); - return val; -} - -_$PaymentElementBillingDetailsAddressImpl - _$$PaymentElementBillingDetailsAddressImplFromJson(Map json) => - _$PaymentElementBillingDetailsAddressImpl( - line1: json['line1'] as String?, - line2: json['line2'] as String?, - city: json['city'] as String?, - state: json['state'] as String?, - country: json['country'] as String?, - postalCode: json['postal_code'] as String?, - ); - -Map _$$PaymentElementBillingDetailsAddressImplToJson( - _$PaymentElementBillingDetailsAddressImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('line1', instance.line1); - writeNotNull('line2', instance.line2); - writeNotNull('city', instance.city); - writeNotNull('state', instance.state); - writeNotNull('country', instance.country); - writeNotNull('postal_code', instance.postalCode); - return val; -} - -_$PaymentElementBusinessImpl _$$PaymentElementBusinessImplFromJson(Map json) => - _$PaymentElementBusinessImpl( - name: json['name'] as String?, +Map _$PaymentElementCardDefaultsToJson( + _PaymentElementCardDefaults instance, +) => {'network': ?instance.network}; + +_PaymentElementBillingDetails _$PaymentElementBillingDetailsFromJson( + Map json, +) => _PaymentElementBillingDetails( + name: json['name'] as String?, + email: json['email'] as String?, + phone: json['phone'] as String?, + address: json['address'] == null + ? null + : PaymentElementBillingDetailsAddress.fromJson( + Map.from(json['address'] as Map), + ), +); + +Map _$PaymentElementBillingDetailsToJson( + _PaymentElementBillingDetails instance, +) => { + 'name': ?instance.name, + 'email': ?instance.email, + 'phone': ?instance.phone, + 'address': ?instance.address?.toJson(), +}; + +_PaymentElementBillingDetailsAddress +_$PaymentElementBillingDetailsAddressFromJson(Map json) => + _PaymentElementBillingDetailsAddress( + line1: json['line1'] as String?, + line2: json['line2'] as String?, + city: json['city'] as String?, + state: json['state'] as String?, + country: json['country'] as String?, + postalCode: json['postal_code'] as String?, ); -Map _$$PaymentElementBusinessImplToJson( - _$PaymentElementBusinessImpl instance) { - final val = {}; +Map _$PaymentElementBillingDetailsAddressToJson( + _PaymentElementBillingDetailsAddress instance, +) => { + 'line1': ?instance.line1, + 'line2': ?instance.line2, + 'city': ?instance.city, + 'state': ?instance.state, + 'country': ?instance.country, + 'postal_code': ?instance.postalCode, +}; - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +_PaymentElementBusiness _$PaymentElementBusinessFromJson(Map json) => + _PaymentElementBusiness(name: json['name'] as String?); - writeNotNull('name', instance.name); - return val; -} +Map _$PaymentElementBusinessToJson( + _PaymentElementBusiness instance, +) => {'name': ?instance.name}; -_$PaymentElementFieldsImpl _$$PaymentElementFieldsImplFromJson(Map json) => - _$PaymentElementFieldsImpl( +_PaymentElementFields _$PaymentElementFieldsFromJson(Map json) => + _PaymentElementFields( billingDetails: json['billingDetails'] == null ? BillingDetailsFields.auto : BillingDetailsFields.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), ); -Map _$$PaymentElementFieldsImplToJson( - _$PaymentElementFieldsImpl instance) => - { - 'billingDetails': instance.billingDetails.toJson(), - }; - -_$BillingDetailsFieldsImpl _$$BillingDetailsFieldsImplFromJson(Map json) => - _$BillingDetailsFieldsImpl( - name: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['name']) ?? +Map _$PaymentElementFieldsToJson( + _PaymentElementFields instance, +) => {'billingDetails': instance.billingDetails.toJson()}; + +_BillingDetailsFields _$BillingDetailsFieldsFromJson(Map json) => + _BillingDetailsFields( + name: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['name'], + ) ?? PaymentElementFieldRequired.auto, - email: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['email']) ?? + email: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['email'], + ) ?? PaymentElementFieldRequired.auto, - phone: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['phone']) ?? + phone: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['phone'], + ) ?? PaymentElementFieldRequired.auto, address: json['address'] == null ? PaymentElementAddressFields.auto : PaymentElementAddressFields.fromJson( - Map.from(json['address'] as Map)), + Map.from(json['address'] as Map), + ), ); -Map _$$BillingDetailsFieldsImplToJson( - _$BillingDetailsFieldsImpl instance) => - { - 'name': _$PaymentElementFieldRequiredEnumMap[instance.name]!, - 'email': _$PaymentElementFieldRequiredEnumMap[instance.email]!, - 'phone': _$PaymentElementFieldRequiredEnumMap[instance.phone]!, - 'address': instance.address.toJson(), - }; - -_$PaymentElementAddressFieldsImpl _$$PaymentElementAddressFieldsImplFromJson( - Map json) => - _$PaymentElementAddressFieldsImpl( - line1: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['line1']) ?? +Map _$BillingDetailsFieldsToJson( + _BillingDetailsFields instance, +) => { + 'name': _$PaymentElementFieldRequiredEnumMap[instance.name]!, + 'email': _$PaymentElementFieldRequiredEnumMap[instance.email]!, + 'phone': _$PaymentElementFieldRequiredEnumMap[instance.phone]!, + 'address': instance.address.toJson(), +}; + +_PaymentElementAddressFields _$PaymentElementAddressFieldsFromJson(Map json) => + _PaymentElementAddressFields( + line1: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['line1'], + ) ?? PaymentElementFieldRequired.auto, - line2: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['line2']) ?? + line2: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['line2'], + ) ?? PaymentElementFieldRequired.auto, - city: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['city']) ?? + city: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['city'], + ) ?? PaymentElementFieldRequired.auto, - state: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['state']) ?? + state: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['state'], + ) ?? PaymentElementFieldRequired.auto, - country: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['country']) ?? + country: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['country'], + ) ?? PaymentElementFieldRequired.auto, - postalCode: $enumDecodeNullable( - _$PaymentElementFieldRequiredEnumMap, json['postalCode']) ?? + postalCode: + $enumDecodeNullable( + _$PaymentElementFieldRequiredEnumMap, + json['postalCode'], + ) ?? PaymentElementFieldRequired.auto, ); -Map _$$PaymentElementAddressFieldsImplToJson( - _$PaymentElementAddressFieldsImpl instance) => - { - 'line1': _$PaymentElementFieldRequiredEnumMap[instance.line1]!, - 'line2': _$PaymentElementFieldRequiredEnumMap[instance.line2]!, - 'city': _$PaymentElementFieldRequiredEnumMap[instance.city]!, - 'state': _$PaymentElementFieldRequiredEnumMap[instance.state]!, - 'country': _$PaymentElementFieldRequiredEnumMap[instance.country]!, - 'postalCode': _$PaymentElementFieldRequiredEnumMap[instance.postalCode]!, - }; - -_$PaymentElementOptionsTermsImpl _$$PaymentElementOptionsTermsImplFromJson( - Map json) => - _$PaymentElementOptionsTermsImpl( - applePay: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['applePay']), - auBecsDebit: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['auBecsDebit']), - bancontact: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['bancontact']), - card: $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['card']), - cashApp: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['cashApp']), - googlePay: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['googlePay']), - ideal: - $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['ideal']), - payPal: - $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['payPal']), - sepaDebit: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['sepaDebit']), - sofort: - $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['sofort']), - usBankAccount: $enumDecodeNullable( - _$PaymentElementShowTermsEnumMap, json['usBankAccount']), - ); +Map _$PaymentElementAddressFieldsToJson( + _PaymentElementAddressFields instance, +) => { + 'line1': _$PaymentElementFieldRequiredEnumMap[instance.line1]!, + 'line2': _$PaymentElementFieldRequiredEnumMap[instance.line2]!, + 'city': _$PaymentElementFieldRequiredEnumMap[instance.city]!, + 'state': _$PaymentElementFieldRequiredEnumMap[instance.state]!, + 'country': _$PaymentElementFieldRequiredEnumMap[instance.country]!, + 'postalCode': _$PaymentElementFieldRequiredEnumMap[instance.postalCode]!, +}; -Map _$$PaymentElementOptionsTermsImplToJson( - _$PaymentElementOptionsTermsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('applePay', _$PaymentElementShowTermsEnumMap[instance.applePay]); - writeNotNull( - 'auBecsDebit', _$PaymentElementShowTermsEnumMap[instance.auBecsDebit]); - writeNotNull( - 'bancontact', _$PaymentElementShowTermsEnumMap[instance.bancontact]); - writeNotNull('card', _$PaymentElementShowTermsEnumMap[instance.card]); - writeNotNull('cashApp', _$PaymentElementShowTermsEnumMap[instance.cashApp]); - writeNotNull( - 'googlePay', _$PaymentElementShowTermsEnumMap[instance.googlePay]); - writeNotNull('ideal', _$PaymentElementShowTermsEnumMap[instance.ideal]); - writeNotNull('payPal', _$PaymentElementShowTermsEnumMap[instance.payPal]); - writeNotNull( - 'sepaDebit', _$PaymentElementShowTermsEnumMap[instance.sepaDebit]); - writeNotNull('sofort', _$PaymentElementShowTermsEnumMap[instance.sofort]); - writeNotNull('usBankAccount', - _$PaymentElementShowTermsEnumMap[instance.usBankAccount]); - return val; -} +_PaymentElementOptionsTerms _$PaymentElementOptionsTermsFromJson( + Map json, +) => _PaymentElementOptionsTerms( + applePay: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['applePay'], + ), + auBecsDebit: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['auBecsDebit'], + ), + bancontact: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['bancontact'], + ), + card: $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['card']), + cashApp: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['cashApp'], + ), + googlePay: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['googlePay'], + ), + ideal: $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['ideal']), + payPal: $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['payPal']), + sepaDebit: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['sepaDebit'], + ), + sofort: $enumDecodeNullable(_$PaymentElementShowTermsEnumMap, json['sofort']), + usBankAccount: $enumDecodeNullable( + _$PaymentElementShowTermsEnumMap, + json['usBankAccount'], + ), +); + +Map _$PaymentElementOptionsTermsToJson( + _PaymentElementOptionsTerms instance, +) => { + 'applePay': ?_$PaymentElementShowTermsEnumMap[instance.applePay], + 'auBecsDebit': ?_$PaymentElementShowTermsEnumMap[instance.auBecsDebit], + 'bancontact': ?_$PaymentElementShowTermsEnumMap[instance.bancontact], + 'card': ?_$PaymentElementShowTermsEnumMap[instance.card], + 'cashApp': ?_$PaymentElementShowTermsEnumMap[instance.cashApp], + 'googlePay': ?_$PaymentElementShowTermsEnumMap[instance.googlePay], + 'ideal': ?_$PaymentElementShowTermsEnumMap[instance.ideal], + 'payPal': ?_$PaymentElementShowTermsEnumMap[instance.payPal], + 'sepaDebit': ?_$PaymentElementShowTermsEnumMap[instance.sepaDebit], + 'sofort': ?_$PaymentElementShowTermsEnumMap[instance.sofort], + 'usBankAccount': ?_$PaymentElementShowTermsEnumMap[instance.usBankAccount], +}; const _$PaymentElementShowTermsEnumMap = { PaymentElementShowTerms.never: 'never', @@ -438,122 +381,96 @@ const _$PaymentElementShowTermsEnumMap = { PaymentElementShowTerms.always: 'always', }; -_$PaymentElementApplePayOptionsImpl - _$$PaymentElementApplePayOptionsImplFromJson(Map json) => - _$PaymentElementApplePayOptionsImpl( - recurringPaymentRequest: json['recurringPaymentRequest'] == null - ? null - : PaymentElementAppleRecurringRequest.fromJson( - Map.from( - json['recurringPaymentRequest'] as Map)), - deferredPaymentRequest: json['deferredPaymentRequest'] == null - ? null - : PaymentElementApplePayDeferredPaymentRequest.fromJson( - Map.from( - json['deferredPaymentRequest'] as Map)), - automaticReloadPaymentRequest: - json['automaticReloadPaymentRequest'] == null - ? null - : PaymentElementApplePayAutoReloadPaymentRequest.fromJson( - Map.from( - json['automaticReloadPaymentRequest'] as Map)), - ); - -Map _$$PaymentElementApplePayOptionsImplToJson( - _$PaymentElementApplePayOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'recurringPaymentRequest', instance.recurringPaymentRequest?.toJson()); - writeNotNull( - 'deferredPaymentRequest', instance.deferredPaymentRequest?.toJson()); - writeNotNull('automaticReloadPaymentRequest', - instance.automaticReloadPaymentRequest?.toJson()); - return val; -} - -_$PaymentElementAppleRecurringRequestImpl - _$$PaymentElementAppleRecurringRequestImplFromJson(Map json) => - _$PaymentElementAppleRecurringRequestImpl( - paymentDescription: json['paymentDescription'] as String, - managementUrl: json['managementUrl'] as String, - trialBilling: json['trialBilling'] == null - ? null - : PaymentElementRecurringPaymentProperties.fromJson( - Map.from(json['trialBilling'] as Map)), - regularBilling: json['regularBilling'] == null - ? null - : PaymentElementRecurringPaymentProperties.fromJson( - Map.from(json['regularBilling'] as Map)), - ); - -Map _$$PaymentElementAppleRecurringRequestImplToJson( - _$PaymentElementAppleRecurringRequestImpl instance) { - final val = { - 'paymentDescription': instance.paymentDescription, - 'managementUrl': instance.managementUrl, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('trialBilling', instance.trialBilling?.toJson()); - writeNotNull('regularBilling', instance.regularBilling?.toJson()); - return val; -} - -_$PaymentElementRecurringPaymentPropertiesImpl - _$$PaymentElementRecurringPaymentPropertiesImplFromJson(Map json) => - _$PaymentElementRecurringPaymentPropertiesImpl( - amount: (json['amount'] as num).toDouble(), - label: json['label'] as String, - recurringPaymentStartDate: json['recurringPaymentStartDate'] == null - ? null - : DateTime.parse(json['recurringPaymentStartDate'] as String), - recurringPaymentEndDate: json['recurringPaymentEndDate'] == null - ? null - : DateTime.parse(json['recurringPaymentEndDate'] as String), - recurringPaymentIntervalUnit: $enumDecodeNullable( - _$ApplePayRecurringPaymentTimeInterValEnumMap, - json['recurringPaymentIntervalUnit']), - recurringPaymentIntervalCount: - (json['recurringPaymentIntervalCount'] as num?)?.toInt(), - ); - -Map _$$PaymentElementRecurringPaymentPropertiesImplToJson( - _$PaymentElementRecurringPaymentPropertiesImpl instance) { - final val = { - 'amount': instance.amount, - 'label': instance.label, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('recurringPaymentStartDate', - instance.recurringPaymentStartDate?.toIso8601String()); - writeNotNull('recurringPaymentEndDate', - instance.recurringPaymentEndDate?.toIso8601String()); - writeNotNull( - 'recurringPaymentIntervalUnit', - _$ApplePayRecurringPaymentTimeInterValEnumMap[ - instance.recurringPaymentIntervalUnit]); - writeNotNull( - 'recurringPaymentIntervalCount', instance.recurringPaymentIntervalCount); - return val; -} +_PaymentElementApplePayOptions _$PaymentElementApplePayOptionsFromJson( + Map json, +) => _PaymentElementApplePayOptions( + recurringPaymentRequest: json['recurringPaymentRequest'] == null + ? null + : PaymentElementAppleRecurringRequest.fromJson( + Map.from(json['recurringPaymentRequest'] as Map), + ), + deferredPaymentRequest: json['deferredPaymentRequest'] == null + ? null + : PaymentElementApplePayDeferredPaymentRequest.fromJson( + Map.from(json['deferredPaymentRequest'] as Map), + ), + automaticReloadPaymentRequest: json['automaticReloadPaymentRequest'] == null + ? null + : PaymentElementApplePayAutoReloadPaymentRequest.fromJson( + Map.from( + json['automaticReloadPaymentRequest'] as Map, + ), + ), +); + +Map _$PaymentElementApplePayOptionsToJson( + _PaymentElementApplePayOptions instance, +) => { + 'recurringPaymentRequest': ?instance.recurringPaymentRequest?.toJson(), + 'deferredPaymentRequest': ?instance.deferredPaymentRequest?.toJson(), + 'automaticReloadPaymentRequest': ?instance.automaticReloadPaymentRequest + ?.toJson(), +}; + +_PaymentElementAppleRecurringRequest +_$PaymentElementAppleRecurringRequestFromJson(Map json) => + _PaymentElementAppleRecurringRequest( + paymentDescription: json['paymentDescription'] as String, + managementUrl: json['managementUrl'] as String, + trialBilling: json['trialBilling'] == null + ? null + : PaymentElementRecurringPaymentProperties.fromJson( + Map.from(json['trialBilling'] as Map), + ), + regularBilling: json['regularBilling'] == null + ? null + : PaymentElementRecurringPaymentProperties.fromJson( + Map.from(json['regularBilling'] as Map), + ), + ); + +Map _$PaymentElementAppleRecurringRequestToJson( + _PaymentElementAppleRecurringRequest instance, +) => { + 'paymentDescription': instance.paymentDescription, + 'managementUrl': instance.managementUrl, + 'trialBilling': ?instance.trialBilling?.toJson(), + 'regularBilling': ?instance.regularBilling?.toJson(), +}; + +_PaymentElementRecurringPaymentProperties +_$PaymentElementRecurringPaymentPropertiesFromJson(Map json) => + _PaymentElementRecurringPaymentProperties( + amount: (json['amount'] as num).toDouble(), + label: json['label'] as String, + recurringPaymentStartDate: json['recurringPaymentStartDate'] == null + ? null + : DateTime.parse(json['recurringPaymentStartDate'] as String), + recurringPaymentEndDate: json['recurringPaymentEndDate'] == null + ? null + : DateTime.parse(json['recurringPaymentEndDate'] as String), + recurringPaymentIntervalUnit: $enumDecodeNullable( + _$ApplePayRecurringPaymentTimeInterValEnumMap, + json['recurringPaymentIntervalUnit'], + ), + recurringPaymentIntervalCount: + (json['recurringPaymentIntervalCount'] as num?)?.toInt(), + ); + +Map _$PaymentElementRecurringPaymentPropertiesToJson( + _PaymentElementRecurringPaymentProperties instance, +) => { + 'amount': instance.amount, + 'label': instance.label, + 'recurringPaymentStartDate': ?instance.recurringPaymentStartDate + ?.toIso8601String(), + 'recurringPaymentEndDate': ?instance.recurringPaymentEndDate + ?.toIso8601String(), + 'recurringPaymentIntervalUnit': + ?_$ApplePayRecurringPaymentTimeInterValEnumMap[instance + .recurringPaymentIntervalUnit], + 'recurringPaymentIntervalCount': ?instance.recurringPaymentIntervalCount, +}; const _$ApplePayRecurringPaymentTimeInterValEnumMap = { ApplePayRecurringPaymentTimeInterVal.year: 'year', @@ -563,94 +480,85 @@ const _$ApplePayRecurringPaymentTimeInterValEnumMap = { ApplePayRecurringPaymentTimeInterVal.minute: 'minute', }; -_$PaymentElementApplePayDeferredPaymentRequestImpl - _$$PaymentElementApplePayDeferredPaymentRequestImplFromJson(Map json) => - _$PaymentElementApplePayDeferredPaymentRequestImpl( - paymentDescription: json['paymentDescription'] as String, - managementUrl: json['managementUrl'] as String, - billingAgreement: json['billingAgreement'] as String?, - freeCancellationDate: json['freeCancellationDate'] == null - ? null - : DateTime.parse(json['freeCancellationDate'] as String), - freeCancellationTimezone: json['freeCancellationTimezone'] as String?, - deferredBilling: - PaymentElementApplePayDeferredPaymentProperties.fromJson( - Map.from(json['deferredBilling'] as Map)), - ); - -Map _$$PaymentElementApplePayDeferredPaymentRequestImplToJson( - _$PaymentElementApplePayDeferredPaymentRequestImpl instance) { - final val = { - 'paymentDescription': instance.paymentDescription, - 'managementUrl': instance.managementUrl, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingAgreement', instance.billingAgreement); - writeNotNull( - 'freeCancellationDate', instance.freeCancellationDate?.toIso8601String()); - writeNotNull('freeCancellationTimezone', instance.freeCancellationTimezone); - val['deferredBilling'] = instance.deferredBilling.toJson(); - return val; -} - -_$PaymentElementApplePayDeferredPaymentPropertiesImpl - _$$PaymentElementApplePayDeferredPaymentPropertiesImplFromJson(Map json) => - _$PaymentElementApplePayDeferredPaymentPropertiesImpl( - amount: (json['amount'] as num).toDouble(), - label: json['label'] as String, - deferredPaymentDate: - DateTime.parse(json['deferredPaymentDate'] as String), - ); - -Map - _$$PaymentElementApplePayDeferredPaymentPropertiesImplToJson( - _$PaymentElementApplePayDeferredPaymentPropertiesImpl instance) => - { - 'amount': instance.amount, - 'label': instance.label, - 'deferredPaymentDate': instance.deferredPaymentDate.toIso8601String(), - }; - -_$PaymentElementApplePayAutoReloadPaymentRequestImpl - _$$PaymentElementApplePayAutoReloadPaymentRequestImplFromJson(Map json) => - _$PaymentElementApplePayAutoReloadPaymentRequestImpl( - paymentDescription: json['paymentDescription'] as String, - managementUrl: json['managementUrl'] as String, - automaticReloadBilling: - PaymentElementApplePayReloadPaymentProperties.fromJson( - Map.from( - json['automaticReloadBilling'] as Map)), - ); - -Map - _$$PaymentElementApplePayAutoReloadPaymentRequestImplToJson( - _$PaymentElementApplePayAutoReloadPaymentRequestImpl instance) => - { - 'paymentDescription': instance.paymentDescription, - 'managementUrl': instance.managementUrl, - 'automaticReloadBilling': instance.automaticReloadBilling.toJson(), - }; - -_$PaymentElementApplePayReloadPaymentPropertiesImpl - _$$PaymentElementApplePayReloadPaymentPropertiesImplFromJson(Map json) => - _$PaymentElementApplePayReloadPaymentPropertiesImpl( - amount: (json['amount'] as num).toDouble(), - label: json['label'] as String, - automaticReloadPaymentThresholdAmount: DateTime.parse( - json['automaticReloadPaymentThresholdAmount'] as String), - ); - -Map _$$PaymentElementApplePayReloadPaymentPropertiesImplToJson( - _$PaymentElementApplePayReloadPaymentPropertiesImpl instance) => - { - 'amount': instance.amount, - 'label': instance.label, - 'automaticReloadPaymentThresholdAmount': - instance.automaticReloadPaymentThresholdAmount.toIso8601String(), - }; +_PaymentElementApplePayDeferredPaymentRequest +_$PaymentElementApplePayDeferredPaymentRequestFromJson(Map json) => + _PaymentElementApplePayDeferredPaymentRequest( + paymentDescription: json['paymentDescription'] as String, + managementUrl: json['managementUrl'] as String, + billingAgreement: json['billingAgreement'] as String?, + freeCancellationDate: json['freeCancellationDate'] == null + ? null + : DateTime.parse(json['freeCancellationDate'] as String), + freeCancellationTimezone: json['freeCancellationTimezone'] as String?, + deferredBilling: PaymentElementApplePayDeferredPaymentProperties.fromJson( + Map.from(json['deferredBilling'] as Map), + ), + ); + +Map _$PaymentElementApplePayDeferredPaymentRequestToJson( + _PaymentElementApplePayDeferredPaymentRequest instance, +) => { + 'paymentDescription': instance.paymentDescription, + 'managementUrl': instance.managementUrl, + 'billingAgreement': ?instance.billingAgreement, + 'freeCancellationDate': ?instance.freeCancellationDate?.toIso8601String(), + 'freeCancellationTimezone': ?instance.freeCancellationTimezone, + 'deferredBilling': instance.deferredBilling.toJson(), +}; + +_PaymentElementApplePayDeferredPaymentProperties +_$PaymentElementApplePayDeferredPaymentPropertiesFromJson(Map json) => + _PaymentElementApplePayDeferredPaymentProperties( + amount: (json['amount'] as num).toDouble(), + label: json['label'] as String, + deferredPaymentDate: DateTime.parse( + json['deferredPaymentDate'] as String, + ), + ); + +Map _$PaymentElementApplePayDeferredPaymentPropertiesToJson( + _PaymentElementApplePayDeferredPaymentProperties instance, +) => { + 'amount': instance.amount, + 'label': instance.label, + 'deferredPaymentDate': instance.deferredPaymentDate.toIso8601String(), +}; + +_PaymentElementApplePayAutoReloadPaymentRequest +_$PaymentElementApplePayAutoReloadPaymentRequestFromJson(Map json) => + _PaymentElementApplePayAutoReloadPaymentRequest( + paymentDescription: json['paymentDescription'] as String, + managementUrl: json['managementUrl'] as String, + automaticReloadBilling: + PaymentElementApplePayReloadPaymentProperties.fromJson( + Map.from(json['automaticReloadBilling'] as Map), + ), + ); + +Map _$PaymentElementApplePayAutoReloadPaymentRequestToJson( + _PaymentElementApplePayAutoReloadPaymentRequest instance, +) => { + 'paymentDescription': instance.paymentDescription, + 'managementUrl': instance.managementUrl, + 'automaticReloadBilling': instance.automaticReloadBilling.toJson(), +}; + +_PaymentElementApplePayReloadPaymentProperties +_$PaymentElementApplePayReloadPaymentPropertiesFromJson(Map json) => + _PaymentElementApplePayReloadPaymentProperties( + amount: (json['amount'] as num).toDouble(), + label: json['label'] as String, + automaticReloadPaymentThresholdAmount: DateTime.parse( + json['automaticReloadPaymentThresholdAmount'] as String, + ), + ); + +Map _$PaymentElementApplePayReloadPaymentPropertiesToJson( + _PaymentElementApplePayReloadPaymentProperties instance, +) => { + 'amount': instance.amount, + 'label': instance.label, + 'automaticReloadPaymentThresholdAmount': instance + .automaticReloadPaymentThresholdAmount + .toIso8601String(), +}; diff --git a/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.dart b/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.dart index 334748b06..78598c0f2 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.dart @@ -4,7 +4,8 @@ part 'payment_intent_shipping_information.freezed.dart'; part 'payment_intent_shipping_information.g.dart'; @freezed -class PaymentElementShippingDetails with _$PaymentElementShippingDetails { +abstract class PaymentElementShippingDetails + with _$PaymentElementShippingDetails { const factory PaymentElementShippingDetails({ /// The Elements instance that was used to create the Payment Element. // @ElementsConverter() required Elements elements, diff --git a/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.freezed.dart b/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.freezed.dart index 6a607bb06..ddb9c6194 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.freezed.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,183 +9,277 @@ part of 'payment_intent_shipping_information.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentElementShippingDetails _$PaymentElementShippingDetailsFromJson( - Map json) { - return _PaymentElementShippingDetails.fromJson(json); -} - /// @nodoc mixin _$PaymentElementShippingDetails { - /// The Elements instance that was used to create the Payment Element. + +/// The Elements instance that was used to create the Payment Element. // @ElementsConverter() required Elements elements, - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - String? get trackingNumber => throw _privateConstructorUsedError; +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. + String? get trackingNumber; +/// Create a copy of PaymentElementShippingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentElementShippingDetailsCopyWith get copyWith => _$PaymentElementShippingDetailsCopyWithImpl(this as PaymentElementShippingDetails, _$identity); /// Serializes this PaymentElementShippingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentElementShippingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentElementShippingDetailsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentElementShippingDetails&&(identical(other.trackingNumber, trackingNumber) || other.trackingNumber == trackingNumber)); } -/// @nodoc -abstract class $PaymentElementShippingDetailsCopyWith<$Res> { - factory $PaymentElementShippingDetailsCopyWith( - PaymentElementShippingDetails value, - $Res Function(PaymentElementShippingDetails) then) = - _$PaymentElementShippingDetailsCopyWithImpl<$Res, - PaymentElementShippingDetails>; - @useResult - $Res call({String? trackingNumber}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,trackingNumber); + +@override +String toString() { + return 'PaymentElementShippingDetails(trackingNumber: $trackingNumber)'; } -/// @nodoc -class _$PaymentElementShippingDetailsCopyWithImpl<$Res, - $Val extends PaymentElementShippingDetails> - implements $PaymentElementShippingDetailsCopyWith<$Res> { - _$PaymentElementShippingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentElementShippingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? trackingNumber = freezed, - }) { - return _then(_value.copyWith( - trackingNumber: freezed == trackingNumber - ? _value.trackingNumber - : trackingNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$PaymentElementShippingDetailsImplCopyWith<$Res> +abstract mixin class $PaymentElementShippingDetailsCopyWith<$Res> { + factory $PaymentElementShippingDetailsCopyWith(PaymentElementShippingDetails value, $Res Function(PaymentElementShippingDetails) _then) = _$PaymentElementShippingDetailsCopyWithImpl; +@useResult +$Res call({ + String? trackingNumber +}); + + + + +} +/// @nodoc +class _$PaymentElementShippingDetailsCopyWithImpl<$Res> implements $PaymentElementShippingDetailsCopyWith<$Res> { - factory _$$PaymentElementShippingDetailsImplCopyWith( - _$PaymentElementShippingDetailsImpl value, - $Res Function(_$PaymentElementShippingDetailsImpl) then) = - __$$PaymentElementShippingDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? trackingNumber}); + _$PaymentElementShippingDetailsCopyWithImpl(this._self, this._then); + + final PaymentElementShippingDetails _self; + final $Res Function(PaymentElementShippingDetails) _then; + +/// Create a copy of PaymentElementShippingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? trackingNumber = freezed,}) { + return _then(_self.copyWith( +trackingNumber: freezed == trackingNumber ? _self.trackingNumber : trackingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentElementShippingDetails]. +extension PaymentElementShippingDetailsPatterns on PaymentElementShippingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentElementShippingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentElementShippingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentElementShippingDetails value) $default,){ +final _that = this; +switch (_that) { +case _PaymentElementShippingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentElementShippingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentElementShippingDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? trackingNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentElementShippingDetails() when $default != null: +return $default(_that.trackingNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? trackingNumber) $default,) {final _that = this; +switch (_that) { +case _PaymentElementShippingDetails(): +return $default(_that.trackingNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? trackingNumber)? $default,) {final _that = this; +switch (_that) { +case _PaymentElementShippingDetails() when $default != null: +return $default(_that.trackingNumber);case _: + return null; + +} } -/// @nodoc -class __$$PaymentElementShippingDetailsImplCopyWithImpl<$Res> - extends _$PaymentElementShippingDetailsCopyWithImpl<$Res, - _$PaymentElementShippingDetailsImpl> - implements _$$PaymentElementShippingDetailsImplCopyWith<$Res> { - __$$PaymentElementShippingDetailsImplCopyWithImpl( - _$PaymentElementShippingDetailsImpl _value, - $Res Function(_$PaymentElementShippingDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentElementShippingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? trackingNumber = freezed, - }) { - return _then(_$PaymentElementShippingDetailsImpl( - trackingNumber: freezed == trackingNumber - ? _value.trackingNumber - : trackingNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentElementShippingDetailsImpl - implements _PaymentElementShippingDetails { - const _$PaymentElementShippingDetailsImpl({this.trackingNumber}); - factory _$PaymentElementShippingDetailsImpl.fromJson( - Map json) => - _$$PaymentElementShippingDetailsImplFromJson(json); +class _PaymentElementShippingDetails implements PaymentElementShippingDetails { + const _PaymentElementShippingDetails({this.trackingNumber}); + factory _PaymentElementShippingDetails.fromJson(Map json) => _$PaymentElementShippingDetailsFromJson(json); - /// The Elements instance that was used to create the Payment Element. -// @ElementsConverter() required Elements elements, - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - final String? trackingNumber; - - @override - String toString() { - return 'PaymentElementShippingDetails(trackingNumber: $trackingNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentElementShippingDetailsImpl && - (identical(other.trackingNumber, trackingNumber) || - other.trackingNumber == trackingNumber)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, trackingNumber); - - /// Create a copy of PaymentElementShippingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentElementShippingDetailsImplCopyWith< - _$PaymentElementShippingDetailsImpl> - get copyWith => __$$PaymentElementShippingDetailsImplCopyWithImpl< - _$PaymentElementShippingDetailsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentElementShippingDetailsImplToJson( - this, - ); - } -} - -abstract class _PaymentElementShippingDetails - implements PaymentElementShippingDetails { - const factory _PaymentElementShippingDetails({final String? trackingNumber}) = - _$PaymentElementShippingDetailsImpl; - - factory _PaymentElementShippingDetails.fromJson(Map json) = - _$PaymentElementShippingDetailsImpl.fromJson; - - /// The Elements instance that was used to create the Payment Element. +/// The Elements instance that was used to create the Payment Element. // @ElementsConverter() required Elements elements, - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - String? get trackingNumber; - - /// Create a copy of PaymentElementShippingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentElementShippingDetailsImplCopyWith< - _$PaymentElementShippingDetailsImpl> - get copyWith => throw _privateConstructorUsedError; +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. +@override final String? trackingNumber; + +/// Create a copy of PaymentElementShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentElementShippingDetailsCopyWith<_PaymentElementShippingDetails> get copyWith => __$PaymentElementShippingDetailsCopyWithImpl<_PaymentElementShippingDetails>(this, _$identity); + +@override +Map toJson() { + return _$PaymentElementShippingDetailsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentElementShippingDetails&&(identical(other.trackingNumber, trackingNumber) || other.trackingNumber == trackingNumber)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,trackingNumber); + +@override +String toString() { + return 'PaymentElementShippingDetails(trackingNumber: $trackingNumber)'; } + + +} + +/// @nodoc +abstract mixin class _$PaymentElementShippingDetailsCopyWith<$Res> implements $PaymentElementShippingDetailsCopyWith<$Res> { + factory _$PaymentElementShippingDetailsCopyWith(_PaymentElementShippingDetails value, $Res Function(_PaymentElementShippingDetails) _then) = __$PaymentElementShippingDetailsCopyWithImpl; +@override @useResult +$Res call({ + String? trackingNumber +}); + + + + +} +/// @nodoc +class __$PaymentElementShippingDetailsCopyWithImpl<$Res> + implements _$PaymentElementShippingDetailsCopyWith<$Res> { + __$PaymentElementShippingDetailsCopyWithImpl(this._self, this._then); + + final _PaymentElementShippingDetails _self; + final $Res Function(_PaymentElementShippingDetails) _then; + +/// Create a copy of PaymentElementShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? trackingNumber = freezed,}) { + return _then(_PaymentElementShippingDetails( +trackingNumber: freezed == trackingNumber ? _self.trackingNumber : trackingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.g.dart b/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.g.dart index 40059557e..b569ae5e5 100644 --- a/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.g.dart +++ b/packages/stripe_js/lib/src/api/elements/payment_intent_shipping_information.g.dart @@ -6,22 +6,12 @@ part of 'payment_intent_shipping_information.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentElementShippingDetailsImpl - _$$PaymentElementShippingDetailsImplFromJson(Map json) => - _$PaymentElementShippingDetailsImpl( - trackingNumber: json['trackingNumber'] as String?, - ); +_PaymentElementShippingDetails _$PaymentElementShippingDetailsFromJson( + Map json, +) => _PaymentElementShippingDetails( + trackingNumber: json['trackingNumber'] as String?, +); -Map _$$PaymentElementShippingDetailsImplToJson( - _$PaymentElementShippingDetailsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('trackingNumber', instance.trackingNumber); - return val; -} +Map _$PaymentElementShippingDetailsToJson( + _PaymentElementShippingDetails instance, +) => {'trackingNumber': ?instance.trackingNumber}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.dart index fd44ea4c5..775f1cbcd 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.dart @@ -4,7 +4,7 @@ part 'confirm_acss_debit_payment_data.freezed.dart'; part 'confirm_acss_debit_payment_data.g.dart'; @freezed -class ConfirmAcssDebitPaymentData with _$ConfirmAcssDebitPaymentData { +abstract class ConfirmAcssDebitPaymentData with _$ConfirmAcssDebitPaymentData { const factory ConfirmAcssDebitPaymentData({ /// Either the id of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.freezed.dart index 64e8c1621..ea370f949 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,183 +9,275 @@ part of 'confirm_acss_debit_payment_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmAcssDebitPaymentData _$ConfirmAcssDebitPaymentDataFromJson( - Map json) { - return _ConfirmAcssDebitPaymentData.fromJson(json); -} - /// @nodoc mixin _$ConfirmAcssDebitPaymentData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @JsonKey(name: "payment_method") - String? get paymentMethod => throw _privateConstructorUsedError; + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@JsonKey(name: "payment_method") String? get paymentMethod; +/// Create a copy of ConfirmAcssDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmAcssDebitPaymentDataCopyWith get copyWith => _$ConfirmAcssDebitPaymentDataCopyWithImpl(this as ConfirmAcssDebitPaymentData, _$identity); /// Serializes this ConfirmAcssDebitPaymentData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmAcssDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmAcssDebitPaymentDataCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmAcssDebitPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)); } -/// @nodoc -abstract class $ConfirmAcssDebitPaymentDataCopyWith<$Res> { - factory $ConfirmAcssDebitPaymentDataCopyWith( - ConfirmAcssDebitPaymentData value, - $Res Function(ConfirmAcssDebitPaymentData) then) = - _$ConfirmAcssDebitPaymentDataCopyWithImpl<$Res, - ConfirmAcssDebitPaymentData>; - @useResult - $Res call({@JsonKey(name: "payment_method") String? paymentMethod}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod); + +@override +String toString() { + return 'ConfirmAcssDebitPaymentData(paymentMethod: $paymentMethod)'; } -/// @nodoc -class _$ConfirmAcssDebitPaymentDataCopyWithImpl<$Res, - $Val extends ConfirmAcssDebitPaymentData> - implements $ConfirmAcssDebitPaymentDataCopyWith<$Res> { - _$ConfirmAcssDebitPaymentDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmAcssDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmAcssDebitPaymentDataImplCopyWith<$Res> +abstract mixin class $ConfirmAcssDebitPaymentDataCopyWith<$Res> { + factory $ConfirmAcssDebitPaymentDataCopyWith(ConfirmAcssDebitPaymentData value, $Res Function(ConfirmAcssDebitPaymentData) _then) = _$ConfirmAcssDebitPaymentDataCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "payment_method") String? paymentMethod +}); + + + + +} +/// @nodoc +class _$ConfirmAcssDebitPaymentDataCopyWithImpl<$Res> implements $ConfirmAcssDebitPaymentDataCopyWith<$Res> { - factory _$$ConfirmAcssDebitPaymentDataImplCopyWith( - _$ConfirmAcssDebitPaymentDataImpl value, - $Res Function(_$ConfirmAcssDebitPaymentDataImpl) then) = - __$$ConfirmAcssDebitPaymentDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({@JsonKey(name: "payment_method") String? paymentMethod}); + _$ConfirmAcssDebitPaymentDataCopyWithImpl(this._self, this._then); + + final ConfirmAcssDebitPaymentData _self; + final $Res Function(ConfirmAcssDebitPaymentData) _then; + +/// Create a copy of ConfirmAcssDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmAcssDebitPaymentData]. +extension ConfirmAcssDebitPaymentDataPatterns on ConfirmAcssDebitPaymentData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmAcssDebitPaymentData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmAcssDebitPaymentData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmAcssDebitPaymentData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "payment_method") String? paymentMethod)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentData() when $default != null: +return $default(_that.paymentMethod);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "payment_method") String? paymentMethod) $default,) {final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentData(): +return $default(_that.paymentMethod);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "payment_method") String? paymentMethod)? $default,) {final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentData() when $default != null: +return $default(_that.paymentMethod);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmAcssDebitPaymentDataImplCopyWithImpl<$Res> - extends _$ConfirmAcssDebitPaymentDataCopyWithImpl<$Res, - _$ConfirmAcssDebitPaymentDataImpl> - implements _$$ConfirmAcssDebitPaymentDataImplCopyWith<$Res> { - __$$ConfirmAcssDebitPaymentDataImplCopyWithImpl( - _$ConfirmAcssDebitPaymentDataImpl _value, - $Res Function(_$ConfirmAcssDebitPaymentDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmAcssDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - }) { - return _then(_$ConfirmAcssDebitPaymentDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmAcssDebitPaymentDataImpl - implements _ConfirmAcssDebitPaymentData { - const _$ConfirmAcssDebitPaymentDataImpl( - {@JsonKey(name: "payment_method") this.paymentMethod}); - - factory _$ConfirmAcssDebitPaymentDataImpl.fromJson( - Map json) => - _$$ConfirmAcssDebitPaymentDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @JsonKey(name: "payment_method") - final String? paymentMethod; - - @override - String toString() { - return 'ConfirmAcssDebitPaymentData(paymentMethod: $paymentMethod)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmAcssDebitPaymentDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod); - - /// Create a copy of ConfirmAcssDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmAcssDebitPaymentDataImplCopyWith<_$ConfirmAcssDebitPaymentDataImpl> - get copyWith => __$$ConfirmAcssDebitPaymentDataImplCopyWithImpl< - _$ConfirmAcssDebitPaymentDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmAcssDebitPaymentDataImplToJson( - this, - ); - } -} - -abstract class _ConfirmAcssDebitPaymentData - implements ConfirmAcssDebitPaymentData { - const factory _ConfirmAcssDebitPaymentData( - {@JsonKey(name: "payment_method") final String? paymentMethod}) = - _$ConfirmAcssDebitPaymentDataImpl; - - factory _ConfirmAcssDebitPaymentData.fromJson(Map json) = - _$ConfirmAcssDebitPaymentDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @JsonKey(name: "payment_method") - String? get paymentMethod; - - /// Create a copy of ConfirmAcssDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmAcssDebitPaymentDataImplCopyWith<_$ConfirmAcssDebitPaymentDataImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmAcssDebitPaymentData implements ConfirmAcssDebitPaymentData { + const _ConfirmAcssDebitPaymentData({@JsonKey(name: "payment_method") this.paymentMethod}); + factory _ConfirmAcssDebitPaymentData.fromJson(Map json) => _$ConfirmAcssDebitPaymentDataFromJson(json); + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@override@JsonKey(name: "payment_method") final String? paymentMethod; + +/// Create a copy of ConfirmAcssDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmAcssDebitPaymentDataCopyWith<_ConfirmAcssDebitPaymentData> get copyWith => __$ConfirmAcssDebitPaymentDataCopyWithImpl<_ConfirmAcssDebitPaymentData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmAcssDebitPaymentDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmAcssDebitPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod); + +@override +String toString() { + return 'ConfirmAcssDebitPaymentData(paymentMethod: $paymentMethod)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmAcssDebitPaymentDataCopyWith<$Res> implements $ConfirmAcssDebitPaymentDataCopyWith<$Res> { + factory _$ConfirmAcssDebitPaymentDataCopyWith(_ConfirmAcssDebitPaymentData value, $Res Function(_ConfirmAcssDebitPaymentData) _then) = __$ConfirmAcssDebitPaymentDataCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "payment_method") String? paymentMethod +}); + + + + +} +/// @nodoc +class __$ConfirmAcssDebitPaymentDataCopyWithImpl<$Res> + implements _$ConfirmAcssDebitPaymentDataCopyWith<$Res> { + __$ConfirmAcssDebitPaymentDataCopyWithImpl(this._self, this._then); + + final _ConfirmAcssDebitPaymentData _self; + final $Res Function(_ConfirmAcssDebitPaymentData) _then; + +/// Create a copy of ConfirmAcssDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,}) { + return _then(_ConfirmAcssDebitPaymentData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.g.dart index cfa84371b..36b7a5070 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_data.g.dart @@ -6,22 +6,11 @@ part of 'confirm_acss_debit_payment_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmAcssDebitPaymentDataImpl _$$ConfirmAcssDebitPaymentDataImplFromJson( - Map json) => - _$ConfirmAcssDebitPaymentDataImpl( +_ConfirmAcssDebitPaymentData _$ConfirmAcssDebitPaymentDataFromJson(Map json) => + _ConfirmAcssDebitPaymentData( paymentMethod: json['payment_method'] as String?, ); -Map _$$ConfirmAcssDebitPaymentDataImplToJson( - _$ConfirmAcssDebitPaymentDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', instance.paymentMethod); - return val; -} +Map _$ConfirmAcssDebitPaymentDataToJson( + _ConfirmAcssDebitPaymentData instance, +) => {'payment_method': ?instance.paymentMethod}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.dart index f599d132d..7ed5400d1 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.dart @@ -4,7 +4,8 @@ part 'confirm_acss_debit_payment_options.freezed.dart'; part 'confirm_acss_debit_payment_options.g.dart'; @freezed -class ConfirmAcssDebitPaymentOptions with _$ConfirmAcssDebitPaymentOptions { +abstract class ConfirmAcssDebitPaymentOptions + with _$ConfirmAcssDebitPaymentOptions { const factory ConfirmAcssDebitPaymentOptions({ /// Set this to true if you want to skip displaying the mandate confirmation. @Default(false) bool? skipMandate, diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.freezed.dart index e99ed5574..d3a670984 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,175 +9,271 @@ part of 'confirm_acss_debit_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmAcssDebitPaymentOptions _$ConfirmAcssDebitPaymentOptionsFromJson( - Map json) { - return _ConfirmAcssDebitPaymentOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmAcssDebitPaymentOptions { - /// Set this to true if you want to skip displaying the mandate confirmation. - bool? get skipMandate => throw _privateConstructorUsedError; + +/// Set this to true if you want to skip displaying the mandate confirmation. + bool? get skipMandate; +/// Create a copy of ConfirmAcssDebitPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmAcssDebitPaymentOptionsCopyWith get copyWith => _$ConfirmAcssDebitPaymentOptionsCopyWithImpl(this as ConfirmAcssDebitPaymentOptions, _$identity); /// Serializes this ConfirmAcssDebitPaymentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmAcssDebitPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmAcssDebitPaymentOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmAcssDebitPaymentOptions&&(identical(other.skipMandate, skipMandate) || other.skipMandate == skipMandate)); } -/// @nodoc -abstract class $ConfirmAcssDebitPaymentOptionsCopyWith<$Res> { - factory $ConfirmAcssDebitPaymentOptionsCopyWith( - ConfirmAcssDebitPaymentOptions value, - $Res Function(ConfirmAcssDebitPaymentOptions) then) = - _$ConfirmAcssDebitPaymentOptionsCopyWithImpl<$Res, - ConfirmAcssDebitPaymentOptions>; - @useResult - $Res call({bool? skipMandate}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,skipMandate); + +@override +String toString() { + return 'ConfirmAcssDebitPaymentOptions(skipMandate: $skipMandate)'; } -/// @nodoc -class _$ConfirmAcssDebitPaymentOptionsCopyWithImpl<$Res, - $Val extends ConfirmAcssDebitPaymentOptions> - implements $ConfirmAcssDebitPaymentOptionsCopyWith<$Res> { - _$ConfirmAcssDebitPaymentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmAcssDebitPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? skipMandate = freezed, - }) { - return _then(_value.copyWith( - skipMandate: freezed == skipMandate - ? _value.skipMandate - : skipMandate // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmAcssDebitPaymentOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmAcssDebitPaymentOptionsCopyWith<$Res> { + factory $ConfirmAcssDebitPaymentOptionsCopyWith(ConfirmAcssDebitPaymentOptions value, $Res Function(ConfirmAcssDebitPaymentOptions) _then) = _$ConfirmAcssDebitPaymentOptionsCopyWithImpl; +@useResult +$Res call({ + bool? skipMandate +}); + + + + +} +/// @nodoc +class _$ConfirmAcssDebitPaymentOptionsCopyWithImpl<$Res> implements $ConfirmAcssDebitPaymentOptionsCopyWith<$Res> { - factory _$$ConfirmAcssDebitPaymentOptionsImplCopyWith( - _$ConfirmAcssDebitPaymentOptionsImpl value, - $Res Function(_$ConfirmAcssDebitPaymentOptionsImpl) then) = - __$$ConfirmAcssDebitPaymentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? skipMandate}); + _$ConfirmAcssDebitPaymentOptionsCopyWithImpl(this._self, this._then); + + final ConfirmAcssDebitPaymentOptions _self; + final $Res Function(ConfirmAcssDebitPaymentOptions) _then; + +/// Create a copy of ConfirmAcssDebitPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? skipMandate = freezed,}) { + return _then(_self.copyWith( +skipMandate: freezed == skipMandate ? _self.skipMandate : skipMandate // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmAcssDebitPaymentOptions]. +extension ConfirmAcssDebitPaymentOptionsPatterns on ConfirmAcssDebitPaymentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmAcssDebitPaymentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmAcssDebitPaymentOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmAcssDebitPaymentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? skipMandate)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentOptions() when $default != null: +return $default(_that.skipMandate);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? skipMandate) $default,) {final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentOptions(): +return $default(_that.skipMandate);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? skipMandate)? $default,) {final _that = this; +switch (_that) { +case _ConfirmAcssDebitPaymentOptions() when $default != null: +return $default(_that.skipMandate);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmAcssDebitPaymentOptionsImplCopyWithImpl<$Res> - extends _$ConfirmAcssDebitPaymentOptionsCopyWithImpl<$Res, - _$ConfirmAcssDebitPaymentOptionsImpl> - implements _$$ConfirmAcssDebitPaymentOptionsImplCopyWith<$Res> { - __$$ConfirmAcssDebitPaymentOptionsImplCopyWithImpl( - _$ConfirmAcssDebitPaymentOptionsImpl _value, - $Res Function(_$ConfirmAcssDebitPaymentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmAcssDebitPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? skipMandate = freezed, - }) { - return _then(_$ConfirmAcssDebitPaymentOptionsImpl( - skipMandate: freezed == skipMandate - ? _value.skipMandate - : skipMandate // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmAcssDebitPaymentOptionsImpl - implements _ConfirmAcssDebitPaymentOptions { - const _$ConfirmAcssDebitPaymentOptionsImpl({this.skipMandate = false}); - - factory _$ConfirmAcssDebitPaymentOptionsImpl.fromJson( - Map json) => - _$$ConfirmAcssDebitPaymentOptionsImplFromJson(json); - - /// Set this to true if you want to skip displaying the mandate confirmation. - @override - @JsonKey() - final bool? skipMandate; - - @override - String toString() { - return 'ConfirmAcssDebitPaymentOptions(skipMandate: $skipMandate)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmAcssDebitPaymentOptionsImpl && - (identical(other.skipMandate, skipMandate) || - other.skipMandate == skipMandate)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, skipMandate); - - /// Create a copy of ConfirmAcssDebitPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmAcssDebitPaymentOptionsImplCopyWith< - _$ConfirmAcssDebitPaymentOptionsImpl> - get copyWith => __$$ConfirmAcssDebitPaymentOptionsImplCopyWithImpl< - _$ConfirmAcssDebitPaymentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmAcssDebitPaymentOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmAcssDebitPaymentOptions - implements ConfirmAcssDebitPaymentOptions { - const factory _ConfirmAcssDebitPaymentOptions({final bool? skipMandate}) = - _$ConfirmAcssDebitPaymentOptionsImpl; - - factory _ConfirmAcssDebitPaymentOptions.fromJson(Map json) = - _$ConfirmAcssDebitPaymentOptionsImpl.fromJson; - - /// Set this to true if you want to skip displaying the mandate confirmation. - @override - bool? get skipMandate; - - /// Create a copy of ConfirmAcssDebitPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmAcssDebitPaymentOptionsImplCopyWith< - _$ConfirmAcssDebitPaymentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmAcssDebitPaymentOptions implements ConfirmAcssDebitPaymentOptions { + const _ConfirmAcssDebitPaymentOptions({this.skipMandate = false}); + factory _ConfirmAcssDebitPaymentOptions.fromJson(Map json) => _$ConfirmAcssDebitPaymentOptionsFromJson(json); + +/// Set this to true if you want to skip displaying the mandate confirmation. +@override@JsonKey() final bool? skipMandate; + +/// Create a copy of ConfirmAcssDebitPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmAcssDebitPaymentOptionsCopyWith<_ConfirmAcssDebitPaymentOptions> get copyWith => __$ConfirmAcssDebitPaymentOptionsCopyWithImpl<_ConfirmAcssDebitPaymentOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmAcssDebitPaymentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmAcssDebitPaymentOptions&&(identical(other.skipMandate, skipMandate) || other.skipMandate == skipMandate)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,skipMandate); + +@override +String toString() { + return 'ConfirmAcssDebitPaymentOptions(skipMandate: $skipMandate)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmAcssDebitPaymentOptionsCopyWith<$Res> implements $ConfirmAcssDebitPaymentOptionsCopyWith<$Res> { + factory _$ConfirmAcssDebitPaymentOptionsCopyWith(_ConfirmAcssDebitPaymentOptions value, $Res Function(_ConfirmAcssDebitPaymentOptions) _then) = __$ConfirmAcssDebitPaymentOptionsCopyWithImpl; +@override @useResult +$Res call({ + bool? skipMandate +}); + + + + +} +/// @nodoc +class __$ConfirmAcssDebitPaymentOptionsCopyWithImpl<$Res> + implements _$ConfirmAcssDebitPaymentOptionsCopyWith<$Res> { + __$ConfirmAcssDebitPaymentOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmAcssDebitPaymentOptions _self; + final $Res Function(_ConfirmAcssDebitPaymentOptions) _then; + +/// Create a copy of ConfirmAcssDebitPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? skipMandate = freezed,}) { + return _then(_ConfirmAcssDebitPaymentOptions( +skipMandate: freezed == skipMandate ? _self.skipMandate : skipMandate // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.g.dart index a6ce0bbce..cd5652a7f 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_acss_debit_payment_options.g.dart @@ -6,22 +6,12 @@ part of 'confirm_acss_debit_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmAcssDebitPaymentOptionsImpl - _$$ConfirmAcssDebitPaymentOptionsImplFromJson(Map json) => - _$ConfirmAcssDebitPaymentOptionsImpl( - skipMandate: json['skipMandate'] as bool? ?? false, - ); +_ConfirmAcssDebitPaymentOptions _$ConfirmAcssDebitPaymentOptionsFromJson( + Map json, +) => _ConfirmAcssDebitPaymentOptions( + skipMandate: json['skipMandate'] as bool? ?? false, +); -Map _$$ConfirmAcssDebitPaymentOptionsImplToJson( - _$ConfirmAcssDebitPaymentOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('skipMandate', instance.skipMandate); - return val; -} +Map _$ConfirmAcssDebitPaymentOptionsToJson( + _ConfirmAcssDebitPaymentOptions instance, +) => {'skipMandate': ?instance.skipMandate}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.dart index db988c583..564608900 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.dart @@ -4,7 +4,7 @@ part 'confirm_alipay_payment_data.freezed.dart'; part 'confirm_alipay_payment_data.g.dart'; @freezed -class ConfirmAlipayPaymentData with _$ConfirmAlipayPaymentData { +abstract class ConfirmAlipayPaymentData with _$ConfirmAlipayPaymentData { const factory ConfirmAlipayPaymentData({ /// Either the id of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.freezed.dart index abaa1d51e..5c1b977be 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,210 +9,280 @@ part of 'confirm_alipay_payment_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmAlipayPaymentData _$ConfirmAlipayPaymentDataFromJson( - Map json) { - return _ConfirmAlipayPaymentData.fromJson(json); -} - /// @nodoc mixin _$ConfirmAlipayPaymentData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @JsonKey(name: "payment_method") - String? get paymentMethod => throw _privateConstructorUsedError; - /// The url your customer will be directed to after they complete authentication. - @JsonKey(name: "return_url") - String? get returnUrl => throw _privateConstructorUsedError; +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@JsonKey(name: "payment_method") String? get paymentMethod;/// The url your customer will be directed to after they complete authentication. +@JsonKey(name: "return_url") String? get returnUrl; +/// Create a copy of ConfirmAlipayPaymentData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmAlipayPaymentDataCopyWith get copyWith => _$ConfirmAlipayPaymentDataCopyWithImpl(this as ConfirmAlipayPaymentData, _$identity); /// Serializes this ConfirmAlipayPaymentData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmAlipayPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmAlipayPaymentDataCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmAlipayPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)); } -/// @nodoc -abstract class $ConfirmAlipayPaymentDataCopyWith<$Res> { - factory $ConfirmAlipayPaymentDataCopyWith(ConfirmAlipayPaymentData value, - $Res Function(ConfirmAlipayPaymentData) then) = - _$ConfirmAlipayPaymentDataCopyWithImpl<$Res, ConfirmAlipayPaymentData>; - @useResult - $Res call( - {@JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl); + +@override +String toString() { + return 'ConfirmAlipayPaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl)'; } -/// @nodoc -class _$ConfirmAlipayPaymentDataCopyWithImpl<$Res, - $Val extends ConfirmAlipayPaymentData> - implements $ConfirmAlipayPaymentDataCopyWith<$Res> { - _$ConfirmAlipayPaymentDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmAlipayPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmAlipayPaymentDataImplCopyWith<$Res> +abstract mixin class $ConfirmAlipayPaymentDataCopyWith<$Res> { + factory $ConfirmAlipayPaymentDataCopyWith(ConfirmAlipayPaymentData value, $Res Function(ConfirmAlipayPaymentData) _then) = _$ConfirmAlipayPaymentDataCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "payment_method") String? paymentMethod,@JsonKey(name: "return_url") String? returnUrl +}); + + + + +} +/// @nodoc +class _$ConfirmAlipayPaymentDataCopyWithImpl<$Res> implements $ConfirmAlipayPaymentDataCopyWith<$Res> { - factory _$$ConfirmAlipayPaymentDataImplCopyWith( - _$ConfirmAlipayPaymentDataImpl value, - $Res Function(_$ConfirmAlipayPaymentDataImpl) then) = - __$$ConfirmAlipayPaymentDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl}); + _$ConfirmAlipayPaymentDataCopyWithImpl(this._self, this._then); + + final ConfirmAlipayPaymentData _self; + final $Res Function(ConfirmAlipayPaymentData) _then; + +/// Create a copy of ConfirmAlipayPaymentData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmAlipayPaymentData]. +extension ConfirmAlipayPaymentDataPatterns on ConfirmAlipayPaymentData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmAlipayPaymentData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmAlipayPaymentData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmAlipayPaymentData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "return_url") String? returnUrl)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "return_url") String? returnUrl) $default,) {final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentData(): +return $default(_that.paymentMethod,_that.returnUrl);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "return_url") String? returnUrl)? $default,) {final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmAlipayPaymentDataImplCopyWithImpl<$Res> - extends _$ConfirmAlipayPaymentDataCopyWithImpl<$Res, - _$ConfirmAlipayPaymentDataImpl> - implements _$$ConfirmAlipayPaymentDataImplCopyWith<$Res> { - __$$ConfirmAlipayPaymentDataImplCopyWithImpl( - _$ConfirmAlipayPaymentDataImpl _value, - $Res Function(_$ConfirmAlipayPaymentDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmAlipayPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - }) { - return _then(_$ConfirmAlipayPaymentDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmAlipayPaymentDataImpl implements _ConfirmAlipayPaymentData { - const _$ConfirmAlipayPaymentDataImpl( - {@JsonKey(name: "payment_method") this.paymentMethod, - @JsonKey(name: "return_url") this.returnUrl}); - - factory _$ConfirmAlipayPaymentDataImpl.fromJson(Map json) => - _$$ConfirmAlipayPaymentDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @JsonKey(name: "payment_method") - final String? paymentMethod; - - /// The url your customer will be directed to after they complete authentication. - @override - @JsonKey(name: "return_url") - final String? returnUrl; - - @override - String toString() { - return 'ConfirmAlipayPaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmAlipayPaymentDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.returnUrl, returnUrl) || - other.returnUrl == returnUrl)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod, returnUrl); - - /// Create a copy of ConfirmAlipayPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmAlipayPaymentDataImplCopyWith<_$ConfirmAlipayPaymentDataImpl> - get copyWith => __$$ConfirmAlipayPaymentDataImplCopyWithImpl< - _$ConfirmAlipayPaymentDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmAlipayPaymentDataImplToJson( - this, - ); - } -} - -abstract class _ConfirmAlipayPaymentData implements ConfirmAlipayPaymentData { - const factory _ConfirmAlipayPaymentData( - {@JsonKey(name: "payment_method") final String? paymentMethod, - @JsonKey(name: "return_url") final String? returnUrl}) = - _$ConfirmAlipayPaymentDataImpl; - - factory _ConfirmAlipayPaymentData.fromJson(Map json) = - _$ConfirmAlipayPaymentDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @JsonKey(name: "payment_method") - String? get paymentMethod; - - /// The url your customer will be directed to after they complete authentication. - @override - @JsonKey(name: "return_url") - String? get returnUrl; - - /// Create a copy of ConfirmAlipayPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmAlipayPaymentDataImplCopyWith<_$ConfirmAlipayPaymentDataImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmAlipayPaymentData implements ConfirmAlipayPaymentData { + const _ConfirmAlipayPaymentData({@JsonKey(name: "payment_method") this.paymentMethod, @JsonKey(name: "return_url") this.returnUrl}); + factory _ConfirmAlipayPaymentData.fromJson(Map json) => _$ConfirmAlipayPaymentDataFromJson(json); + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@override@JsonKey(name: "payment_method") final String? paymentMethod; +/// The url your customer will be directed to after they complete authentication. +@override@JsonKey(name: "return_url") final String? returnUrl; + +/// Create a copy of ConfirmAlipayPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmAlipayPaymentDataCopyWith<_ConfirmAlipayPaymentData> get copyWith => __$ConfirmAlipayPaymentDataCopyWithImpl<_ConfirmAlipayPaymentData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmAlipayPaymentDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmAlipayPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl); + +@override +String toString() { + return 'ConfirmAlipayPaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmAlipayPaymentDataCopyWith<$Res> implements $ConfirmAlipayPaymentDataCopyWith<$Res> { + factory _$ConfirmAlipayPaymentDataCopyWith(_ConfirmAlipayPaymentData value, $Res Function(_ConfirmAlipayPaymentData) _then) = __$ConfirmAlipayPaymentDataCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "payment_method") String? paymentMethod,@JsonKey(name: "return_url") String? returnUrl +}); + + + + +} +/// @nodoc +class __$ConfirmAlipayPaymentDataCopyWithImpl<$Res> + implements _$ConfirmAlipayPaymentDataCopyWith<$Res> { + __$ConfirmAlipayPaymentDataCopyWithImpl(this._self, this._then); + + final _ConfirmAlipayPaymentData _self; + final $Res Function(_ConfirmAlipayPaymentData) _then; + +/// Create a copy of ConfirmAlipayPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,}) { + return _then(_ConfirmAlipayPaymentData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.g.dart index c07019a0d..33551118f 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_data.g.dart @@ -6,24 +6,15 @@ part of 'confirm_alipay_payment_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmAlipayPaymentDataImpl _$$ConfirmAlipayPaymentDataImplFromJson( - Map json) => - _$ConfirmAlipayPaymentDataImpl( +_ConfirmAlipayPaymentData _$ConfirmAlipayPaymentDataFromJson(Map json) => + _ConfirmAlipayPaymentData( paymentMethod: json['payment_method'] as String?, returnUrl: json['return_url'] as String?, ); -Map _$$ConfirmAlipayPaymentDataImplToJson( - _$ConfirmAlipayPaymentDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', instance.paymentMethod); - writeNotNull('return_url', instance.returnUrl); - return val; -} +Map _$ConfirmAlipayPaymentDataToJson( + _ConfirmAlipayPaymentData instance, +) => { + 'payment_method': ?instance.paymentMethod, + 'return_url': ?instance.returnUrl, +}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.dart index ecac37a5e..2dac6f3f8 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.dart @@ -4,7 +4,7 @@ part 'confirm_alipay_payment_options.freezed.dart'; part 'confirm_alipay_payment_options.g.dart'; @freezed -class ConfirmAlipayPaymentOptions with _$ConfirmAlipayPaymentOptions { +abstract class ConfirmAlipayPaymentOptions with _$ConfirmAlipayPaymentOptions { const factory ConfirmAlipayPaymentOptions({ /// Set this to false if you want to manually handle /// the authorization redirect. Default is true. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.freezed.dart index 4e72ec744..8481f3890 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,176 +9,273 @@ part of 'confirm_alipay_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmAlipayPaymentOptions _$ConfirmAlipayPaymentOptionsFromJson( - Map json) { - return _ConfirmAlipayPaymentOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmAlipayPaymentOptions { - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - bool? get handleActions => throw _privateConstructorUsedError; + +/// Set this to false if you want to manually handle +/// the authorization redirect. Default is true. + bool? get handleActions; +/// Create a copy of ConfirmAlipayPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmAlipayPaymentOptionsCopyWith get copyWith => _$ConfirmAlipayPaymentOptionsCopyWithImpl(this as ConfirmAlipayPaymentOptions, _$identity); /// Serializes this ConfirmAlipayPaymentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmAlipayPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmAlipayPaymentOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmAlipayPaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); } -/// @nodoc -abstract class $ConfirmAlipayPaymentOptionsCopyWith<$Res> { - factory $ConfirmAlipayPaymentOptionsCopyWith( - ConfirmAlipayPaymentOptions value, - $Res Function(ConfirmAlipayPaymentOptions) then) = - _$ConfirmAlipayPaymentOptionsCopyWithImpl<$Res, - ConfirmAlipayPaymentOptions>; - @useResult - $Res call({bool? handleActions}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmAlipayPaymentOptions(handleActions: $handleActions)'; } -/// @nodoc -class _$ConfirmAlipayPaymentOptionsCopyWithImpl<$Res, - $Val extends ConfirmAlipayPaymentOptions> - implements $ConfirmAlipayPaymentOptionsCopyWith<$Res> { - _$ConfirmAlipayPaymentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmAlipayPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_value.copyWith( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmAlipayPaymentOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmAlipayPaymentOptionsCopyWith<$Res> { + factory $ConfirmAlipayPaymentOptionsCopyWith(ConfirmAlipayPaymentOptions value, $Res Function(ConfirmAlipayPaymentOptions) _then) = _$ConfirmAlipayPaymentOptionsCopyWithImpl; +@useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class _$ConfirmAlipayPaymentOptionsCopyWithImpl<$Res> implements $ConfirmAlipayPaymentOptionsCopyWith<$Res> { - factory _$$ConfirmAlipayPaymentOptionsImplCopyWith( - _$ConfirmAlipayPaymentOptionsImpl value, - $Res Function(_$ConfirmAlipayPaymentOptionsImpl) then) = - __$$ConfirmAlipayPaymentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? handleActions}); + _$ConfirmAlipayPaymentOptionsCopyWithImpl(this._self, this._then); + + final ConfirmAlipayPaymentOptions _self; + final $Res Function(ConfirmAlipayPaymentOptions) _then; + +/// Create a copy of ConfirmAlipayPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? handleActions = freezed,}) { + return _then(_self.copyWith( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmAlipayPaymentOptions]. +extension ConfirmAlipayPaymentOptionsPatterns on ConfirmAlipayPaymentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmAlipayPaymentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmAlipayPaymentOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmAlipayPaymentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? handleActions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? handleActions) $default,) {final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentOptions(): +return $default(_that.handleActions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? handleActions)? $default,) {final _that = this; +switch (_that) { +case _ConfirmAlipayPaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmAlipayPaymentOptionsImplCopyWithImpl<$Res> - extends _$ConfirmAlipayPaymentOptionsCopyWithImpl<$Res, - _$ConfirmAlipayPaymentOptionsImpl> - implements _$$ConfirmAlipayPaymentOptionsImplCopyWith<$Res> { - __$$ConfirmAlipayPaymentOptionsImplCopyWithImpl( - _$ConfirmAlipayPaymentOptionsImpl _value, - $Res Function(_$ConfirmAlipayPaymentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmAlipayPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_$ConfirmAlipayPaymentOptionsImpl( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmAlipayPaymentOptionsImpl - implements _ConfirmAlipayPaymentOptions { - const _$ConfirmAlipayPaymentOptionsImpl({this.handleActions = true}); - - factory _$ConfirmAlipayPaymentOptionsImpl.fromJson( - Map json) => - _$$ConfirmAlipayPaymentOptionsImplFromJson(json); - - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - @override - @JsonKey() - final bool? handleActions; - - @override - String toString() { - return 'ConfirmAlipayPaymentOptions(handleActions: $handleActions)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmAlipayPaymentOptionsImpl && - (identical(other.handleActions, handleActions) || - other.handleActions == handleActions)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, handleActions); - - /// Create a copy of ConfirmAlipayPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmAlipayPaymentOptionsImplCopyWith<_$ConfirmAlipayPaymentOptionsImpl> - get copyWith => __$$ConfirmAlipayPaymentOptionsImplCopyWithImpl< - _$ConfirmAlipayPaymentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmAlipayPaymentOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmAlipayPaymentOptions - implements ConfirmAlipayPaymentOptions { - const factory _ConfirmAlipayPaymentOptions({final bool? handleActions}) = - _$ConfirmAlipayPaymentOptionsImpl; - - factory _ConfirmAlipayPaymentOptions.fromJson(Map json) = - _$ConfirmAlipayPaymentOptionsImpl.fromJson; - - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - @override - bool? get handleActions; - - /// Create a copy of ConfirmAlipayPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmAlipayPaymentOptionsImplCopyWith<_$ConfirmAlipayPaymentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmAlipayPaymentOptions implements ConfirmAlipayPaymentOptions { + const _ConfirmAlipayPaymentOptions({this.handleActions = true}); + factory _ConfirmAlipayPaymentOptions.fromJson(Map json) => _$ConfirmAlipayPaymentOptionsFromJson(json); + +/// Set this to false if you want to manually handle +/// the authorization redirect. Default is true. +@override@JsonKey() final bool? handleActions; + +/// Create a copy of ConfirmAlipayPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmAlipayPaymentOptionsCopyWith<_ConfirmAlipayPaymentOptions> get copyWith => __$ConfirmAlipayPaymentOptionsCopyWithImpl<_ConfirmAlipayPaymentOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmAlipayPaymentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmAlipayPaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmAlipayPaymentOptions(handleActions: $handleActions)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmAlipayPaymentOptionsCopyWith<$Res> implements $ConfirmAlipayPaymentOptionsCopyWith<$Res> { + factory _$ConfirmAlipayPaymentOptionsCopyWith(_ConfirmAlipayPaymentOptions value, $Res Function(_ConfirmAlipayPaymentOptions) _then) = __$ConfirmAlipayPaymentOptionsCopyWithImpl; +@override @useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class __$ConfirmAlipayPaymentOptionsCopyWithImpl<$Res> + implements _$ConfirmAlipayPaymentOptionsCopyWith<$Res> { + __$ConfirmAlipayPaymentOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmAlipayPaymentOptions _self; + final $Res Function(_ConfirmAlipayPaymentOptions) _then; + +/// Create a copy of ConfirmAlipayPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? handleActions = freezed,}) { + return _then(_ConfirmAlipayPaymentOptions( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.g.dart index ef7602620..f6f6b5894 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_alipay_payment_options.g.dart @@ -6,22 +6,11 @@ part of 'confirm_alipay_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmAlipayPaymentOptionsImpl _$$ConfirmAlipayPaymentOptionsImplFromJson( - Map json) => - _$ConfirmAlipayPaymentOptionsImpl( +_ConfirmAlipayPaymentOptions _$ConfirmAlipayPaymentOptionsFromJson(Map json) => + _ConfirmAlipayPaymentOptions( handleActions: json['handleActions'] as bool? ?? true, ); -Map _$$ConfirmAlipayPaymentOptionsImplToJson( - _$ConfirmAlipayPaymentOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('handleActions', instance.handleActions); - return val; -} +Map _$ConfirmAlipayPaymentOptionsToJson( + _ConfirmAlipayPaymentOptions instance, +) => {'handleActions': ?instance.handleActions}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.dart index 67112908e..830a17a63 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.dart @@ -5,7 +5,7 @@ part 'confirm_card_payment_data.freezed.dart'; part 'confirm_card_payment_data.g.dart'; @freezed -class ConfirmCardPaymentData with _$ConfirmCardPaymentData { +abstract class ConfirmCardPaymentData with _$ConfirmCardPaymentData { const factory ConfirmCardPaymentData({ /// Either the id of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.freezed.dart index 44660b3cf..018cdc685 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,425 +9,380 @@ part of 'confirm_card_payment_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmCardPaymentData _$ConfirmCardPaymentDataFromJson( - Map json) { - return _ConfirmCardPaymentData.fromJson(json); -} - /// @nodoc mixin _$ConfirmCardPaymentData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @paymentMethodDetailJsonKey - CardPaymentMethodDetails? get paymentMethod => - throw _privateConstructorUsedError; - - /// The shipping details for the payment, if collected. - ShippingDetails? get shipping => throw _privateConstructorUsedError; - - /// If you are handling next actions yourself, pass in a return_url. - /// If the subsequent action is redirect_to_url, - /// this URL will be used on the return path for the redirect. - @JsonKey(name: "return_url") - String? get returnUrl => throw _privateConstructorUsedError; - - /// Email address that the receipt for the resulting payment will be sent to. - @JsonKey(name: "receipt_email") - String? get receiptEmail => throw _privateConstructorUsedError; - - /// Indicates that you intend to make future payments with this - /// PaymentIntent's payment method. - /// - /// If present, the payment method used with this PaymentIntent can be attached - /// to a Customer, even after the transaction completes. - /// - /// Use on_session if you intend to only reuse the payment method when your - /// customer is present in your checkout flow. Use off_session if your customer - /// may or may not be in your checkout flow. See saving card details during - /// payment to learn more. - /// - /// Stripe uses setup_future_usage to dynamically optimize your payment flow - /// and comply with regional legislation and network rules. For example, if - /// your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer. - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage => - throw _privateConstructorUsedError; - - /// An object containing payment-method-specific configuration to - /// confirm the PaymentIntent with. - @JsonKey(name: "payment_method_options") - dynamic get paymentMethodOptions => throw _privateConstructorUsedError; + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@paymentMethodDetailJsonKey CardPaymentMethodDetails? get paymentMethod;/// The shipping details for the payment, if collected. + ShippingDetails? get shipping;/// If you are handling next actions yourself, pass in a return_url. +/// If the subsequent action is redirect_to_url, +/// this URL will be used on the return path for the redirect. +@JsonKey(name: "return_url") String? get returnUrl;/// Email address that the receipt for the resulting payment will be sent to. +@JsonKey(name: "receipt_email") String? get receiptEmail;/// Indicates that you intend to make future payments with this +/// PaymentIntent's payment method. +/// +/// If present, the payment method used with this PaymentIntent can be attached +/// to a Customer, even after the transaction completes. +/// +/// Use on_session if you intend to only reuse the payment method when your +/// customer is present in your checkout flow. Use off_session if your customer +/// may or may not be in your checkout flow. See saving card details during +/// payment to learn more. +/// +/// Stripe uses setup_future_usage to dynamically optimize your payment flow +/// and comply with regional legislation and network rules. For example, if +/// your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer. +@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? get setupFutureUsage;/// An object containing payment-method-specific configuration to +/// confirm the PaymentIntent with. +@JsonKey(name: "payment_method_options") dynamic get paymentMethodOptions; +/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmCardPaymentDataCopyWith get copyWith => _$ConfirmCardPaymentDataCopyWithImpl(this as ConfirmCardPaymentData, _$identity); /// Serializes this ConfirmCardPaymentData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmCardPaymentDataCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmCardPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.shipping, shipping) || other.shipping == shipping)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)&&(identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&const DeepCollectionEquality().equals(other.paymentMethodOptions, paymentMethodOptions)); } -/// @nodoc -abstract class $ConfirmCardPaymentDataCopyWith<$Res> { - factory $ConfirmCardPaymentDataCopyWith(ConfirmCardPaymentData value, - $Res Function(ConfirmCardPaymentData) then) = - _$ConfirmCardPaymentDataCopyWithImpl<$Res, ConfirmCardPaymentData>; - @useResult - $Res call( - {@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, - ShippingDetails? shipping, - @JsonKey(name: "return_url") String? returnUrl, - @JsonKey(name: "receipt_email") String? receiptEmail, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage, - @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions}); - - $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; - $ShippingDetailsCopyWith<$Res>? get shipping; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,shipping,returnUrl,receiptEmail,setupFutureUsage,const DeepCollectionEquality().hash(paymentMethodOptions)); + +@override +String toString() { + return 'ConfirmCardPaymentData(paymentMethod: $paymentMethod, shipping: $shipping, returnUrl: $returnUrl, receiptEmail: $receiptEmail, setupFutureUsage: $setupFutureUsage, paymentMethodOptions: $paymentMethodOptions)'; +} + + } /// @nodoc -class _$ConfirmCardPaymentDataCopyWithImpl<$Res, - $Val extends ConfirmCardPaymentData> +abstract mixin class $ConfirmCardPaymentDataCopyWith<$Res> { + factory $ConfirmCardPaymentDataCopyWith(ConfirmCardPaymentData value, $Res Function(ConfirmCardPaymentData) _then) = _$ConfirmCardPaymentDataCopyWithImpl; +@useResult +$Res call({ +@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, ShippingDetails? shipping,@JsonKey(name: "return_url") String? returnUrl,@JsonKey(name: "receipt_email") String? receiptEmail,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage,@JsonKey(name: "payment_method_options") dynamic paymentMethodOptions +}); + + +$CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod;$ShippingDetailsCopyWith<$Res>? get shipping; + +} +/// @nodoc +class _$ConfirmCardPaymentDataCopyWithImpl<$Res> implements $ConfirmCardPaymentDataCopyWith<$Res> { - _$ConfirmCardPaymentDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? shipping = freezed, - Object? returnUrl = freezed, - Object? receiptEmail = freezed, - Object? setupFutureUsage = freezed, - Object? paymentMethodOptions = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as CardPaymentMethodDetails?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - paymentMethodOptions: freezed == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); + _$ConfirmCardPaymentDataCopyWithImpl(this._self, this._then); + + final ConfirmCardPaymentData _self; + final $Res Function(ConfirmCardPaymentData) _then; + +/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? shipping = freezed,Object? returnUrl = freezed,Object? receiptEmail = freezed,Object? setupFutureUsage = freezed,Object? paymentMethodOptions = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as CardPaymentMethodDetails?,shipping: freezed == shipping ? _self.shipping : shipping // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?,receiptEmail: freezed == receiptEmail ? _self.receiptEmail : receiptEmail // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?,paymentMethodOptions: freezed == paymentMethodOptions ? _self.paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} +/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $CardPaymentMethodDetailsCopyWith<$Res>(_value.paymentMethod!, - (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); + return $CardPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shipping { + if (_self.shipping == null) { + return null; } - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shipping { - if (_value.shipping == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shipping!, (value) { - return _then(_value.copyWith(shipping: value) as $Val); - }); - } + return $ShippingDetailsCopyWith<$Res>(_self.shipping!, (value) { + return _then(_self.copyWith(shipping: value)); + }); +} } -/// @nodoc -abstract class _$$ConfirmCardPaymentDataImplCopyWith<$Res> - implements $ConfirmCardPaymentDataCopyWith<$Res> { - factory _$$ConfirmCardPaymentDataImplCopyWith( - _$ConfirmCardPaymentDataImpl value, - $Res Function(_$ConfirmCardPaymentDataImpl) then) = - __$$ConfirmCardPaymentDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, - ShippingDetails? shipping, - @JsonKey(name: "return_url") String? returnUrl, - @JsonKey(name: "receipt_email") String? receiptEmail, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage, - @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions}); - - @override - $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; - @override - $ShippingDetailsCopyWith<$Res>? get shipping; + +/// Adds pattern-matching-related methods to [ConfirmCardPaymentData]. +extension ConfirmCardPaymentDataPatterns on ConfirmCardPaymentData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmCardPaymentData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmCardPaymentData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmCardPaymentData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardPaymentData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmCardPaymentData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardPaymentData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, ShippingDetails? shipping, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "receipt_email") String? receiptEmail, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmCardPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.shipping,_that.returnUrl,_that.receiptEmail,_that.setupFutureUsage,_that.paymentMethodOptions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, ShippingDetails? shipping, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "receipt_email") String? receiptEmail, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions) $default,) {final _that = this; +switch (_that) { +case _ConfirmCardPaymentData(): +return $default(_that.paymentMethod,_that.shipping,_that.returnUrl,_that.receiptEmail,_that.setupFutureUsage,_that.paymentMethodOptions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, ShippingDetails? shipping, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "receipt_email") String? receiptEmail, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions)? $default,) {final _that = this; +switch (_that) { +case _ConfirmCardPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.shipping,_that.returnUrl,_that.receiptEmail,_that.setupFutureUsage,_that.paymentMethodOptions);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmCardPaymentDataImplCopyWithImpl<$Res> - extends _$ConfirmCardPaymentDataCopyWithImpl<$Res, - _$ConfirmCardPaymentDataImpl> - implements _$$ConfirmCardPaymentDataImplCopyWith<$Res> { - __$$ConfirmCardPaymentDataImplCopyWithImpl( - _$ConfirmCardPaymentDataImpl _value, - $Res Function(_$ConfirmCardPaymentDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? shipping = freezed, - Object? returnUrl = freezed, - Object? receiptEmail = freezed, - Object? setupFutureUsage = freezed, - Object? paymentMethodOptions = freezed, - }) { - return _then(_$ConfirmCardPaymentDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as CardPaymentMethodDetails?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - paymentMethodOptions: freezed == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as dynamic, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmCardPaymentDataImpl implements _ConfirmCardPaymentData { - const _$ConfirmCardPaymentDataImpl( - {@paymentMethodDetailJsonKey this.paymentMethod, - this.shipping, - @JsonKey(name: "return_url") this.returnUrl, - @JsonKey(name: "receipt_email") this.receiptEmail, - @JsonKey(name: "setup_future_usage") this.setupFutureUsage, - @JsonKey(name: "payment_method_options") this.paymentMethodOptions}); - - factory _$ConfirmCardPaymentDataImpl.fromJson(Map json) => - _$$ConfirmCardPaymentDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - final CardPaymentMethodDetails? paymentMethod; - - /// The shipping details for the payment, if collected. - @override - final ShippingDetails? shipping; - - /// If you are handling next actions yourself, pass in a return_url. - /// If the subsequent action is redirect_to_url, - /// this URL will be used on the return path for the redirect. - @override - @JsonKey(name: "return_url") - final String? returnUrl; - - /// Email address that the receipt for the resulting payment will be sent to. - @override - @JsonKey(name: "receipt_email") - final String? receiptEmail; - - /// Indicates that you intend to make future payments with this - /// PaymentIntent's payment method. - /// - /// If present, the payment method used with this PaymentIntent can be attached - /// to a Customer, even after the transaction completes. - /// - /// Use on_session if you intend to only reuse the payment method when your - /// customer is present in your checkout flow. Use off_session if your customer - /// may or may not be in your checkout flow. See saving card details during - /// payment to learn more. - /// - /// Stripe uses setup_future_usage to dynamically optimize your payment flow - /// and comply with regional legislation and network rules. For example, if - /// your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer. - @override - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage; - - /// An object containing payment-method-specific configuration to - /// confirm the PaymentIntent with. - @override - @JsonKey(name: "payment_method_options") - final dynamic paymentMethodOptions; - - @override - String toString() { - return 'ConfirmCardPaymentData(paymentMethod: $paymentMethod, shipping: $shipping, returnUrl: $returnUrl, receiptEmail: $receiptEmail, setupFutureUsage: $setupFutureUsage, paymentMethodOptions: $paymentMethodOptions)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmCardPaymentDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.shipping, shipping) || - other.shipping == shipping) && - (identical(other.returnUrl, returnUrl) || - other.returnUrl == returnUrl) && - (identical(other.receiptEmail, receiptEmail) || - other.receiptEmail == receiptEmail) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage) && - const DeepCollectionEquality() - .equals(other.paymentMethodOptions, paymentMethodOptions)); +class _ConfirmCardPaymentData implements ConfirmCardPaymentData { + const _ConfirmCardPaymentData({@paymentMethodDetailJsonKey this.paymentMethod, this.shipping, @JsonKey(name: "return_url") this.returnUrl, @JsonKey(name: "receipt_email") this.receiptEmail, @JsonKey(name: "setup_future_usage") this.setupFutureUsage, @JsonKey(name: "payment_method_options") this.paymentMethodOptions}); + factory _ConfirmCardPaymentData.fromJson(Map json) => _$ConfirmCardPaymentDataFromJson(json); + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@override@paymentMethodDetailJsonKey final CardPaymentMethodDetails? paymentMethod; +/// The shipping details for the payment, if collected. +@override final ShippingDetails? shipping; +/// If you are handling next actions yourself, pass in a return_url. +/// If the subsequent action is redirect_to_url, +/// this URL will be used on the return path for the redirect. +@override@JsonKey(name: "return_url") final String? returnUrl; +/// Email address that the receipt for the resulting payment will be sent to. +@override@JsonKey(name: "receipt_email") final String? receiptEmail; +/// Indicates that you intend to make future payments with this +/// PaymentIntent's payment method. +/// +/// If present, the payment method used with this PaymentIntent can be attached +/// to a Customer, even after the transaction completes. +/// +/// Use on_session if you intend to only reuse the payment method when your +/// customer is present in your checkout flow. Use off_session if your customer +/// may or may not be in your checkout flow. See saving card details during +/// payment to learn more. +/// +/// Stripe uses setup_future_usage to dynamically optimize your payment flow +/// and comply with regional legislation and network rules. For example, if +/// your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer. +@override@JsonKey(name: "setup_future_usage") final PaymentIntentSetupFutureUsage? setupFutureUsage; +/// An object containing payment-method-specific configuration to +/// confirm the PaymentIntent with. +@override@JsonKey(name: "payment_method_options") final dynamic paymentMethodOptions; + +/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmCardPaymentDataCopyWith<_ConfirmCardPaymentData> get copyWith => __$ConfirmCardPaymentDataCopyWithImpl<_ConfirmCardPaymentData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmCardPaymentDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmCardPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.shipping, shipping) || other.shipping == shipping)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)&&(identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&const DeepCollectionEquality().equals(other.paymentMethodOptions, paymentMethodOptions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,shipping,returnUrl,receiptEmail,setupFutureUsage,const DeepCollectionEquality().hash(paymentMethodOptions)); + +@override +String toString() { + return 'ConfirmCardPaymentData(paymentMethod: $paymentMethod, shipping: $shipping, returnUrl: $returnUrl, receiptEmail: $receiptEmail, setupFutureUsage: $setupFutureUsage, paymentMethodOptions: $paymentMethodOptions)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmCardPaymentDataCopyWith<$Res> implements $ConfirmCardPaymentDataCopyWith<$Res> { + factory _$ConfirmCardPaymentDataCopyWith(_ConfirmCardPaymentData value, $Res Function(_ConfirmCardPaymentData) _then) = __$ConfirmCardPaymentDataCopyWithImpl; +@override @useResult +$Res call({ +@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, ShippingDetails? shipping,@JsonKey(name: "return_url") String? returnUrl,@JsonKey(name: "receipt_email") String? receiptEmail,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage,@JsonKey(name: "payment_method_options") dynamic paymentMethodOptions +}); + + +@override $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod;@override $ShippingDetailsCopyWith<$Res>? get shipping; + +} +/// @nodoc +class __$ConfirmCardPaymentDataCopyWithImpl<$Res> + implements _$ConfirmCardPaymentDataCopyWith<$Res> { + __$ConfirmCardPaymentDataCopyWithImpl(this._self, this._then); + + final _ConfirmCardPaymentData _self; + final $Res Function(_ConfirmCardPaymentData) _then; + +/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? shipping = freezed,Object? returnUrl = freezed,Object? receiptEmail = freezed,Object? setupFutureUsage = freezed,Object? paymentMethodOptions = freezed,}) { + return _then(_ConfirmCardPaymentData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as CardPaymentMethodDetails?,shipping: freezed == shipping ? _self.shipping : shipping // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?,receiptEmail: freezed == receiptEmail ? _self.receiptEmail : receiptEmail // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?,paymentMethodOptions: freezed == paymentMethodOptions ? _self.paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} + +/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - paymentMethod, - shipping, - returnUrl, - receiptEmail, - setupFutureUsage, - const DeepCollectionEquality().hash(paymentMethodOptions)); - - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmCardPaymentDataImplCopyWith<_$ConfirmCardPaymentDataImpl> - get copyWith => __$$ConfirmCardPaymentDataImplCopyWithImpl< - _$ConfirmCardPaymentDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmCardPaymentDataImplToJson( - this, - ); + return $CardPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of ConfirmCardPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shipping { + if (_self.shipping == null) { + return null; } -} -abstract class _ConfirmCardPaymentData implements ConfirmCardPaymentData { - const factory _ConfirmCardPaymentData( - {@paymentMethodDetailJsonKey - final CardPaymentMethodDetails? paymentMethod, - final ShippingDetails? shipping, - @JsonKey(name: "return_url") final String? returnUrl, - @JsonKey(name: "receipt_email") final String? receiptEmail, - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage, - @JsonKey(name: "payment_method_options") - final dynamic paymentMethodOptions}) = _$ConfirmCardPaymentDataImpl; - - factory _ConfirmCardPaymentData.fromJson(Map json) = - _$ConfirmCardPaymentDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - CardPaymentMethodDetails? get paymentMethod; - - /// The shipping details for the payment, if collected. - @override - ShippingDetails? get shipping; - - /// If you are handling next actions yourself, pass in a return_url. - /// If the subsequent action is redirect_to_url, - /// this URL will be used on the return path for the redirect. - @override - @JsonKey(name: "return_url") - String? get returnUrl; - - /// Email address that the receipt for the resulting payment will be sent to. - @override - @JsonKey(name: "receipt_email") - String? get receiptEmail; - - /// Indicates that you intend to make future payments with this - /// PaymentIntent's payment method. - /// - /// If present, the payment method used with this PaymentIntent can be attached - /// to a Customer, even after the transaction completes. - /// - /// Use on_session if you intend to only reuse the payment method when your - /// customer is present in your checkout flow. Use off_session if your customer - /// may or may not be in your checkout flow. See saving card details during - /// payment to learn more. - /// - /// Stripe uses setup_future_usage to dynamically optimize your payment flow - /// and comply with regional legislation and network rules. For example, if - /// your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer. - @override - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage; - - /// An object containing payment-method-specific configuration to - /// confirm the PaymentIntent with. - @override - @JsonKey(name: "payment_method_options") - dynamic get paymentMethodOptions; - - /// Create a copy of ConfirmCardPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmCardPaymentDataImplCopyWith<_$ConfirmCardPaymentDataImpl> - get copyWith => throw _privateConstructorUsedError; + return $ShippingDetailsCopyWith<$Res>(_self.shipping!, (value) { + return _then(_self.copyWith(shipping: value)); + }); } +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.g.dart index e138e69cb..e11d2b10e 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_data.g.dart @@ -6,43 +6,40 @@ part of 'confirm_card_payment_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmCardPaymentDataImpl _$$ConfirmCardPaymentDataImplFromJson(Map json) => - _$ConfirmCardPaymentDataImpl( +_ConfirmCardPaymentData _$ConfirmCardPaymentDataFromJson(Map json) => + _ConfirmCardPaymentData( paymentMethod: json['payment_method'] == null ? null : CardPaymentMethodDetails.fromJson( - Map.from(json['payment_method'] as Map)), + Map.from(json['payment_method'] as Map), + ), shipping: json['shipping'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shipping'] as Map)), + Map.from(json['shipping'] as Map), + ), returnUrl: json['return_url'] as String?, receiptEmail: json['receipt_email'] as String?, setupFutureUsage: $enumDecodeNullable( - _$PaymentIntentSetupFutureUsageEnumMap, json['setup_future_usage']), + _$PaymentIntentSetupFutureUsageEnumMap, + json['setup_future_usage'], + ), paymentMethodOptions: json['payment_method_options'], ); -Map _$$ConfirmCardPaymentDataImplToJson( - _$ConfirmCardPaymentDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', - PaymentMethodDetails.toJsonConverter(instance.paymentMethod)); - writeNotNull('shipping', instance.shipping?.toJson()); - writeNotNull('return_url', instance.returnUrl); - writeNotNull('receipt_email', instance.receiptEmail); - writeNotNull('setup_future_usage', - _$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage]); - writeNotNull('payment_method_options', instance.paymentMethodOptions); - return val; -} +Map _$ConfirmCardPaymentDataToJson( + _ConfirmCardPaymentData instance, +) => { + 'payment_method': ?PaymentMethodDetails.toJsonConverter( + instance.paymentMethod, + ), + 'shipping': ?instance.shipping?.toJson(), + 'return_url': ?instance.returnUrl, + 'receipt_email': ?instance.receiptEmail, + 'setup_future_usage': + ?_$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage], + 'payment_method_options': ?instance.paymentMethodOptions, +}; const _$PaymentIntentSetupFutureUsageEnumMap = { PaymentIntentSetupFutureUsage.onSession: 'on_session', diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.dart index 0456fb8bb..19b5f15ef 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.dart @@ -4,7 +4,7 @@ part 'confirm_card_payment_options.freezed.dart'; part 'confirm_card_payment_options.g.dart'; @freezed -class ConfirmCardPaymentOptions with _$ConfirmCardPaymentOptions { +abstract class ConfirmCardPaymentOptions with _$ConfirmCardPaymentOptions { const factory ConfirmCardPaymentOptions({ /// Set this to false if you want to handle next actions yourself, /// or if you want to defer next action handling until later diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.freezed.dart index 148f6ef0c..28f502b8c 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,174 +9,275 @@ part of 'confirm_card_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmCardPaymentOptions _$ConfirmCardPaymentOptionsFromJson( - Map json) { - return _ConfirmCardPaymentOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmCardPaymentOptions { - /// Set this to false if you want to handle next actions yourself, - /// or if you want to defer next action handling until later - /// (e.g. for use in the PaymentRequest API). Default is true. - bool? get handleActions => throw _privateConstructorUsedError; + +/// Set this to false if you want to handle next actions yourself, +/// or if you want to defer next action handling until later +/// (e.g. for use in the PaymentRequest API). Default is true. + bool? get handleActions; +/// Create a copy of ConfirmCardPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmCardPaymentOptionsCopyWith get copyWith => _$ConfirmCardPaymentOptionsCopyWithImpl(this as ConfirmCardPaymentOptions, _$identity); /// Serializes this ConfirmCardPaymentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmCardPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmCardPaymentOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmCardPaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); } -/// @nodoc -abstract class $ConfirmCardPaymentOptionsCopyWith<$Res> { - factory $ConfirmCardPaymentOptionsCopyWith(ConfirmCardPaymentOptions value, - $Res Function(ConfirmCardPaymentOptions) then) = - _$ConfirmCardPaymentOptionsCopyWithImpl<$Res, ConfirmCardPaymentOptions>; - @useResult - $Res call({bool? handleActions}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmCardPaymentOptions(handleActions: $handleActions)'; } -/// @nodoc -class _$ConfirmCardPaymentOptionsCopyWithImpl<$Res, - $Val extends ConfirmCardPaymentOptions> - implements $ConfirmCardPaymentOptionsCopyWith<$Res> { - _$ConfirmCardPaymentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmCardPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_value.copyWith( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmCardPaymentOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmCardPaymentOptionsCopyWith<$Res> { + factory $ConfirmCardPaymentOptionsCopyWith(ConfirmCardPaymentOptions value, $Res Function(ConfirmCardPaymentOptions) _then) = _$ConfirmCardPaymentOptionsCopyWithImpl; +@useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class _$ConfirmCardPaymentOptionsCopyWithImpl<$Res> implements $ConfirmCardPaymentOptionsCopyWith<$Res> { - factory _$$ConfirmCardPaymentOptionsImplCopyWith( - _$ConfirmCardPaymentOptionsImpl value, - $Res Function(_$ConfirmCardPaymentOptionsImpl) then) = - __$$ConfirmCardPaymentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? handleActions}); + _$ConfirmCardPaymentOptionsCopyWithImpl(this._self, this._then); + + final ConfirmCardPaymentOptions _self; + final $Res Function(ConfirmCardPaymentOptions) _then; + +/// Create a copy of ConfirmCardPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? handleActions = freezed,}) { + return _then(_self.copyWith( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmCardPaymentOptions]. +extension ConfirmCardPaymentOptionsPatterns on ConfirmCardPaymentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmCardPaymentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmCardPaymentOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmCardPaymentOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardPaymentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmCardPaymentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardPaymentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? handleActions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmCardPaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? handleActions) $default,) {final _that = this; +switch (_that) { +case _ConfirmCardPaymentOptions(): +return $default(_that.handleActions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? handleActions)? $default,) {final _that = this; +switch (_that) { +case _ConfirmCardPaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmCardPaymentOptionsImplCopyWithImpl<$Res> - extends _$ConfirmCardPaymentOptionsCopyWithImpl<$Res, - _$ConfirmCardPaymentOptionsImpl> - implements _$$ConfirmCardPaymentOptionsImplCopyWith<$Res> { - __$$ConfirmCardPaymentOptionsImplCopyWithImpl( - _$ConfirmCardPaymentOptionsImpl _value, - $Res Function(_$ConfirmCardPaymentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmCardPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_$ConfirmCardPaymentOptionsImpl( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmCardPaymentOptionsImpl implements _ConfirmCardPaymentOptions { - const _$ConfirmCardPaymentOptionsImpl({this.handleActions = true}); - - factory _$ConfirmCardPaymentOptionsImpl.fromJson(Map json) => - _$$ConfirmCardPaymentOptionsImplFromJson(json); - - /// Set this to false if you want to handle next actions yourself, - /// or if you want to defer next action handling until later - /// (e.g. for use in the PaymentRequest API). Default is true. - @override - @JsonKey() - final bool? handleActions; - - @override - String toString() { - return 'ConfirmCardPaymentOptions(handleActions: $handleActions)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmCardPaymentOptionsImpl && - (identical(other.handleActions, handleActions) || - other.handleActions == handleActions)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, handleActions); - - /// Create a copy of ConfirmCardPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmCardPaymentOptionsImplCopyWith<_$ConfirmCardPaymentOptionsImpl> - get copyWith => __$$ConfirmCardPaymentOptionsImplCopyWithImpl< - _$ConfirmCardPaymentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmCardPaymentOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmCardPaymentOptions implements ConfirmCardPaymentOptions { - const factory _ConfirmCardPaymentOptions({final bool? handleActions}) = - _$ConfirmCardPaymentOptionsImpl; - - factory _ConfirmCardPaymentOptions.fromJson(Map json) = - _$ConfirmCardPaymentOptionsImpl.fromJson; - - /// Set this to false if you want to handle next actions yourself, - /// or if you want to defer next action handling until later - /// (e.g. for use in the PaymentRequest API). Default is true. - @override - bool? get handleActions; - - /// Create a copy of ConfirmCardPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmCardPaymentOptionsImplCopyWith<_$ConfirmCardPaymentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmCardPaymentOptions implements ConfirmCardPaymentOptions { + const _ConfirmCardPaymentOptions({this.handleActions = true}); + factory _ConfirmCardPaymentOptions.fromJson(Map json) => _$ConfirmCardPaymentOptionsFromJson(json); + +/// Set this to false if you want to handle next actions yourself, +/// or if you want to defer next action handling until later +/// (e.g. for use in the PaymentRequest API). Default is true. +@override@JsonKey() final bool? handleActions; + +/// Create a copy of ConfirmCardPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmCardPaymentOptionsCopyWith<_ConfirmCardPaymentOptions> get copyWith => __$ConfirmCardPaymentOptionsCopyWithImpl<_ConfirmCardPaymentOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmCardPaymentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmCardPaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmCardPaymentOptions(handleActions: $handleActions)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmCardPaymentOptionsCopyWith<$Res> implements $ConfirmCardPaymentOptionsCopyWith<$Res> { + factory _$ConfirmCardPaymentOptionsCopyWith(_ConfirmCardPaymentOptions value, $Res Function(_ConfirmCardPaymentOptions) _then) = __$ConfirmCardPaymentOptionsCopyWithImpl; +@override @useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class __$ConfirmCardPaymentOptionsCopyWithImpl<$Res> + implements _$ConfirmCardPaymentOptionsCopyWith<$Res> { + __$ConfirmCardPaymentOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmCardPaymentOptions _self; + final $Res Function(_ConfirmCardPaymentOptions) _then; + +/// Create a copy of ConfirmCardPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? handleActions = freezed,}) { + return _then(_ConfirmCardPaymentOptions( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.g.dart index 330f88c64..5c351a256 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_card_payment_options.g.dart @@ -6,22 +6,11 @@ part of 'confirm_card_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmCardPaymentOptionsImpl _$$ConfirmCardPaymentOptionsImplFromJson( - Map json) => - _$ConfirmCardPaymentOptionsImpl( +_ConfirmCardPaymentOptions _$ConfirmCardPaymentOptionsFromJson(Map json) => + _ConfirmCardPaymentOptions( handleActions: json['handleActions'] as bool? ?? true, ); -Map _$$ConfirmCardPaymentOptionsImplToJson( - _$ConfirmCardPaymentOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('handleActions', instance.handleActions); - return val; -} +Map _$ConfirmCardPaymentOptionsToJson( + _ConfirmCardPaymentOptions instance, +) => {'handleActions': ?instance.handleActions}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.dart index 6fbde7351..d53d5fbbc 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.dart @@ -5,7 +5,7 @@ part 'confirm_ideal_payment_data.freezed.dart'; part 'confirm_ideal_payment_data.g.dart'; @freezed -class ConfirmIdealPaymentData with _$ConfirmIdealPaymentData { +abstract class ConfirmIdealPaymentData with _$ConfirmIdealPaymentData { const factory ConfirmIdealPaymentData({ /// Either the id of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.freezed.dart index 73e80283b..51c440c7c 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,279 +9,317 @@ part of 'confirm_ideal_payment_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmIdealPaymentData _$ConfirmIdealPaymentDataFromJson( - Map json) { - return _ConfirmIdealPaymentData.fromJson(json); -} - /// @nodoc mixin _$ConfirmIdealPaymentData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @paymentMethodDetailJsonKey - IdealPaymentMethodDetails? get paymentMethod => - throw _privateConstructorUsedError; - - /// The url your customer will be directed to after they complete authentication. - @JsonKey(name: "return_url") - String? get returnUrl => throw _privateConstructorUsedError; - - /// To set up a SEPA Direct Debit payment method using the bank details - /// from this iDEAL payment, set this parameter to off_session. - /// When using this parameter, a customer will need to be set on the - /// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod - /// will be attached to this customer. - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage => - throw _privateConstructorUsedError; + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@paymentMethodDetailJsonKey IdealPaymentMethodDetails? get paymentMethod;/// The url your customer will be directed to after they complete authentication. +@JsonKey(name: "return_url") String? get returnUrl;/// To set up a SEPA Direct Debit payment method using the bank details +/// from this iDEAL payment, set this parameter to off_session. +/// When using this parameter, a customer will need to be set on the +/// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod +/// will be attached to this customer. +@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? get setupFutureUsage; +/// Create a copy of ConfirmIdealPaymentData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmIdealPaymentDataCopyWith get copyWith => _$ConfirmIdealPaymentDataCopyWithImpl(this as ConfirmIdealPaymentData, _$identity); /// Serializes this ConfirmIdealPaymentData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmIdealPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmIdealPaymentDataCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmIdealPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); } -/// @nodoc -abstract class $ConfirmIdealPaymentDataCopyWith<$Res> { - factory $ConfirmIdealPaymentDataCopyWith(ConfirmIdealPaymentData value, - $Res Function(ConfirmIdealPaymentData) then) = - _$ConfirmIdealPaymentDataCopyWithImpl<$Res, ConfirmIdealPaymentData>; - @useResult - $Res call( - {@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage}); - - $IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl,setupFutureUsage); + +@override +String toString() { + return 'ConfirmIdealPaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl, setupFutureUsage: $setupFutureUsage)'; +} + + } /// @nodoc -class _$ConfirmIdealPaymentDataCopyWithImpl<$Res, - $Val extends ConfirmIdealPaymentData> +abstract mixin class $ConfirmIdealPaymentDataCopyWith<$Res> { + factory $ConfirmIdealPaymentDataCopyWith(ConfirmIdealPaymentData value, $Res Function(ConfirmIdealPaymentData) _then) = _$ConfirmIdealPaymentDataCopyWithImpl; +@useResult +$Res call({ +@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod,@JsonKey(name: "return_url") String? returnUrl,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage +}); + + +$IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} +/// @nodoc +class _$ConfirmIdealPaymentDataCopyWithImpl<$Res> implements $ConfirmIdealPaymentDataCopyWith<$Res> { - _$ConfirmIdealPaymentDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmIdealPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - Object? setupFutureUsage = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as IdealPaymentMethodDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - ) as $Val); + _$ConfirmIdealPaymentDataCopyWithImpl(this._self, this._then); + + final ConfirmIdealPaymentData _self; + final $Res Function(ConfirmIdealPaymentData) _then; + +/// Create a copy of ConfirmIdealPaymentData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,Object? setupFutureUsage = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as IdealPaymentMethodDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?, + )); +} +/// Create a copy of ConfirmIdealPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of ConfirmIdealPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $IdealPaymentMethodDetailsCopyWith<$Res>(_value.paymentMethod!, - (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); - } + return $IdealPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +} } -/// @nodoc -abstract class _$$ConfirmIdealPaymentDataImplCopyWith<$Res> - implements $ConfirmIdealPaymentDataCopyWith<$Res> { - factory _$$ConfirmIdealPaymentDataImplCopyWith( - _$ConfirmIdealPaymentDataImpl value, - $Res Function(_$ConfirmIdealPaymentDataImpl) then) = - __$$ConfirmIdealPaymentDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage}); - - @override - $IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +/// Adds pattern-matching-related methods to [ConfirmIdealPaymentData]. +extension ConfirmIdealPaymentDataPatterns on ConfirmIdealPaymentData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmIdealPaymentData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmIdealPaymentData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmIdealPaymentData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmIdealPaymentData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmIdealPaymentData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmIdealPaymentData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmIdealPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl,_that.setupFutureUsage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage) $default,) {final _that = this; +switch (_that) { +case _ConfirmIdealPaymentData(): +return $default(_that.paymentMethod,_that.returnUrl,_that.setupFutureUsage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage)? $default,) {final _that = this; +switch (_that) { +case _ConfirmIdealPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl,_that.setupFutureUsage);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmIdealPaymentDataImplCopyWithImpl<$Res> - extends _$ConfirmIdealPaymentDataCopyWithImpl<$Res, - _$ConfirmIdealPaymentDataImpl> - implements _$$ConfirmIdealPaymentDataImplCopyWith<$Res> { - __$$ConfirmIdealPaymentDataImplCopyWithImpl( - _$ConfirmIdealPaymentDataImpl _value, - $Res Function(_$ConfirmIdealPaymentDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmIdealPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - Object? setupFutureUsage = freezed, - }) { - return _then(_$ConfirmIdealPaymentDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as IdealPaymentMethodDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmIdealPaymentDataImpl implements _ConfirmIdealPaymentData { - const _$ConfirmIdealPaymentDataImpl( - {@paymentMethodDetailJsonKey this.paymentMethod, - @JsonKey(name: "return_url") this.returnUrl, - @JsonKey(name: "setup_future_usage") this.setupFutureUsage}); - - factory _$ConfirmIdealPaymentDataImpl.fromJson(Map json) => - _$$ConfirmIdealPaymentDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - final IdealPaymentMethodDetails? paymentMethod; - - /// The url your customer will be directed to after they complete authentication. - @override - @JsonKey(name: "return_url") - final String? returnUrl; - - /// To set up a SEPA Direct Debit payment method using the bank details - /// from this iDEAL payment, set this parameter to off_session. - /// When using this parameter, a customer will need to be set on the - /// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod - /// will be attached to this customer. - @override - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage; - - @override - String toString() { - return 'ConfirmIdealPaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl, setupFutureUsage: $setupFutureUsage)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmIdealPaymentDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.returnUrl, returnUrl) || - other.returnUrl == returnUrl) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage)); - } +class _ConfirmIdealPaymentData implements ConfirmIdealPaymentData { + const _ConfirmIdealPaymentData({@paymentMethodDetailJsonKey this.paymentMethod, @JsonKey(name: "return_url") this.returnUrl, @JsonKey(name: "setup_future_usage") this.setupFutureUsage}); + factory _ConfirmIdealPaymentData.fromJson(Map json) => _$ConfirmIdealPaymentDataFromJson(json); + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@override@paymentMethodDetailJsonKey final IdealPaymentMethodDetails? paymentMethod; +/// The url your customer will be directed to after they complete authentication. +@override@JsonKey(name: "return_url") final String? returnUrl; +/// To set up a SEPA Direct Debit payment method using the bank details +/// from this iDEAL payment, set this parameter to off_session. +/// When using this parameter, a customer will need to be set on the +/// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod +/// will be attached to this customer. +@override@JsonKey(name: "setup_future_usage") final PaymentIntentSetupFutureUsage? setupFutureUsage; + +/// Create a copy of ConfirmIdealPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmIdealPaymentDataCopyWith<_ConfirmIdealPaymentData> get copyWith => __$ConfirmIdealPaymentDataCopyWithImpl<_ConfirmIdealPaymentData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmIdealPaymentDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, paymentMethod, returnUrl, setupFutureUsage); - - /// Create a copy of ConfirmIdealPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmIdealPaymentDataImplCopyWith<_$ConfirmIdealPaymentDataImpl> - get copyWith => __$$ConfirmIdealPaymentDataImplCopyWithImpl< - _$ConfirmIdealPaymentDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmIdealPaymentDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmIdealPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl,setupFutureUsage); + +@override +String toString() { + return 'ConfirmIdealPaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl, setupFutureUsage: $setupFutureUsage)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmIdealPaymentDataCopyWith<$Res> implements $ConfirmIdealPaymentDataCopyWith<$Res> { + factory _$ConfirmIdealPaymentDataCopyWith(_ConfirmIdealPaymentData value, $Res Function(_ConfirmIdealPaymentData) _then) = __$ConfirmIdealPaymentDataCopyWithImpl; +@override @useResult +$Res call({ +@paymentMethodDetailJsonKey IdealPaymentMethodDetails? paymentMethod,@JsonKey(name: "return_url") String? returnUrl,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage +}); + + +@override $IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} +/// @nodoc +class __$ConfirmIdealPaymentDataCopyWithImpl<$Res> + implements _$ConfirmIdealPaymentDataCopyWith<$Res> { + __$ConfirmIdealPaymentDataCopyWithImpl(this._self, this._then); + + final _ConfirmIdealPaymentData _self; + final $Res Function(_ConfirmIdealPaymentData) _then; + +/// Create a copy of ConfirmIdealPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,Object? setupFutureUsage = freezed,}) { + return _then(_ConfirmIdealPaymentData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as IdealPaymentMethodDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?, + )); } -abstract class _ConfirmIdealPaymentData implements ConfirmIdealPaymentData { - const factory _ConfirmIdealPaymentData( - {@paymentMethodDetailJsonKey - final IdealPaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") final String? returnUrl, - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage}) = - _$ConfirmIdealPaymentDataImpl; - - factory _ConfirmIdealPaymentData.fromJson(Map json) = - _$ConfirmIdealPaymentDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - IdealPaymentMethodDetails? get paymentMethod; - - /// The url your customer will be directed to after they complete authentication. - @override - @JsonKey(name: "return_url") - String? get returnUrl; - - /// To set up a SEPA Direct Debit payment method using the bank details - /// from this iDEAL payment, set this parameter to off_session. - /// When using this parameter, a customer will need to be set on the - /// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod - /// will be attached to this customer. - @override - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage; - - /// Create a copy of ConfirmIdealPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmIdealPaymentDataImplCopyWith<_$ConfirmIdealPaymentDataImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of ConfirmIdealPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; + } + + return $IdealPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); } +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.g.dart index b8463f328..b47c81ef8 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_data.g.dart @@ -6,35 +6,30 @@ part of 'confirm_ideal_payment_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmIdealPaymentDataImpl _$$ConfirmIdealPaymentDataImplFromJson( - Map json) => - _$ConfirmIdealPaymentDataImpl( +_ConfirmIdealPaymentData _$ConfirmIdealPaymentDataFromJson(Map json) => + _ConfirmIdealPaymentData( paymentMethod: json['payment_method'] == null ? null : IdealPaymentMethodDetails.fromJson( - Map.from(json['payment_method'] as Map)), + Map.from(json['payment_method'] as Map), + ), returnUrl: json['return_url'] as String?, setupFutureUsage: $enumDecodeNullable( - _$PaymentIntentSetupFutureUsageEnumMap, json['setup_future_usage']), + _$PaymentIntentSetupFutureUsageEnumMap, + json['setup_future_usage'], + ), ); -Map _$$ConfirmIdealPaymentDataImplToJson( - _$ConfirmIdealPaymentDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', - PaymentMethodDetails.toJsonConverter(instance.paymentMethod)); - writeNotNull('return_url', instance.returnUrl); - writeNotNull('setup_future_usage', - _$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage]); - return val; -} +Map _$ConfirmIdealPaymentDataToJson( + _ConfirmIdealPaymentData instance, +) => { + 'payment_method': ?PaymentMethodDetails.toJsonConverter( + instance.paymentMethod, + ), + 'return_url': ?instance.returnUrl, + 'setup_future_usage': + ?_$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage], +}; const _$PaymentIntentSetupFutureUsageEnumMap = { PaymentIntentSetupFutureUsage.onSession: 'on_session', diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.dart index 1c57507c3..c0c75d277 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.dart @@ -4,7 +4,7 @@ part 'confirm_ideal_payment_options.freezed.dart'; part 'confirm_ideal_payment_options.g.dart'; @freezed -class ConfirmIdealPaymentOptions with _$ConfirmIdealPaymentOptions { +abstract class ConfirmIdealPaymentOptions with _$ConfirmIdealPaymentOptions { const factory ConfirmIdealPaymentOptions({ /// Set this to false if you want to manually handle /// the authorization redirect. Default is true. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.freezed.dart index d97504263..f8ccd2861 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,174 +9,273 @@ part of 'confirm_ideal_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmIdealPaymentOptions _$ConfirmIdealPaymentOptionsFromJson( - Map json) { - return _ConfirmIdealPaymentOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmIdealPaymentOptions { - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - bool? get handleActions => throw _privateConstructorUsedError; + +/// Set this to false if you want to manually handle +/// the authorization redirect. Default is true. + bool? get handleActions; +/// Create a copy of ConfirmIdealPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmIdealPaymentOptionsCopyWith get copyWith => _$ConfirmIdealPaymentOptionsCopyWithImpl(this as ConfirmIdealPaymentOptions, _$identity); /// Serializes this ConfirmIdealPaymentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmIdealPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmIdealPaymentOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmIdealPaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); } -/// @nodoc -abstract class $ConfirmIdealPaymentOptionsCopyWith<$Res> { - factory $ConfirmIdealPaymentOptionsCopyWith(ConfirmIdealPaymentOptions value, - $Res Function(ConfirmIdealPaymentOptions) then) = - _$ConfirmIdealPaymentOptionsCopyWithImpl<$Res, - ConfirmIdealPaymentOptions>; - @useResult - $Res call({bool? handleActions}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmIdealPaymentOptions(handleActions: $handleActions)'; } -/// @nodoc -class _$ConfirmIdealPaymentOptionsCopyWithImpl<$Res, - $Val extends ConfirmIdealPaymentOptions> - implements $ConfirmIdealPaymentOptionsCopyWith<$Res> { - _$ConfirmIdealPaymentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmIdealPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_value.copyWith( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmIdealPaymentOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmIdealPaymentOptionsCopyWith<$Res> { + factory $ConfirmIdealPaymentOptionsCopyWith(ConfirmIdealPaymentOptions value, $Res Function(ConfirmIdealPaymentOptions) _then) = _$ConfirmIdealPaymentOptionsCopyWithImpl; +@useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class _$ConfirmIdealPaymentOptionsCopyWithImpl<$Res> implements $ConfirmIdealPaymentOptionsCopyWith<$Res> { - factory _$$ConfirmIdealPaymentOptionsImplCopyWith( - _$ConfirmIdealPaymentOptionsImpl value, - $Res Function(_$ConfirmIdealPaymentOptionsImpl) then) = - __$$ConfirmIdealPaymentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? handleActions}); + _$ConfirmIdealPaymentOptionsCopyWithImpl(this._self, this._then); + + final ConfirmIdealPaymentOptions _self; + final $Res Function(ConfirmIdealPaymentOptions) _then; + +/// Create a copy of ConfirmIdealPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? handleActions = freezed,}) { + return _then(_self.copyWith( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmIdealPaymentOptions]. +extension ConfirmIdealPaymentOptionsPatterns on ConfirmIdealPaymentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmIdealPaymentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmIdealPaymentOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmIdealPaymentOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmIdealPaymentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmIdealPaymentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmIdealPaymentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? handleActions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmIdealPaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? handleActions) $default,) {final _that = this; +switch (_that) { +case _ConfirmIdealPaymentOptions(): +return $default(_that.handleActions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? handleActions)? $default,) {final _that = this; +switch (_that) { +case _ConfirmIdealPaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmIdealPaymentOptionsImplCopyWithImpl<$Res> - extends _$ConfirmIdealPaymentOptionsCopyWithImpl<$Res, - _$ConfirmIdealPaymentOptionsImpl> - implements _$$ConfirmIdealPaymentOptionsImplCopyWith<$Res> { - __$$ConfirmIdealPaymentOptionsImplCopyWithImpl( - _$ConfirmIdealPaymentOptionsImpl _value, - $Res Function(_$ConfirmIdealPaymentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmIdealPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_$ConfirmIdealPaymentOptionsImpl( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmIdealPaymentOptionsImpl implements _ConfirmIdealPaymentOptions { - const _$ConfirmIdealPaymentOptionsImpl({this.handleActions = true}); - - factory _$ConfirmIdealPaymentOptionsImpl.fromJson( - Map json) => - _$$ConfirmIdealPaymentOptionsImplFromJson(json); - - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - @override - @JsonKey() - final bool? handleActions; - - @override - String toString() { - return 'ConfirmIdealPaymentOptions(handleActions: $handleActions)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmIdealPaymentOptionsImpl && - (identical(other.handleActions, handleActions) || - other.handleActions == handleActions)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, handleActions); - - /// Create a copy of ConfirmIdealPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmIdealPaymentOptionsImplCopyWith<_$ConfirmIdealPaymentOptionsImpl> - get copyWith => __$$ConfirmIdealPaymentOptionsImplCopyWithImpl< - _$ConfirmIdealPaymentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmIdealPaymentOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmIdealPaymentOptions - implements ConfirmIdealPaymentOptions { - const factory _ConfirmIdealPaymentOptions({final bool? handleActions}) = - _$ConfirmIdealPaymentOptionsImpl; - - factory _ConfirmIdealPaymentOptions.fromJson(Map json) = - _$ConfirmIdealPaymentOptionsImpl.fromJson; - - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - @override - bool? get handleActions; - - /// Create a copy of ConfirmIdealPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmIdealPaymentOptionsImplCopyWith<_$ConfirmIdealPaymentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmIdealPaymentOptions implements ConfirmIdealPaymentOptions { + const _ConfirmIdealPaymentOptions({this.handleActions = true}); + factory _ConfirmIdealPaymentOptions.fromJson(Map json) => _$ConfirmIdealPaymentOptionsFromJson(json); + +/// Set this to false if you want to manually handle +/// the authorization redirect. Default is true. +@override@JsonKey() final bool? handleActions; + +/// Create a copy of ConfirmIdealPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmIdealPaymentOptionsCopyWith<_ConfirmIdealPaymentOptions> get copyWith => __$ConfirmIdealPaymentOptionsCopyWithImpl<_ConfirmIdealPaymentOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmIdealPaymentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmIdealPaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmIdealPaymentOptions(handleActions: $handleActions)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmIdealPaymentOptionsCopyWith<$Res> implements $ConfirmIdealPaymentOptionsCopyWith<$Res> { + factory _$ConfirmIdealPaymentOptionsCopyWith(_ConfirmIdealPaymentOptions value, $Res Function(_ConfirmIdealPaymentOptions) _then) = __$ConfirmIdealPaymentOptionsCopyWithImpl; +@override @useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class __$ConfirmIdealPaymentOptionsCopyWithImpl<$Res> + implements _$ConfirmIdealPaymentOptionsCopyWith<$Res> { + __$ConfirmIdealPaymentOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmIdealPaymentOptions _self; + final $Res Function(_ConfirmIdealPaymentOptions) _then; + +/// Create a copy of ConfirmIdealPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? handleActions = freezed,}) { + return _then(_ConfirmIdealPaymentOptions( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.g.dart index b9acbf656..5589c37a7 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_ideal_payment_options.g.dart @@ -6,22 +6,11 @@ part of 'confirm_ideal_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmIdealPaymentOptionsImpl _$$ConfirmIdealPaymentOptionsImplFromJson( - Map json) => - _$ConfirmIdealPaymentOptionsImpl( +_ConfirmIdealPaymentOptions _$ConfirmIdealPaymentOptionsFromJson(Map json) => + _ConfirmIdealPaymentOptions( handleActions: json['handleActions'] as bool? ?? true, ); -Map _$$ConfirmIdealPaymentOptionsImplToJson( - _$ConfirmIdealPaymentOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('handleActions', instance.handleActions); - return val; -} +Map _$ConfirmIdealPaymentOptionsToJson( + _ConfirmIdealPaymentOptions instance, +) => {'handleActions': ?instance.handleActions}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.dart index 34dd2afe3..014bdd4ad 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.dart @@ -5,7 +5,7 @@ part 'confirm_p24_payment_data.freezed.dart'; part 'confirm_p24_payment_data.g.dart'; @freezed -class ConfirmP24PaymentData with _$ConfirmP24PaymentData { +abstract class ConfirmP24PaymentData with _$ConfirmP24PaymentData { const factory ConfirmP24PaymentData({ /// Either the ID of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.freezed.dart index 052cd449b..3fde10c32 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,277 +9,327 @@ part of 'confirm_p24_payment_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmP24PaymentData _$ConfirmP24PaymentDataFromJson( - Map json) { - return _ConfirmP24PaymentData.fromJson(json); -} - /// @nodoc mixin _$ConfirmP24PaymentData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @paymentMethodDetailJsonKey - P24PaymentMethodDetails? get paymentMethod => - throw _privateConstructorUsedError; - - /// The url your customer will be directed to after they complete authentication. - @JsonKey(name: "return_url") - String? get returnUrl => throw _privateConstructorUsedError; - - /// To set up a SEPA Direct Debit payment method using the bank details - /// from this iDEAL payment, set this parameter to off_session. - /// When using this parameter, a customer will need to be set on the - /// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod - /// will be attached to this customer. - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage => - throw _privateConstructorUsedError; + +/// Either the ID of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// +/// This is required to process the payment. If you already have a PaymentMethod +/// attached to the PaymentIntent, you do not need to specify this field. +/// +/// See the official Stripe documentation for additional details: +/// https://stripe.com/docs/payments/p24 +@paymentMethodDetailJsonKey P24PaymentMethodDetails? get paymentMethod;/// The url your customer will be directed to after they complete authentication. +@JsonKey(name: "return_url") String? get returnUrl;/// To set up a SEPA Direct Debit payment method using the bank details +/// from this P24 payment, set this parameter to off_session. +/// When using this parameter, a customer will need to be set on the +/// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod +/// will be attached to this customer. +@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? get setupFutureUsage; +/// Create a copy of ConfirmP24PaymentData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmP24PaymentDataCopyWith get copyWith => _$ConfirmP24PaymentDataCopyWithImpl(this as ConfirmP24PaymentData, _$identity); /// Serializes this ConfirmP24PaymentData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmP24PaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmP24PaymentDataCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmP24PaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); } -/// @nodoc -abstract class $ConfirmP24PaymentDataCopyWith<$Res> { - factory $ConfirmP24PaymentDataCopyWith(ConfirmP24PaymentData value, - $Res Function(ConfirmP24PaymentData) then) = - _$ConfirmP24PaymentDataCopyWithImpl<$Res, ConfirmP24PaymentData>; - @useResult - $Res call( - {@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage}); - - $P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl,setupFutureUsage); + +@override +String toString() { + return 'ConfirmP24PaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl, setupFutureUsage: $setupFutureUsage)'; +} + + } /// @nodoc -class _$ConfirmP24PaymentDataCopyWithImpl<$Res, - $Val extends ConfirmP24PaymentData> +abstract mixin class $ConfirmP24PaymentDataCopyWith<$Res> { + factory $ConfirmP24PaymentDataCopyWith(ConfirmP24PaymentData value, $Res Function(ConfirmP24PaymentData) _then) = _$ConfirmP24PaymentDataCopyWithImpl; +@useResult +$Res call({ +@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod,@JsonKey(name: "return_url") String? returnUrl,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage +}); + + +$P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} +/// @nodoc +class _$ConfirmP24PaymentDataCopyWithImpl<$Res> implements $ConfirmP24PaymentDataCopyWith<$Res> { - _$ConfirmP24PaymentDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmP24PaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - Object? setupFutureUsage = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as P24PaymentMethodDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - ) as $Val); + _$ConfirmP24PaymentDataCopyWithImpl(this._self, this._then); + + final ConfirmP24PaymentData _self; + final $Res Function(ConfirmP24PaymentData) _then; + +/// Create a copy of ConfirmP24PaymentData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,Object? setupFutureUsage = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as P24PaymentMethodDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?, + )); +} +/// Create a copy of ConfirmP24PaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of ConfirmP24PaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $P24PaymentMethodDetailsCopyWith<$Res>(_value.paymentMethod!, - (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); - } + return $P24PaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +} } -/// @nodoc -abstract class _$$ConfirmP24PaymentDataImplCopyWith<$Res> - implements $ConfirmP24PaymentDataCopyWith<$Res> { - factory _$$ConfirmP24PaymentDataImplCopyWith( - _$ConfirmP24PaymentDataImpl value, - $Res Function(_$ConfirmP24PaymentDataImpl) then) = - __$$ConfirmP24PaymentDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage}); - - @override - $P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +/// Adds pattern-matching-related methods to [ConfirmP24PaymentData]. +extension ConfirmP24PaymentDataPatterns on ConfirmP24PaymentData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmP24PaymentData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmP24PaymentData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmP24PaymentData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmP24PaymentData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmP24PaymentData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmP24PaymentData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmP24PaymentData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl,_that.setupFutureUsage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage) $default,) {final _that = this; +switch (_that) { +case _ConfirmP24PaymentData(): +return $default(_that.paymentMethod,_that.returnUrl,_that.setupFutureUsage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage)? $default,) {final _that = this; +switch (_that) { +case _ConfirmP24PaymentData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl,_that.setupFutureUsage);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmP24PaymentDataImplCopyWithImpl<$Res> - extends _$ConfirmP24PaymentDataCopyWithImpl<$Res, - _$ConfirmP24PaymentDataImpl> - implements _$$ConfirmP24PaymentDataImplCopyWith<$Res> { - __$$ConfirmP24PaymentDataImplCopyWithImpl(_$ConfirmP24PaymentDataImpl _value, - $Res Function(_$ConfirmP24PaymentDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmP24PaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - Object? setupFutureUsage = freezed, - }) { - return _then(_$ConfirmP24PaymentDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as P24PaymentMethodDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmP24PaymentDataImpl implements _ConfirmP24PaymentData { - const _$ConfirmP24PaymentDataImpl( - {@paymentMethodDetailJsonKey this.paymentMethod, - @JsonKey(name: "return_url") this.returnUrl, - @JsonKey(name: "setup_future_usage") this.setupFutureUsage}); - - factory _$ConfirmP24PaymentDataImpl.fromJson(Map json) => - _$$ConfirmP24PaymentDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - final P24PaymentMethodDetails? paymentMethod; - - /// The url your customer will be directed to after they complete authentication. - @override - @JsonKey(name: "return_url") - final String? returnUrl; - - /// To set up a SEPA Direct Debit payment method using the bank details - /// from this iDEAL payment, set this parameter to off_session. - /// When using this parameter, a customer will need to be set on the - /// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod - /// will be attached to this customer. - @override - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage; - - @override - String toString() { - return 'ConfirmP24PaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl, setupFutureUsage: $setupFutureUsage)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmP24PaymentDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.returnUrl, returnUrl) || - other.returnUrl == returnUrl) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage)); - } +class _ConfirmP24PaymentData implements ConfirmP24PaymentData { + const _ConfirmP24PaymentData({@paymentMethodDetailJsonKey this.paymentMethod, @JsonKey(name: "return_url") this.returnUrl, @JsonKey(name: "setup_future_usage") this.setupFutureUsage}); + factory _ConfirmP24PaymentData.fromJson(Map json) => _$ConfirmP24PaymentDataFromJson(json); + +/// Either the ID of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// +/// This is required to process the payment. If you already have a PaymentMethod +/// attached to the PaymentIntent, you do not need to specify this field. +/// +/// See the official Stripe documentation for additional details: +/// https://stripe.com/docs/payments/p24 +@override@paymentMethodDetailJsonKey final P24PaymentMethodDetails? paymentMethod; +/// The url your customer will be directed to after they complete authentication. +@override@JsonKey(name: "return_url") final String? returnUrl; +/// To set up a SEPA Direct Debit payment method using the bank details +/// from this P24 payment, set this parameter to off_session. +/// When using this parameter, a customer will need to be set on the +/// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod +/// will be attached to this customer. +@override@JsonKey(name: "setup_future_usage") final PaymentIntentSetupFutureUsage? setupFutureUsage; + +/// Create a copy of ConfirmP24PaymentData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmP24PaymentDataCopyWith<_ConfirmP24PaymentData> get copyWith => __$ConfirmP24PaymentDataCopyWithImpl<_ConfirmP24PaymentData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmP24PaymentDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, paymentMethod, returnUrl, setupFutureUsage); - - /// Create a copy of ConfirmP24PaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmP24PaymentDataImplCopyWith<_$ConfirmP24PaymentDataImpl> - get copyWith => __$$ConfirmP24PaymentDataImplCopyWithImpl< - _$ConfirmP24PaymentDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmP24PaymentDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmP24PaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl,setupFutureUsage); + +@override +String toString() { + return 'ConfirmP24PaymentData(paymentMethod: $paymentMethod, returnUrl: $returnUrl, setupFutureUsage: $setupFutureUsage)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmP24PaymentDataCopyWith<$Res> implements $ConfirmP24PaymentDataCopyWith<$Res> { + factory _$ConfirmP24PaymentDataCopyWith(_ConfirmP24PaymentData value, $Res Function(_ConfirmP24PaymentData) _then) = __$ConfirmP24PaymentDataCopyWithImpl; +@override @useResult +$Res call({ +@paymentMethodDetailJsonKey P24PaymentMethodDetails? paymentMethod,@JsonKey(name: "return_url") String? returnUrl,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage +}); + + +@override $P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} +/// @nodoc +class __$ConfirmP24PaymentDataCopyWithImpl<$Res> + implements _$ConfirmP24PaymentDataCopyWith<$Res> { + __$ConfirmP24PaymentDataCopyWithImpl(this._self, this._then); + + final _ConfirmP24PaymentData _self; + final $Res Function(_ConfirmP24PaymentData) _then; + +/// Create a copy of ConfirmP24PaymentData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,Object? setupFutureUsage = freezed,}) { + return _then(_ConfirmP24PaymentData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as P24PaymentMethodDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?, + )); } -abstract class _ConfirmP24PaymentData implements ConfirmP24PaymentData { - const factory _ConfirmP24PaymentData( - {@paymentMethodDetailJsonKey final P24PaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") final String? returnUrl, - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? - setupFutureUsage}) = _$ConfirmP24PaymentDataImpl; - - factory _ConfirmP24PaymentData.fromJson(Map json) = - _$ConfirmP24PaymentDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - P24PaymentMethodDetails? get paymentMethod; - - /// The url your customer will be directed to after they complete authentication. - @override - @JsonKey(name: "return_url") - String? get returnUrl; - - /// To set up a SEPA Direct Debit payment method using the bank details - /// from this iDEAL payment, set this parameter to off_session. - /// When using this parameter, a customer will need to be set on the - /// PaymentIntent. The newly created SEPA Direct Debit PaymentMethod - /// will be attached to this customer. - @override - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage; - - /// Create a copy of ConfirmP24PaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmP24PaymentDataImplCopyWith<_$ConfirmP24PaymentDataImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of ConfirmP24PaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$P24PaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; + } + + return $P24PaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); } +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.g.dart index a534a9d82..c65fbec25 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_data.g.dart @@ -6,28 +6,30 @@ part of 'confirm_p24_payment_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmP24PaymentDataImpl _$$ConfirmP24PaymentDataImplFromJson(Map json) => - _$ConfirmP24PaymentDataImpl( +_ConfirmP24PaymentData _$ConfirmP24PaymentDataFromJson(Map json) => + _ConfirmP24PaymentData( paymentMethod: json['payment_method'] == null ? null : P24PaymentMethodDetails.fromJson( - Map.from(json['payment_method'] as Map)), + Map.from(json['payment_method'] as Map), + ), returnUrl: json['return_url'] as String?, setupFutureUsage: $enumDecodeNullable( - _$PaymentIntentSetupFutureUsageEnumMap, json['setup_future_usage']), + _$PaymentIntentSetupFutureUsageEnumMap, + json['setup_future_usage'], + ), ); -Map _$$ConfirmP24PaymentDataImplToJson( - _$ConfirmP24PaymentDataImpl instance) => - { - if (PaymentMethodDetails.toJsonConverter(instance.paymentMethod) - case final value?) - 'payment_method': value, - if (instance.returnUrl case final value?) 'return_url': value, - if (_$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage] - case final value?) - 'setup_future_usage': value, - }; +Map _$ConfirmP24PaymentDataToJson( + _ConfirmP24PaymentData instance, +) => { + 'payment_method': ?PaymentMethodDetails.toJsonConverter( + instance.paymentMethod, + ), + 'return_url': ?instance.returnUrl, + 'setup_future_usage': + ?_$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage], +}; const _$PaymentIntentSetupFutureUsageEnumMap = { PaymentIntentSetupFutureUsage.onSession: 'on_session', diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.dart index aa0106774..e7f42a170 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.dart @@ -4,7 +4,7 @@ part 'confirm_p24_payment_options.freezed.dart'; part 'confirm_p24_payment_options.g.dart'; @freezed -class ConfirmP24PaymentOptions with _$ConfirmP24PaymentOptions { +abstract class ConfirmP24PaymentOptions with _$ConfirmP24PaymentOptions { const factory ConfirmP24PaymentOptions({ /// Set this to false if you want to manually handle /// the authorization redirect. Default is true. diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.freezed.dart index f3fe7e07f..f2ce6ec8c 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,171 +9,273 @@ part of 'confirm_p24_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmP24PaymentOptions _$ConfirmP24PaymentOptionsFromJson( - Map json) { - return _ConfirmP24PaymentOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmP24PaymentOptions { - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - bool? get handleActions => throw _privateConstructorUsedError; + +/// Set this to false if you want to manually handle +/// the authorization redirect. Default is true. + bool? get handleActions; +/// Create a copy of ConfirmP24PaymentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmP24PaymentOptionsCopyWith get copyWith => _$ConfirmP24PaymentOptionsCopyWithImpl(this as ConfirmP24PaymentOptions, _$identity); /// Serializes this ConfirmP24PaymentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmP24PaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmP24PaymentOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmP24PaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); } -/// @nodoc -abstract class $ConfirmP24PaymentOptionsCopyWith<$Res> { - factory $ConfirmP24PaymentOptionsCopyWith(ConfirmP24PaymentOptions value, - $Res Function(ConfirmP24PaymentOptions) then) = - _$ConfirmP24PaymentOptionsCopyWithImpl<$Res, ConfirmP24PaymentOptions>; - @useResult - $Res call({bool? handleActions}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmP24PaymentOptions(handleActions: $handleActions)'; } -/// @nodoc -class _$ConfirmP24PaymentOptionsCopyWithImpl<$Res, - $Val extends ConfirmP24PaymentOptions> - implements $ConfirmP24PaymentOptionsCopyWith<$Res> { - _$ConfirmP24PaymentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmP24PaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_value.copyWith( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmP24PaymentOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmP24PaymentOptionsCopyWith<$Res> { + factory $ConfirmP24PaymentOptionsCopyWith(ConfirmP24PaymentOptions value, $Res Function(ConfirmP24PaymentOptions) _then) = _$ConfirmP24PaymentOptionsCopyWithImpl; +@useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class _$ConfirmP24PaymentOptionsCopyWithImpl<$Res> implements $ConfirmP24PaymentOptionsCopyWith<$Res> { - factory _$$ConfirmP24PaymentOptionsImplCopyWith( - _$ConfirmP24PaymentOptionsImpl value, - $Res Function(_$ConfirmP24PaymentOptionsImpl) then) = - __$$ConfirmP24PaymentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? handleActions}); + _$ConfirmP24PaymentOptionsCopyWithImpl(this._self, this._then); + + final ConfirmP24PaymentOptions _self; + final $Res Function(ConfirmP24PaymentOptions) _then; + +/// Create a copy of ConfirmP24PaymentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? handleActions = freezed,}) { + return _then(_self.copyWith( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmP24PaymentOptions]. +extension ConfirmP24PaymentOptionsPatterns on ConfirmP24PaymentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmP24PaymentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmP24PaymentOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmP24PaymentOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmP24PaymentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmP24PaymentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmP24PaymentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? handleActions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmP24PaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? handleActions) $default,) {final _that = this; +switch (_that) { +case _ConfirmP24PaymentOptions(): +return $default(_that.handleActions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? handleActions)? $default,) {final _that = this; +switch (_that) { +case _ConfirmP24PaymentOptions() when $default != null: +return $default(_that.handleActions);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmP24PaymentOptionsImplCopyWithImpl<$Res> - extends _$ConfirmP24PaymentOptionsCopyWithImpl<$Res, - _$ConfirmP24PaymentOptionsImpl> - implements _$$ConfirmP24PaymentOptionsImplCopyWith<$Res> { - __$$ConfirmP24PaymentOptionsImplCopyWithImpl( - _$ConfirmP24PaymentOptionsImpl _value, - $Res Function(_$ConfirmP24PaymentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmP24PaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_$ConfirmP24PaymentOptionsImpl( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmP24PaymentOptionsImpl implements _ConfirmP24PaymentOptions { - const _$ConfirmP24PaymentOptionsImpl({this.handleActions = true}); - - factory _$ConfirmP24PaymentOptionsImpl.fromJson(Map json) => - _$$ConfirmP24PaymentOptionsImplFromJson(json); - - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - @override - @JsonKey() - final bool? handleActions; - - @override - String toString() { - return 'ConfirmP24PaymentOptions(handleActions: $handleActions)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmP24PaymentOptionsImpl && - (identical(other.handleActions, handleActions) || - other.handleActions == handleActions)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, handleActions); - - /// Create a copy of ConfirmP24PaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmP24PaymentOptionsImplCopyWith<_$ConfirmP24PaymentOptionsImpl> - get copyWith => __$$ConfirmP24PaymentOptionsImplCopyWithImpl< - _$ConfirmP24PaymentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmP24PaymentOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmP24PaymentOptions implements ConfirmP24PaymentOptions { - const factory _ConfirmP24PaymentOptions({final bool? handleActions}) = - _$ConfirmP24PaymentOptionsImpl; - - factory _ConfirmP24PaymentOptions.fromJson(Map json) = - _$ConfirmP24PaymentOptionsImpl.fromJson; - - /// Set this to false if you want to manually handle - /// the authorization redirect. Default is true. - @override - bool? get handleActions; - - /// Create a copy of ConfirmP24PaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmP24PaymentOptionsImplCopyWith<_$ConfirmP24PaymentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmP24PaymentOptions implements ConfirmP24PaymentOptions { + const _ConfirmP24PaymentOptions({this.handleActions = true}); + factory _ConfirmP24PaymentOptions.fromJson(Map json) => _$ConfirmP24PaymentOptionsFromJson(json); + +/// Set this to false if you want to manually handle +/// the authorization redirect. Default is true. +@override@JsonKey() final bool? handleActions; + +/// Create a copy of ConfirmP24PaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmP24PaymentOptionsCopyWith<_ConfirmP24PaymentOptions> get copyWith => __$ConfirmP24PaymentOptionsCopyWithImpl<_ConfirmP24PaymentOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmP24PaymentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmP24PaymentOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmP24PaymentOptions(handleActions: $handleActions)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmP24PaymentOptionsCopyWith<$Res> implements $ConfirmP24PaymentOptionsCopyWith<$Res> { + factory _$ConfirmP24PaymentOptionsCopyWith(_ConfirmP24PaymentOptions value, $Res Function(_ConfirmP24PaymentOptions) _then) = __$ConfirmP24PaymentOptionsCopyWithImpl; +@override @useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class __$ConfirmP24PaymentOptionsCopyWithImpl<$Res> + implements _$ConfirmP24PaymentOptionsCopyWith<$Res> { + __$ConfirmP24PaymentOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmP24PaymentOptions _self; + final $Res Function(_ConfirmP24PaymentOptions) _then; + +/// Create a copy of ConfirmP24PaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? handleActions = freezed,}) { + return _then(_ConfirmP24PaymentOptions( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.g.dart index 81b9c2198..05d8d55c5 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_p24_payment_options.g.dart @@ -6,14 +6,11 @@ part of 'confirm_p24_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmP24PaymentOptionsImpl _$$ConfirmP24PaymentOptionsImplFromJson( - Map json) => - _$ConfirmP24PaymentOptionsImpl( +_ConfirmP24PaymentOptions _$ConfirmP24PaymentOptionsFromJson(Map json) => + _ConfirmP24PaymentOptions( handleActions: json['handleActions'] as bool? ?? true, ); -Map _$$ConfirmP24PaymentOptionsImplToJson( - _$ConfirmP24PaymentOptionsImpl instance) => - { - if (instance.handleActions case final value?) 'handleActions': value, - }; +Map _$ConfirmP24PaymentOptionsToJson( + _ConfirmP24PaymentOptions instance, +) => {'handleActions': ?instance.handleActions}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.dart index 3d2a31e87..3373877f6 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.dart @@ -7,7 +7,7 @@ part 'confirm_payment_options.freezed.dart'; part 'confirm_payment_options.g.dart'; @freezed -class ConfirmPaymentOptions with _$ConfirmPaymentOptions { +abstract class ConfirmPaymentOptions with _$ConfirmPaymentOptions { const factory ConfirmPaymentOptions({ /// The Elements instance that was used to create the Payment Element. @ElementsConverter() required Elements elements, @@ -34,7 +34,7 @@ class ConfirmPaymentOptions with _$ConfirmPaymentOptions { } @freezed -class ConfirmPaymentParams with _$ConfirmPaymentParams { +abstract class ConfirmPaymentParams with _$ConfirmPaymentParams { const factory ConfirmPaymentParams({ /// The url your customer will be directed to after they complete payment. // ignore: non_constant_identifier_names diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.freezed.dart index c32606df4..a84762864 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,431 +9,586 @@ part of 'confirm_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmPaymentOptions _$ConfirmPaymentOptionsFromJson( - Map json) { - return _ConfirmPaymentOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmPaymentOptions { - /// The Elements instance that was used to create the Payment Element. - @ElementsConverter() - Elements get elements => throw _privateConstructorUsedError; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - ConfirmPaymentParams get confirmParams => throw _privateConstructorUsedError; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - PaymentConfirmationRedirect? get redirect => - throw _privateConstructorUsedError; + +/// The Elements instance that was used to create the Payment Element. +@ElementsConverter() Elements get elements;/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. + ConfirmPaymentParams get confirmParams;/// By default, stripe.confirmPayment will always redirect to your +/// return_url after a successful confirmation. +/// If you set redirect: "if_required", then stripe.confirmPayment will +/// only redirect if your user chooses a redirect-based payment method. +/// +/// Note: Setting if_required requires that you handle successful +/// confirmations for redirect-based and non-redirect based payment +/// methods separately. When a non-redirect based payment method is +/// successfully confirmed, stripe.confirmPayment will resolve with a +/// {paymentIntent} object. + PaymentConfirmationRedirect? get redirect; +/// Create a copy of ConfirmPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmPaymentOptionsCopyWith get copyWith => _$ConfirmPaymentOptionsCopyWithImpl(this as ConfirmPaymentOptions, _$identity); /// Serializes this ConfirmPaymentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmPaymentOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmPaymentOptions&&(identical(other.elements, elements) || other.elements == elements)&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); } -/// @nodoc -abstract class $ConfirmPaymentOptionsCopyWith<$Res> { - factory $ConfirmPaymentOptionsCopyWith(ConfirmPaymentOptions value, - $Res Function(ConfirmPaymentOptions) then) = - _$ConfirmPaymentOptionsCopyWithImpl<$Res, ConfirmPaymentOptions>; - @useResult - $Res call( - {@ElementsConverter() Elements elements, - ConfirmPaymentParams confirmParams, - PaymentConfirmationRedirect? redirect}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elements,confirmParams,redirect); - $ConfirmPaymentParamsCopyWith<$Res> get confirmParams; +@override +String toString() { + return 'ConfirmPaymentOptions(elements: $elements, confirmParams: $confirmParams, redirect: $redirect)'; } -/// @nodoc -class _$ConfirmPaymentOptionsCopyWithImpl<$Res, - $Val extends ConfirmPaymentOptions> - implements $ConfirmPaymentOptionsCopyWith<$Res> { - _$ConfirmPaymentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elements = null, - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_value.copyWith( - elements: null == elements - ? _value.elements - : elements // ignore: cast_nullable_to_non_nullable - as Elements, - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmPaymentParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as PaymentConfirmationRedirect?, - ) as $Val); - } - - /// Create a copy of ConfirmPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ConfirmPaymentParamsCopyWith<$Res> get confirmParams { - return $ConfirmPaymentParamsCopyWith<$Res>(_value.confirmParams, (value) { - return _then(_value.copyWith(confirmParams: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$ConfirmPaymentOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmPaymentOptionsCopyWith<$Res> { + factory $ConfirmPaymentOptionsCopyWith(ConfirmPaymentOptions value, $Res Function(ConfirmPaymentOptions) _then) = _$ConfirmPaymentOptionsCopyWithImpl; +@useResult +$Res call({ +@ElementsConverter() Elements elements, ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect +}); + + +$ConfirmPaymentParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class _$ConfirmPaymentOptionsCopyWithImpl<$Res> implements $ConfirmPaymentOptionsCopyWith<$Res> { - factory _$$ConfirmPaymentOptionsImplCopyWith( - _$ConfirmPaymentOptionsImpl value, - $Res Function(_$ConfirmPaymentOptionsImpl) then) = - __$$ConfirmPaymentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@ElementsConverter() Elements elements, - ConfirmPaymentParams confirmParams, - PaymentConfirmationRedirect? redirect}); + _$ConfirmPaymentOptionsCopyWithImpl(this._self, this._then); + + final ConfirmPaymentOptions _self; + final $Res Function(ConfirmPaymentOptions) _then; + +/// Create a copy of ConfirmPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? elements = null,Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_self.copyWith( +elements: null == elements ? _self.elements : elements // ignore: cast_nullable_to_non_nullable +as Elements,confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmPaymentParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as PaymentConfirmationRedirect?, + )); +} +/// Create a copy of ConfirmPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmPaymentParamsCopyWith<$Res> get confirmParams { + + return $ConfirmPaymentParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ConfirmPaymentOptions]. +extension ConfirmPaymentOptionsPatterns on ConfirmPaymentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmPaymentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmPaymentOptions() when $default != null: +return $default(_that);case _: + return orElse(); - @override - $ConfirmPaymentParamsCopyWith<$Res> get confirmParams; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmPaymentOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmPaymentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmPaymentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmPaymentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@ElementsConverter() Elements elements, ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmPaymentOptions() when $default != null: +return $default(_that.elements,_that.confirmParams,_that.redirect);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@ElementsConverter() Elements elements, ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect) $default,) {final _that = this; +switch (_that) { +case _ConfirmPaymentOptions(): +return $default(_that.elements,_that.confirmParams,_that.redirect);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@ElementsConverter() Elements elements, ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect)? $default,) {final _that = this; +switch (_that) { +case _ConfirmPaymentOptions() when $default != null: +return $default(_that.elements,_that.confirmParams,_that.redirect);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmPaymentOptionsImplCopyWithImpl<$Res> - extends _$ConfirmPaymentOptionsCopyWithImpl<$Res, - _$ConfirmPaymentOptionsImpl> - implements _$$ConfirmPaymentOptionsImplCopyWith<$Res> { - __$$ConfirmPaymentOptionsImplCopyWithImpl(_$ConfirmPaymentOptionsImpl _value, - $Res Function(_$ConfirmPaymentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elements = null, - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_$ConfirmPaymentOptionsImpl( - elements: null == elements - ? _value.elements - : elements // ignore: cast_nullable_to_non_nullable - as Elements, - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmPaymentParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as PaymentConfirmationRedirect?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmPaymentOptionsImpl implements _ConfirmPaymentOptions { - const _$ConfirmPaymentOptionsImpl( - {@ElementsConverter() required this.elements, - required this.confirmParams, - this.redirect}); - - factory _$ConfirmPaymentOptionsImpl.fromJson(Map json) => - _$$ConfirmPaymentOptionsImplFromJson(json); - - /// The Elements instance that was used to create the Payment Element. - @override - @ElementsConverter() - final Elements elements; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - final ConfirmPaymentParams confirmParams; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - @override - final PaymentConfirmationRedirect? redirect; - - @override - String toString() { - return 'ConfirmPaymentOptions(elements: $elements, confirmParams: $confirmParams, redirect: $redirect)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmPaymentOptionsImpl && - (identical(other.elements, elements) || - other.elements == elements) && - (identical(other.confirmParams, confirmParams) || - other.confirmParams == confirmParams) && - (identical(other.redirect, redirect) || - other.redirect == redirect)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, elements, confirmParams, redirect); - - /// Create a copy of ConfirmPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmPaymentOptionsImplCopyWith<_$ConfirmPaymentOptionsImpl> - get copyWith => __$$ConfirmPaymentOptionsImplCopyWithImpl< - _$ConfirmPaymentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmPaymentOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmPaymentOptions implements ConfirmPaymentOptions { - const factory _ConfirmPaymentOptions( - {@ElementsConverter() required final Elements elements, - required final ConfirmPaymentParams confirmParams, - final PaymentConfirmationRedirect? redirect}) = - _$ConfirmPaymentOptionsImpl; - - factory _ConfirmPaymentOptions.fromJson(Map json) = - _$ConfirmPaymentOptionsImpl.fromJson; - - /// The Elements instance that was used to create the Payment Element. - @override - @ElementsConverter() - Elements get elements; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - ConfirmPaymentParams get confirmParams; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - @override - PaymentConfirmationRedirect? get redirect; - - /// Create a copy of ConfirmPaymentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmPaymentOptionsImplCopyWith<_$ConfirmPaymentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -ConfirmPaymentParams _$ConfirmPaymentParamsFromJson(Map json) { - return _ConfirmPaymentParams.fromJson(json); + +class _ConfirmPaymentOptions implements ConfirmPaymentOptions { + const _ConfirmPaymentOptions({@ElementsConverter() required this.elements, required this.confirmParams, this.redirect}); + factory _ConfirmPaymentOptions.fromJson(Map json) => _$ConfirmPaymentOptionsFromJson(json); + +/// The Elements instance that was used to create the Payment Element. +@override@ElementsConverter() final Elements elements; +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. +@override final ConfirmPaymentParams confirmParams; +/// By default, stripe.confirmPayment will always redirect to your +/// return_url after a successful confirmation. +/// If you set redirect: "if_required", then stripe.confirmPayment will +/// only redirect if your user chooses a redirect-based payment method. +/// +/// Note: Setting if_required requires that you handle successful +/// confirmations for redirect-based and non-redirect based payment +/// methods separately. When a non-redirect based payment method is +/// successfully confirmed, stripe.confirmPayment will resolve with a +/// {paymentIntent} object. +@override final PaymentConfirmationRedirect? redirect; + +/// Create a copy of ConfirmPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmPaymentOptionsCopyWith<_ConfirmPaymentOptions> get copyWith => __$ConfirmPaymentOptionsCopyWithImpl<_ConfirmPaymentOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmPaymentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmPaymentOptions&&(identical(other.elements, elements) || other.elements == elements)&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elements,confirmParams,redirect); + +@override +String toString() { + return 'ConfirmPaymentOptions(elements: $elements, confirmParams: $confirmParams, redirect: $redirect)'; +} + + } +/// @nodoc +abstract mixin class _$ConfirmPaymentOptionsCopyWith<$Res> implements $ConfirmPaymentOptionsCopyWith<$Res> { + factory _$ConfirmPaymentOptionsCopyWith(_ConfirmPaymentOptions value, $Res Function(_ConfirmPaymentOptions) _then) = __$ConfirmPaymentOptionsCopyWithImpl; +@override @useResult +$Res call({ +@ElementsConverter() Elements elements, ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect +}); + + +@override $ConfirmPaymentParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class __$ConfirmPaymentOptionsCopyWithImpl<$Res> + implements _$ConfirmPaymentOptionsCopyWith<$Res> { + __$ConfirmPaymentOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmPaymentOptions _self; + final $Res Function(_ConfirmPaymentOptions) _then; + +/// Create a copy of ConfirmPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? elements = null,Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_ConfirmPaymentOptions( +elements: null == elements ? _self.elements : elements // ignore: cast_nullable_to_non_nullable +as Elements,confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmPaymentParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as PaymentConfirmationRedirect?, + )); +} + +/// Create a copy of ConfirmPaymentOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmPaymentParamsCopyWith<$Res> get confirmParams { + + return $ConfirmPaymentParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + + /// @nodoc mixin _$ConfirmPaymentParams { - /// The url your customer will be directed to after they complete payment. - String get return_url => throw _privateConstructorUsedError; + +/// The url your customer will be directed to after they complete payment. +// ignore: non_constant_identifier_names + String get return_url; +/// Create a copy of ConfirmPaymentParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmPaymentParamsCopyWith get copyWith => _$ConfirmPaymentParamsCopyWithImpl(this as ConfirmPaymentParams, _$identity); /// Serializes this ConfirmPaymentParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmPaymentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmPaymentParamsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmPaymentParams&&(identical(other.return_url, return_url) || other.return_url == return_url)); } -/// @nodoc -abstract class $ConfirmPaymentParamsCopyWith<$Res> { - factory $ConfirmPaymentParamsCopyWith(ConfirmPaymentParams value, - $Res Function(ConfirmPaymentParams) then) = - _$ConfirmPaymentParamsCopyWithImpl<$Res, ConfirmPaymentParams>; - @useResult - $Res call({String return_url}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,return_url); + +@override +String toString() { + return 'ConfirmPaymentParams(return_url: $return_url)'; } -/// @nodoc -class _$ConfirmPaymentParamsCopyWithImpl<$Res, - $Val extends ConfirmPaymentParams> - implements $ConfirmPaymentParamsCopyWith<$Res> { - _$ConfirmPaymentParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmPaymentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? return_url = null, - }) { - return _then(_value.copyWith( - return_url: null == return_url - ? _value.return_url - : return_url // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmPaymentParamsImplCopyWith<$Res> +abstract mixin class $ConfirmPaymentParamsCopyWith<$Res> { + factory $ConfirmPaymentParamsCopyWith(ConfirmPaymentParams value, $Res Function(ConfirmPaymentParams) _then) = _$ConfirmPaymentParamsCopyWithImpl; +@useResult +$Res call({ + String return_url +}); + + + + +} +/// @nodoc +class _$ConfirmPaymentParamsCopyWithImpl<$Res> implements $ConfirmPaymentParamsCopyWith<$Res> { - factory _$$ConfirmPaymentParamsImplCopyWith(_$ConfirmPaymentParamsImpl value, - $Res Function(_$ConfirmPaymentParamsImpl) then) = - __$$ConfirmPaymentParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String return_url}); + _$ConfirmPaymentParamsCopyWithImpl(this._self, this._then); + + final ConfirmPaymentParams _self; + final $Res Function(ConfirmPaymentParams) _then; + +/// Create a copy of ConfirmPaymentParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? return_url = null,}) { + return _then(_self.copyWith( +return_url: null == return_url ? _self.return_url : return_url // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmPaymentParams]. +extension ConfirmPaymentParamsPatterns on ConfirmPaymentParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmPaymentParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmPaymentParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmPaymentParams value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmPaymentParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmPaymentParams value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmPaymentParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String return_url)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmPaymentParams() when $default != null: +return $default(_that.return_url);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String return_url) $default,) {final _that = this; +switch (_that) { +case _ConfirmPaymentParams(): +return $default(_that.return_url);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String return_url)? $default,) {final _that = this; +switch (_that) { +case _ConfirmPaymentParams() when $default != null: +return $default(_that.return_url);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmPaymentParamsImplCopyWithImpl<$Res> - extends _$ConfirmPaymentParamsCopyWithImpl<$Res, _$ConfirmPaymentParamsImpl> - implements _$$ConfirmPaymentParamsImplCopyWith<$Res> { - __$$ConfirmPaymentParamsImplCopyWithImpl(_$ConfirmPaymentParamsImpl _value, - $Res Function(_$ConfirmPaymentParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmPaymentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? return_url = null, - }) { - return _then(_$ConfirmPaymentParamsImpl( - return_url: null == return_url - ? _value.return_url - : return_url // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmPaymentParamsImpl implements _ConfirmPaymentParams { - const _$ConfirmPaymentParamsImpl({required this.return_url}); - - factory _$ConfirmPaymentParamsImpl.fromJson(Map json) => - _$$ConfirmPaymentParamsImplFromJson(json); - - /// The url your customer will be directed to after they complete payment. - @override - final String return_url; - - @override - String toString() { - return 'ConfirmPaymentParams(return_url: $return_url)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmPaymentParamsImpl && - (identical(other.return_url, return_url) || - other.return_url == return_url)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, return_url); - - /// Create a copy of ConfirmPaymentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmPaymentParamsImplCopyWith<_$ConfirmPaymentParamsImpl> - get copyWith => - __$$ConfirmPaymentParamsImplCopyWithImpl<_$ConfirmPaymentParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ConfirmPaymentParamsImplToJson( - this, - ); - } -} - -abstract class _ConfirmPaymentParams implements ConfirmPaymentParams { - const factory _ConfirmPaymentParams({required final String return_url}) = - _$ConfirmPaymentParamsImpl; - - factory _ConfirmPaymentParams.fromJson(Map json) = - _$ConfirmPaymentParamsImpl.fromJson; - - /// The url your customer will be directed to after they complete payment. - @override - String get return_url; - - /// Create a copy of ConfirmPaymentParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmPaymentParamsImplCopyWith<_$ConfirmPaymentParamsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmPaymentParams implements ConfirmPaymentParams { + const _ConfirmPaymentParams({required this.return_url}); + factory _ConfirmPaymentParams.fromJson(Map json) => _$ConfirmPaymentParamsFromJson(json); + +/// The url your customer will be directed to after they complete payment. +// ignore: non_constant_identifier_names +@override final String return_url; + +/// Create a copy of ConfirmPaymentParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmPaymentParamsCopyWith<_ConfirmPaymentParams> get copyWith => __$ConfirmPaymentParamsCopyWithImpl<_ConfirmPaymentParams>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmPaymentParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmPaymentParams&&(identical(other.return_url, return_url) || other.return_url == return_url)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,return_url); + +@override +String toString() { + return 'ConfirmPaymentParams(return_url: $return_url)'; +} + + } + +/// @nodoc +abstract mixin class _$ConfirmPaymentParamsCopyWith<$Res> implements $ConfirmPaymentParamsCopyWith<$Res> { + factory _$ConfirmPaymentParamsCopyWith(_ConfirmPaymentParams value, $Res Function(_ConfirmPaymentParams) _then) = __$ConfirmPaymentParamsCopyWithImpl; +@override @useResult +$Res call({ + String return_url +}); + + + + +} +/// @nodoc +class __$ConfirmPaymentParamsCopyWithImpl<$Res> + implements _$ConfirmPaymentParamsCopyWith<$Res> { + __$ConfirmPaymentParamsCopyWithImpl(this._self, this._then); + + final _ConfirmPaymentParams _self; + final $Res Function(_ConfirmPaymentParams) _then; + +/// Create a copy of ConfirmPaymentParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? return_url = null,}) { + return _then(_ConfirmPaymentParams( +return_url: null == return_url ? _self.return_url : return_url // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.g.dart index a1718bdd0..7c4a1a2da 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_payment_options.g.dart @@ -6,44 +6,34 @@ part of 'confirm_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmPaymentOptionsImpl _$$ConfirmPaymentOptionsImplFromJson(Map json) => - _$ConfirmPaymentOptionsImpl( +_ConfirmPaymentOptions _$ConfirmPaymentOptionsFromJson(Map json) => + _ConfirmPaymentOptions( elements: const ElementsConverter().fromJson(json['elements']), confirmParams: ConfirmPaymentParams.fromJson( - Map.from(json['confirmParams'] as Map)), + Map.from(json['confirmParams'] as Map), + ), redirect: $enumDecodeNullable( - _$PaymentConfirmationRedirectEnumMap, json['redirect']), + _$PaymentConfirmationRedirectEnumMap, + json['redirect'], + ), ); -Map _$$ConfirmPaymentOptionsImplToJson( - _$ConfirmPaymentOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('elements', const ElementsConverter().toJson(instance.elements)); - val['confirmParams'] = instance.confirmParams.toJson(); - writeNotNull( - 'redirect', _$PaymentConfirmationRedirectEnumMap[instance.redirect]); - return val; -} +Map _$ConfirmPaymentOptionsToJson( + _ConfirmPaymentOptions instance, +) => { + 'elements': ?const ElementsConverter().toJson(instance.elements), + 'confirmParams': instance.confirmParams.toJson(), + 'redirect': ?_$PaymentConfirmationRedirectEnumMap[instance.redirect], +}; const _$PaymentConfirmationRedirectEnumMap = { PaymentConfirmationRedirect.always: 'always', PaymentConfirmationRedirect.ifRequired: 'if_required', }; -_$ConfirmPaymentParamsImpl _$$ConfirmPaymentParamsImplFromJson(Map json) => - _$ConfirmPaymentParamsImpl( - return_url: json['return_url'] as String, - ); +_ConfirmPaymentParams _$ConfirmPaymentParamsFromJson(Map json) => + _ConfirmPaymentParams(return_url: json['return_url'] as String); -Map _$$ConfirmPaymentParamsImplToJson( - _$ConfirmPaymentParamsImpl instance) => - { - 'return_url': instance.return_url, - }; +Map _$ConfirmPaymentParamsToJson( + _ConfirmPaymentParams instance, +) => {'return_url': instance.return_url}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.dart index 77eff66ca..e49dce125 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.dart @@ -6,7 +6,7 @@ part 'confirm_sepa_debit_payment_data.freezed.dart'; part 'confirm_sepa_debit_payment_data.g.dart'; @freezed -class ConfirmSepaDebitPaymentData with _$ConfirmSepaDebitPaymentData { +abstract class ConfirmSepaDebitPaymentData with _$ConfirmSepaDebitPaymentData { const factory ConfirmSepaDebitPaymentData({ /// Either the id of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. @@ -27,7 +27,7 @@ class ConfirmSepaDebitPaymentData with _$ConfirmSepaDebitPaymentData { } @Freezed(unionKey: 'type') -class SepaDebitPaymentMethodDetails +sealed class SepaDebitPaymentMethodDetails with _$SepaDebitPaymentMethodDetails implements PaymentMethodDetails { @FreezedUnionValue('sepa_debit') @@ -48,7 +48,7 @@ class SepaDebitPaymentMethodDetails /// The customer's billing_details. name and email are required. @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails, - }) = _SepaDebitPaymentMethodDetails; + }) = _SepaDebitPaymentMethodDetailsElement; /// If you already know the customer’s bank or want to collect it yourself, /// then you do not need to use the idealBank Element. @@ -68,7 +68,7 @@ class SepaDebitPaymentMethodDetails } @freezed -class SepaDebitIbanData with _$SepaDebitIbanData { +abstract class SepaDebitIbanData with _$SepaDebitIbanData { const factory SepaDebitIbanData({ /// An IBAN account number. required String iban, @@ -80,7 +80,7 @@ class SepaDebitIbanData with _$SepaDebitIbanData { /// Billing information associated with the payment method. @freezed -class SepaBillingDetails with _$SepaBillingDetails { +abstract class SepaBillingDetails with _$SepaBillingDetails { const factory SepaBillingDetails({ /// Email address. required String email, diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.freezed.dart index 0ffe90f4e..ed6fa8bef 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1474 +9,1337 @@ part of 'confirm_sepa_debit_payment_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmSepaDebitPaymentData _$ConfirmSepaDebitPaymentDataFromJson( - Map json) { - return _ConfirmSepaDebitPaymentData.fromJson(json); -} - /// @nodoc mixin _$ConfirmSepaDebitPaymentData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @paymentMethodDetailJsonKey - SepaDebitPaymentMethodDetails? get paymentMethod => - throw _privateConstructorUsedError; - - /// To set up the SEPA Direct Debit account for reuse, set this parameter - /// to off_session. SEPA Direct Debit only accepts an off_session value - /// for this parameter. If a customer is provided on this PaymentIntent, - /// the PaymentMethod will be attached to the customer when the - /// PaymentIntent transitions to processing. - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage => - throw _privateConstructorUsedError; + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? get paymentMethod;/// To set up the SEPA Direct Debit account for reuse, set this parameter +/// to off_session. SEPA Direct Debit only accepts an off_session value +/// for this parameter. If a customer is provided on this PaymentIntent, +/// the PaymentMethod will be attached to the customer when the +/// PaymentIntent transitions to processing. +@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? get setupFutureUsage; +/// Create a copy of ConfirmSepaDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmSepaDebitPaymentDataCopyWith get copyWith => _$ConfirmSepaDebitPaymentDataCopyWithImpl(this as ConfirmSepaDebitPaymentData, _$identity); /// Serializes this ConfirmSepaDebitPaymentData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmSepaDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmSepaDebitPaymentDataCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmSepaDebitPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); } -/// @nodoc -abstract class $ConfirmSepaDebitPaymentDataCopyWith<$Res> { - factory $ConfirmSepaDebitPaymentDataCopyWith( - ConfirmSepaDebitPaymentData value, - $Res Function(ConfirmSepaDebitPaymentData) then) = - _$ConfirmSepaDebitPaymentDataCopyWithImpl<$Res, - ConfirmSepaDebitPaymentData>; - @useResult - $Res call( - {@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,setupFutureUsage); - $SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; +@override +String toString() { + return 'ConfirmSepaDebitPaymentData(paymentMethod: $paymentMethod, setupFutureUsage: $setupFutureUsage)'; } + +} + +/// @nodoc +abstract mixin class $ConfirmSepaDebitPaymentDataCopyWith<$Res> { + factory $ConfirmSepaDebitPaymentDataCopyWith(ConfirmSepaDebitPaymentData value, $Res Function(ConfirmSepaDebitPaymentData) _then) = _$ConfirmSepaDebitPaymentDataCopyWithImpl; +@useResult +$Res call({ +@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage +}); + + +$SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} /// @nodoc -class _$ConfirmSepaDebitPaymentDataCopyWithImpl<$Res, - $Val extends ConfirmSepaDebitPaymentData> +class _$ConfirmSepaDebitPaymentDataCopyWithImpl<$Res> implements $ConfirmSepaDebitPaymentDataCopyWith<$Res> { - _$ConfirmSepaDebitPaymentDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmSepaDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? setupFutureUsage = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as SepaDebitPaymentMethodDetails?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - ) as $Val); + _$ConfirmSepaDebitPaymentDataCopyWithImpl(this._self, this._then); + + final ConfirmSepaDebitPaymentData _self; + final $Res Function(ConfirmSepaDebitPaymentData) _then; + +/// Create a copy of ConfirmSepaDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? setupFutureUsage = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as SepaDebitPaymentMethodDetails?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?, + )); +} +/// Create a copy of ConfirmSepaDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of ConfirmSepaDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $SepaDebitPaymentMethodDetailsCopyWith<$Res>(_value.paymentMethod!, - (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); - } + return $SepaDebitPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +} } -/// @nodoc -abstract class _$$ConfirmSepaDebitPaymentDataImplCopyWith<$Res> - implements $ConfirmSepaDebitPaymentDataCopyWith<$Res> { - factory _$$ConfirmSepaDebitPaymentDataImplCopyWith( - _$ConfirmSepaDebitPaymentDataImpl value, - $Res Function(_$ConfirmSepaDebitPaymentDataImpl) then) = - __$$ConfirmSepaDebitPaymentDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage}); - @override - $SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; +/// Adds pattern-matching-related methods to [ConfirmSepaDebitPaymentData]. +extension ConfirmSepaDebitPaymentDataPatterns on ConfirmSepaDebitPaymentData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmSepaDebitPaymentData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmSepaDebitPaymentData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmSepaDebitPaymentData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmSepaDebitPaymentData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmSepaDebitPaymentData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmSepaDebitPaymentData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmSepaDebitPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.setupFutureUsage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage) $default,) {final _that = this; +switch (_that) { +case _ConfirmSepaDebitPaymentData(): +return $default(_that.paymentMethod,_that.setupFutureUsage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage)? $default,) {final _that = this; +switch (_that) { +case _ConfirmSepaDebitPaymentData() when $default != null: +return $default(_that.paymentMethod,_that.setupFutureUsage);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmSepaDebitPaymentDataImplCopyWithImpl<$Res> - extends _$ConfirmSepaDebitPaymentDataCopyWithImpl<$Res, - _$ConfirmSepaDebitPaymentDataImpl> - implements _$$ConfirmSepaDebitPaymentDataImplCopyWith<$Res> { - __$$ConfirmSepaDebitPaymentDataImplCopyWithImpl( - _$ConfirmSepaDebitPaymentDataImpl _value, - $Res Function(_$ConfirmSepaDebitPaymentDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmSepaDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? setupFutureUsage = freezed, - }) { - return _then(_$ConfirmSepaDebitPaymentDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as SepaDebitPaymentMethodDetails?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmSepaDebitPaymentDataImpl - implements _ConfirmSepaDebitPaymentData { - const _$ConfirmSepaDebitPaymentDataImpl( - {@paymentMethodDetailJsonKey this.paymentMethod, - @JsonKey(name: "setup_future_usage") this.setupFutureUsage}); - - factory _$ConfirmSepaDebitPaymentDataImpl.fromJson( - Map json) => - _$$ConfirmSepaDebitPaymentDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - final SepaDebitPaymentMethodDetails? paymentMethod; - - /// To set up the SEPA Direct Debit account for reuse, set this parameter - /// to off_session. SEPA Direct Debit only accepts an off_session value - /// for this parameter. If a customer is provided on this PaymentIntent, - /// the PaymentMethod will be attached to the customer when the - /// PaymentIntent transitions to processing. - @override - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage; - - @override - String toString() { - return 'ConfirmSepaDebitPaymentData(paymentMethod: $paymentMethod, setupFutureUsage: $setupFutureUsage)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmSepaDebitPaymentDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage)); - } +class _ConfirmSepaDebitPaymentData implements ConfirmSepaDebitPaymentData { + const _ConfirmSepaDebitPaymentData({@paymentMethodDetailJsonKey this.paymentMethod, @JsonKey(name: "setup_future_usage") this.setupFutureUsage}); + factory _ConfirmSepaDebitPaymentData.fromJson(Map json) => _$ConfirmSepaDebitPaymentDataFromJson(json); + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@override@paymentMethodDetailJsonKey final SepaDebitPaymentMethodDetails? paymentMethod; +/// To set up the SEPA Direct Debit account for reuse, set this parameter +/// to off_session. SEPA Direct Debit only accepts an off_session value +/// for this parameter. If a customer is provided on this PaymentIntent, +/// the PaymentMethod will be attached to the customer when the +/// PaymentIntent transitions to processing. +@override@JsonKey(name: "setup_future_usage") final PaymentIntentSetupFutureUsage? setupFutureUsage; + +/// Create a copy of ConfirmSepaDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmSepaDebitPaymentDataCopyWith<_ConfirmSepaDebitPaymentData> get copyWith => __$ConfirmSepaDebitPaymentDataCopyWithImpl<_ConfirmSepaDebitPaymentData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmSepaDebitPaymentDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod, setupFutureUsage); - - /// Create a copy of ConfirmSepaDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmSepaDebitPaymentDataImplCopyWith<_$ConfirmSepaDebitPaymentDataImpl> - get copyWith => __$$ConfirmSepaDebitPaymentDataImplCopyWithImpl< - _$ConfirmSepaDebitPaymentDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmSepaDebitPaymentDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmSepaDebitPaymentData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); } -abstract class _ConfirmSepaDebitPaymentData - implements ConfirmSepaDebitPaymentData { - const factory _ConfirmSepaDebitPaymentData( - {@paymentMethodDetailJsonKey - final SepaDebitPaymentMethodDetails? paymentMethod, - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage}) = - _$ConfirmSepaDebitPaymentDataImpl; - - factory _ConfirmSepaDebitPaymentData.fromJson(Map json) = - _$ConfirmSepaDebitPaymentDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - SepaDebitPaymentMethodDetails? get paymentMethod; - - /// To set up the SEPA Direct Debit account for reuse, set this parameter - /// to off_session. SEPA Direct Debit only accepts an off_session value - /// for this parameter. If a customer is provided on this PaymentIntent, - /// the PaymentMethod will be attached to the customer when the - /// PaymentIntent transitions to processing. - @override - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage; - - /// Create a copy of ConfirmSepaDebitPaymentData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmSepaDebitPaymentDataImplCopyWith<_$ConfirmSepaDebitPaymentDataImpl> - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,setupFutureUsage); + +@override +String toString() { + return 'ConfirmSepaDebitPaymentData(paymentMethod: $paymentMethod, setupFutureUsage: $setupFutureUsage)'; } -SepaDebitPaymentMethodDetails _$SepaDebitPaymentMethodDetailsFromJson( - Map json) { - switch (json['type']) { - case 'sepa_debit': - return _IdSepaDebitPaymentMethodDetails.fromJson(json); - case 'sepa_debit': - return _SepaDebitPaymentMethodDetails.fromJson(json); - case 'sepa_debit': - return _SepaDebitPaymentMethodDetailsWithIban.fromJson(json); - - default: - throw CheckedFromJsonException( - json, - 'type', - 'SepaDebitPaymentMethodDetails', - 'Invalid union type "${json['type']}"!'); + +} + +/// @nodoc +abstract mixin class _$ConfirmSepaDebitPaymentDataCopyWith<$Res> implements $ConfirmSepaDebitPaymentDataCopyWith<$Res> { + factory _$ConfirmSepaDebitPaymentDataCopyWith(_ConfirmSepaDebitPaymentData value, $Res Function(_ConfirmSepaDebitPaymentData) _then) = __$ConfirmSepaDebitPaymentDataCopyWithImpl; +@override @useResult +$Res call({ +@paymentMethodDetailJsonKey SepaDebitPaymentMethodDetails? paymentMethod,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage +}); + + +@override $SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} +/// @nodoc +class __$ConfirmSepaDebitPaymentDataCopyWithImpl<$Res> + implements _$ConfirmSepaDebitPaymentDataCopyWith<$Res> { + __$ConfirmSepaDebitPaymentDataCopyWithImpl(this._self, this._then); + + final _ConfirmSepaDebitPaymentData _self; + final $Res Function(_ConfirmSepaDebitPaymentData) _then; + +/// Create a copy of ConfirmSepaDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? setupFutureUsage = freezed,}) { + return _then(_ConfirmSepaDebitPaymentData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as SepaDebitPaymentMethodDetails?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?, + )); +} + +/// Create a copy of ConfirmSepaDebitPaymentData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } + + return $SepaDebitPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +} +} + +SepaDebitPaymentMethodDetails _$SepaDebitPaymentMethodDetailsFromJson( + Map json +) { + switch (json['type']) { + case 'sepa_debit': + return _IdSepaDebitPaymentMethodDetails.fromJson( + json + ); + case 'sepa_debit': + return _SepaDebitPaymentMethodDetailsElement.fromJson( + json + ); + case 'sepa_debit': + return _SepaDebitPaymentMethodDetailsWithIban.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'type', + 'SepaDebitPaymentMethodDetails', + 'Invalid union type "${json['type']}"!' +); + } + } /// @nodoc mixin _$SepaDebitPaymentMethodDetails { - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - withIban, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map( - TResult Function(_SepaDebitPaymentMethodDetails value) $default, { - required TResult Function(_IdSepaDebitPaymentMethodDetails value) id, - required TResult Function(_SepaDebitPaymentMethodDetailsWithIban value) - withIban, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult? Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult? Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap( - TResult Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + /// Serializes this SepaDebitPaymentMethodDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SepaDebitPaymentMethodDetails); } -/// @nodoc -abstract class $SepaDebitPaymentMethodDetailsCopyWith<$Res> { - factory $SepaDebitPaymentMethodDetailsCopyWith( - SepaDebitPaymentMethodDetails value, - $Res Function(SepaDebitPaymentMethodDetails) then) = - _$SepaDebitPaymentMethodDetailsCopyWithImpl<$Res, - SepaDebitPaymentMethodDetails>; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'SepaDebitPaymentMethodDetails()'; +} + + } /// @nodoc -class _$SepaDebitPaymentMethodDetailsCopyWithImpl<$Res, - $Val extends SepaDebitPaymentMethodDetails> - implements $SepaDebitPaymentMethodDetailsCopyWith<$Res> { - _$SepaDebitPaymentMethodDetailsCopyWithImpl(this._value, this._then); +class $SepaDebitPaymentMethodDetailsCopyWith<$Res> { +$SepaDebitPaymentMethodDetailsCopyWith(SepaDebitPaymentMethodDetails _, $Res Function(SepaDebitPaymentMethodDetails) __); +} + - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +/// Adds pattern-matching-related methods to [SepaDebitPaymentMethodDetails]. +extension SepaDebitPaymentMethodDetailsPatterns on SepaDebitPaymentMethodDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SepaDebitPaymentMethodDetailsElement value)? $default,{TResult Function( _IdSepaDebitPaymentMethodDetails value)? id,TResult Function( _SepaDebitPaymentMethodDetailsWithIban value)? withIban,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IdSepaDebitPaymentMethodDetails() when id != null: +return id(_that);case _SepaDebitPaymentMethodDetailsElement() when $default != null: +return $default(_that);case _SepaDebitPaymentMethodDetailsWithIban() when withIban != null: +return withIban(_that);case _: + return orElse(); - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. } +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SepaDebitPaymentMethodDetailsElement value) $default,{required TResult Function( _IdSepaDebitPaymentMethodDetails value) id,required TResult Function( _SepaDebitPaymentMethodDetailsWithIban value) withIban,}){ +final _that = this; +switch (_that) { +case _IdSepaDebitPaymentMethodDetails(): +return id(_that);case _SepaDebitPaymentMethodDetailsElement(): +return $default(_that);case _SepaDebitPaymentMethodDetailsWithIban(): +return withIban(_that);} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SepaDebitPaymentMethodDetailsElement value)? $default,{TResult? Function( _IdSepaDebitPaymentMethodDetails value)? id,TResult? Function( _SepaDebitPaymentMethodDetailsWithIban value)? withIban,}){ +final _that = this; +switch (_that) { +case _IdSepaDebitPaymentMethodDetails() when id != null: +return id(_that);case _SepaDebitPaymentMethodDetailsElement() when $default != null: +return $default(_that);case _SepaDebitPaymentMethodDetailsWithIban() when withIban != null: +return withIban(_that);case _: + return null; -/// @nodoc -abstract class _$$IdSepaDebitPaymentMethodDetailsImplCopyWith<$Res> { - factory _$$IdSepaDebitPaymentMethodDetailsImplCopyWith( - _$IdSepaDebitPaymentMethodDetailsImpl value, - $Res Function(_$IdSepaDebitPaymentMethodDetailsImpl) then) = - __$$IdSepaDebitPaymentMethodDetailsImplCopyWithImpl<$Res>; - @useResult - $Res call({String id}); +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "sepa_debit")@ElementConverter() Element sepaDebit, @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails)? $default,{TResult Function( String id)? id,TResult Function(@JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails)? withIban,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IdSepaDebitPaymentMethodDetails() when id != null: +return id(_that.id);case _SepaDebitPaymentMethodDetailsElement() when $default != null: +return $default(_that.sepaDebit,_that.billingDetails);case _SepaDebitPaymentMethodDetailsWithIban() when withIban != null: +return withIban(_that.sepaDebit,_that.billingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "sepa_debit")@ElementConverter() Element sepaDebit, @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails) $default,{required TResult Function( String id) id,required TResult Function(@JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails) withIban,}) {final _that = this; +switch (_that) { +case _IdSepaDebitPaymentMethodDetails(): +return id(_that.id);case _SepaDebitPaymentMethodDetailsElement(): +return $default(_that.sepaDebit,_that.billingDetails);case _SepaDebitPaymentMethodDetailsWithIban(): +return withIban(_that.sepaDebit,_that.billingDetails);} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "sepa_debit")@ElementConverter() Element sepaDebit, @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails)? $default,{TResult? Function( String id)? id,TResult? Function(@JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails)? withIban,}) {final _that = this; +switch (_that) { +case _IdSepaDebitPaymentMethodDetails() when id != null: +return id(_that.id);case _SepaDebitPaymentMethodDetailsElement() when $default != null: +return $default(_that.sepaDebit,_that.billingDetails);case _SepaDebitPaymentMethodDetailsWithIban() when withIban != null: +return withIban(_that.sepaDebit,_that.billingDetails);case _: + return null; + +} } -/// @nodoc -class __$$IdSepaDebitPaymentMethodDetailsImplCopyWithImpl<$Res> - extends _$SepaDebitPaymentMethodDetailsCopyWithImpl<$Res, - _$IdSepaDebitPaymentMethodDetailsImpl> - implements _$$IdSepaDebitPaymentMethodDetailsImplCopyWith<$Res> { - __$$IdSepaDebitPaymentMethodDetailsImplCopyWithImpl( - _$IdSepaDebitPaymentMethodDetailsImpl _value, - $Res Function(_$IdSepaDebitPaymentMethodDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_$IdSepaDebitPaymentMethodDetailsImpl( - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$IdSepaDebitPaymentMethodDetailsImpl - implements _IdSepaDebitPaymentMethodDetails { - const _$IdSepaDebitPaymentMethodDetailsImpl(this.id, {final String? $type}) - : $type = $type ?? 'sepa_debit'; - factory _$IdSepaDebitPaymentMethodDetailsImpl.fromJson( - Map json) => - _$$IdSepaDebitPaymentMethodDetailsImplFromJson(json); +class _IdSepaDebitPaymentMethodDetails implements SepaDebitPaymentMethodDetails, IdPaymentMethodDetails { + const _IdSepaDebitPaymentMethodDetails(this.id, {final String? $type}): $type = $type ?? 'sepa_debit'; + factory _IdSepaDebitPaymentMethodDetails.fromJson(Map json) => _$IdSepaDebitPaymentMethodDetailsFromJson(json); - @override - final String id; + final String id; - @JsonKey(name: 'type') - final String $type; +@JsonKey(name: 'type') +final String $type; - @override - String toString() { - return 'SepaDebitPaymentMethodDetails.id(id: $id)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdSepaDebitPaymentMethodDetailsImpl && - (identical(other.id, id) || other.id == id)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id); - - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdSepaDebitPaymentMethodDetailsImplCopyWith< - _$IdSepaDebitPaymentMethodDetailsImpl> - get copyWith => __$$IdSepaDebitPaymentMethodDetailsImplCopyWithImpl< - _$IdSepaDebitPaymentMethodDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - withIban, - }) { - return id(this.id); - } +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdSepaDebitPaymentMethodDetailsCopyWith<_IdSepaDebitPaymentMethodDetails> get copyWith => __$IdSepaDebitPaymentMethodDetailsCopyWithImpl<_IdSepaDebitPaymentMethodDetails>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - }) { - return id?.call(this.id); - } +@override +Map toJson() { + return _$IdSepaDebitPaymentMethodDetailsToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - required TResult orElse(), - }) { - if (id != null) { - return id(this.id); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IdSepaDebitPaymentMethodDetails&&(identical(other.id, id) || other.id == id)); +} - @override - @optionalTypeArgs - TResult map( - TResult Function(_SepaDebitPaymentMethodDetails value) $default, { - required TResult Function(_IdSepaDebitPaymentMethodDetails value) id, - required TResult Function(_SepaDebitPaymentMethodDetailsWithIban value) - withIban, - }) { - return id(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult? Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult? Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - }) { - return id?.call(this); - } +@override +String toString() { + return 'SepaDebitPaymentMethodDetails.id(id: $id)'; +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - required TResult orElse(), - }) { - if (id != null) { - return id(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$IdSepaDebitPaymentMethodDetailsImplToJson( - this, - ); - } } -abstract class _IdSepaDebitPaymentMethodDetails - implements SepaDebitPaymentMethodDetails, IdPaymentMethodDetails { - const factory _IdSepaDebitPaymentMethodDetails(final String id) = - _$IdSepaDebitPaymentMethodDetailsImpl; +/// @nodoc +abstract mixin class _$IdSepaDebitPaymentMethodDetailsCopyWith<$Res> implements $SepaDebitPaymentMethodDetailsCopyWith<$Res> { + factory _$IdSepaDebitPaymentMethodDetailsCopyWith(_IdSepaDebitPaymentMethodDetails value, $Res Function(_IdSepaDebitPaymentMethodDetails) _then) = __$IdSepaDebitPaymentMethodDetailsCopyWithImpl; +@useResult +$Res call({ + String id +}); + - factory _IdSepaDebitPaymentMethodDetails.fromJson(Map json) = - _$IdSepaDebitPaymentMethodDetailsImpl.fromJson; - String get id; - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdSepaDebitPaymentMethodDetailsImplCopyWith< - _$IdSepaDebitPaymentMethodDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$SepaDebitPaymentMethodDetailsImplCopyWith<$Res> { - factory _$$SepaDebitPaymentMethodDetailsImplCopyWith( - _$SepaDebitPaymentMethodDetailsImpl value, - $Res Function(_$SepaDebitPaymentMethodDetailsImpl) then) = - __$$SepaDebitPaymentMethodDetailsImplCopyWithImpl<$Res>; - @useResult - $Res call( - {@JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails}); - - $SepaBillingDetailsCopyWith<$Res>? get billingDetails; +class __$IdSepaDebitPaymentMethodDetailsCopyWithImpl<$Res> + implements _$IdSepaDebitPaymentMethodDetailsCopyWith<$Res> { + __$IdSepaDebitPaymentMethodDetailsCopyWithImpl(this._self, this._then); + + final _IdSepaDebitPaymentMethodDetails _self; + final $Res Function(_IdSepaDebitPaymentMethodDetails) _then; + +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? id = null,}) { + return _then(_IdSepaDebitPaymentMethodDetails( +null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String, + )); } -/// @nodoc -class __$$SepaDebitPaymentMethodDetailsImplCopyWithImpl<$Res> - extends _$SepaDebitPaymentMethodDetailsCopyWithImpl<$Res, - _$SepaDebitPaymentMethodDetailsImpl> - implements _$$SepaDebitPaymentMethodDetailsImplCopyWith<$Res> { - __$$SepaDebitPaymentMethodDetailsImplCopyWithImpl( - _$SepaDebitPaymentMethodDetailsImpl _value, - $Res Function(_$SepaDebitPaymentMethodDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sepaDebit = null, - Object? billingDetails = freezed, - }) { - return _then(_$SepaDebitPaymentMethodDetailsImpl( - sepaDebit: null == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as Element, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as SepaBillingDetails?, - )); - } - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SepaBillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $SepaBillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } } /// @nodoc @JsonSerializable() -class _$SepaDebitPaymentMethodDetailsImpl - implements _SepaDebitPaymentMethodDetails { - const _$SepaDebitPaymentMethodDetailsImpl( - {@JsonKey(name: "sepa_debit") @ElementConverter() required this.sepaDebit, - @JsonKey(name: "billing_details") this.billingDetails, - final String? $type}) - : $type = $type ?? 'sepa_debit'; - - factory _$SepaDebitPaymentMethodDetailsImpl.fromJson( - Map json) => - _$$SepaDebitPaymentMethodDetailsImplFromJson(json); - - /// Uses the provided card or cardNumber Element for confirmation. - @override - @JsonKey(name: "sepa_debit") - @ElementConverter() - final Element sepaDebit; - - /// The customer's billing_details. name and email are required. - @override - @JsonKey(name: "billing_details") - final SepaBillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'SepaDebitPaymentMethodDetails(sepaDebit: $sepaDebit, billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SepaDebitPaymentMethodDetailsImpl && - (identical(other.sepaDebit, sepaDebit) || - other.sepaDebit == sepaDebit) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _SepaDebitPaymentMethodDetailsElement implements SepaDebitPaymentMethodDetails { + const _SepaDebitPaymentMethodDetailsElement({@JsonKey(name: "sepa_debit")@ElementConverter() required this.sepaDebit, @JsonKey(name: "billing_details") this.billingDetails, final String? $type}): $type = $type ?? 'sepa_debit'; + factory _SepaDebitPaymentMethodDetailsElement.fromJson(Map json) => _$SepaDebitPaymentMethodDetailsElementFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, sepaDebit, billingDetails); - - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SepaDebitPaymentMethodDetailsImplCopyWith< - _$SepaDebitPaymentMethodDetailsImpl> - get copyWith => __$$SepaDebitPaymentMethodDetailsImplCopyWithImpl< - _$SepaDebitPaymentMethodDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - withIban, - }) { - return $default(sepaDebit, billingDetails); - } +/// Uses the provided card or cardNumber Element for confirmation. +@JsonKey(name: "sepa_debit")@ElementConverter() final Element sepaDebit; +/// The customer's billing_details. name and email are required. +@JsonKey(name: "billing_details") final SepaBillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - }) { - return $default?.call(sepaDebit, billingDetails); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - required TResult orElse(), - }) { - if ($default != null) { - return $default(sepaDebit, billingDetails); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map( - TResult Function(_SepaDebitPaymentMethodDetails value) $default, { - required TResult Function(_IdSepaDebitPaymentMethodDetails value) id, - required TResult Function(_SepaDebitPaymentMethodDetailsWithIban value) - withIban, - }) { - return $default(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult? Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult? Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - }) { - return $default?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - required TResult orElse(), - }) { - if ($default != null) { - return $default(this); - } - return orElse(); - } +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SepaDebitPaymentMethodDetailsElementCopyWith<_SepaDebitPaymentMethodDetailsElement> get copyWith => __$SepaDebitPaymentMethodDetailsElementCopyWithImpl<_SepaDebitPaymentMethodDetailsElement>(this, _$identity); - @override - Map toJson() { - return _$$SepaDebitPaymentMethodDetailsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$SepaDebitPaymentMethodDetailsElementToJson(this, ); } -abstract class _SepaDebitPaymentMethodDetails - implements SepaDebitPaymentMethodDetails { - const factory _SepaDebitPaymentMethodDetails( - {@JsonKey(name: "sepa_debit") - @ElementConverter() - required final Element sepaDebit, - @JsonKey(name: "billing_details") - final SepaBillingDetails? billingDetails}) = - _$SepaDebitPaymentMethodDetailsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SepaDebitPaymentMethodDetailsElement&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - factory _SepaDebitPaymentMethodDetails.fromJson(Map json) = - _$SepaDebitPaymentMethodDetailsImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sepaDebit,billingDetails); - /// Uses the provided card or cardNumber Element for confirmation. - @JsonKey(name: "sepa_debit") - @ElementConverter() - Element get sepaDebit; +@override +String toString() { + return 'SepaDebitPaymentMethodDetails(sepaDebit: $sepaDebit, billingDetails: $billingDetails)'; +} - /// The customer's billing_details. name and email are required. - @JsonKey(name: "billing_details") - SepaBillingDetails? get billingDetails; - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SepaDebitPaymentMethodDetailsImplCopyWith< - _$SepaDebitPaymentMethodDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWith<$Res> { - factory _$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWith( - _$SepaDebitPaymentMethodDetailsWithIbanImpl value, - $Res Function(_$SepaDebitPaymentMethodDetailsWithIbanImpl) then) = - __$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWithImpl<$Res>; - @useResult - $Res call( - {@JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") SepaBillingDetails? billingDetails}); +abstract mixin class _$SepaDebitPaymentMethodDetailsElementCopyWith<$Res> implements $SepaDebitPaymentMethodDetailsCopyWith<$Res> { + factory _$SepaDebitPaymentMethodDetailsElementCopyWith(_SepaDebitPaymentMethodDetailsElement value, $Res Function(_SepaDebitPaymentMethodDetailsElement) _then) = __$SepaDebitPaymentMethodDetailsElementCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "sepa_debit")@ElementConverter() Element sepaDebit,@JsonKey(name: "billing_details") SepaBillingDetails? billingDetails +}); - $SepaDebitIbanDataCopyWith<$Res> get sepaDebit; - $SepaBillingDetailsCopyWith<$Res>? get billingDetails; -} +$SepaBillingDetailsCopyWith<$Res>? get billingDetails; + +} /// @nodoc -class __$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWithImpl<$Res> - extends _$SepaDebitPaymentMethodDetailsCopyWithImpl<$Res, - _$SepaDebitPaymentMethodDetailsWithIbanImpl> - implements _$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWith<$Res> { - __$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWithImpl( - _$SepaDebitPaymentMethodDetailsWithIbanImpl _value, - $Res Function(_$SepaDebitPaymentMethodDetailsWithIbanImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sepaDebit = null, - Object? billingDetails = freezed, - }) { - return _then(_$SepaDebitPaymentMethodDetailsWithIbanImpl( - sepaDebit: null == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as SepaDebitIbanData, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as SepaBillingDetails?, - )); - } +class __$SepaDebitPaymentMethodDetailsElementCopyWithImpl<$Res> + implements _$SepaDebitPaymentMethodDetailsElementCopyWith<$Res> { + __$SepaDebitPaymentMethodDetailsElementCopyWithImpl(this._self, this._then); + + final _SepaDebitPaymentMethodDetailsElement _self; + final $Res Function(_SepaDebitPaymentMethodDetailsElement) _then; + +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? sepaDebit = null,Object? billingDetails = freezed,}) { + return _then(_SepaDebitPaymentMethodDetailsElement( +sepaDebit: null == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as Element,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as SepaBillingDetails?, + )); +} - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SepaDebitIbanDataCopyWith<$Res> get sepaDebit { - return $SepaDebitIbanDataCopyWith<$Res>(_value.sepaDebit, (value) { - return _then(_value.copyWith(sepaDebit: value)); - }); +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaBillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SepaBillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $SepaBillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } + return $SepaBillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } /// @nodoc @JsonSerializable() -class _$SepaDebitPaymentMethodDetailsWithIbanImpl - implements _SepaDebitPaymentMethodDetailsWithIban { - const _$SepaDebitPaymentMethodDetailsWithIbanImpl( - {@JsonKey(name: "sepa_debit") required this.sepaDebit, - @JsonKey(name: "billing_details") this.billingDetails, - final String? $type}) - : $type = $type ?? 'sepa_debit'; - - factory _$SepaDebitPaymentMethodDetailsWithIbanImpl.fromJson( - Map json) => - _$$SepaDebitPaymentMethodDetailsWithIbanImplFromJson(json); - - /// Uses the provided card or cardNumber Element for confirmation. - @override - @JsonKey(name: "sepa_debit") - final SepaDebitIbanData sepaDebit; - - /// The customer's billing_details. name and email are required. - @override - @JsonKey(name: "billing_details") - final SepaBillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'SepaDebitPaymentMethodDetails.withIban(sepaDebit: $sepaDebit, billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SepaDebitPaymentMethodDetailsWithIbanImpl && - (identical(other.sepaDebit, sepaDebit) || - other.sepaDebit == sepaDebit) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _SepaDebitPaymentMethodDetailsWithIban implements SepaDebitPaymentMethodDetails { + const _SepaDebitPaymentMethodDetailsWithIban({@JsonKey(name: "sepa_debit") required this.sepaDebit, @JsonKey(name: "billing_details") this.billingDetails, final String? $type}): $type = $type ?? 'sepa_debit'; + factory _SepaDebitPaymentMethodDetailsWithIban.fromJson(Map json) => _$SepaDebitPaymentMethodDetailsWithIbanFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, sepaDebit, billingDetails); - - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWith< - _$SepaDebitPaymentMethodDetailsWithIbanImpl> - get copyWith => __$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWithImpl< - _$SepaDebitPaymentMethodDetailsWithIbanImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails) - withIban, - }) { - return withIban(sepaDebit, billingDetails); - } +/// Uses the provided card or cardNumber Element for confirmation. +@JsonKey(name: "sepa_debit") final SepaDebitIbanData sepaDebit; +/// The customer's billing_details. name and email are required. +@JsonKey(name: "billing_details") final SepaBillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - }) { - return withIban?.call(sepaDebit, billingDetails); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "sepa_debit") @ElementConverter() Element sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function( - @JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - SepaBillingDetails? billingDetails)? - withIban, - required TResult orElse(), - }) { - if (withIban != null) { - return withIban(sepaDebit, billingDetails); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map( - TResult Function(_SepaDebitPaymentMethodDetails value) $default, { - required TResult Function(_IdSepaDebitPaymentMethodDetails value) id, - required TResult Function(_SepaDebitPaymentMethodDetailsWithIban value) - withIban, - }) { - return withIban(this); - } +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SepaDebitPaymentMethodDetailsWithIbanCopyWith<_SepaDebitPaymentMethodDetailsWithIban> get copyWith => __$SepaDebitPaymentMethodDetailsWithIbanCopyWithImpl<_SepaDebitPaymentMethodDetailsWithIban>(this, _$identity); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult? Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult? Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - }) { - return withIban?.call(this); - } +@override +Map toJson() { + return _$SepaDebitPaymentMethodDetailsWithIbanToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_SepaDebitPaymentMethodDetails value)? $default, { - TResult Function(_IdSepaDebitPaymentMethodDetails value)? id, - TResult Function(_SepaDebitPaymentMethodDetailsWithIban value)? withIban, - required TResult orElse(), - }) { - if (withIban != null) { - return withIban(this); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SepaDebitPaymentMethodDetailsWithIban&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - @override - Map toJson() { - return _$$SepaDebitPaymentMethodDetailsWithIbanImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sepaDebit,billingDetails); + +@override +String toString() { + return 'SepaDebitPaymentMethodDetails.withIban(sepaDebit: $sepaDebit, billingDetails: $billingDetails)'; } -abstract class _SepaDebitPaymentMethodDetailsWithIban - implements SepaDebitPaymentMethodDetails { - const factory _SepaDebitPaymentMethodDetailsWithIban( - {@JsonKey(name: "sepa_debit") required final SepaDebitIbanData sepaDebit, - @JsonKey(name: "billing_details") - final SepaBillingDetails? - billingDetails}) = _$SepaDebitPaymentMethodDetailsWithIbanImpl; - factory _SepaDebitPaymentMethodDetailsWithIban.fromJson( - Map json) = - _$SepaDebitPaymentMethodDetailsWithIbanImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$SepaDebitPaymentMethodDetailsWithIbanCopyWith<$Res> implements $SepaDebitPaymentMethodDetailsCopyWith<$Res> { + factory _$SepaDebitPaymentMethodDetailsWithIbanCopyWith(_SepaDebitPaymentMethodDetailsWithIban value, $Res Function(_SepaDebitPaymentMethodDetailsWithIban) _then) = __$SepaDebitPaymentMethodDetailsWithIbanCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "sepa_debit") SepaDebitIbanData sepaDebit,@JsonKey(name: "billing_details") SepaBillingDetails? billingDetails +}); - /// Uses the provided card or cardNumber Element for confirmation. - @JsonKey(name: "sepa_debit") - SepaDebitIbanData get sepaDebit; - /// The customer's billing_details. name and email are required. - @JsonKey(name: "billing_details") - SepaBillingDetails? get billingDetails; +$SepaDebitIbanDataCopyWith<$Res> get sepaDebit;$SepaBillingDetailsCopyWith<$Res>? get billingDetails; - /// Create a copy of SepaDebitPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SepaDebitPaymentMethodDetailsWithIbanImplCopyWith< - _$SepaDebitPaymentMethodDetailsWithIbanImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$SepaDebitPaymentMethodDetailsWithIbanCopyWithImpl<$Res> + implements _$SepaDebitPaymentMethodDetailsWithIbanCopyWith<$Res> { + __$SepaDebitPaymentMethodDetailsWithIbanCopyWithImpl(this._self, this._then); + + final _SepaDebitPaymentMethodDetailsWithIban _self; + final $Res Function(_SepaDebitPaymentMethodDetailsWithIban) _then; + +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? sepaDebit = null,Object? billingDetails = freezed,}) { + return _then(_SepaDebitPaymentMethodDetailsWithIban( +sepaDebit: null == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as SepaDebitIbanData,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as SepaBillingDetails?, + )); +} + +/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitIbanDataCopyWith<$Res> get sepaDebit { + + return $SepaDebitIbanDataCopyWith<$Res>(_self.sepaDebit, (value) { + return _then(_self.copyWith(sepaDebit: value)); + }); +}/// Create a copy of SepaDebitPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaBillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } -SepaDebitIbanData _$SepaDebitIbanDataFromJson(Map json) { - return _SepaDebitIbanData.fromJson(json); + return $SepaBillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); } +} + /// @nodoc mixin _$SepaDebitIbanData { - /// An IBAN account number. - String get iban => throw _privateConstructorUsedError; + +/// An IBAN account number. + String get iban; +/// Create a copy of SepaDebitIbanData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SepaDebitIbanDataCopyWith get copyWith => _$SepaDebitIbanDataCopyWithImpl(this as SepaDebitIbanData, _$identity); /// Serializes this SepaDebitIbanData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of SepaDebitIbanData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SepaDebitIbanDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SepaDebitIbanData&&(identical(other.iban, iban) || other.iban == iban)); } -/// @nodoc -abstract class $SepaDebitIbanDataCopyWith<$Res> { - factory $SepaDebitIbanDataCopyWith( - SepaDebitIbanData value, $Res Function(SepaDebitIbanData) then) = - _$SepaDebitIbanDataCopyWithImpl<$Res, SepaDebitIbanData>; - @useResult - $Res call({String iban}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,iban); + +@override +String toString() { + return 'SepaDebitIbanData(iban: $iban)'; } -/// @nodoc -class _$SepaDebitIbanDataCopyWithImpl<$Res, $Val extends SepaDebitIbanData> - implements $SepaDebitIbanDataCopyWith<$Res> { - _$SepaDebitIbanDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SepaDebitIbanData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? iban = null, - }) { - return _then(_value.copyWith( - iban: null == iban - ? _value.iban - : iban // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$SepaDebitIbanDataImplCopyWith<$Res> +abstract mixin class $SepaDebitIbanDataCopyWith<$Res> { + factory $SepaDebitIbanDataCopyWith(SepaDebitIbanData value, $Res Function(SepaDebitIbanData) _then) = _$SepaDebitIbanDataCopyWithImpl; +@useResult +$Res call({ + String iban +}); + + + + +} +/// @nodoc +class _$SepaDebitIbanDataCopyWithImpl<$Res> implements $SepaDebitIbanDataCopyWith<$Res> { - factory _$$SepaDebitIbanDataImplCopyWith(_$SepaDebitIbanDataImpl value, - $Res Function(_$SepaDebitIbanDataImpl) then) = - __$$SepaDebitIbanDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String iban}); + _$SepaDebitIbanDataCopyWithImpl(this._self, this._then); + + final SepaDebitIbanData _self; + final $Res Function(SepaDebitIbanData) _then; + +/// Create a copy of SepaDebitIbanData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? iban = null,}) { + return _then(_self.copyWith( +iban: null == iban ? _self.iban : iban // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [SepaDebitIbanData]. +extension SepaDebitIbanDataPatterns on SepaDebitIbanData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SepaDebitIbanData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SepaDebitIbanData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SepaDebitIbanData value) $default,){ +final _that = this; +switch (_that) { +case _SepaDebitIbanData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SepaDebitIbanData value)? $default,){ +final _that = this; +switch (_that) { +case _SepaDebitIbanData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String iban)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SepaDebitIbanData() when $default != null: +return $default(_that.iban);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String iban) $default,) {final _that = this; +switch (_that) { +case _SepaDebitIbanData(): +return $default(_that.iban);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String iban)? $default,) {final _that = this; +switch (_that) { +case _SepaDebitIbanData() when $default != null: +return $default(_that.iban);case _: + return null; + +} } -/// @nodoc -class __$$SepaDebitIbanDataImplCopyWithImpl<$Res> - extends _$SepaDebitIbanDataCopyWithImpl<$Res, _$SepaDebitIbanDataImpl> - implements _$$SepaDebitIbanDataImplCopyWith<$Res> { - __$$SepaDebitIbanDataImplCopyWithImpl(_$SepaDebitIbanDataImpl _value, - $Res Function(_$SepaDebitIbanDataImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaDebitIbanData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? iban = null, - }) { - return _then(_$SepaDebitIbanDataImpl( - iban: null == iban - ? _value.iban - : iban // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$SepaDebitIbanDataImpl implements _SepaDebitIbanData { - const _$SepaDebitIbanDataImpl({required this.iban}); - factory _$SepaDebitIbanDataImpl.fromJson(Map json) => - _$$SepaDebitIbanDataImplFromJson(json); +class _SepaDebitIbanData implements SepaDebitIbanData { + const _SepaDebitIbanData({required this.iban}); + factory _SepaDebitIbanData.fromJson(Map json) => _$SepaDebitIbanDataFromJson(json); - /// An IBAN account number. - @override - final String iban; +/// An IBAN account number. +@override final String iban; - @override - String toString() { - return 'SepaDebitIbanData(iban: $iban)'; - } +/// Create a copy of SepaDebitIbanData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SepaDebitIbanDataCopyWith<_SepaDebitIbanData> get copyWith => __$SepaDebitIbanDataCopyWithImpl<_SepaDebitIbanData>(this, _$identity); + +@override +Map toJson() { + return _$SepaDebitIbanDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SepaDebitIbanData&&(identical(other.iban, iban) || other.iban == iban)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,iban); + +@override +String toString() { + return 'SepaDebitIbanData(iban: $iban)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SepaDebitIbanDataImpl && - (identical(other.iban, iban) || other.iban == iban)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, iban); - - /// Create a copy of SepaDebitIbanData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SepaDebitIbanDataImplCopyWith<_$SepaDebitIbanDataImpl> get copyWith => - __$$SepaDebitIbanDataImplCopyWithImpl<_$SepaDebitIbanDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$SepaDebitIbanDataImplToJson( - this, - ); - } } -abstract class _SepaDebitIbanData implements SepaDebitIbanData { - const factory _SepaDebitIbanData({required final String iban}) = - _$SepaDebitIbanDataImpl; +/// @nodoc +abstract mixin class _$SepaDebitIbanDataCopyWith<$Res> implements $SepaDebitIbanDataCopyWith<$Res> { + factory _$SepaDebitIbanDataCopyWith(_SepaDebitIbanData value, $Res Function(_SepaDebitIbanData) _then) = __$SepaDebitIbanDataCopyWithImpl; +@override @useResult +$Res call({ + String iban +}); + - factory _SepaDebitIbanData.fromJson(Map json) = - _$SepaDebitIbanDataImpl.fromJson; - /// An IBAN account number. - @override - String get iban; - /// Create a copy of SepaDebitIbanData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SepaDebitIbanDataImplCopyWith<_$SepaDebitIbanDataImpl> get copyWith => - throw _privateConstructorUsedError; +} +/// @nodoc +class __$SepaDebitIbanDataCopyWithImpl<$Res> + implements _$SepaDebitIbanDataCopyWith<$Res> { + __$SepaDebitIbanDataCopyWithImpl(this._self, this._then); + + final _SepaDebitIbanData _self; + final $Res Function(_SepaDebitIbanData) _then; + +/// Create a copy of SepaDebitIbanData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? iban = null,}) { + return _then(_SepaDebitIbanData( +iban: null == iban ? _self.iban : iban // ignore: cast_nullable_to_non_nullable +as String, + )); } -SepaBillingDetails _$SepaBillingDetailsFromJson(Map json) { - return _SepaBillingDetails.fromJson(json); + } + /// @nodoc mixin _$SepaBillingDetails { - /// Email address. - String get email => throw _privateConstructorUsedError; - /// Billing address. - BillingAddress? get address => throw _privateConstructorUsedError; +/// Email address. + String get email;/// Billing address. + BillingAddress? get address;/// Billing phone number. + String? get phone;/// Full name. + String get name; +/// Create a copy of SepaBillingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SepaBillingDetailsCopyWith get copyWith => _$SepaBillingDetailsCopyWithImpl(this as SepaBillingDetails, _$identity); - /// Billing phone number. - String? get phone => throw _privateConstructorUsedError; + /// Serializes this SepaBillingDetails to a JSON map. + Map toJson(); - /// Full name. - String get name => throw _privateConstructorUsedError; - /// Serializes this SepaBillingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SepaBillingDetails&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.name, name) || other.name == name)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,email,address,phone,name); - /// Create a copy of SepaBillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SepaBillingDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'SepaBillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; } -/// @nodoc -abstract class $SepaBillingDetailsCopyWith<$Res> { - factory $SepaBillingDetailsCopyWith( - SepaBillingDetails value, $Res Function(SepaBillingDetails) then) = - _$SepaBillingDetailsCopyWithImpl<$Res, SepaBillingDetails>; - @useResult - $Res call( - {String email, BillingAddress? address, String? phone, String name}); - $BillingAddressCopyWith<$Res>? get address; } /// @nodoc -class _$SepaBillingDetailsCopyWithImpl<$Res, $Val extends SepaBillingDetails> +abstract mixin class $SepaBillingDetailsCopyWith<$Res> { + factory $SepaBillingDetailsCopyWith(SepaBillingDetails value, $Res Function(SepaBillingDetails) _then) = _$SepaBillingDetailsCopyWithImpl; +@useResult +$Res call({ + String email, BillingAddress? address, String? phone, String name +}); + + +$BillingAddressCopyWith<$Res>? get address; + +} +/// @nodoc +class _$SepaBillingDetailsCopyWithImpl<$Res> implements $SepaBillingDetailsCopyWith<$Res> { - _$SepaBillingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SepaBillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? email = null, - Object? address = freezed, - Object? phone = freezed, - Object? name = null, - }) { - return _then(_value.copyWith( - email: null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as BillingAddress?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + _$SepaBillingDetailsCopyWithImpl(this._self, this._then); + + final SepaBillingDetails _self; + final $Res Function(SepaBillingDetails) _then; + +/// Create a copy of SepaBillingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? email = null,Object? address = freezed,Object? phone = freezed,Object? name = null,}) { + return _then(_self.copyWith( +email: null == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as BillingAddress?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} +/// Create a copy of SepaBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingAddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - /// Create a copy of SepaBillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingAddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $BillingAddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } + return $BillingAddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} } -/// @nodoc -abstract class _$$SepaBillingDetailsImplCopyWith<$Res> - implements $SepaBillingDetailsCopyWith<$Res> { - factory _$$SepaBillingDetailsImplCopyWith(_$SepaBillingDetailsImpl value, - $Res Function(_$SepaBillingDetailsImpl) then) = - __$$SepaBillingDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String email, BillingAddress? address, String? phone, String name}); - @override - $BillingAddressCopyWith<$Res>? get address; +/// Adds pattern-matching-related methods to [SepaBillingDetails]. +extension SepaBillingDetailsPatterns on SepaBillingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SepaBillingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SepaBillingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SepaBillingDetails value) $default,){ +final _that = this; +switch (_that) { +case _SepaBillingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SepaBillingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _SepaBillingDetails() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc -class __$$SepaBillingDetailsImplCopyWithImpl<$Res> - extends _$SepaBillingDetailsCopyWithImpl<$Res, _$SepaBillingDetailsImpl> - implements _$$SepaBillingDetailsImplCopyWith<$Res> { - __$$SepaBillingDetailsImplCopyWithImpl(_$SepaBillingDetailsImpl _value, - $Res Function(_$SepaBillingDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaBillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? email = null, - Object? address = freezed, - Object? phone = freezed, - Object? name = null, - }) { - return _then(_$SepaBillingDetailsImpl( - email: null == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as BillingAddress?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - )); - } } +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String email, BillingAddress? address, String? phone, String name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SepaBillingDetails() when $default != null: +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + return orElse(); -/// @nodoc -@JsonSerializable() -class _$SepaBillingDetailsImpl implements _SepaBillingDetails { - const _$SepaBillingDetailsImpl( - {required this.email, this.address, this.phone, required this.name}); +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String email, BillingAddress? address, String? phone, String name) $default,) {final _that = this; +switch (_that) { +case _SepaBillingDetails(): +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + throw StateError('Unexpected subclass'); - factory _$SepaBillingDetailsImpl.fromJson(Map json) => - _$$SepaBillingDetailsImplFromJson(json); +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String email, BillingAddress? address, String? phone, String name)? $default,) {final _that = this; +switch (_that) { +case _SepaBillingDetails() when $default != null: +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + return null; - /// Email address. - @override - final String email; +} +} - /// Billing address. - @override - final BillingAddress? address; +} - /// Billing phone number. - @override - final String? phone; +/// @nodoc +@JsonSerializable() - /// Full name. - @override - final String name; +class _SepaBillingDetails implements SepaBillingDetails { + const _SepaBillingDetails({required this.email, this.address, this.phone, required this.name}); + factory _SepaBillingDetails.fromJson(Map json) => _$SepaBillingDetailsFromJson(json); + +/// Email address. +@override final String email; +/// Billing address. +@override final BillingAddress? address; +/// Billing phone number. +@override final String? phone; +/// Full name. +@override final String name; + +/// Create a copy of SepaBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SepaBillingDetailsCopyWith<_SepaBillingDetails> get copyWith => __$SepaBillingDetailsCopyWithImpl<_SepaBillingDetails>(this, _$identity); + +@override +Map toJson() { + return _$SepaBillingDetailsToJson(this, ); +} - @override - String toString() { - return 'SepaBillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SepaBillingDetails&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.name, name) || other.name == name)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SepaBillingDetailsImpl && - (identical(other.email, email) || other.email == email) && - (identical(other.address, address) || other.address == address) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.name, name) || other.name == name)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,email,address,phone,name); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, email, address, phone, name); - - /// Create a copy of SepaBillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SepaBillingDetailsImplCopyWith<_$SepaBillingDetailsImpl> get copyWith => - __$$SepaBillingDetailsImplCopyWithImpl<_$SepaBillingDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$SepaBillingDetailsImplToJson( - this, - ); - } +@override +String toString() { + return 'SepaBillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; } -abstract class _SepaBillingDetails implements SepaBillingDetails { - const factory _SepaBillingDetails( - {required final String email, - final BillingAddress? address, - final String? phone, - required final String name}) = _$SepaBillingDetailsImpl; - factory _SepaBillingDetails.fromJson(Map json) = - _$SepaBillingDetailsImpl.fromJson; +} - /// Email address. - @override - String get email; +/// @nodoc +abstract mixin class _$SepaBillingDetailsCopyWith<$Res> implements $SepaBillingDetailsCopyWith<$Res> { + factory _$SepaBillingDetailsCopyWith(_SepaBillingDetails value, $Res Function(_SepaBillingDetails) _then) = __$SepaBillingDetailsCopyWithImpl; +@override @useResult +$Res call({ + String email, BillingAddress? address, String? phone, String name +}); - /// Billing address. - @override - BillingAddress? get address; - /// Billing phone number. - @override - String? get phone; +@override $BillingAddressCopyWith<$Res>? get address; - /// Full name. - @override - String get name; +} +/// @nodoc +class __$SepaBillingDetailsCopyWithImpl<$Res> + implements _$SepaBillingDetailsCopyWith<$Res> { + __$SepaBillingDetailsCopyWithImpl(this._self, this._then); + + final _SepaBillingDetails _self; + final $Res Function(_SepaBillingDetails) _then; + +/// Create a copy of SepaBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? email = null,Object? address = freezed,Object? phone = freezed,Object? name = null,}) { + return _then(_SepaBillingDetails( +email: null == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as BillingAddress?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} - /// Create a copy of SepaBillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SepaBillingDetailsImplCopyWith<_$SepaBillingDetailsImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of SepaBillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingAddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $BillingAddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.g.dart b/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.g.dart index ee2309d2f..8d8fafc29 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/confirm_sepa_debit_payment_data.g.dart @@ -6,146 +6,109 @@ part of 'confirm_sepa_debit_payment_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmSepaDebitPaymentDataImpl _$$ConfirmSepaDebitPaymentDataImplFromJson( - Map json) => - _$ConfirmSepaDebitPaymentDataImpl( +_ConfirmSepaDebitPaymentData _$ConfirmSepaDebitPaymentDataFromJson(Map json) => + _ConfirmSepaDebitPaymentData( paymentMethod: json['payment_method'] == null ? null : SepaDebitPaymentMethodDetails.fromJson( - Map.from(json['payment_method'] as Map)), + Map.from(json['payment_method'] as Map), + ), setupFutureUsage: $enumDecodeNullable( - _$PaymentIntentSetupFutureUsageEnumMap, json['setup_future_usage']), + _$PaymentIntentSetupFutureUsageEnumMap, + json['setup_future_usage'], + ), ); -Map _$$ConfirmSepaDebitPaymentDataImplToJson( - _$ConfirmSepaDebitPaymentDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', - PaymentMethodDetails.toJsonConverter(instance.paymentMethod)); - writeNotNull('setup_future_usage', - _$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage]); - return val; -} +Map _$ConfirmSepaDebitPaymentDataToJson( + _ConfirmSepaDebitPaymentData instance, +) => { + 'payment_method': ?PaymentMethodDetails.toJsonConverter( + instance.paymentMethod, + ), + 'setup_future_usage': + ?_$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage], +}; const _$PaymentIntentSetupFutureUsageEnumMap = { PaymentIntentSetupFutureUsage.onSession: 'on_session', PaymentIntentSetupFutureUsage.offSession: 'off_session', }; -_$IdSepaDebitPaymentMethodDetailsImpl - _$$IdSepaDebitPaymentMethodDetailsImplFromJson(Map json) => - _$IdSepaDebitPaymentMethodDetailsImpl( - json['id'] as String, - $type: json['type'] as String?, - ); - -Map _$$IdSepaDebitPaymentMethodDetailsImplToJson( - _$IdSepaDebitPaymentMethodDetailsImpl instance) => - { - 'id': instance.id, - 'type': instance.$type, - }; - -_$SepaDebitPaymentMethodDetailsImpl - _$$SepaDebitPaymentMethodDetailsImplFromJson(Map json) => - _$SepaDebitPaymentMethodDetailsImpl( - sepaDebit: const ElementConverter().fromJson(json['sepa_debit']), - billingDetails: json['billing_details'] == null - ? null - : SepaBillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), - $type: json['type'] as String?, - ); - -Map _$$SepaDebitPaymentMethodDetailsImplToJson( - _$SepaDebitPaymentMethodDetailsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'sepa_debit', const ElementConverter().toJson(instance.sepaDebit)); - writeNotNull('billing_details', instance.billingDetails?.toJson()); - val['type'] = instance.$type; - return val; -} - -_$SepaDebitPaymentMethodDetailsWithIbanImpl - _$$SepaDebitPaymentMethodDetailsWithIbanImplFromJson(Map json) => - _$SepaDebitPaymentMethodDetailsWithIbanImpl( - sepaDebit: SepaDebitIbanData.fromJson( - Map.from(json['sepa_debit'] as Map)), - billingDetails: json['billing_details'] == null - ? null - : SepaBillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), - $type: json['type'] as String?, - ); +_IdSepaDebitPaymentMethodDetails _$IdSepaDebitPaymentMethodDetailsFromJson( + Map json, +) => _IdSepaDebitPaymentMethodDetails( + json['id'] as String, + $type: json['type'] as String?, +); + +Map _$IdSepaDebitPaymentMethodDetailsToJson( + _IdSepaDebitPaymentMethodDetails instance, +) => {'id': instance.id, 'type': instance.$type}; + +_SepaDebitPaymentMethodDetailsElement +_$SepaDebitPaymentMethodDetailsElementFromJson(Map json) => + _SepaDebitPaymentMethodDetailsElement( + sepaDebit: const ElementConverter().fromJson(json['sepa_debit']), + billingDetails: json['billing_details'] == null + ? null + : SepaBillingDetails.fromJson( + Map.from(json['billing_details'] as Map), + ), + $type: json['type'] as String?, + ); -Map _$$SepaDebitPaymentMethodDetailsWithIbanImplToJson( - _$SepaDebitPaymentMethodDetailsWithIbanImpl instance) { - final val = { - 'sepa_debit': instance.sepaDebit.toJson(), - }; +Map _$SepaDebitPaymentMethodDetailsElementToJson( + _SepaDebitPaymentMethodDetailsElement instance, +) => { + 'sepa_debit': ?const ElementConverter().toJson(instance.sepaDebit), + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +_SepaDebitPaymentMethodDetailsWithIban +_$SepaDebitPaymentMethodDetailsWithIbanFromJson(Map json) => + _SepaDebitPaymentMethodDetailsWithIban( + sepaDebit: SepaDebitIbanData.fromJson( + Map.from(json['sepa_debit'] as Map), + ), + billingDetails: json['billing_details'] == null + ? null + : SepaBillingDetails.fromJson( + Map.from(json['billing_details'] as Map), + ), + $type: json['type'] as String?, + ); - writeNotNull('billing_details', instance.billingDetails?.toJson()); - val['type'] = instance.$type; - return val; -} +Map _$SepaDebitPaymentMethodDetailsWithIbanToJson( + _SepaDebitPaymentMethodDetailsWithIban instance, +) => { + 'sepa_debit': instance.sepaDebit.toJson(), + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; -_$SepaDebitIbanDataImpl _$$SepaDebitIbanDataImplFromJson(Map json) => - _$SepaDebitIbanDataImpl( - iban: json['iban'] as String, - ); +_SepaDebitIbanData _$SepaDebitIbanDataFromJson(Map json) => + _SepaDebitIbanData(iban: json['iban'] as String); -Map _$$SepaDebitIbanDataImplToJson( - _$SepaDebitIbanDataImpl instance) => - { - 'iban': instance.iban, - }; +Map _$SepaDebitIbanDataToJson(_SepaDebitIbanData instance) => + {'iban': instance.iban}; -_$SepaBillingDetailsImpl _$$SepaBillingDetailsImplFromJson(Map json) => - _$SepaBillingDetailsImpl( +_SepaBillingDetails _$SepaBillingDetailsFromJson(Map json) => + _SepaBillingDetails( email: json['email'] as String, address: json['address'] == null ? null : BillingAddress.fromJson( - Map.from(json['address'] as Map)), + Map.from(json['address'] as Map), + ), phone: json['phone'] as String?, name: json['name'] as String, ); -Map _$$SepaBillingDetailsImplToJson( - _$SepaBillingDetailsImpl instance) { - final val = { - 'email': instance.email, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('address', instance.address?.toJson()); - writeNotNull('phone', instance.phone); - val['name'] = instance.name; - return val; -} +Map _$SepaBillingDetailsToJson(_SepaBillingDetails instance) => + { + 'email': instance.email, + 'address': ?instance.address?.toJson(), + 'phone': ?instance.phone, + 'name': instance.name, + }; diff --git a/packages/stripe_js/lib/src/api/payment_intents/payment_intent.dart b/packages/stripe_js/lib/src/api/payment_intents/payment_intent.dart index 626b0dfc1..134c30c36 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/payment_intent.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/payment_intent.dart @@ -74,7 +74,7 @@ enum PaymentIntentSetupFutureUsage { /// /// https://stripe.com/docs/api/payment_intents @freezed -class PaymentIntent with _$PaymentIntent { +abstract class PaymentIntent with _$PaymentIntent { const factory PaymentIntent({ /// Unique identifier for the object. required String id, @@ -284,7 +284,7 @@ class PaymentIntent with _$PaymentIntent { } @freezed -class PaymentIntentAmountDetails with _$PaymentIntentAmountDetails { +abstract class PaymentIntentAmountDetails with _$PaymentIntentAmountDetails { const factory PaymentIntentAmountDetails({ /// Details about items included in the amount @Default(PaymentIntentTip()) PaymentIntentTip? tip, @@ -295,7 +295,7 @@ class PaymentIntentAmountDetails with _$PaymentIntentAmountDetails { } @freezed -class PaymentIntentTip with _$PaymentIntentTip { +abstract class PaymentIntentTip with _$PaymentIntentTip { const factory PaymentIntentTip({ /// Portion of the amount that corresponds to a tip. int? amount, @@ -306,7 +306,7 @@ class PaymentIntentTip with _$PaymentIntentTip { } @freezed -class PaymentIntentAutomaticPaymentMethods +abstract class PaymentIntentAutomaticPaymentMethods with _$PaymentIntentAutomaticPaymentMethods { const factory PaymentIntentAutomaticPaymentMethods({ /// Automatically calculates compatible payment methods @@ -314,6 +314,6 @@ class PaymentIntentAutomaticPaymentMethods }) = _PaymentIntentAutomaticPaymentMethods; factory PaymentIntentAutomaticPaymentMethods.fromJson( - Map json) => - _$PaymentIntentAutomaticPaymentMethodsFromJson(json); + Map json, + ) => _$PaymentIntentAutomaticPaymentMethodsFromJson(json); } diff --git a/packages/stripe_js/lib/src/api/payment_intents/payment_intent.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/payment_intent.freezed.dart index 0da240082..b02b4c709 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/payment_intent.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/payment_intent.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,2136 +9,1539 @@ part of 'payment_intent.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentIntent _$PaymentIntentFromJson(Map json) { - return _PaymentIntent.fromJson(json); -} - /// @nodoc mixin _$PaymentIntent { - /// Unique identifier for the object. - String get id => throw _privateConstructorUsedError; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "payment_intent". - String get object => throw _privateConstructorUsedError; - - /// Amount intended to be collected by this PaymentIntent. - /// A positive integer representing how much to charge in the - /// smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to - /// charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or equivalent in charge currency. - /// The amount value supports up to eight digits - /// (e.g., a value of 99999999 for a USD charge of $999,999.99). - int get amount => throw _privateConstructorUsedError; - - /// The amount that can be captured with from this PaymentIntent (in cents). - @JsonKey(name: "amount_capturable") - int? get amountCapturable => throw _privateConstructorUsedError; - - /// Details about items included in the amount - @JsonKey(name: "amount_details") - PaymentIntentAmountDetails? get amountDetails => - throw _privateConstructorUsedError; - - /// The amount that was collected from this PaymentIntent (in cents). - @JsonKey(name: "amount_received") - int? get amountReceived => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// ID of the Connect application that created the PaymentIntent. - String? get application => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// The amount of the application fee (if any) that will be requested to - /// be applied to the payment and transferred to the application owner’s - /// Stripe account. The amount of the application fee collected will be - /// capped at the total payment amount. - /// For more information, see the PaymentIntents use - /// case for connected accounts.. - @JsonKey(name: "application_fee_amount") - int? get applicationFeeAmount => throw _privateConstructorUsedError; - - /// Settings to configure compatible payment methods from the - /// Stripe Dashboard - @JsonKey(name: "automatic_payment_methods") - PaymentIntentAutomaticPaymentMethods? get automaticPaymentMethods => - throw _privateConstructorUsedError; - - /// Populated when status is canceled, this is the time at which the - /// PaymentIntent was canceled. Measured in seconds since the Unix epoch. - @JsonKey(name: "canceled_at") - int? get canceledAt => throw _privateConstructorUsedError; - - /// Reason for cancellation of this PaymentIntent, - /// either user-provided - /// (duplicate, fraudulent, requested_by_customer, or abandoned) or - /// generated by Stripe internally - /// (failed_invoice, void_invoice, or automatic). - @JsonKey(name: "cancellation_reason") - PaymentIntentCancellationReason? get cancellationReason => - throw _privateConstructorUsedError; - - /// The client secret of this PaymentIntent. Used for client-side retrieval - /// using a publishable key. - /// The client secret can be used to complete a payment from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the - /// customer. Make sure that you have TLS enabled on any page that includes - /// the client secret. - /// - /// Refer to our docs to accept a payment and learn about how `client_secret` - /// should be handled. - @JsonKey(name: "client_secret") - String get clientSecret => throw _privateConstructorUsedError; - - /// Controls when the funds will be captured from the customer’s account. - @JsonKey(name: "capture_method") - PaymentIntentCaptureMethod get captureMethod => - throw _privateConstructorUsedError; - @JsonKey(name: "confirmation_method") - PaymentIntentConfirmationMethod get confirmationMethod => - throw _privateConstructorUsedError; - - /// Time at which the object was created. Measured in seconds since the - /// Unix epoch. - int? get created => throw _privateConstructorUsedError; - - /// Three-letter ISO currency code, in lowercase. Must be a supported - /// currency. - String get currency => throw _privateConstructorUsedError; - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// Payment methods attached to other Customers cannot be used with this - /// PaymentIntent. - /// - /// If present in combination with setup_future_usage, - /// this PaymentIntent’s payment method will be attached to the - /// Customer after the PaymentIntent has been confirmed and any - /// required actions from the user are complete. - String? get customer => throw _privateConstructorUsedError; - - /// An arbitrary string attached to the object. - /// Often useful for displaying to users. - String? get description => throw _privateConstructorUsedError; - - /// ID of the invoice that created this PaymentIntent, if it exists. - String? get invoice => throw _privateConstructorUsedError; - - /// The payment error encountered in the previous PaymentIntent confirmation. - /// It will be cleared if the PaymentIntent is later updated for any reason. - @JsonKey(name: "last_payment_error") - StripeError? get lastPaymentError => throw _privateConstructorUsedError; - - /// The latest charge created by this payment intent. - @JsonKey(name: "latest_charge") - String? get latestCharge => throw _privateConstructorUsedError; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - bool get livemode => throw _privateConstructorUsedError; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - Map get metadata => throw _privateConstructorUsedError; - - /// If present, this property tells you what actions you need to - /// take in order for your customer to fulfill a payment using the - /// provided source. - @JsonKey(name: "next_action") - dynamic get nextAction => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// The account (if any) for which the funds of the PaymentIntent are - /// intended. See the PaymentIntents use case for connected accounts - /// for details. - @JsonKey(name: "on_behalf_of") - String? get onBehalfOf => throw _privateConstructorUsedError; - - /// ID of the payment method used in this PaymentIntent. - @JsonKey(name: "payment_method") - String? get paymentMethod => throw _privateConstructorUsedError; - - /// Payment-method-specific configuration for this PaymentIntent. - @JsonKey(name: "payment_method_options") - Map get paymentMethodOptions => - throw _privateConstructorUsedError; - - /// The list of payment method types (e.g. card) that this PaymentIntent - /// is allowed to use. - @JsonKey( - name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) - List get paymentMethodTypes => - throw _privateConstructorUsedError; - - /// If present, this property tells you about the processing state of the payment. - dynamic get processing => throw _privateConstructorUsedError; - - /// Email address that the receipt for the resulting payment will be sent to. - /// If receipt_email is specified for a payment in live mode, a receipt - /// will be sent regardless of your email settings. - @JsonKey(name: "receipt_email") - String? get receiptEmail => - throw _privateConstructorUsedError; // ID of the review associated with this PaymentIntent, if any. - String? get review => throw _privateConstructorUsedError; - - /// Indicates that you intend to make future payments with this - /// PaymentIntent’s payment method. - /// Providing this parameter will attach the payment method to the - /// PaymentIntent’s Customer, if present, after the PaymentIntent is - /// confirmed and any required actions from the user are complete. I - /// If no Customer was provided, the payment method can still be attached to - /// a Customer after the transaction completes. - /// When processing card payments, Stripe also uses setup_future_usage - /// to dynamically optimize your payment flow and comply with regional - /// legislation and network rules, such as SCA. - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage => - throw _privateConstructorUsedError; - - /// Shipping information for this PaymentIntent. - ShippingDetails? get shipping => throw _privateConstructorUsedError; - - /// For non-card charges, you can use this value as the complete - /// description that appears on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - @JsonKey(name: "statement_descriptor") - String? get statementDescriptor => throw _privateConstructorUsedError; - - /// Provides information about a card payment that customers see on - /// their statements. - /// Concatenated with the prefix (shortened descriptor) or statement - /// descriptor that’s set on the account to form the complete statement - /// descriptor. Maximum 22 characters for the concatenated descriptor. - @JsonKey(name: "statement_descriptor_suffix") - String? get statementDescriptorSuffix => throw _privateConstructorUsedError; - - /// Status of this PaymentIntent, one of requires_payment_method, - /// requires_confirmation, requires_action, processing, requires_capture, - /// canceled, or succeeded. - PaymentIntentsStatus get status => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// The data with which to automatically create a Transfer when the payment - /// is finalized. See the PaymentIntents use case for connected - /// accounts for details. - @JsonKey(name: "transfer_data") - dynamic get transferData => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// A string that identifies the resulting payment as part of a group. - /// See the PaymentIntents use case for connected accounts for details. - @JsonKey(name: "transfer_group") - dynamic get transferGroup => throw _privateConstructorUsedError; + +/// Unique identifier for the object. + String get id;/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "payment_intent". + String get object;/// Amount intended to be collected by this PaymentIntent. +/// A positive integer representing how much to charge in the +/// smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to +/// charge ¥100, a zero-decimal currency). +/// The minimum amount is $0.50 US or equivalent in charge currency. +/// The amount value supports up to eight digits +/// (e.g., a value of 99999999 for a USD charge of $999,999.99). + int get amount;/// The amount that can be captured with from this PaymentIntent (in cents). +@JsonKey(name: "amount_capturable") int? get amountCapturable;/// Details about items included in the amount +@JsonKey(name: "amount_details") PaymentIntentAmountDetails? get amountDetails;/// The amount that was collected from this PaymentIntent (in cents). +@JsonKey(name: "amount_received") int? get amountReceived;/// CONNECT ONLY +/// ID of the Connect application that created the PaymentIntent. + String? get application;/// CONNECT ONLY +/// The amount of the application fee (if any) that will be requested to +/// be applied to the payment and transferred to the application owner’s +/// Stripe account. The amount of the application fee collected will be +/// capped at the total payment amount. +/// For more information, see the PaymentIntents use +/// case for connected accounts.. +@JsonKey(name: "application_fee_amount") int? get applicationFeeAmount;/// Settings to configure compatible payment methods from the +/// Stripe Dashboard +@JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? get automaticPaymentMethods;/// Populated when status is canceled, this is the time at which the +/// PaymentIntent was canceled. Measured in seconds since the Unix epoch. +@JsonKey(name: "canceled_at") int? get canceledAt;/// Reason for cancellation of this PaymentIntent, +/// either user-provided +/// (duplicate, fraudulent, requested_by_customer, or abandoned) or +/// generated by Stripe internally +/// (failed_invoice, void_invoice, or automatic). +@JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? get cancellationReason;/// The client secret of this PaymentIntent. Used for client-side retrieval +/// using a publishable key. +/// The client secret can be used to complete a payment from your frontend. +/// It should not be stored, logged, or exposed to anyone other than the +/// customer. Make sure that you have TLS enabled on any page that includes +/// the client secret. +/// +/// Refer to our docs to accept a payment and learn about how `client_secret` +/// should be handled. +@JsonKey(name: "client_secret") String get clientSecret;/// Controls when the funds will be captured from the customer’s account. +@JsonKey(name: "capture_method") PaymentIntentCaptureMethod get captureMethod;@JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod get confirmationMethod;/// Time at which the object was created. Measured in seconds since the +/// Unix epoch. + int? get created;/// Three-letter ISO currency code, in lowercase. Must be a supported +/// currency. + String get currency;/// ID of the Customer this PaymentIntent belongs to, if one exists. +/// Payment methods attached to other Customers cannot be used with this +/// PaymentIntent. +/// +/// If present in combination with setup_future_usage, +/// this PaymentIntent’s payment method will be attached to the +/// Customer after the PaymentIntent has been confirmed and any +/// required actions from the user are complete. + String? get customer;/// An arbitrary string attached to the object. +/// Often useful for displaying to users. + String? get description;/// ID of the invoice that created this PaymentIntent, if it exists. + String? get invoice;/// The payment error encountered in the previous PaymentIntent confirmation. +/// It will be cleared if the PaymentIntent is later updated for any reason. +@JsonKey(name: "last_payment_error") StripeError? get lastPaymentError;/// The latest charge created by this payment intent. +@JsonKey(name: "latest_charge") String? get latestCharge;/// Has the value true if the object exists in live mode or the +/// value false if the object exists in test mode. + bool get livemode;/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the +/// object in a structured format. + Map get metadata;/// If present, this property tells you what actions you need to +/// take in order for your customer to fulfill a payment using the +/// provided source. +@JsonKey(name: "next_action") dynamic get nextAction;/// CONNECT ONLY +/// The account (if any) for which the funds of the PaymentIntent are +/// intended. See the PaymentIntents use case for connected accounts +/// for details. +@JsonKey(name: "on_behalf_of") String? get onBehalfOf;/// ID of the payment method used in this PaymentIntent. +@JsonKey(name: "payment_method") String? get paymentMethod;/// Payment-method-specific configuration for this PaymentIntent. +@JsonKey(name: "payment_method_options") Map get paymentMethodOptions;/// The list of payment method types (e.g. card) that this PaymentIntent +/// is allowed to use. +@JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List get paymentMethodTypes;/// If present, this property tells you about the processing state of the payment. + dynamic get processing;/// Email address that the receipt for the resulting payment will be sent to. +/// If receipt_email is specified for a payment in live mode, a receipt +/// will be sent regardless of your email settings. +@JsonKey(name: "receipt_email") String? get receiptEmail;// ID of the review associated with this PaymentIntent, if any. + String? get review;/// Indicates that you intend to make future payments with this +/// PaymentIntent’s payment method. +/// Providing this parameter will attach the payment method to the +/// PaymentIntent’s Customer, if present, after the PaymentIntent is +/// confirmed and any required actions from the user are complete. I +/// If no Customer was provided, the payment method can still be attached to +/// a Customer after the transaction completes. +/// When processing card payments, Stripe also uses setup_future_usage +/// to dynamically optimize your payment flow and comply with regional +/// legislation and network rules, such as SCA. +@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? get setupFutureUsage;/// Shipping information for this PaymentIntent. + ShippingDetails? get shipping;/// For non-card charges, you can use this value as the complete +/// description that appears on your customers’ statements. +/// Must contain at least one letter, maximum 22 characters. +@JsonKey(name: "statement_descriptor") String? get statementDescriptor;/// Provides information about a card payment that customers see on +/// their statements. +/// Concatenated with the prefix (shortened descriptor) or statement +/// descriptor that’s set on the account to form the complete statement +/// descriptor. Maximum 22 characters for the concatenated descriptor. +@JsonKey(name: "statement_descriptor_suffix") String? get statementDescriptorSuffix;/// Status of this PaymentIntent, one of requires_payment_method, +/// requires_confirmation, requires_action, processing, requires_capture, +/// canceled, or succeeded. + PaymentIntentsStatus get status;/// CONNECT ONLY +/// The data with which to automatically create a Transfer when the payment +/// is finalized. See the PaymentIntents use case for connected +/// accounts for details. +@JsonKey(name: "transfer_data") dynamic get transferData;/// CONNECT ONLY +/// A string that identifies the resulting payment as part of a group. +/// See the PaymentIntents use case for connected accounts for details. +@JsonKey(name: "transfer_group") dynamic get transferGroup; +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentIntentCopyWith get copyWith => _$PaymentIntentCopyWithImpl(this as PaymentIntent, _$identity); /// Serializes this PaymentIntent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentIntentCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.amountCapturable, amountCapturable) || other.amountCapturable == amountCapturable)&&(identical(other.amountDetails, amountDetails) || other.amountDetails == amountDetails)&&(identical(other.amountReceived, amountReceived) || other.amountReceived == amountReceived)&&(identical(other.application, application) || other.application == application)&&(identical(other.applicationFeeAmount, applicationFeeAmount) || other.applicationFeeAmount == applicationFeeAmount)&&(identical(other.automaticPaymentMethods, automaticPaymentMethods) || other.automaticPaymentMethods == automaticPaymentMethods)&&(identical(other.canceledAt, canceledAt) || other.canceledAt == canceledAt)&&(identical(other.cancellationReason, cancellationReason) || other.cancellationReason == cancellationReason)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.captureMethod, captureMethod) || other.captureMethod == captureMethod)&&(identical(other.confirmationMethod, confirmationMethod) || other.confirmationMethod == confirmationMethod)&&(identical(other.created, created) || other.created == created)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.description, description) || other.description == description)&&(identical(other.invoice, invoice) || other.invoice == invoice)&&(identical(other.lastPaymentError, lastPaymentError) || other.lastPaymentError == lastPaymentError)&&(identical(other.latestCharge, latestCharge) || other.latestCharge == latestCharge)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&const DeepCollectionEquality().equals(other.metadata, metadata)&&const DeepCollectionEquality().equals(other.nextAction, nextAction)&&(identical(other.onBehalfOf, onBehalfOf) || other.onBehalfOf == onBehalfOf)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&const DeepCollectionEquality().equals(other.paymentMethodOptions, paymentMethodOptions)&&const DeepCollectionEquality().equals(other.paymentMethodTypes, paymentMethodTypes)&&const DeepCollectionEquality().equals(other.processing, processing)&&(identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail)&&(identical(other.review, review) || other.review == review)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&(identical(other.shipping, shipping) || other.shipping == shipping)&&(identical(other.statementDescriptor, statementDescriptor) || other.statementDescriptor == statementDescriptor)&&(identical(other.statementDescriptorSuffix, statementDescriptorSuffix) || other.statementDescriptorSuffix == statementDescriptorSuffix)&&(identical(other.status, status) || other.status == status)&&const DeepCollectionEquality().equals(other.transferData, transferData)&&const DeepCollectionEquality().equals(other.transferGroup, transferGroup)); } -/// @nodoc -abstract class $PaymentIntentCopyWith<$Res> { - factory $PaymentIntentCopyWith( - PaymentIntent value, $Res Function(PaymentIntent) then) = - _$PaymentIntentCopyWithImpl<$Res, PaymentIntent>; - @useResult - $Res call( - {String id, - String object, - int amount, - @JsonKey(name: "amount_capturable") int? amountCapturable, - @JsonKey(name: "amount_details") - PaymentIntentAmountDetails? amountDetails, - @JsonKey(name: "amount_received") int? amountReceived, - String? application, - @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") - PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, - @JsonKey(name: "canceled_at") int? canceledAt, - @JsonKey(name: "cancellation_reason") - PaymentIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") String clientSecret, - @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, - @JsonKey(name: "confirmation_method") - PaymentIntentConfirmationMethod confirmationMethod, - int? created, - String currency, - String? customer, - String? description, - String? invoice, - @JsonKey(name: "last_payment_error") StripeError? lastPaymentError, - @JsonKey(name: "latest_charge") String? latestCharge, - bool livemode, - Map metadata, - @JsonKey(name: "next_action") dynamic nextAction, - @JsonKey(name: "on_behalf_of") String? onBehalfOf, - @JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "payment_method_options") - Map paymentMethodOptions, - @JsonKey( - name: "payment_method_types", - unknownEnumValue: PaymentMethodType.unknown) - List paymentMethodTypes, - dynamic processing, - @JsonKey(name: "receipt_email") String? receiptEmail, - String? review, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage, - ShippingDetails? shipping, - @JsonKey(name: "statement_descriptor") String? statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - String? statementDescriptorSuffix, - PaymentIntentsStatus status, - @JsonKey(name: "transfer_data") dynamic transferData, - @JsonKey(name: "transfer_group") dynamic transferGroup}); - - $PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails; - $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? - get automaticPaymentMethods; - $StripeErrorCopyWith<$Res>? get lastPaymentError; - $ShippingDetailsCopyWith<$Res>? get shipping; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,object,amount,amountCapturable,amountDetails,amountReceived,application,applicationFeeAmount,automaticPaymentMethods,canceledAt,cancellationReason,clientSecret,captureMethod,confirmationMethod,created,currency,customer,description,invoice,lastPaymentError,latestCharge,livemode,const DeepCollectionEquality().hash(metadata),const DeepCollectionEquality().hash(nextAction),onBehalfOf,paymentMethod,const DeepCollectionEquality().hash(paymentMethodOptions),const DeepCollectionEquality().hash(paymentMethodTypes),const DeepCollectionEquality().hash(processing),receiptEmail,review,setupFutureUsage,shipping,statementDescriptor,statementDescriptorSuffix,status,const DeepCollectionEquality().hash(transferData),const DeepCollectionEquality().hash(transferGroup)]); + +@override +String toString() { + return 'PaymentIntent(id: $id, object: $object, amount: $amount, amountCapturable: $amountCapturable, amountDetails: $amountDetails, amountReceived: $amountReceived, application: $application, applicationFeeAmount: $applicationFeeAmount, automaticPaymentMethods: $automaticPaymentMethods, canceledAt: $canceledAt, cancellationReason: $cancellationReason, clientSecret: $clientSecret, captureMethod: $captureMethod, confirmationMethod: $confirmationMethod, created: $created, currency: $currency, customer: $customer, description: $description, invoice: $invoice, lastPaymentError: $lastPaymentError, latestCharge: $latestCharge, livemode: $livemode, metadata: $metadata, nextAction: $nextAction, onBehalfOf: $onBehalfOf, paymentMethod: $paymentMethod, paymentMethodOptions: $paymentMethodOptions, paymentMethodTypes: $paymentMethodTypes, processing: $processing, receiptEmail: $receiptEmail, review: $review, setupFutureUsage: $setupFutureUsage, shipping: $shipping, statementDescriptor: $statementDescriptor, statementDescriptorSuffix: $statementDescriptorSuffix, status: $status, transferData: $transferData, transferGroup: $transferGroup)'; +} + + } /// @nodoc -class _$PaymentIntentCopyWithImpl<$Res, $Val extends PaymentIntent> +abstract mixin class $PaymentIntentCopyWith<$Res> { + factory $PaymentIntentCopyWith(PaymentIntent value, $Res Function(PaymentIntent) _then) = _$PaymentIntentCopyWithImpl; +@useResult +$Res call({ + String id, String object, int amount,@JsonKey(name: "amount_capturable") int? amountCapturable,@JsonKey(name: "amount_details") PaymentIntentAmountDetails? amountDetails,@JsonKey(name: "amount_received") int? amountReceived, String? application,@JsonKey(name: "application_fee_amount") int? applicationFeeAmount,@JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods,@JsonKey(name: "canceled_at") int? canceledAt,@JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? cancellationReason,@JsonKey(name: "client_secret") String clientSecret,@JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod,@JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod confirmationMethod, int? created, String currency, String? customer, String? description, String? invoice,@JsonKey(name: "last_payment_error") StripeError? lastPaymentError,@JsonKey(name: "latest_charge") String? latestCharge, bool livemode, Map metadata,@JsonKey(name: "next_action") dynamic nextAction,@JsonKey(name: "on_behalf_of") String? onBehalfOf,@JsonKey(name: "payment_method") String? paymentMethod,@JsonKey(name: "payment_method_options") Map paymentMethodOptions,@JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List paymentMethodTypes, dynamic processing,@JsonKey(name: "receipt_email") String? receiptEmail, String? review,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, ShippingDetails? shipping,@JsonKey(name: "statement_descriptor") String? statementDescriptor,@JsonKey(name: "statement_descriptor_suffix") String? statementDescriptorSuffix, PaymentIntentsStatus status,@JsonKey(name: "transfer_data") dynamic transferData,@JsonKey(name: "transfer_group") dynamic transferGroup +}); + + +$PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails;$PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? get automaticPaymentMethods;$StripeErrorCopyWith<$Res>? get lastPaymentError;$ShippingDetailsCopyWith<$Res>? get shipping; + +} +/// @nodoc +class _$PaymentIntentCopyWithImpl<$Res> implements $PaymentIntentCopyWith<$Res> { - _$PaymentIntentCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? amount = null, - Object? amountCapturable = freezed, - Object? amountDetails = freezed, - Object? amountReceived = freezed, - Object? application = freezed, - Object? applicationFeeAmount = freezed, - Object? automaticPaymentMethods = freezed, - Object? canceledAt = freezed, - Object? cancellationReason = freezed, - Object? clientSecret = null, - Object? captureMethod = null, - Object? confirmationMethod = null, - Object? created = freezed, - Object? currency = null, - Object? customer = freezed, - Object? description = freezed, - Object? invoice = freezed, - Object? lastPaymentError = freezed, - Object? latestCharge = freezed, - Object? livemode = null, - Object? metadata = null, - Object? nextAction = freezed, - Object? onBehalfOf = freezed, - Object? paymentMethod = freezed, - Object? paymentMethodOptions = null, - Object? paymentMethodTypes = null, - Object? processing = freezed, - Object? receiptEmail = freezed, - Object? review = freezed, - Object? setupFutureUsage = freezed, - Object? shipping = freezed, - Object? statementDescriptor = freezed, - Object? statementDescriptorSuffix = freezed, - Object? status = null, - Object? transferData = freezed, - Object? transferGroup = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - amountCapturable: freezed == amountCapturable - ? _value.amountCapturable - : amountCapturable // ignore: cast_nullable_to_non_nullable - as int?, - amountDetails: freezed == amountDetails - ? _value.amountDetails - : amountDetails // ignore: cast_nullable_to_non_nullable - as PaymentIntentAmountDetails?, - amountReceived: freezed == amountReceived - ? _value.amountReceived - : amountReceived // ignore: cast_nullable_to_non_nullable - as int?, - application: freezed == application - ? _value.application - : application // ignore: cast_nullable_to_non_nullable - as String?, - applicationFeeAmount: freezed == applicationFeeAmount - ? _value.applicationFeeAmount - : applicationFeeAmount // ignore: cast_nullable_to_non_nullable - as int?, - automaticPaymentMethods: freezed == automaticPaymentMethods - ? _value.automaticPaymentMethods - : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable - as PaymentIntentAutomaticPaymentMethods?, - canceledAt: freezed == canceledAt - ? _value.canceledAt - : canceledAt // ignore: cast_nullable_to_non_nullable - as int?, - cancellationReason: freezed == cancellationReason - ? _value.cancellationReason - : cancellationReason // ignore: cast_nullable_to_non_nullable - as PaymentIntentCancellationReason?, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - captureMethod: null == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentCaptureMethod, - confirmationMethod: null == confirmationMethod - ? _value.confirmationMethod - : confirmationMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentConfirmationMethod, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - invoice: freezed == invoice - ? _value.invoice - : invoice // ignore: cast_nullable_to_non_nullable - as String?, - lastPaymentError: freezed == lastPaymentError - ? _value.lastPaymentError - : lastPaymentError // ignore: cast_nullable_to_non_nullable - as StripeError?, - latestCharge: freezed == latestCharge - ? _value.latestCharge - : latestCharge // ignore: cast_nullable_to_non_nullable - as String?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as dynamic, - onBehalfOf: freezed == onBehalfOf - ? _value.onBehalfOf - : onBehalfOf // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethodOptions: null == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as Map, - paymentMethodTypes: null == paymentMethodTypes - ? _value.paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - processing: freezed == processing - ? _value.processing - : processing // ignore: cast_nullable_to_non_nullable - as dynamic, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - review: freezed == review - ? _value.review - : review // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - statementDescriptor: freezed == statementDescriptor - ? _value.statementDescriptor - : statementDescriptor // ignore: cast_nullable_to_non_nullable - as String?, - statementDescriptorSuffix: freezed == statementDescriptorSuffix - ? _value.statementDescriptorSuffix - : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as PaymentIntentsStatus, - transferData: freezed == transferData - ? _value.transferData - : transferData // ignore: cast_nullable_to_non_nullable - as dynamic, - transferGroup: freezed == transferGroup - ? _value.transferGroup - : transferGroup // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); + _$PaymentIntentCopyWithImpl(this._self, this._then); + + final PaymentIntent _self; + final $Res Function(PaymentIntent) _then; + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? object = null,Object? amount = null,Object? amountCapturable = freezed,Object? amountDetails = freezed,Object? amountReceived = freezed,Object? application = freezed,Object? applicationFeeAmount = freezed,Object? automaticPaymentMethods = freezed,Object? canceledAt = freezed,Object? cancellationReason = freezed,Object? clientSecret = null,Object? captureMethod = null,Object? confirmationMethod = null,Object? created = freezed,Object? currency = null,Object? customer = freezed,Object? description = freezed,Object? invoice = freezed,Object? lastPaymentError = freezed,Object? latestCharge = freezed,Object? livemode = null,Object? metadata = null,Object? nextAction = freezed,Object? onBehalfOf = freezed,Object? paymentMethod = freezed,Object? paymentMethodOptions = null,Object? paymentMethodTypes = null,Object? processing = freezed,Object? receiptEmail = freezed,Object? review = freezed,Object? setupFutureUsage = freezed,Object? shipping = freezed,Object? statementDescriptor = freezed,Object? statementDescriptorSuffix = freezed,Object? status = null,Object? transferData = freezed,Object? transferGroup = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int,amountCapturable: freezed == amountCapturable ? _self.amountCapturable : amountCapturable // ignore: cast_nullable_to_non_nullable +as int?,amountDetails: freezed == amountDetails ? _self.amountDetails : amountDetails // ignore: cast_nullable_to_non_nullable +as PaymentIntentAmountDetails?,amountReceived: freezed == amountReceived ? _self.amountReceived : amountReceived // ignore: cast_nullable_to_non_nullable +as int?,application: freezed == application ? _self.application : application // ignore: cast_nullable_to_non_nullable +as String?,applicationFeeAmount: freezed == applicationFeeAmount ? _self.applicationFeeAmount : applicationFeeAmount // ignore: cast_nullable_to_non_nullable +as int?,automaticPaymentMethods: freezed == automaticPaymentMethods ? _self.automaticPaymentMethods : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable +as PaymentIntentAutomaticPaymentMethods?,canceledAt: freezed == canceledAt ? _self.canceledAt : canceledAt // ignore: cast_nullable_to_non_nullable +as int?,cancellationReason: freezed == cancellationReason ? _self.cancellationReason : cancellationReason // ignore: cast_nullable_to_non_nullable +as PaymentIntentCancellationReason?,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,captureMethod: null == captureMethod ? _self.captureMethod : captureMethod // ignore: cast_nullable_to_non_nullable +as PaymentIntentCaptureMethod,confirmationMethod: null == confirmationMethod ? _self.confirmationMethod : confirmationMethod // ignore: cast_nullable_to_non_nullable +as PaymentIntentConfirmationMethod,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,invoice: freezed == invoice ? _self.invoice : invoice // ignore: cast_nullable_to_non_nullable +as String?,lastPaymentError: freezed == lastPaymentError ? _self.lastPaymentError : lastPaymentError // ignore: cast_nullable_to_non_nullable +as StripeError?,latestCharge: freezed == latestCharge ? _self.latestCharge : latestCharge // ignore: cast_nullable_to_non_nullable +as String?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,metadata: null == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as dynamic,onBehalfOf: freezed == onBehalfOf ? _self.onBehalfOf : onBehalfOf // ignore: cast_nullable_to_non_nullable +as String?,paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?,paymentMethodOptions: null == paymentMethodOptions ? _self.paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as Map,paymentMethodTypes: null == paymentMethodTypes ? _self.paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List,processing: freezed == processing ? _self.processing : processing // ignore: cast_nullable_to_non_nullable +as dynamic,receiptEmail: freezed == receiptEmail ? _self.receiptEmail : receiptEmail // ignore: cast_nullable_to_non_nullable +as String?,review: freezed == review ? _self.review : review // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?,shipping: freezed == shipping ? _self.shipping : shipping // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,statementDescriptor: freezed == statementDescriptor ? _self.statementDescriptor : statementDescriptor // ignore: cast_nullable_to_non_nullable +as String?,statementDescriptorSuffix: freezed == statementDescriptorSuffix ? _self.statementDescriptorSuffix : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable +as String?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as PaymentIntentsStatus,transferData: freezed == transferData ? _self.transferData : transferData // ignore: cast_nullable_to_non_nullable +as dynamic,transferGroup: freezed == transferGroup ? _self.transferGroup : transferGroup // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails { + if (_self.amountDetails == null) { + return null; } - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails { - if (_value.amountDetails == null) { - return null; - } - - return $PaymentIntentAmountDetailsCopyWith<$Res>(_value.amountDetails!, - (value) { - return _then(_value.copyWith(amountDetails: value) as $Val); - }); + return $PaymentIntentAmountDetailsCopyWith<$Res>(_self.amountDetails!, (value) { + return _then(_self.copyWith(amountDetails: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? get automaticPaymentMethods { + if (_self.automaticPaymentMethods == null) { + return null; } - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? - get automaticPaymentMethods { - if (_value.automaticPaymentMethods == null) { - return null; - } - - return $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>( - _value.automaticPaymentMethods!, (value) { - return _then(_value.copyWith(automaticPaymentMethods: value) as $Val); - }); + return $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>(_self.automaticPaymentMethods!, (value) { + return _then(_self.copyWith(automaticPaymentMethods: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get lastPaymentError { + if (_self.lastPaymentError == null) { + return null; } - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith<$Res>? get lastPaymentError { - if (_value.lastPaymentError == null) { - return null; - } - - return $StripeErrorCopyWith<$Res>(_value.lastPaymentError!, (value) { - return _then(_value.copyWith(lastPaymentError: value) as $Val); - }); + return $StripeErrorCopyWith<$Res>(_self.lastPaymentError!, (value) { + return _then(_self.copyWith(lastPaymentError: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shipping { + if (_self.shipping == null) { + return null; } - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shipping { - if (_value.shipping == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shipping!, (value) { - return _then(_value.copyWith(shipping: value) as $Val); - }); - } + return $ShippingDetailsCopyWith<$Res>(_self.shipping!, (value) { + return _then(_self.copyWith(shipping: value)); + }); +} } -/// @nodoc -abstract class _$$PaymentIntentImplCopyWith<$Res> - implements $PaymentIntentCopyWith<$Res> { - factory _$$PaymentIntentImplCopyWith( - _$PaymentIntentImpl value, $Res Function(_$PaymentIntentImpl) then) = - __$$PaymentIntentImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String object, - int amount, - @JsonKey(name: "amount_capturable") int? amountCapturable, - @JsonKey(name: "amount_details") - PaymentIntentAmountDetails? amountDetails, - @JsonKey(name: "amount_received") int? amountReceived, - String? application, - @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") - PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, - @JsonKey(name: "canceled_at") int? canceledAt, - @JsonKey(name: "cancellation_reason") - PaymentIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") String clientSecret, - @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, - @JsonKey(name: "confirmation_method") - PaymentIntentConfirmationMethod confirmationMethod, - int? created, - String currency, - String? customer, - String? description, - String? invoice, - @JsonKey(name: "last_payment_error") StripeError? lastPaymentError, - @JsonKey(name: "latest_charge") String? latestCharge, - bool livemode, - Map metadata, - @JsonKey(name: "next_action") dynamic nextAction, - @JsonKey(name: "on_behalf_of") String? onBehalfOf, - @JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "payment_method_options") - Map paymentMethodOptions, - @JsonKey( - name: "payment_method_types", - unknownEnumValue: PaymentMethodType.unknown) - List paymentMethodTypes, - dynamic processing, - @JsonKey(name: "receipt_email") String? receiptEmail, - String? review, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage, - ShippingDetails? shipping, - @JsonKey(name: "statement_descriptor") String? statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - String? statementDescriptorSuffix, - PaymentIntentsStatus status, - @JsonKey(name: "transfer_data") dynamic transferData, - @JsonKey(name: "transfer_group") dynamic transferGroup}); - - @override - $PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails; - @override - $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? - get automaticPaymentMethods; - @override - $StripeErrorCopyWith<$Res>? get lastPaymentError; - @override - $ShippingDetailsCopyWith<$Res>? get shipping; + +/// Adds pattern-matching-related methods to [PaymentIntent]. +extension PaymentIntentPatterns on PaymentIntent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentIntent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentIntent value) $default,){ +final _that = this; +switch (_that) { +case _PaymentIntent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentIntent value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String object, int amount, @JsonKey(name: "amount_capturable") int? amountCapturable, @JsonKey(name: "amount_details") PaymentIntentAmountDetails? amountDetails, @JsonKey(name: "amount_received") int? amountReceived, String? application, @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, @JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, @JsonKey(name: "canceled_at") int? canceledAt, @JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? cancellationReason, @JsonKey(name: "client_secret") String clientSecret, @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, @JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod confirmationMethod, int? created, String currency, String? customer, String? description, String? invoice, @JsonKey(name: "last_payment_error") StripeError? lastPaymentError, @JsonKey(name: "latest_charge") String? latestCharge, bool livemode, Map metadata, @JsonKey(name: "next_action") dynamic nextAction, @JsonKey(name: "on_behalf_of") String? onBehalfOf, @JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "payment_method_options") Map paymentMethodOptions, @JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List paymentMethodTypes, dynamic processing, @JsonKey(name: "receipt_email") String? receiptEmail, String? review, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, ShippingDetails? shipping, @JsonKey(name: "statement_descriptor") String? statementDescriptor, @JsonKey(name: "statement_descriptor_suffix") String? statementDescriptorSuffix, PaymentIntentsStatus status, @JsonKey(name: "transfer_data") dynamic transferData, @JsonKey(name: "transfer_group") dynamic transferGroup)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that.id,_that.object,_that.amount,_that.amountCapturable,_that.amountDetails,_that.amountReceived,_that.application,_that.applicationFeeAmount,_that.automaticPaymentMethods,_that.canceledAt,_that.cancellationReason,_that.clientSecret,_that.captureMethod,_that.confirmationMethod,_that.created,_that.currency,_that.customer,_that.description,_that.invoice,_that.lastPaymentError,_that.latestCharge,_that.livemode,_that.metadata,_that.nextAction,_that.onBehalfOf,_that.paymentMethod,_that.paymentMethodOptions,_that.paymentMethodTypes,_that.processing,_that.receiptEmail,_that.review,_that.setupFutureUsage,_that.shipping,_that.statementDescriptor,_that.statementDescriptorSuffix,_that.status,_that.transferData,_that.transferGroup);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String object, int amount, @JsonKey(name: "amount_capturable") int? amountCapturable, @JsonKey(name: "amount_details") PaymentIntentAmountDetails? amountDetails, @JsonKey(name: "amount_received") int? amountReceived, String? application, @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, @JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, @JsonKey(name: "canceled_at") int? canceledAt, @JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? cancellationReason, @JsonKey(name: "client_secret") String clientSecret, @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, @JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod confirmationMethod, int? created, String currency, String? customer, String? description, String? invoice, @JsonKey(name: "last_payment_error") StripeError? lastPaymentError, @JsonKey(name: "latest_charge") String? latestCharge, bool livemode, Map metadata, @JsonKey(name: "next_action") dynamic nextAction, @JsonKey(name: "on_behalf_of") String? onBehalfOf, @JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "payment_method_options") Map paymentMethodOptions, @JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List paymentMethodTypes, dynamic processing, @JsonKey(name: "receipt_email") String? receiptEmail, String? review, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, ShippingDetails? shipping, @JsonKey(name: "statement_descriptor") String? statementDescriptor, @JsonKey(name: "statement_descriptor_suffix") String? statementDescriptorSuffix, PaymentIntentsStatus status, @JsonKey(name: "transfer_data") dynamic transferData, @JsonKey(name: "transfer_group") dynamic transferGroup) $default,) {final _that = this; +switch (_that) { +case _PaymentIntent(): +return $default(_that.id,_that.object,_that.amount,_that.amountCapturable,_that.amountDetails,_that.amountReceived,_that.application,_that.applicationFeeAmount,_that.automaticPaymentMethods,_that.canceledAt,_that.cancellationReason,_that.clientSecret,_that.captureMethod,_that.confirmationMethod,_that.created,_that.currency,_that.customer,_that.description,_that.invoice,_that.lastPaymentError,_that.latestCharge,_that.livemode,_that.metadata,_that.nextAction,_that.onBehalfOf,_that.paymentMethod,_that.paymentMethodOptions,_that.paymentMethodTypes,_that.processing,_that.receiptEmail,_that.review,_that.setupFutureUsage,_that.shipping,_that.statementDescriptor,_that.statementDescriptorSuffix,_that.status,_that.transferData,_that.transferGroup);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String object, int amount, @JsonKey(name: "amount_capturable") int? amountCapturable, @JsonKey(name: "amount_details") PaymentIntentAmountDetails? amountDetails, @JsonKey(name: "amount_received") int? amountReceived, String? application, @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, @JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, @JsonKey(name: "canceled_at") int? canceledAt, @JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? cancellationReason, @JsonKey(name: "client_secret") String clientSecret, @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, @JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod confirmationMethod, int? created, String currency, String? customer, String? description, String? invoice, @JsonKey(name: "last_payment_error") StripeError? lastPaymentError, @JsonKey(name: "latest_charge") String? latestCharge, bool livemode, Map metadata, @JsonKey(name: "next_action") dynamic nextAction, @JsonKey(name: "on_behalf_of") String? onBehalfOf, @JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "payment_method_options") Map paymentMethodOptions, @JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List paymentMethodTypes, dynamic processing, @JsonKey(name: "receipt_email") String? receiptEmail, String? review, @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, ShippingDetails? shipping, @JsonKey(name: "statement_descriptor") String? statementDescriptor, @JsonKey(name: "statement_descriptor_suffix") String? statementDescriptorSuffix, PaymentIntentsStatus status, @JsonKey(name: "transfer_data") dynamic transferData, @JsonKey(name: "transfer_group") dynamic transferGroup)? $default,) {final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that.id,_that.object,_that.amount,_that.amountCapturable,_that.amountDetails,_that.amountReceived,_that.application,_that.applicationFeeAmount,_that.automaticPaymentMethods,_that.canceledAt,_that.cancellationReason,_that.clientSecret,_that.captureMethod,_that.confirmationMethod,_that.created,_that.currency,_that.customer,_that.description,_that.invoice,_that.lastPaymentError,_that.latestCharge,_that.livemode,_that.metadata,_that.nextAction,_that.onBehalfOf,_that.paymentMethod,_that.paymentMethodOptions,_that.paymentMethodTypes,_that.processing,_that.receiptEmail,_that.review,_that.setupFutureUsage,_that.shipping,_that.statementDescriptor,_that.statementDescriptorSuffix,_that.status,_that.transferData,_that.transferGroup);case _: + return null; + +} } -/// @nodoc -class __$$PaymentIntentImplCopyWithImpl<$Res> - extends _$PaymentIntentCopyWithImpl<$Res, _$PaymentIntentImpl> - implements _$$PaymentIntentImplCopyWith<$Res> { - __$$PaymentIntentImplCopyWithImpl( - _$PaymentIntentImpl _value, $Res Function(_$PaymentIntentImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? amount = null, - Object? amountCapturable = freezed, - Object? amountDetails = freezed, - Object? amountReceived = freezed, - Object? application = freezed, - Object? applicationFeeAmount = freezed, - Object? automaticPaymentMethods = freezed, - Object? canceledAt = freezed, - Object? cancellationReason = freezed, - Object? clientSecret = null, - Object? captureMethod = null, - Object? confirmationMethod = null, - Object? created = freezed, - Object? currency = null, - Object? customer = freezed, - Object? description = freezed, - Object? invoice = freezed, - Object? lastPaymentError = freezed, - Object? latestCharge = freezed, - Object? livemode = null, - Object? metadata = null, - Object? nextAction = freezed, - Object? onBehalfOf = freezed, - Object? paymentMethod = freezed, - Object? paymentMethodOptions = null, - Object? paymentMethodTypes = null, - Object? processing = freezed, - Object? receiptEmail = freezed, - Object? review = freezed, - Object? setupFutureUsage = freezed, - Object? shipping = freezed, - Object? statementDescriptor = freezed, - Object? statementDescriptorSuffix = freezed, - Object? status = null, - Object? transferData = freezed, - Object? transferGroup = freezed, - }) { - return _then(_$PaymentIntentImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - amountCapturable: freezed == amountCapturable - ? _value.amountCapturable - : amountCapturable // ignore: cast_nullable_to_non_nullable - as int?, - amountDetails: freezed == amountDetails - ? _value.amountDetails - : amountDetails // ignore: cast_nullable_to_non_nullable - as PaymentIntentAmountDetails?, - amountReceived: freezed == amountReceived - ? _value.amountReceived - : amountReceived // ignore: cast_nullable_to_non_nullable - as int?, - application: freezed == application - ? _value.application - : application // ignore: cast_nullable_to_non_nullable - as String?, - applicationFeeAmount: freezed == applicationFeeAmount - ? _value.applicationFeeAmount - : applicationFeeAmount // ignore: cast_nullable_to_non_nullable - as int?, - automaticPaymentMethods: freezed == automaticPaymentMethods - ? _value.automaticPaymentMethods - : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable - as PaymentIntentAutomaticPaymentMethods?, - canceledAt: freezed == canceledAt - ? _value.canceledAt - : canceledAt // ignore: cast_nullable_to_non_nullable - as int?, - cancellationReason: freezed == cancellationReason - ? _value.cancellationReason - : cancellationReason // ignore: cast_nullable_to_non_nullable - as PaymentIntentCancellationReason?, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - captureMethod: null == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentCaptureMethod, - confirmationMethod: null == confirmationMethod - ? _value.confirmationMethod - : confirmationMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentConfirmationMethod, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - invoice: freezed == invoice - ? _value.invoice - : invoice // ignore: cast_nullable_to_non_nullable - as String?, - lastPaymentError: freezed == lastPaymentError - ? _value.lastPaymentError - : lastPaymentError // ignore: cast_nullable_to_non_nullable - as StripeError?, - latestCharge: freezed == latestCharge - ? _value.latestCharge - : latestCharge // ignore: cast_nullable_to_non_nullable - as String?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - metadata: null == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as dynamic, - onBehalfOf: freezed == onBehalfOf - ? _value.onBehalfOf - : onBehalfOf // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethodOptions: null == paymentMethodOptions - ? _value._paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as Map, - paymentMethodTypes: null == paymentMethodTypes - ? _value._paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - processing: freezed == processing - ? _value.processing - : processing // ignore: cast_nullable_to_non_nullable - as dynamic, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - review: freezed == review - ? _value.review - : review // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - statementDescriptor: freezed == statementDescriptor - ? _value.statementDescriptor - : statementDescriptor // ignore: cast_nullable_to_non_nullable - as String?, - statementDescriptorSuffix: freezed == statementDescriptorSuffix - ? _value.statementDescriptorSuffix - : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as PaymentIntentsStatus, - transferData: freezed == transferData - ? _value.transferData - : transferData // ignore: cast_nullable_to_non_nullable - as dynamic, - transferGroup: freezed == transferGroup - ? _value.transferGroup - : transferGroup // ignore: cast_nullable_to_non_nullable - as dynamic, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentIntentImpl implements _PaymentIntent { - const _$PaymentIntentImpl( - {required this.id, - this.object = "payment_intent", - required this.amount, - @JsonKey(name: "amount_capturable") this.amountCapturable, - @JsonKey(name: "amount_details") - this.amountDetails = const PaymentIntentAmountDetails(), - @JsonKey(name: "amount_received") this.amountReceived, - this.application, - @JsonKey(name: "application_fee_amount") this.applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") this.automaticPaymentMethods, - @JsonKey(name: "canceled_at") this.canceledAt, - @JsonKey(name: "cancellation_reason") this.cancellationReason, - @JsonKey(name: "client_secret") required this.clientSecret, - @JsonKey(name: "capture_method") - this.captureMethod = PaymentIntentCaptureMethod.automatic, - @JsonKey(name: "confirmation_method") - this.confirmationMethod = PaymentIntentConfirmationMethod.automatic, - this.created, - required this.currency, - this.customer, - this.description, - this.invoice, - @JsonKey(name: "last_payment_error") this.lastPaymentError, - @JsonKey(name: "latest_charge") this.latestCharge, - required this.livemode, - final Map metadata = const {}, - @JsonKey(name: "next_action") this.nextAction, - @JsonKey(name: "on_behalf_of") this.onBehalfOf, - @JsonKey(name: "payment_method") this.paymentMethod, - @JsonKey(name: "payment_method_options") - final Map paymentMethodOptions = const {}, - @JsonKey( - name: "payment_method_types", - unknownEnumValue: PaymentMethodType.unknown) - final List paymentMethodTypes = const [], - this.processing, - @JsonKey(name: "receipt_email") this.receiptEmail, - this.review, - @JsonKey(name: "setup_future_usage") this.setupFutureUsage, - this.shipping, - @JsonKey(name: "statement_descriptor") this.statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - this.statementDescriptorSuffix, - required this.status, - @JsonKey(name: "transfer_data") this.transferData, - @JsonKey(name: "transfer_group") this.transferGroup}) - : _metadata = metadata, - _paymentMethodOptions = paymentMethodOptions, - _paymentMethodTypes = paymentMethodTypes; - - factory _$PaymentIntentImpl.fromJson(Map json) => - _$$PaymentIntentImplFromJson(json); - - /// Unique identifier for the object. - @override - final String id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "payment_intent". - @override - @JsonKey() - final String object; - - /// Amount intended to be collected by this PaymentIntent. - /// A positive integer representing how much to charge in the - /// smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to - /// charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or equivalent in charge currency. - /// The amount value supports up to eight digits - /// (e.g., a value of 99999999 for a USD charge of $999,999.99). - @override - final int amount; - - /// The amount that can be captured with from this PaymentIntent (in cents). - @override - @JsonKey(name: "amount_capturable") - final int? amountCapturable; - - /// Details about items included in the amount - @override - @JsonKey(name: "amount_details") - final PaymentIntentAmountDetails? amountDetails; - - /// The amount that was collected from this PaymentIntent (in cents). - @override - @JsonKey(name: "amount_received") - final int? amountReceived; - - /// CONNECT ONLY - /// ID of the Connect application that created the PaymentIntent. - @override - final String? application; - - /// CONNECT ONLY - /// The amount of the application fee (if any) that will be requested to - /// be applied to the payment and transferred to the application owner’s - /// Stripe account. The amount of the application fee collected will be - /// capped at the total payment amount. - /// For more information, see the PaymentIntents use - /// case for connected accounts.. - @override - @JsonKey(name: "application_fee_amount") - final int? applicationFeeAmount; - - /// Settings to configure compatible payment methods from the - /// Stripe Dashboard - @override - @JsonKey(name: "automatic_payment_methods") - final PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods; - - /// Populated when status is canceled, this is the time at which the - /// PaymentIntent was canceled. Measured in seconds since the Unix epoch. - @override - @JsonKey(name: "canceled_at") - final int? canceledAt; - - /// Reason for cancellation of this PaymentIntent, - /// either user-provided - /// (duplicate, fraudulent, requested_by_customer, or abandoned) or - /// generated by Stripe internally - /// (failed_invoice, void_invoice, or automatic). - @override - @JsonKey(name: "cancellation_reason") - final PaymentIntentCancellationReason? cancellationReason; - - /// The client secret of this PaymentIntent. Used for client-side retrieval - /// using a publishable key. - /// The client secret can be used to complete a payment from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the - /// customer. Make sure that you have TLS enabled on any page that includes - /// the client secret. - /// - /// Refer to our docs to accept a payment and learn about how `client_secret` - /// should be handled. - @override - @JsonKey(name: "client_secret") - final String clientSecret; - - /// Controls when the funds will be captured from the customer’s account. - @override - @JsonKey(name: "capture_method") - final PaymentIntentCaptureMethod captureMethod; - @override - @JsonKey(name: "confirmation_method") - final PaymentIntentConfirmationMethod confirmationMethod; - - /// Time at which the object was created. Measured in seconds since the - /// Unix epoch. - @override - final int? created; - - /// Three-letter ISO currency code, in lowercase. Must be a supported - /// currency. - @override - final String currency; - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// Payment methods attached to other Customers cannot be used with this - /// PaymentIntent. - /// - /// If present in combination with setup_future_usage, - /// this PaymentIntent’s payment method will be attached to the - /// Customer after the PaymentIntent has been confirmed and any - /// required actions from the user are complete. - @override - final String? customer; - - /// An arbitrary string attached to the object. - /// Often useful for displaying to users. - @override - final String? description; - - /// ID of the invoice that created this PaymentIntent, if it exists. - @override - final String? invoice; - - /// The payment error encountered in the previous PaymentIntent confirmation. - /// It will be cleared if the PaymentIntent is later updated for any reason. - @override - @JsonKey(name: "last_payment_error") - final StripeError? lastPaymentError; - - /// The latest charge created by this payment intent. - @override - @JsonKey(name: "latest_charge") - final String? latestCharge; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - @override - final bool livemode; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - final Map _metadata; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - @override - @JsonKey() - Map get metadata { - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_metadata); - } - /// If present, this property tells you what actions you need to - /// take in order for your customer to fulfill a payment using the - /// provided source. - @override - @JsonKey(name: "next_action") - final dynamic nextAction; - - /// CONNECT ONLY - /// The account (if any) for which the funds of the PaymentIntent are - /// intended. See the PaymentIntents use case for connected accounts - /// for details. - @override - @JsonKey(name: "on_behalf_of") - final String? onBehalfOf; - - /// ID of the payment method used in this PaymentIntent. - @override - @JsonKey(name: "payment_method") - final String? paymentMethod; - - /// Payment-method-specific configuration for this PaymentIntent. - final Map _paymentMethodOptions; - - /// Payment-method-specific configuration for this PaymentIntent. - @override - @JsonKey(name: "payment_method_options") - Map get paymentMethodOptions { - if (_paymentMethodOptions is EqualUnmodifiableMapView) - return _paymentMethodOptions; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_paymentMethodOptions); - } +class _PaymentIntent implements PaymentIntent { + const _PaymentIntent({required this.id, this.object = "payment_intent", required this.amount, @JsonKey(name: "amount_capturable") this.amountCapturable, @JsonKey(name: "amount_details") this.amountDetails = const PaymentIntentAmountDetails(), @JsonKey(name: "amount_received") this.amountReceived, this.application, @JsonKey(name: "application_fee_amount") this.applicationFeeAmount, @JsonKey(name: "automatic_payment_methods") this.automaticPaymentMethods, @JsonKey(name: "canceled_at") this.canceledAt, @JsonKey(name: "cancellation_reason") this.cancellationReason, @JsonKey(name: "client_secret") required this.clientSecret, @JsonKey(name: "capture_method") this.captureMethod = PaymentIntentCaptureMethod.automatic, @JsonKey(name: "confirmation_method") this.confirmationMethod = PaymentIntentConfirmationMethod.automatic, this.created, required this.currency, this.customer, this.description, this.invoice, @JsonKey(name: "last_payment_error") this.lastPaymentError, @JsonKey(name: "latest_charge") this.latestCharge, required this.livemode, final Map metadata = const {}, @JsonKey(name: "next_action") this.nextAction, @JsonKey(name: "on_behalf_of") this.onBehalfOf, @JsonKey(name: "payment_method") this.paymentMethod, @JsonKey(name: "payment_method_options") final Map paymentMethodOptions = const {}, @JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) final List paymentMethodTypes = const [], this.processing, @JsonKey(name: "receipt_email") this.receiptEmail, this.review, @JsonKey(name: "setup_future_usage") this.setupFutureUsage, this.shipping, @JsonKey(name: "statement_descriptor") this.statementDescriptor, @JsonKey(name: "statement_descriptor_suffix") this.statementDescriptorSuffix, required this.status, @JsonKey(name: "transfer_data") this.transferData, @JsonKey(name: "transfer_group") this.transferGroup}): _metadata = metadata,_paymentMethodOptions = paymentMethodOptions,_paymentMethodTypes = paymentMethodTypes; + factory _PaymentIntent.fromJson(Map json) => _$PaymentIntentFromJson(json); + +/// Unique identifier for the object. +@override final String id; +/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "payment_intent". +@override@JsonKey() final String object; +/// Amount intended to be collected by this PaymentIntent. +/// A positive integer representing how much to charge in the +/// smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to +/// charge ¥100, a zero-decimal currency). +/// The minimum amount is $0.50 US or equivalent in charge currency. +/// The amount value supports up to eight digits +/// (e.g., a value of 99999999 for a USD charge of $999,999.99). +@override final int amount; +/// The amount that can be captured with from this PaymentIntent (in cents). +@override@JsonKey(name: "amount_capturable") final int? amountCapturable; +/// Details about items included in the amount +@override@JsonKey(name: "amount_details") final PaymentIntentAmountDetails? amountDetails; +/// The amount that was collected from this PaymentIntent (in cents). +@override@JsonKey(name: "amount_received") final int? amountReceived; +/// CONNECT ONLY +/// ID of the Connect application that created the PaymentIntent. +@override final String? application; +/// CONNECT ONLY +/// The amount of the application fee (if any) that will be requested to +/// be applied to the payment and transferred to the application owner’s +/// Stripe account. The amount of the application fee collected will be +/// capped at the total payment amount. +/// For more information, see the PaymentIntents use +/// case for connected accounts.. +@override@JsonKey(name: "application_fee_amount") final int? applicationFeeAmount; +/// Settings to configure compatible payment methods from the +/// Stripe Dashboard +@override@JsonKey(name: "automatic_payment_methods") final PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods; +/// Populated when status is canceled, this is the time at which the +/// PaymentIntent was canceled. Measured in seconds since the Unix epoch. +@override@JsonKey(name: "canceled_at") final int? canceledAt; +/// Reason for cancellation of this PaymentIntent, +/// either user-provided +/// (duplicate, fraudulent, requested_by_customer, or abandoned) or +/// generated by Stripe internally +/// (failed_invoice, void_invoice, or automatic). +@override@JsonKey(name: "cancellation_reason") final PaymentIntentCancellationReason? cancellationReason; +/// The client secret of this PaymentIntent. Used for client-side retrieval +/// using a publishable key. +/// The client secret can be used to complete a payment from your frontend. +/// It should not be stored, logged, or exposed to anyone other than the +/// customer. Make sure that you have TLS enabled on any page that includes +/// the client secret. +/// +/// Refer to our docs to accept a payment and learn about how `client_secret` +/// should be handled. +@override@JsonKey(name: "client_secret") final String clientSecret; +/// Controls when the funds will be captured from the customer’s account. +@override@JsonKey(name: "capture_method") final PaymentIntentCaptureMethod captureMethod; +@override@JsonKey(name: "confirmation_method") final PaymentIntentConfirmationMethod confirmationMethod; +/// Time at which the object was created. Measured in seconds since the +/// Unix epoch. +@override final int? created; +/// Three-letter ISO currency code, in lowercase. Must be a supported +/// currency. +@override final String currency; +/// ID of the Customer this PaymentIntent belongs to, if one exists. +/// Payment methods attached to other Customers cannot be used with this +/// PaymentIntent. +/// +/// If present in combination with setup_future_usage, +/// this PaymentIntent’s payment method will be attached to the +/// Customer after the PaymentIntent has been confirmed and any +/// required actions from the user are complete. +@override final String? customer; +/// An arbitrary string attached to the object. +/// Often useful for displaying to users. +@override final String? description; +/// ID of the invoice that created this PaymentIntent, if it exists. +@override final String? invoice; +/// The payment error encountered in the previous PaymentIntent confirmation. +/// It will be cleared if the PaymentIntent is later updated for any reason. +@override@JsonKey(name: "last_payment_error") final StripeError? lastPaymentError; +/// The latest charge created by this payment intent. +@override@JsonKey(name: "latest_charge") final String? latestCharge; +/// Has the value true if the object exists in live mode or the +/// value false if the object exists in test mode. +@override final bool livemode; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the +/// object in a structured format. + final Map _metadata; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the +/// object in a structured format. +@override@JsonKey() Map get metadata { + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_metadata); +} - /// The list of payment method types (e.g. card) that this PaymentIntent - /// is allowed to use. - final List _paymentMethodTypes; - - /// The list of payment method types (e.g. card) that this PaymentIntent - /// is allowed to use. - @override - @JsonKey( - name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) - List get paymentMethodTypes { - if (_paymentMethodTypes is EqualUnmodifiableListView) - return _paymentMethodTypes; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_paymentMethodTypes); - } +/// If present, this property tells you what actions you need to +/// take in order for your customer to fulfill a payment using the +/// provided source. +@override@JsonKey(name: "next_action") final dynamic nextAction; +/// CONNECT ONLY +/// The account (if any) for which the funds of the PaymentIntent are +/// intended. See the PaymentIntents use case for connected accounts +/// for details. +@override@JsonKey(name: "on_behalf_of") final String? onBehalfOf; +/// ID of the payment method used in this PaymentIntent. +@override@JsonKey(name: "payment_method") final String? paymentMethod; +/// Payment-method-specific configuration for this PaymentIntent. + final Map _paymentMethodOptions; +/// Payment-method-specific configuration for this PaymentIntent. +@override@JsonKey(name: "payment_method_options") Map get paymentMethodOptions { + if (_paymentMethodOptions is EqualUnmodifiableMapView) return _paymentMethodOptions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_paymentMethodOptions); +} - /// If present, this property tells you about the processing state of the payment. - @override - final dynamic processing; +/// The list of payment method types (e.g. card) that this PaymentIntent +/// is allowed to use. + final List _paymentMethodTypes; +/// The list of payment method types (e.g. card) that this PaymentIntent +/// is allowed to use. +@override@JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List get paymentMethodTypes { + if (_paymentMethodTypes is EqualUnmodifiableListView) return _paymentMethodTypes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_paymentMethodTypes); +} - /// Email address that the receipt for the resulting payment will be sent to. - /// If receipt_email is specified for a payment in live mode, a receipt - /// will be sent regardless of your email settings. - @override - @JsonKey(name: "receipt_email") - final String? receiptEmail; +/// If present, this property tells you about the processing state of the payment. +@override final dynamic processing; +/// Email address that the receipt for the resulting payment will be sent to. +/// If receipt_email is specified for a payment in live mode, a receipt +/// will be sent regardless of your email settings. +@override@JsonKey(name: "receipt_email") final String? receiptEmail; // ID of the review associated with this PaymentIntent, if any. - @override - final String? review; - - /// Indicates that you intend to make future payments with this - /// PaymentIntent’s payment method. - /// Providing this parameter will attach the payment method to the - /// PaymentIntent’s Customer, if present, after the PaymentIntent is - /// confirmed and any required actions from the user are complete. I - /// If no Customer was provided, the payment method can still be attached to - /// a Customer after the transaction completes. - /// When processing card payments, Stripe also uses setup_future_usage - /// to dynamically optimize your payment flow and comply with regional - /// legislation and network rules, such as SCA. - @override - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage; - - /// Shipping information for this PaymentIntent. - @override - final ShippingDetails? shipping; - - /// For non-card charges, you can use this value as the complete - /// description that appears on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - @override - @JsonKey(name: "statement_descriptor") - final String? statementDescriptor; - - /// Provides information about a card payment that customers see on - /// their statements. - /// Concatenated with the prefix (shortened descriptor) or statement - /// descriptor that’s set on the account to form the complete statement - /// descriptor. Maximum 22 characters for the concatenated descriptor. - @override - @JsonKey(name: "statement_descriptor_suffix") - final String? statementDescriptorSuffix; - - /// Status of this PaymentIntent, one of requires_payment_method, - /// requires_confirmation, requires_action, processing, requires_capture, - /// canceled, or succeeded. - @override - final PaymentIntentsStatus status; - - /// CONNECT ONLY - /// The data with which to automatically create a Transfer when the payment - /// is finalized. See the PaymentIntents use case for connected - /// accounts for details. - @override - @JsonKey(name: "transfer_data") - final dynamic transferData; - - /// CONNECT ONLY - /// A string that identifies the resulting payment as part of a group. - /// See the PaymentIntents use case for connected accounts for details. - @override - @JsonKey(name: "transfer_group") - final dynamic transferGroup; - - @override - String toString() { - return 'PaymentIntent(id: $id, object: $object, amount: $amount, amountCapturable: $amountCapturable, amountDetails: $amountDetails, amountReceived: $amountReceived, application: $application, applicationFeeAmount: $applicationFeeAmount, automaticPaymentMethods: $automaticPaymentMethods, canceledAt: $canceledAt, cancellationReason: $cancellationReason, clientSecret: $clientSecret, captureMethod: $captureMethod, confirmationMethod: $confirmationMethod, created: $created, currency: $currency, customer: $customer, description: $description, invoice: $invoice, lastPaymentError: $lastPaymentError, latestCharge: $latestCharge, livemode: $livemode, metadata: $metadata, nextAction: $nextAction, onBehalfOf: $onBehalfOf, paymentMethod: $paymentMethod, paymentMethodOptions: $paymentMethodOptions, paymentMethodTypes: $paymentMethodTypes, processing: $processing, receiptEmail: $receiptEmail, review: $review, setupFutureUsage: $setupFutureUsage, shipping: $shipping, statementDescriptor: $statementDescriptor, statementDescriptorSuffix: $statementDescriptorSuffix, status: $status, transferData: $transferData, transferGroup: $transferGroup)'; +@override final String? review; +/// Indicates that you intend to make future payments with this +/// PaymentIntent’s payment method. +/// Providing this parameter will attach the payment method to the +/// PaymentIntent’s Customer, if present, after the PaymentIntent is +/// confirmed and any required actions from the user are complete. I +/// If no Customer was provided, the payment method can still be attached to +/// a Customer after the transaction completes. +/// When processing card payments, Stripe also uses setup_future_usage +/// to dynamically optimize your payment flow and comply with regional +/// legislation and network rules, such as SCA. +@override@JsonKey(name: "setup_future_usage") final PaymentIntentSetupFutureUsage? setupFutureUsage; +/// Shipping information for this PaymentIntent. +@override final ShippingDetails? shipping; +/// For non-card charges, you can use this value as the complete +/// description that appears on your customers’ statements. +/// Must contain at least one letter, maximum 22 characters. +@override@JsonKey(name: "statement_descriptor") final String? statementDescriptor; +/// Provides information about a card payment that customers see on +/// their statements. +/// Concatenated with the prefix (shortened descriptor) or statement +/// descriptor that’s set on the account to form the complete statement +/// descriptor. Maximum 22 characters for the concatenated descriptor. +@override@JsonKey(name: "statement_descriptor_suffix") final String? statementDescriptorSuffix; +/// Status of this PaymentIntent, one of requires_payment_method, +/// requires_confirmation, requires_action, processing, requires_capture, +/// canceled, or succeeded. +@override final PaymentIntentsStatus status; +/// CONNECT ONLY +/// The data with which to automatically create a Transfer when the payment +/// is finalized. See the PaymentIntents use case for connected +/// accounts for details. +@override@JsonKey(name: "transfer_data") final dynamic transferData; +/// CONNECT ONLY +/// A string that identifies the resulting payment as part of a group. +/// See the PaymentIntents use case for connected accounts for details. +@override@JsonKey(name: "transfer_group") final dynamic transferGroup; + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentIntentCopyWith<_PaymentIntent> get copyWith => __$PaymentIntentCopyWithImpl<_PaymentIntent>(this, _$identity); + +@override +Map toJson() { + return _$PaymentIntentToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.amountCapturable, amountCapturable) || other.amountCapturable == amountCapturable)&&(identical(other.amountDetails, amountDetails) || other.amountDetails == amountDetails)&&(identical(other.amountReceived, amountReceived) || other.amountReceived == amountReceived)&&(identical(other.application, application) || other.application == application)&&(identical(other.applicationFeeAmount, applicationFeeAmount) || other.applicationFeeAmount == applicationFeeAmount)&&(identical(other.automaticPaymentMethods, automaticPaymentMethods) || other.automaticPaymentMethods == automaticPaymentMethods)&&(identical(other.canceledAt, canceledAt) || other.canceledAt == canceledAt)&&(identical(other.cancellationReason, cancellationReason) || other.cancellationReason == cancellationReason)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.captureMethod, captureMethod) || other.captureMethod == captureMethod)&&(identical(other.confirmationMethod, confirmationMethod) || other.confirmationMethod == confirmationMethod)&&(identical(other.created, created) || other.created == created)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.description, description) || other.description == description)&&(identical(other.invoice, invoice) || other.invoice == invoice)&&(identical(other.lastPaymentError, lastPaymentError) || other.lastPaymentError == lastPaymentError)&&(identical(other.latestCharge, latestCharge) || other.latestCharge == latestCharge)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&const DeepCollectionEquality().equals(other._metadata, _metadata)&&const DeepCollectionEquality().equals(other.nextAction, nextAction)&&(identical(other.onBehalfOf, onBehalfOf) || other.onBehalfOf == onBehalfOf)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&const DeepCollectionEquality().equals(other._paymentMethodOptions, _paymentMethodOptions)&&const DeepCollectionEquality().equals(other._paymentMethodTypes, _paymentMethodTypes)&&const DeepCollectionEquality().equals(other.processing, processing)&&(identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail)&&(identical(other.review, review) || other.review == review)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&(identical(other.shipping, shipping) || other.shipping == shipping)&&(identical(other.statementDescriptor, statementDescriptor) || other.statementDescriptor == statementDescriptor)&&(identical(other.statementDescriptorSuffix, statementDescriptorSuffix) || other.statementDescriptorSuffix == statementDescriptorSuffix)&&(identical(other.status, status) || other.status == status)&&const DeepCollectionEquality().equals(other.transferData, transferData)&&const DeepCollectionEquality().equals(other.transferGroup, transferGroup)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,object,amount,amountCapturable,amountDetails,amountReceived,application,applicationFeeAmount,automaticPaymentMethods,canceledAt,cancellationReason,clientSecret,captureMethod,confirmationMethod,created,currency,customer,description,invoice,lastPaymentError,latestCharge,livemode,const DeepCollectionEquality().hash(_metadata),const DeepCollectionEquality().hash(nextAction),onBehalfOf,paymentMethod,const DeepCollectionEquality().hash(_paymentMethodOptions),const DeepCollectionEquality().hash(_paymentMethodTypes),const DeepCollectionEquality().hash(processing),receiptEmail,review,setupFutureUsage,shipping,statementDescriptor,statementDescriptorSuffix,status,const DeepCollectionEquality().hash(transferData),const DeepCollectionEquality().hash(transferGroup)]); + +@override +String toString() { + return 'PaymentIntent(id: $id, object: $object, amount: $amount, amountCapturable: $amountCapturable, amountDetails: $amountDetails, amountReceived: $amountReceived, application: $application, applicationFeeAmount: $applicationFeeAmount, automaticPaymentMethods: $automaticPaymentMethods, canceledAt: $canceledAt, cancellationReason: $cancellationReason, clientSecret: $clientSecret, captureMethod: $captureMethod, confirmationMethod: $confirmationMethod, created: $created, currency: $currency, customer: $customer, description: $description, invoice: $invoice, lastPaymentError: $lastPaymentError, latestCharge: $latestCharge, livemode: $livemode, metadata: $metadata, nextAction: $nextAction, onBehalfOf: $onBehalfOf, paymentMethod: $paymentMethod, paymentMethodOptions: $paymentMethodOptions, paymentMethodTypes: $paymentMethodTypes, processing: $processing, receiptEmail: $receiptEmail, review: $review, setupFutureUsage: $setupFutureUsage, shipping: $shipping, statementDescriptor: $statementDescriptor, statementDescriptorSuffix: $statementDescriptorSuffix, status: $status, transferData: $transferData, transferGroup: $transferGroup)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentIntentCopyWith<$Res> implements $PaymentIntentCopyWith<$Res> { + factory _$PaymentIntentCopyWith(_PaymentIntent value, $Res Function(_PaymentIntent) _then) = __$PaymentIntentCopyWithImpl; +@override @useResult +$Res call({ + String id, String object, int amount,@JsonKey(name: "amount_capturable") int? amountCapturable,@JsonKey(name: "amount_details") PaymentIntentAmountDetails? amountDetails,@JsonKey(name: "amount_received") int? amountReceived, String? application,@JsonKey(name: "application_fee_amount") int? applicationFeeAmount,@JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods,@JsonKey(name: "canceled_at") int? canceledAt,@JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? cancellationReason,@JsonKey(name: "client_secret") String clientSecret,@JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod,@JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod confirmationMethod, int? created, String currency, String? customer, String? description, String? invoice,@JsonKey(name: "last_payment_error") StripeError? lastPaymentError,@JsonKey(name: "latest_charge") String? latestCharge, bool livemode, Map metadata,@JsonKey(name: "next_action") dynamic nextAction,@JsonKey(name: "on_behalf_of") String? onBehalfOf,@JsonKey(name: "payment_method") String? paymentMethod,@JsonKey(name: "payment_method_options") Map paymentMethodOptions,@JsonKey(name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) List paymentMethodTypes, dynamic processing,@JsonKey(name: "receipt_email") String? receiptEmail, String? review,@JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? setupFutureUsage, ShippingDetails? shipping,@JsonKey(name: "statement_descriptor") String? statementDescriptor,@JsonKey(name: "statement_descriptor_suffix") String? statementDescriptorSuffix, PaymentIntentsStatus status,@JsonKey(name: "transfer_data") dynamic transferData,@JsonKey(name: "transfer_group") dynamic transferGroup +}); + + +@override $PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails;@override $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? get automaticPaymentMethods;@override $StripeErrorCopyWith<$Res>? get lastPaymentError;@override $ShippingDetailsCopyWith<$Res>? get shipping; + +} +/// @nodoc +class __$PaymentIntentCopyWithImpl<$Res> + implements _$PaymentIntentCopyWith<$Res> { + __$PaymentIntentCopyWithImpl(this._self, this._then); + + final _PaymentIntent _self; + final $Res Function(_PaymentIntent) _then; + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? object = null,Object? amount = null,Object? amountCapturable = freezed,Object? amountDetails = freezed,Object? amountReceived = freezed,Object? application = freezed,Object? applicationFeeAmount = freezed,Object? automaticPaymentMethods = freezed,Object? canceledAt = freezed,Object? cancellationReason = freezed,Object? clientSecret = null,Object? captureMethod = null,Object? confirmationMethod = null,Object? created = freezed,Object? currency = null,Object? customer = freezed,Object? description = freezed,Object? invoice = freezed,Object? lastPaymentError = freezed,Object? latestCharge = freezed,Object? livemode = null,Object? metadata = null,Object? nextAction = freezed,Object? onBehalfOf = freezed,Object? paymentMethod = freezed,Object? paymentMethodOptions = null,Object? paymentMethodTypes = null,Object? processing = freezed,Object? receiptEmail = freezed,Object? review = freezed,Object? setupFutureUsage = freezed,Object? shipping = freezed,Object? statementDescriptor = freezed,Object? statementDescriptorSuffix = freezed,Object? status = null,Object? transferData = freezed,Object? transferGroup = freezed,}) { + return _then(_PaymentIntent( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int,amountCapturable: freezed == amountCapturable ? _self.amountCapturable : amountCapturable // ignore: cast_nullable_to_non_nullable +as int?,amountDetails: freezed == amountDetails ? _self.amountDetails : amountDetails // ignore: cast_nullable_to_non_nullable +as PaymentIntentAmountDetails?,amountReceived: freezed == amountReceived ? _self.amountReceived : amountReceived // ignore: cast_nullable_to_non_nullable +as int?,application: freezed == application ? _self.application : application // ignore: cast_nullable_to_non_nullable +as String?,applicationFeeAmount: freezed == applicationFeeAmount ? _self.applicationFeeAmount : applicationFeeAmount // ignore: cast_nullable_to_non_nullable +as int?,automaticPaymentMethods: freezed == automaticPaymentMethods ? _self.automaticPaymentMethods : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable +as PaymentIntentAutomaticPaymentMethods?,canceledAt: freezed == canceledAt ? _self.canceledAt : canceledAt // ignore: cast_nullable_to_non_nullable +as int?,cancellationReason: freezed == cancellationReason ? _self.cancellationReason : cancellationReason // ignore: cast_nullable_to_non_nullable +as PaymentIntentCancellationReason?,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,captureMethod: null == captureMethod ? _self.captureMethod : captureMethod // ignore: cast_nullable_to_non_nullable +as PaymentIntentCaptureMethod,confirmationMethod: null == confirmationMethod ? _self.confirmationMethod : confirmationMethod // ignore: cast_nullable_to_non_nullable +as PaymentIntentConfirmationMethod,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,invoice: freezed == invoice ? _self.invoice : invoice // ignore: cast_nullable_to_non_nullable +as String?,lastPaymentError: freezed == lastPaymentError ? _self.lastPaymentError : lastPaymentError // ignore: cast_nullable_to_non_nullable +as StripeError?,latestCharge: freezed == latestCharge ? _self.latestCharge : latestCharge // ignore: cast_nullable_to_non_nullable +as String?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,metadata: null == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as dynamic,onBehalfOf: freezed == onBehalfOf ? _self.onBehalfOf : onBehalfOf // ignore: cast_nullable_to_non_nullable +as String?,paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?,paymentMethodOptions: null == paymentMethodOptions ? _self._paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as Map,paymentMethodTypes: null == paymentMethodTypes ? _self._paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List,processing: freezed == processing ? _self.processing : processing // ignore: cast_nullable_to_non_nullable +as dynamic,receiptEmail: freezed == receiptEmail ? _self.receiptEmail : receiptEmail // ignore: cast_nullable_to_non_nullable +as String?,review: freezed == review ? _self.review : review // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentSetupFutureUsage?,shipping: freezed == shipping ? _self.shipping : shipping // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,statementDescriptor: freezed == statementDescriptor ? _self.statementDescriptor : statementDescriptor // ignore: cast_nullable_to_non_nullable +as String?,statementDescriptorSuffix: freezed == statementDescriptorSuffix ? _self.statementDescriptorSuffix : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable +as String?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as PaymentIntentsStatus,transferData: freezed == transferData ? _self.transferData : transferData // ignore: cast_nullable_to_non_nullable +as dynamic,transferGroup: freezed == transferGroup ? _self.transferGroup : transferGroup // ignore: cast_nullable_to_non_nullable +as dynamic, + )); +} + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentAmountDetailsCopyWith<$Res>? get amountDetails { + if (_self.amountDetails == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentIntentImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.object, object) || other.object == object) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.amountCapturable, amountCapturable) || - other.amountCapturable == amountCapturable) && - (identical(other.amountDetails, amountDetails) || - other.amountDetails == amountDetails) && - (identical(other.amountReceived, amountReceived) || - other.amountReceived == amountReceived) && - (identical(other.application, application) || - other.application == application) && - (identical(other.applicationFeeAmount, applicationFeeAmount) || - other.applicationFeeAmount == applicationFeeAmount) && - (identical(other.automaticPaymentMethods, automaticPaymentMethods) || - other.automaticPaymentMethods == automaticPaymentMethods) && - (identical(other.canceledAt, canceledAt) || - other.canceledAt == canceledAt) && - (identical(other.cancellationReason, cancellationReason) || - other.cancellationReason == cancellationReason) && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.captureMethod, captureMethod) || - other.captureMethod == captureMethod) && - (identical(other.confirmationMethod, confirmationMethod) || - other.confirmationMethod == confirmationMethod) && - (identical(other.created, created) || other.created == created) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.customer, customer) || - other.customer == customer) && - (identical(other.description, description) || - other.description == description) && - (identical(other.invoice, invoice) || other.invoice == invoice) && - (identical(other.lastPaymentError, lastPaymentError) || - other.lastPaymentError == lastPaymentError) && - (identical(other.latestCharge, latestCharge) || - other.latestCharge == latestCharge) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - const DeepCollectionEquality().equals(other._metadata, _metadata) && - const DeepCollectionEquality() - .equals(other.nextAction, nextAction) && - (identical(other.onBehalfOf, onBehalfOf) || - other.onBehalfOf == onBehalfOf) && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - const DeepCollectionEquality() - .equals(other._paymentMethodOptions, _paymentMethodOptions) && - const DeepCollectionEquality() - .equals(other._paymentMethodTypes, _paymentMethodTypes) && - const DeepCollectionEquality() - .equals(other.processing, processing) && - (identical(other.receiptEmail, receiptEmail) || - other.receiptEmail == receiptEmail) && - (identical(other.review, review) || other.review == review) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage) && - (identical(other.shipping, shipping) || - other.shipping == shipping) && - (identical(other.statementDescriptor, statementDescriptor) || - other.statementDescriptor == statementDescriptor) && - (identical(other.statementDescriptorSuffix, - statementDescriptorSuffix) || - other.statementDescriptorSuffix == statementDescriptorSuffix) && - (identical(other.status, status) || other.status == status) && - const DeepCollectionEquality() - .equals(other.transferData, transferData) && - const DeepCollectionEquality() - .equals(other.transferGroup, transferGroup)); + return $PaymentIntentAmountDetailsCopyWith<$Res>(_self.amountDetails!, (value) { + return _then(_self.copyWith(amountDetails: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? get automaticPaymentMethods { + if (_self.automaticPaymentMethods == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - id, - object, - amount, - amountCapturable, - amountDetails, - amountReceived, - application, - applicationFeeAmount, - automaticPaymentMethods, - canceledAt, - cancellationReason, - clientSecret, - captureMethod, - confirmationMethod, - created, - currency, - customer, - description, - invoice, - lastPaymentError, - latestCharge, - livemode, - const DeepCollectionEquality().hash(_metadata), - const DeepCollectionEquality().hash(nextAction), - onBehalfOf, - paymentMethod, - const DeepCollectionEquality().hash(_paymentMethodOptions), - const DeepCollectionEquality().hash(_paymentMethodTypes), - const DeepCollectionEquality().hash(processing), - receiptEmail, - review, - setupFutureUsage, - shipping, - statementDescriptor, - statementDescriptorSuffix, - status, - const DeepCollectionEquality().hash(transferData), - const DeepCollectionEquality().hash(transferGroup) - ]); - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentIntentImplCopyWith<_$PaymentIntentImpl> get copyWith => - __$$PaymentIntentImplCopyWithImpl<_$PaymentIntentImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentIntentImplToJson( - this, - ); + return $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>(_self.automaticPaymentMethods!, (value) { + return _then(_self.copyWith(automaticPaymentMethods: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get lastPaymentError { + if (_self.lastPaymentError == null) { + return null; } -} -abstract class _PaymentIntent implements PaymentIntent { - const factory _PaymentIntent( - {required final String id, - final String object, - required final int amount, - @JsonKey(name: "amount_capturable") final int? amountCapturable, - @JsonKey(name: "amount_details") - final PaymentIntentAmountDetails? amountDetails, - @JsonKey(name: "amount_received") final int? amountReceived, - final String? application, - @JsonKey(name: "application_fee_amount") final int? applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") - final PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, - @JsonKey(name: "canceled_at") final int? canceledAt, - @JsonKey(name: "cancellation_reason") - final PaymentIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") required final String clientSecret, - @JsonKey(name: "capture_method") - final PaymentIntentCaptureMethod captureMethod, - @JsonKey(name: "confirmation_method") - final PaymentIntentConfirmationMethod confirmationMethod, - final int? created, - required final String currency, - final String? customer, - final String? description, - final String? invoice, - @JsonKey(name: "last_payment_error") final StripeError? lastPaymentError, - @JsonKey(name: "latest_charge") final String? latestCharge, - required final bool livemode, - final Map metadata, - @JsonKey(name: "next_action") final dynamic nextAction, - @JsonKey(name: "on_behalf_of") final String? onBehalfOf, - @JsonKey(name: "payment_method") final String? paymentMethod, - @JsonKey(name: "payment_method_options") - final Map paymentMethodOptions, - @JsonKey( - name: "payment_method_types", - unknownEnumValue: PaymentMethodType.unknown) - final List paymentMethodTypes, - final dynamic processing, - @JsonKey(name: "receipt_email") final String? receiptEmail, - final String? review, - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage, - final ShippingDetails? shipping, - @JsonKey(name: "statement_descriptor") final String? statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - final String? statementDescriptorSuffix, - required final PaymentIntentsStatus status, - @JsonKey(name: "transfer_data") final dynamic transferData, - @JsonKey(name: "transfer_group") - final dynamic transferGroup}) = _$PaymentIntentImpl; - - factory _PaymentIntent.fromJson(Map json) = - _$PaymentIntentImpl.fromJson; - - /// Unique identifier for the object. - @override - String get id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "payment_intent". - @override - String get object; - - /// Amount intended to be collected by this PaymentIntent. - /// A positive integer representing how much to charge in the - /// smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to - /// charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or equivalent in charge currency. - /// The amount value supports up to eight digits - /// (e.g., a value of 99999999 for a USD charge of $999,999.99). - @override - int get amount; - - /// The amount that can be captured with from this PaymentIntent (in cents). - @override - @JsonKey(name: "amount_capturable") - int? get amountCapturable; - - /// Details about items included in the amount - @override - @JsonKey(name: "amount_details") - PaymentIntentAmountDetails? get amountDetails; - - /// The amount that was collected from this PaymentIntent (in cents). - @override - @JsonKey(name: "amount_received") - int? get amountReceived; - - /// CONNECT ONLY - /// ID of the Connect application that created the PaymentIntent. - @override - String? get application; - - /// CONNECT ONLY - /// The amount of the application fee (if any) that will be requested to - /// be applied to the payment and transferred to the application owner’s - /// Stripe account. The amount of the application fee collected will be - /// capped at the total payment amount. - /// For more information, see the PaymentIntents use - /// case for connected accounts.. - @override - @JsonKey(name: "application_fee_amount") - int? get applicationFeeAmount; - - /// Settings to configure compatible payment methods from the - /// Stripe Dashboard - @override - @JsonKey(name: "automatic_payment_methods") - PaymentIntentAutomaticPaymentMethods? get automaticPaymentMethods; - - /// Populated when status is canceled, this is the time at which the - /// PaymentIntent was canceled. Measured in seconds since the Unix epoch. - @override - @JsonKey(name: "canceled_at") - int? get canceledAt; - - /// Reason for cancellation of this PaymentIntent, - /// either user-provided - /// (duplicate, fraudulent, requested_by_customer, or abandoned) or - /// generated by Stripe internally - /// (failed_invoice, void_invoice, or automatic). - @override - @JsonKey(name: "cancellation_reason") - PaymentIntentCancellationReason? get cancellationReason; - - /// The client secret of this PaymentIntent. Used for client-side retrieval - /// using a publishable key. - /// The client secret can be used to complete a payment from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the - /// customer. Make sure that you have TLS enabled on any page that includes - /// the client secret. - /// - /// Refer to our docs to accept a payment and learn about how `client_secret` - /// should be handled. - @override - @JsonKey(name: "client_secret") - String get clientSecret; - - /// Controls when the funds will be captured from the customer’s account. - @override - @JsonKey(name: "capture_method") - PaymentIntentCaptureMethod get captureMethod; - @override - @JsonKey(name: "confirmation_method") - PaymentIntentConfirmationMethod get confirmationMethod; - - /// Time at which the object was created. Measured in seconds since the - /// Unix epoch. - @override - int? get created; - - /// Three-letter ISO currency code, in lowercase. Must be a supported - /// currency. - @override - String get currency; - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// Payment methods attached to other Customers cannot be used with this - /// PaymentIntent. - /// - /// If present in combination with setup_future_usage, - /// this PaymentIntent’s payment method will be attached to the - /// Customer after the PaymentIntent has been confirmed and any - /// required actions from the user are complete. - @override - String? get customer; - - /// An arbitrary string attached to the object. - /// Often useful for displaying to users. - @override - String? get description; - - /// ID of the invoice that created this PaymentIntent, if it exists. - @override - String? get invoice; - - /// The payment error encountered in the previous PaymentIntent confirmation. - /// It will be cleared if the PaymentIntent is later updated for any reason. - @override - @JsonKey(name: "last_payment_error") - StripeError? get lastPaymentError; - - /// The latest charge created by this payment intent. - @override - @JsonKey(name: "latest_charge") - String? get latestCharge; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - @override - bool get livemode; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - @override - Map get metadata; - - /// If present, this property tells you what actions you need to - /// take in order for your customer to fulfill a payment using the - /// provided source. - @override - @JsonKey(name: "next_action") - dynamic get nextAction; - - /// CONNECT ONLY - /// The account (if any) for which the funds of the PaymentIntent are - /// intended. See the PaymentIntents use case for connected accounts - /// for details. - @override - @JsonKey(name: "on_behalf_of") - String? get onBehalfOf; - - /// ID of the payment method used in this PaymentIntent. - @override - @JsonKey(name: "payment_method") - String? get paymentMethod; - - /// Payment-method-specific configuration for this PaymentIntent. - @override - @JsonKey(name: "payment_method_options") - Map get paymentMethodOptions; - - /// The list of payment method types (e.g. card) that this PaymentIntent - /// is allowed to use. - @override - @JsonKey( - name: "payment_method_types", unknownEnumValue: PaymentMethodType.unknown) - List get paymentMethodTypes; - - /// If present, this property tells you about the processing state of the payment. - @override - dynamic get processing; - - /// Email address that the receipt for the resulting payment will be sent to. - /// If receipt_email is specified for a payment in live mode, a receipt - /// will be sent regardless of your email settings. - @override - @JsonKey(name: "receipt_email") - String? - get receiptEmail; // ID of the review associated with this PaymentIntent, if any. - @override - String? get review; - - /// Indicates that you intend to make future payments with this - /// PaymentIntent’s payment method. - /// Providing this parameter will attach the payment method to the - /// PaymentIntent’s Customer, if present, after the PaymentIntent is - /// confirmed and any required actions from the user are complete. I - /// If no Customer was provided, the payment method can still be attached to - /// a Customer after the transaction completes. - /// When processing card payments, Stripe also uses setup_future_usage - /// to dynamically optimize your payment flow and comply with regional - /// legislation and network rules, such as SCA. - @override - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? get setupFutureUsage; - - /// Shipping information for this PaymentIntent. - @override - ShippingDetails? get shipping; - - /// For non-card charges, you can use this value as the complete - /// description that appears on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - @override - @JsonKey(name: "statement_descriptor") - String? get statementDescriptor; - - /// Provides information about a card payment that customers see on - /// their statements. - /// Concatenated with the prefix (shortened descriptor) or statement - /// descriptor that’s set on the account to form the complete statement - /// descriptor. Maximum 22 characters for the concatenated descriptor. - @override - @JsonKey(name: "statement_descriptor_suffix") - String? get statementDescriptorSuffix; - - /// Status of this PaymentIntent, one of requires_payment_method, - /// requires_confirmation, requires_action, processing, requires_capture, - /// canceled, or succeeded. - @override - PaymentIntentsStatus get status; - - /// CONNECT ONLY - /// The data with which to automatically create a Transfer when the payment - /// is finalized. See the PaymentIntents use case for connected - /// accounts for details. - @override - @JsonKey(name: "transfer_data") - dynamic get transferData; - - /// CONNECT ONLY - /// A string that identifies the resulting payment as part of a group. - /// See the PaymentIntents use case for connected accounts for details. - @override - @JsonKey(name: "transfer_group") - dynamic get transferGroup; - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentIntentImplCopyWith<_$PaymentIntentImpl> get copyWith => - throw _privateConstructorUsedError; -} - -PaymentIntentAmountDetails _$PaymentIntentAmountDetailsFromJson( - Map json) { - return _PaymentIntentAmountDetails.fromJson(json); + return $StripeErrorCopyWith<$Res>(_self.lastPaymentError!, (value) { + return _then(_self.copyWith(lastPaymentError: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shipping { + if (_self.shipping == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shipping!, (value) { + return _then(_self.copyWith(shipping: value)); + }); } +} + /// @nodoc mixin _$PaymentIntentAmountDetails { - /// Details about items included in the amount - PaymentIntentTip? get tip => throw _privateConstructorUsedError; + +/// Details about items included in the amount + PaymentIntentTip? get tip; +/// Create a copy of PaymentIntentAmountDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentIntentAmountDetailsCopyWith get copyWith => _$PaymentIntentAmountDetailsCopyWithImpl(this as PaymentIntentAmountDetails, _$identity); /// Serializes this PaymentIntentAmountDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentIntentAmountDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentIntentAmountDetailsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentIntentAmountDetails&&(identical(other.tip, tip) || other.tip == tip)); } -/// @nodoc -abstract class $PaymentIntentAmountDetailsCopyWith<$Res> { - factory $PaymentIntentAmountDetailsCopyWith(PaymentIntentAmountDetails value, - $Res Function(PaymentIntentAmountDetails) then) = - _$PaymentIntentAmountDetailsCopyWithImpl<$Res, - PaymentIntentAmountDetails>; - @useResult - $Res call({PaymentIntentTip? tip}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,tip); - $PaymentIntentTipCopyWith<$Res>? get tip; +@override +String toString() { + return 'PaymentIntentAmountDetails(tip: $tip)'; } + +} + +/// @nodoc +abstract mixin class $PaymentIntentAmountDetailsCopyWith<$Res> { + factory $PaymentIntentAmountDetailsCopyWith(PaymentIntentAmountDetails value, $Res Function(PaymentIntentAmountDetails) _then) = _$PaymentIntentAmountDetailsCopyWithImpl; +@useResult +$Res call({ + PaymentIntentTip? tip +}); + + +$PaymentIntentTipCopyWith<$Res>? get tip; + +} /// @nodoc -class _$PaymentIntentAmountDetailsCopyWithImpl<$Res, - $Val extends PaymentIntentAmountDetails> +class _$PaymentIntentAmountDetailsCopyWithImpl<$Res> implements $PaymentIntentAmountDetailsCopyWith<$Res> { - _$PaymentIntentAmountDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentIntentAmountDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? tip = freezed, - }) { - return _then(_value.copyWith( - tip: freezed == tip - ? _value.tip - : tip // ignore: cast_nullable_to_non_nullable - as PaymentIntentTip?, - ) as $Val); + _$PaymentIntentAmountDetailsCopyWithImpl(this._self, this._then); + + final PaymentIntentAmountDetails _self; + final $Res Function(PaymentIntentAmountDetails) _then; + +/// Create a copy of PaymentIntentAmountDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? tip = freezed,}) { + return _then(_self.copyWith( +tip: freezed == tip ? _self.tip : tip // ignore: cast_nullable_to_non_nullable +as PaymentIntentTip?, + )); +} +/// Create a copy of PaymentIntentAmountDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentTipCopyWith<$Res>? get tip { + if (_self.tip == null) { + return null; } - /// Create a copy of PaymentIntentAmountDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentIntentTipCopyWith<$Res>? get tip { - if (_value.tip == null) { - return null; - } - - return $PaymentIntentTipCopyWith<$Res>(_value.tip!, (value) { - return _then(_value.copyWith(tip: value) as $Val); - }); - } + return $PaymentIntentTipCopyWith<$Res>(_self.tip!, (value) { + return _then(_self.copyWith(tip: value)); + }); +} } -/// @nodoc -abstract class _$$PaymentIntentAmountDetailsImplCopyWith<$Res> - implements $PaymentIntentAmountDetailsCopyWith<$Res> { - factory _$$PaymentIntentAmountDetailsImplCopyWith( - _$PaymentIntentAmountDetailsImpl value, - $Res Function(_$PaymentIntentAmountDetailsImpl) then) = - __$$PaymentIntentAmountDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({PaymentIntentTip? tip}); - @override - $PaymentIntentTipCopyWith<$Res>? get tip; +/// Adds pattern-matching-related methods to [PaymentIntentAmountDetails]. +extension PaymentIntentAmountDetailsPatterns on PaymentIntentAmountDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentIntentAmountDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentIntentAmountDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentIntentAmountDetails value) $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentAmountDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentIntentAmountDetails value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentAmountDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentIntentTip? tip)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentIntentAmountDetails() when $default != null: +return $default(_that.tip);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentIntentTip? tip) $default,) {final _that = this; +switch (_that) { +case _PaymentIntentAmountDetails(): +return $default(_that.tip);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentIntentTip? tip)? $default,) {final _that = this; +switch (_that) { +case _PaymentIntentAmountDetails() when $default != null: +return $default(_that.tip);case _: + return null; + +} } -/// @nodoc -class __$$PaymentIntentAmountDetailsImplCopyWithImpl<$Res> - extends _$PaymentIntentAmountDetailsCopyWithImpl<$Res, - _$PaymentIntentAmountDetailsImpl> - implements _$$PaymentIntentAmountDetailsImplCopyWith<$Res> { - __$$PaymentIntentAmountDetailsImplCopyWithImpl( - _$PaymentIntentAmountDetailsImpl _value, - $Res Function(_$PaymentIntentAmountDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentIntentAmountDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? tip = freezed, - }) { - return _then(_$PaymentIntentAmountDetailsImpl( - tip: freezed == tip - ? _value.tip - : tip // ignore: cast_nullable_to_non_nullable - as PaymentIntentTip?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentIntentAmountDetailsImpl implements _PaymentIntentAmountDetails { - const _$PaymentIntentAmountDetailsImpl({this.tip = const PaymentIntentTip()}); - factory _$PaymentIntentAmountDetailsImpl.fromJson( - Map json) => - _$$PaymentIntentAmountDetailsImplFromJson(json); +class _PaymentIntentAmountDetails implements PaymentIntentAmountDetails { + const _PaymentIntentAmountDetails({this.tip = const PaymentIntentTip()}); + factory _PaymentIntentAmountDetails.fromJson(Map json) => _$PaymentIntentAmountDetailsFromJson(json); - /// Details about items included in the amount - @override - @JsonKey() - final PaymentIntentTip? tip; +/// Details about items included in the amount +@override@JsonKey() final PaymentIntentTip? tip; - @override - String toString() { - return 'PaymentIntentAmountDetails(tip: $tip)'; - } +/// Create a copy of PaymentIntentAmountDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentIntentAmountDetailsCopyWith<_PaymentIntentAmountDetails> get copyWith => __$PaymentIntentAmountDetailsCopyWithImpl<_PaymentIntentAmountDetails>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentIntentAmountDetailsImpl && - (identical(other.tip, tip) || other.tip == tip)); - } +@override +Map toJson() { + return _$PaymentIntentAmountDetailsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, tip); - - /// Create a copy of PaymentIntentAmountDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentIntentAmountDetailsImplCopyWith<_$PaymentIntentAmountDetailsImpl> - get copyWith => __$$PaymentIntentAmountDetailsImplCopyWithImpl< - _$PaymentIntentAmountDetailsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentIntentAmountDetailsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentIntentAmountDetails&&(identical(other.tip, tip) || other.tip == tip)); } -abstract class _PaymentIntentAmountDetails - implements PaymentIntentAmountDetails { - const factory _PaymentIntentAmountDetails({final PaymentIntentTip? tip}) = - _$PaymentIntentAmountDetailsImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,tip); - factory _PaymentIntentAmountDetails.fromJson(Map json) = - _$PaymentIntentAmountDetailsImpl.fromJson; +@override +String toString() { + return 'PaymentIntentAmountDetails(tip: $tip)'; +} - /// Details about items included in the amount - @override - PaymentIntentTip? get tip; - /// Create a copy of PaymentIntentAmountDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentIntentAmountDetailsImplCopyWith<_$PaymentIntentAmountDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } -PaymentIntentTip _$PaymentIntentTipFromJson(Map json) { - return _PaymentIntentTip.fromJson(json); +/// @nodoc +abstract mixin class _$PaymentIntentAmountDetailsCopyWith<$Res> implements $PaymentIntentAmountDetailsCopyWith<$Res> { + factory _$PaymentIntentAmountDetailsCopyWith(_PaymentIntentAmountDetails value, $Res Function(_PaymentIntentAmountDetails) _then) = __$PaymentIntentAmountDetailsCopyWithImpl; +@override @useResult +$Res call({ + PaymentIntentTip? tip +}); + + +@override $PaymentIntentTipCopyWith<$Res>? get tip; + +} +/// @nodoc +class __$PaymentIntentAmountDetailsCopyWithImpl<$Res> + implements _$PaymentIntentAmountDetailsCopyWith<$Res> { + __$PaymentIntentAmountDetailsCopyWithImpl(this._self, this._then); + + final _PaymentIntentAmountDetails _self; + final $Res Function(_PaymentIntentAmountDetails) _then; + +/// Create a copy of PaymentIntentAmountDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? tip = freezed,}) { + return _then(_PaymentIntentAmountDetails( +tip: freezed == tip ? _self.tip : tip // ignore: cast_nullable_to_non_nullable +as PaymentIntentTip?, + )); } +/// Create a copy of PaymentIntentAmountDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentTipCopyWith<$Res>? get tip { + if (_self.tip == null) { + return null; + } + + return $PaymentIntentTipCopyWith<$Res>(_self.tip!, (value) { + return _then(_self.copyWith(tip: value)); + }); +} +} + + /// @nodoc mixin _$PaymentIntentTip { - /// Portion of the amount that corresponds to a tip. - int? get amount => throw _privateConstructorUsedError; + +/// Portion of the amount that corresponds to a tip. + int? get amount; +/// Create a copy of PaymentIntentTip +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentIntentTipCopyWith get copyWith => _$PaymentIntentTipCopyWithImpl(this as PaymentIntentTip, _$identity); /// Serializes this PaymentIntentTip to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentIntentTip - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentIntentTipCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentIntentTip&&(identical(other.amount, amount) || other.amount == amount)); } -/// @nodoc -abstract class $PaymentIntentTipCopyWith<$Res> { - factory $PaymentIntentTipCopyWith( - PaymentIntentTip value, $Res Function(PaymentIntentTip) then) = - _$PaymentIntentTipCopyWithImpl<$Res, PaymentIntentTip>; - @useResult - $Res call({int? amount}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount); + +@override +String toString() { + return 'PaymentIntentTip(amount: $amount)'; } -/// @nodoc -class _$PaymentIntentTipCopyWithImpl<$Res, $Val extends PaymentIntentTip> - implements $PaymentIntentTipCopyWith<$Res> { - _$PaymentIntentTipCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentIntentTip - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = freezed, - }) { - return _then(_value.copyWith( - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } + } /// @nodoc -abstract class _$$PaymentIntentTipImplCopyWith<$Res> +abstract mixin class $PaymentIntentTipCopyWith<$Res> { + factory $PaymentIntentTipCopyWith(PaymentIntentTip value, $Res Function(PaymentIntentTip) _then) = _$PaymentIntentTipCopyWithImpl; +@useResult +$Res call({ + int? amount +}); + + + + +} +/// @nodoc +class _$PaymentIntentTipCopyWithImpl<$Res> implements $PaymentIntentTipCopyWith<$Res> { - factory _$$PaymentIntentTipImplCopyWith(_$PaymentIntentTipImpl value, - $Res Function(_$PaymentIntentTipImpl) then) = - __$$PaymentIntentTipImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int? amount}); + _$PaymentIntentTipCopyWithImpl(this._self, this._then); + + final PaymentIntentTip _self; + final $Res Function(PaymentIntentTip) _then; + +/// Create a copy of PaymentIntentTip +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? amount = freezed,}) { + return _then(_self.copyWith( +amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentIntentTip]. +extension PaymentIntentTipPatterns on PaymentIntentTip { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentIntentTip value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentIntentTip() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentIntentTip value) $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentTip(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentIntentTip value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentTip() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentIntentTip() when $default != null: +return $default(_that.amount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? amount) $default,) {final _that = this; +switch (_that) { +case _PaymentIntentTip(): +return $default(_that.amount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? amount)? $default,) {final _that = this; +switch (_that) { +case _PaymentIntentTip() when $default != null: +return $default(_that.amount);case _: + return null; + +} } -/// @nodoc -class __$$PaymentIntentTipImplCopyWithImpl<$Res> - extends _$PaymentIntentTipCopyWithImpl<$Res, _$PaymentIntentTipImpl> - implements _$$PaymentIntentTipImplCopyWith<$Res> { - __$$PaymentIntentTipImplCopyWithImpl(_$PaymentIntentTipImpl _value, - $Res Function(_$PaymentIntentTipImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentIntentTip - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = freezed, - }) { - return _then(_$PaymentIntentTipImpl( - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentIntentTipImpl implements _PaymentIntentTip { - const _$PaymentIntentTipImpl({this.amount}); - factory _$PaymentIntentTipImpl.fromJson(Map json) => - _$$PaymentIntentTipImplFromJson(json); +class _PaymentIntentTip implements PaymentIntentTip { + const _PaymentIntentTip({this.amount}); + factory _PaymentIntentTip.fromJson(Map json) => _$PaymentIntentTipFromJson(json); - /// Portion of the amount that corresponds to a tip. - @override - final int? amount; +/// Portion of the amount that corresponds to a tip. +@override final int? amount; - @override - String toString() { - return 'PaymentIntentTip(amount: $amount)'; - } +/// Create a copy of PaymentIntentTip +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentIntentTipCopyWith<_PaymentIntentTip> get copyWith => __$PaymentIntentTipCopyWithImpl<_PaymentIntentTip>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentIntentTipImpl && - (identical(other.amount, amount) || other.amount == amount)); - } +@override +Map toJson() { + return _$PaymentIntentTipToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, amount); - - /// Create a copy of PaymentIntentTip - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentIntentTipImplCopyWith<_$PaymentIntentTipImpl> get copyWith => - __$$PaymentIntentTipImplCopyWithImpl<_$PaymentIntentTipImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentIntentTipImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentIntentTip&&(identical(other.amount, amount) || other.amount == amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount); + +@override +String toString() { + return 'PaymentIntentTip(amount: $amount)'; } -abstract class _PaymentIntentTip implements PaymentIntentTip { - const factory _PaymentIntentTip({final int? amount}) = _$PaymentIntentTipImpl; - factory _PaymentIntentTip.fromJson(Map json) = - _$PaymentIntentTipImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$PaymentIntentTipCopyWith<$Res> implements $PaymentIntentTipCopyWith<$Res> { + factory _$PaymentIntentTipCopyWith(_PaymentIntentTip value, $Res Function(_PaymentIntentTip) _then) = __$PaymentIntentTipCopyWithImpl; +@override @useResult +$Res call({ + int? amount +}); + - /// Portion of the amount that corresponds to a tip. - @override - int? get amount; - /// Create a copy of PaymentIntentTip - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentIntentTipImplCopyWith<_$PaymentIntentTipImpl> get copyWith => - throw _privateConstructorUsedError; + +} +/// @nodoc +class __$PaymentIntentTipCopyWithImpl<$Res> + implements _$PaymentIntentTipCopyWith<$Res> { + __$PaymentIntentTipCopyWithImpl(this._self, this._then); + + final _PaymentIntentTip _self; + final $Res Function(_PaymentIntentTip) _then; + +/// Create a copy of PaymentIntentTip +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? amount = freezed,}) { + return _then(_PaymentIntentTip( +amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int?, + )); } -PaymentIntentAutomaticPaymentMethods - _$PaymentIntentAutomaticPaymentMethodsFromJson(Map json) { - return _PaymentIntentAutomaticPaymentMethods.fromJson(json); + } + /// @nodoc mixin _$PaymentIntentAutomaticPaymentMethods { - /// Automatically calculates compatible payment methods - bool? get enabled => throw _privateConstructorUsedError; + +/// Automatically calculates compatible payment methods + bool? get enabled; +/// Create a copy of PaymentIntentAutomaticPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentIntentAutomaticPaymentMethodsCopyWith get copyWith => _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl(this as PaymentIntentAutomaticPaymentMethods, _$identity); /// Serializes this PaymentIntentAutomaticPaymentMethods to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentIntentAutomaticPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentIntentAutomaticPaymentMethodsCopyWith< - PaymentIntentAutomaticPaymentMethods> - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentIntentAutomaticPaymentMethods&&(identical(other.enabled, enabled) || other.enabled == enabled)); } -/// @nodoc -abstract class $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { - factory $PaymentIntentAutomaticPaymentMethodsCopyWith( - PaymentIntentAutomaticPaymentMethods value, - $Res Function(PaymentIntentAutomaticPaymentMethods) then) = - _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, - PaymentIntentAutomaticPaymentMethods>; - @useResult - $Res call({bool? enabled}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,enabled); + +@override +String toString() { + return 'PaymentIntentAutomaticPaymentMethods(enabled: $enabled)'; } -/// @nodoc -class _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, - $Val extends PaymentIntentAutomaticPaymentMethods> - implements $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { - _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentIntentAutomaticPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? enabled = freezed, - }) { - return _then(_value.copyWith( - enabled: freezed == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$PaymentIntentAutomaticPaymentMethodsImplCopyWith<$Res> +abstract mixin class $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { + factory $PaymentIntentAutomaticPaymentMethodsCopyWith(PaymentIntentAutomaticPaymentMethods value, $Res Function(PaymentIntentAutomaticPaymentMethods) _then) = _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl; +@useResult +$Res call({ + bool? enabled +}); + + + + +} +/// @nodoc +class _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res> implements $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { - factory _$$PaymentIntentAutomaticPaymentMethodsImplCopyWith( - _$PaymentIntentAutomaticPaymentMethodsImpl value, - $Res Function(_$PaymentIntentAutomaticPaymentMethodsImpl) then) = - __$$PaymentIntentAutomaticPaymentMethodsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? enabled}); + _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl(this._self, this._then); + + final PaymentIntentAutomaticPaymentMethods _self; + final $Res Function(PaymentIntentAutomaticPaymentMethods) _then; + +/// Create a copy of PaymentIntentAutomaticPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? enabled = freezed,}) { + return _then(_self.copyWith( +enabled: freezed == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentIntentAutomaticPaymentMethods]. +extension PaymentIntentAutomaticPaymentMethodsPatterns on PaymentIntentAutomaticPaymentMethods { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentIntentAutomaticPaymentMethods value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentIntentAutomaticPaymentMethods() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentIntentAutomaticPaymentMethods value) $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentAutomaticPaymentMethods(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentIntentAutomaticPaymentMethods value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentAutomaticPaymentMethods() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? enabled)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentIntentAutomaticPaymentMethods() when $default != null: +return $default(_that.enabled);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? enabled) $default,) {final _that = this; +switch (_that) { +case _PaymentIntentAutomaticPaymentMethods(): +return $default(_that.enabled);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? enabled)? $default,) {final _that = this; +switch (_that) { +case _PaymentIntentAutomaticPaymentMethods() when $default != null: +return $default(_that.enabled);case _: + return null; + +} } -/// @nodoc -class __$$PaymentIntentAutomaticPaymentMethodsImplCopyWithImpl<$Res> - extends _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, - _$PaymentIntentAutomaticPaymentMethodsImpl> - implements _$$PaymentIntentAutomaticPaymentMethodsImplCopyWith<$Res> { - __$$PaymentIntentAutomaticPaymentMethodsImplCopyWithImpl( - _$PaymentIntentAutomaticPaymentMethodsImpl _value, - $Res Function(_$PaymentIntentAutomaticPaymentMethodsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentIntentAutomaticPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? enabled = freezed, - }) { - return _then(_$PaymentIntentAutomaticPaymentMethodsImpl( - enabled: freezed == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentIntentAutomaticPaymentMethodsImpl - implements _PaymentIntentAutomaticPaymentMethods { - const _$PaymentIntentAutomaticPaymentMethodsImpl({required this.enabled}); - factory _$PaymentIntentAutomaticPaymentMethodsImpl.fromJson( - Map json) => - _$$PaymentIntentAutomaticPaymentMethodsImplFromJson(json); +class _PaymentIntentAutomaticPaymentMethods implements PaymentIntentAutomaticPaymentMethods { + const _PaymentIntentAutomaticPaymentMethods({required this.enabled}); + factory _PaymentIntentAutomaticPaymentMethods.fromJson(Map json) => _$PaymentIntentAutomaticPaymentMethodsFromJson(json); - /// Automatically calculates compatible payment methods - @override - final bool? enabled; +/// Automatically calculates compatible payment methods +@override final bool? enabled; - @override - String toString() { - return 'PaymentIntentAutomaticPaymentMethods(enabled: $enabled)'; - } +/// Create a copy of PaymentIntentAutomaticPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentIntentAutomaticPaymentMethodsCopyWith<_PaymentIntentAutomaticPaymentMethods> get copyWith => __$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<_PaymentIntentAutomaticPaymentMethods>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentIntentAutomaticPaymentMethodsImpl && - (identical(other.enabled, enabled) || other.enabled == enabled)); - } +@override +Map toJson() { + return _$PaymentIntentAutomaticPaymentMethodsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, enabled); - - /// Create a copy of PaymentIntentAutomaticPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentIntentAutomaticPaymentMethodsImplCopyWith< - _$PaymentIntentAutomaticPaymentMethodsImpl> - get copyWith => __$$PaymentIntentAutomaticPaymentMethodsImplCopyWithImpl< - _$PaymentIntentAutomaticPaymentMethodsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentIntentAutomaticPaymentMethodsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentIntentAutomaticPaymentMethods&&(identical(other.enabled, enabled) || other.enabled == enabled)); } -abstract class _PaymentIntentAutomaticPaymentMethods - implements PaymentIntentAutomaticPaymentMethods { - const factory _PaymentIntentAutomaticPaymentMethods( - {required final bool? enabled}) = - _$PaymentIntentAutomaticPaymentMethodsImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,enabled); + +@override +String toString() { + return 'PaymentIntentAutomaticPaymentMethods(enabled: $enabled)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> implements $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { + factory _$PaymentIntentAutomaticPaymentMethodsCopyWith(_PaymentIntentAutomaticPaymentMethods value, $Res Function(_PaymentIntentAutomaticPaymentMethods) _then) = __$PaymentIntentAutomaticPaymentMethodsCopyWithImpl; +@override @useResult +$Res call({ + bool? enabled +}); - factory _PaymentIntentAutomaticPaymentMethods.fromJson( - Map json) = - _$PaymentIntentAutomaticPaymentMethodsImpl.fromJson; - /// Automatically calculates compatible payment methods - @override - bool? get enabled; - /// Create a copy of PaymentIntentAutomaticPaymentMethods - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentIntentAutomaticPaymentMethodsImplCopyWith< - _$PaymentIntentAutomaticPaymentMethodsImpl> - get copyWith => throw _privateConstructorUsedError; + +} +/// @nodoc +class __$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res> + implements _$PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { + __$PaymentIntentAutomaticPaymentMethodsCopyWithImpl(this._self, this._then); + + final _PaymentIntentAutomaticPaymentMethods _self; + final $Res Function(_PaymentIntentAutomaticPaymentMethods) _then; + +/// Create a copy of PaymentIntentAutomaticPaymentMethods +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? enabled = freezed,}) { + return _then(_PaymentIntentAutomaticPaymentMethods( +enabled: freezed == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool?, + )); } + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/payment_intent.g.dart b/packages/stripe_js/lib/src/api/payment_intents/payment_intent.g.dart index bb566f45c..8c1e3aa43 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/payment_intent.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/payment_intent.g.dart @@ -6,134 +6,139 @@ part of 'payment_intent.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentIntentImpl _$$PaymentIntentImplFromJson(Map json) => - _$PaymentIntentImpl( - id: json['id'] as String, - object: json['object'] as String? ?? "payment_intent", - amount: (json['amount'] as num).toInt(), - amountCapturable: (json['amount_capturable'] as num?)?.toInt(), - amountDetails: json['amount_details'] == null - ? const PaymentIntentAmountDetails() - : PaymentIntentAmountDetails.fromJson( - Map.from(json['amount_details'] as Map)), - amountReceived: (json['amount_received'] as num?)?.toInt(), - application: json['application'] as String?, - applicationFeeAmount: (json['application_fee_amount'] as num?)?.toInt(), - automaticPaymentMethods: json['automatic_payment_methods'] == null - ? null - : PaymentIntentAutomaticPaymentMethods.fromJson( - Map.from( - json['automatic_payment_methods'] as Map)), - canceledAt: (json['canceled_at'] as num?)?.toInt(), - cancellationReason: $enumDecodeNullable( - _$PaymentIntentCancellationReasonEnumMap, - json['cancellation_reason']), - clientSecret: json['client_secret'] as String, - captureMethod: $enumDecodeNullable( - _$PaymentIntentCaptureMethodEnumMap, json['capture_method']) ?? - PaymentIntentCaptureMethod.automatic, - confirmationMethod: $enumDecodeNullable( - _$PaymentIntentConfirmationMethodEnumMap, - json['confirmation_method']) ?? - PaymentIntentConfirmationMethod.automatic, - created: (json['created'] as num?)?.toInt(), - currency: json['currency'] as String, - customer: json['customer'] as String?, - description: json['description'] as String?, - invoice: json['invoice'] as String?, - lastPaymentError: json['last_payment_error'] == null - ? null - : StripeError.fromJson( - Map.from(json['last_payment_error'] as Map)), - latestCharge: json['latest_charge'] as String?, - livemode: json['livemode'] as bool, - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k as String, e), - ) ?? - const {}, - nextAction: json['next_action'], - onBehalfOf: json['on_behalf_of'] as String?, - paymentMethod: json['payment_method'] as String?, - paymentMethodOptions: json['payment_method_options'] as Map? ?? const {}, - paymentMethodTypes: (json['payment_method_types'] as List?) - ?.map((e) => $enumDecode(_$PaymentMethodTypeEnumMap, e, - unknownValue: PaymentMethodType.unknown)) - .toList() ?? - const [], - processing: json['processing'], - receiptEmail: json['receipt_email'] as String?, - review: json['review'] as String?, - setupFutureUsage: $enumDecodeNullable( - _$PaymentIntentSetupFutureUsageEnumMap, json['setup_future_usage']), - shipping: json['shipping'] == null - ? null - : ShippingDetails.fromJson( - Map.from(json['shipping'] as Map)), - statementDescriptor: json['statement_descriptor'] as String?, - statementDescriptorSuffix: json['statement_descriptor_suffix'] as String?, - status: $enumDecode(_$PaymentIntentsStatusEnumMap, json['status']), - transferData: json['transfer_data'], - transferGroup: json['transfer_group'], - ); - -Map _$$PaymentIntentImplToJson(_$PaymentIntentImpl instance) { - final val = { - 'id': instance.id, - 'object': instance.object, - 'amount': instance.amount, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('amount_capturable', instance.amountCapturable); - writeNotNull('amount_details', instance.amountDetails?.toJson()); - writeNotNull('amount_received', instance.amountReceived); - writeNotNull('application', instance.application); - writeNotNull('application_fee_amount', instance.applicationFeeAmount); - writeNotNull( - 'automatic_payment_methods', instance.automaticPaymentMethods?.toJson()); - writeNotNull('canceled_at', instance.canceledAt); - writeNotNull('cancellation_reason', - _$PaymentIntentCancellationReasonEnumMap[instance.cancellationReason]); - val['client_secret'] = instance.clientSecret; - val['capture_method'] = - _$PaymentIntentCaptureMethodEnumMap[instance.captureMethod]!; - val['confirmation_method'] = - _$PaymentIntentConfirmationMethodEnumMap[instance.confirmationMethod]!; - writeNotNull('created', instance.created); - val['currency'] = instance.currency; - writeNotNull('customer', instance.customer); - writeNotNull('description', instance.description); - writeNotNull('invoice', instance.invoice); - writeNotNull('last_payment_error', instance.lastPaymentError?.toJson()); - writeNotNull('latest_charge', instance.latestCharge); - val['livemode'] = instance.livemode; - val['metadata'] = instance.metadata; - writeNotNull('next_action', instance.nextAction); - writeNotNull('on_behalf_of', instance.onBehalfOf); - writeNotNull('payment_method', instance.paymentMethod); - val['payment_method_options'] = instance.paymentMethodOptions; - val['payment_method_types'] = instance.paymentMethodTypes +_PaymentIntent _$PaymentIntentFromJson(Map json) => _PaymentIntent( + id: json['id'] as String, + object: json['object'] as String? ?? "payment_intent", + amount: (json['amount'] as num).toInt(), + amountCapturable: (json['amount_capturable'] as num?)?.toInt(), + amountDetails: json['amount_details'] == null + ? const PaymentIntentAmountDetails() + : PaymentIntentAmountDetails.fromJson( + Map.from(json['amount_details'] as Map), + ), + amountReceived: (json['amount_received'] as num?)?.toInt(), + application: json['application'] as String?, + applicationFeeAmount: (json['application_fee_amount'] as num?)?.toInt(), + automaticPaymentMethods: json['automatic_payment_methods'] == null + ? null + : PaymentIntentAutomaticPaymentMethods.fromJson( + Map.from(json['automatic_payment_methods'] as Map), + ), + canceledAt: (json['canceled_at'] as num?)?.toInt(), + cancellationReason: $enumDecodeNullable( + _$PaymentIntentCancellationReasonEnumMap, + json['cancellation_reason'], + ), + clientSecret: json['client_secret'] as String, + captureMethod: + $enumDecodeNullable( + _$PaymentIntentCaptureMethodEnumMap, + json['capture_method'], + ) ?? + PaymentIntentCaptureMethod.automatic, + confirmationMethod: + $enumDecodeNullable( + _$PaymentIntentConfirmationMethodEnumMap, + json['confirmation_method'], + ) ?? + PaymentIntentConfirmationMethod.automatic, + created: (json['created'] as num?)?.toInt(), + currency: json['currency'] as String, + customer: json['customer'] as String?, + description: json['description'] as String?, + invoice: json['invoice'] as String?, + lastPaymentError: json['last_payment_error'] == null + ? null + : StripeError.fromJson( + Map.from(json['last_payment_error'] as Map), + ), + latestCharge: json['latest_charge'] as String?, + livemode: json['livemode'] as bool, + metadata: + (json['metadata'] as Map?)?.map((k, e) => MapEntry(k as String, e)) ?? + const {}, + nextAction: json['next_action'], + onBehalfOf: json['on_behalf_of'] as String?, + paymentMethod: json['payment_method'] as String?, + paymentMethodOptions: json['payment_method_options'] as Map? ?? const {}, + paymentMethodTypes: + (json['payment_method_types'] as List?) + ?.map( + (e) => $enumDecode( + _$PaymentMethodTypeEnumMap, + e, + unknownValue: PaymentMethodType.unknown, + ), + ) + .toList() ?? + const [], + processing: json['processing'], + receiptEmail: json['receipt_email'] as String?, + review: json['review'] as String?, + setupFutureUsage: $enumDecodeNullable( + _$PaymentIntentSetupFutureUsageEnumMap, + json['setup_future_usage'], + ), + shipping: json['shipping'] == null + ? null + : ShippingDetails.fromJson( + Map.from(json['shipping'] as Map), + ), + statementDescriptor: json['statement_descriptor'] as String?, + statementDescriptorSuffix: json['statement_descriptor_suffix'] as String?, + status: $enumDecode(_$PaymentIntentsStatusEnumMap, json['status']), + transferData: json['transfer_data'], + transferGroup: json['transfer_group'], +); + +Map _$PaymentIntentToJson( + _PaymentIntent instance, +) => { + 'id': instance.id, + 'object': instance.object, + 'amount': instance.amount, + 'amount_capturable': ?instance.amountCapturable, + 'amount_details': ?instance.amountDetails?.toJson(), + 'amount_received': ?instance.amountReceived, + 'application': ?instance.application, + 'application_fee_amount': ?instance.applicationFeeAmount, + 'automatic_payment_methods': ?instance.automaticPaymentMethods?.toJson(), + 'canceled_at': ?instance.canceledAt, + 'cancellation_reason': + ?_$PaymentIntentCancellationReasonEnumMap[instance.cancellationReason], + 'client_secret': instance.clientSecret, + 'capture_method': + _$PaymentIntentCaptureMethodEnumMap[instance.captureMethod]!, + 'confirmation_method': + _$PaymentIntentConfirmationMethodEnumMap[instance.confirmationMethod]!, + 'created': ?instance.created, + 'currency': instance.currency, + 'customer': ?instance.customer, + 'description': ?instance.description, + 'invoice': ?instance.invoice, + 'last_payment_error': ?instance.lastPaymentError?.toJson(), + 'latest_charge': ?instance.latestCharge, + 'livemode': instance.livemode, + 'metadata': instance.metadata, + 'next_action': ?instance.nextAction, + 'on_behalf_of': ?instance.onBehalfOf, + 'payment_method': ?instance.paymentMethod, + 'payment_method_options': instance.paymentMethodOptions, + 'payment_method_types': instance.paymentMethodTypes .map((e) => _$PaymentMethodTypeEnumMap[e]!) - .toList(); - writeNotNull('processing', instance.processing); - writeNotNull('receipt_email', instance.receiptEmail); - writeNotNull('review', instance.review); - writeNotNull('setup_future_usage', - _$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage]); - writeNotNull('shipping', instance.shipping?.toJson()); - writeNotNull('statement_descriptor', instance.statementDescriptor); - writeNotNull( - 'statement_descriptor_suffix', instance.statementDescriptorSuffix); - val['status'] = _$PaymentIntentsStatusEnumMap[instance.status]!; - writeNotNull('transfer_data', instance.transferData); - writeNotNull('transfer_group', instance.transferGroup); - return val; -} + .toList(), + 'processing': ?instance.processing, + 'receipt_email': ?instance.receiptEmail, + 'review': ?instance.review, + 'setup_future_usage': + ?_$PaymentIntentSetupFutureUsageEnumMap[instance.setupFutureUsage], + 'shipping': ?instance.shipping?.toJson(), + 'statement_descriptor': ?instance.statementDescriptor, + 'statement_descriptor_suffix': ?instance.statementDescriptorSuffix, + 'status': _$PaymentIntentsStatusEnumMap[instance.status]!, + 'transfer_data': ?instance.transferData, + 'transfer_group': ?instance.transferGroup, +}; const _$PaymentIntentCancellationReasonEnumMap = { PaymentIntentCancellationReason.duplicate: 'duplicate', @@ -185,7 +190,6 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.pix: 'pix', PaymentMethodType.promptpay: 'promptpay', PaymentMethodType.sepaDebit: 'sepa_debit', - PaymentMethodType.sofort: 'sofort', PaymentMethodType.usBankAccount: 'us_bank_account', PaymentMethodType.wechatPay: 'wechat_pay', PaymentMethodType.unknown: 'unknown', @@ -206,64 +210,29 @@ const _$PaymentIntentsStatusEnumMap = { PaymentIntentsStatus.canceled: 'canceled', }; -_$PaymentIntentAmountDetailsImpl _$$PaymentIntentAmountDetailsImplFromJson( - Map json) => - _$PaymentIntentAmountDetailsImpl( +_PaymentIntentAmountDetails _$PaymentIntentAmountDetailsFromJson(Map json) => + _PaymentIntentAmountDetails( tip: json['tip'] == null ? const PaymentIntentTip() : PaymentIntentTip.fromJson( - Map.from(json['tip'] as Map)), - ); - -Map _$$PaymentIntentAmountDetailsImplToJson( - _$PaymentIntentAmountDetailsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('tip', instance.tip?.toJson()); - return val; -} - -_$PaymentIntentTipImpl _$$PaymentIntentTipImplFromJson(Map json) => - _$PaymentIntentTipImpl( - amount: (json['amount'] as num?)?.toInt(), + Map.from(json['tip'] as Map), + ), ); -Map _$$PaymentIntentTipImplToJson( - _$PaymentIntentTipImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('amount', instance.amount); - return val; -} +Map _$PaymentIntentAmountDetailsToJson( + _PaymentIntentAmountDetails instance, +) => {'tip': ?instance.tip?.toJson()}; -_$PaymentIntentAutomaticPaymentMethodsImpl - _$$PaymentIntentAutomaticPaymentMethodsImplFromJson(Map json) => - _$PaymentIntentAutomaticPaymentMethodsImpl( - enabled: json['enabled'] as bool?, - ); +_PaymentIntentTip _$PaymentIntentTipFromJson(Map json) => + _PaymentIntentTip(amount: (json['amount'] as num?)?.toInt()); -Map _$$PaymentIntentAutomaticPaymentMethodsImplToJson( - _$PaymentIntentAutomaticPaymentMethodsImpl instance) { - final val = {}; +Map _$PaymentIntentTipToJson(_PaymentIntentTip instance) => + {'amount': ?instance.amount}; - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +_PaymentIntentAutomaticPaymentMethods +_$PaymentIntentAutomaticPaymentMethodsFromJson(Map json) => + _PaymentIntentAutomaticPaymentMethods(enabled: json['enabled'] as bool?); - writeNotNull('enabled', instance.enabled); - return val; -} +Map _$PaymentIntentAutomaticPaymentMethodsToJson( + _PaymentIntentAutomaticPaymentMethods instance, +) => {'enabled': ?instance.enabled}; diff --git a/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.dart b/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.dart index aaac3a4f7..ff089b38a 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.dart @@ -5,7 +5,7 @@ part 'payment_intent_response.freezed.dart'; part 'payment_intent_response.g.dart'; @freezed -class PaymentIntentResponse with _$PaymentIntentResponse { +abstract class PaymentIntentResponse with _$PaymentIntentResponse { const factory PaymentIntentResponse({ /// If not null, a PaymentIntent was retrieved successfully PaymentIntent? paymentIntent, diff --git a/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.freezed.dart b/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.freezed.dart index 6b4c45e5c..8daed6dea 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,225 +9,324 @@ part of 'payment_intent_response.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentIntentResponse _$PaymentIntentResponseFromJson( - Map json) { - return _PaymentIntentResponse.fromJson(json); -} - /// @nodoc mixin _$PaymentIntentResponse { - /// If not null, a PaymentIntent was retrieved successfully - PaymentIntent? get paymentIntent => throw _privateConstructorUsedError; - /// If not null, an error occurred - StripeError? get error => throw _privateConstructorUsedError; +/// If not null, a PaymentIntent was retrieved successfully + PaymentIntent? get paymentIntent;/// If not null, an error occurred + StripeError? get error; +/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentIntentResponseCopyWith get copyWith => _$PaymentIntentResponseCopyWithImpl(this as PaymentIntentResponse, _$identity); /// Serializes this PaymentIntentResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentIntentResponseCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentIntentResponse&&(identical(other.paymentIntent, paymentIntent) || other.paymentIntent == paymentIntent)&&(identical(other.error, error) || other.error == error)); } -/// @nodoc -abstract class $PaymentIntentResponseCopyWith<$Res> { - factory $PaymentIntentResponseCopyWith(PaymentIntentResponse value, - $Res Function(PaymentIntentResponse) then) = - _$PaymentIntentResponseCopyWithImpl<$Res, PaymentIntentResponse>; - @useResult - $Res call({PaymentIntent? paymentIntent, StripeError? error}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentIntent,error); - $PaymentIntentCopyWith<$Res>? get paymentIntent; - $StripeErrorCopyWith<$Res>? get error; +@override +String toString() { + return 'PaymentIntentResponse(paymentIntent: $paymentIntent, error: $error)'; } + +} + +/// @nodoc +abstract mixin class $PaymentIntentResponseCopyWith<$Res> { + factory $PaymentIntentResponseCopyWith(PaymentIntentResponse value, $Res Function(PaymentIntentResponse) _then) = _$PaymentIntentResponseCopyWithImpl; +@useResult +$Res call({ + PaymentIntent? paymentIntent, StripeError? error +}); + + +$PaymentIntentCopyWith<$Res>? get paymentIntent;$StripeErrorCopyWith<$Res>? get error; + +} /// @nodoc -class _$PaymentIntentResponseCopyWithImpl<$Res, - $Val extends PaymentIntentResponse> +class _$PaymentIntentResponseCopyWithImpl<$Res> implements $PaymentIntentResponseCopyWith<$Res> { - _$PaymentIntentResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentIntent = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - paymentIntent: freezed == paymentIntent - ? _value.paymentIntent - : paymentIntent // ignore: cast_nullable_to_non_nullable - as PaymentIntent?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - ) as $Val); + _$PaymentIntentResponseCopyWithImpl(this._self, this._then); + + final PaymentIntentResponse _self; + final $Res Function(PaymentIntentResponse) _then; + +/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentIntent = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +paymentIntent: freezed == paymentIntent ? _self.paymentIntent : paymentIntent // ignore: cast_nullable_to_non_nullable +as PaymentIntent?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} +/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentCopyWith<$Res>? get paymentIntent { + if (_self.paymentIntent == null) { + return null; } - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentIntentCopyWith<$Res>? get paymentIntent { - if (_value.paymentIntent == null) { - return null; - } - - return $PaymentIntentCopyWith<$Res>(_value.paymentIntent!, (value) { - return _then(_value.copyWith(paymentIntent: value) as $Val); - }); + return $PaymentIntentCopyWith<$Res>(_self.paymentIntent!, (value) { + return _then(_self.copyWith(paymentIntent: value)); + }); +}/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith<$Res>? get error { - if (_value.error == null) { - return null; - } - - return $StripeErrorCopyWith<$Res>(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } -/// @nodoc -abstract class _$$PaymentIntentResponseImplCopyWith<$Res> - implements $PaymentIntentResponseCopyWith<$Res> { - factory _$$PaymentIntentResponseImplCopyWith( - _$PaymentIntentResponseImpl value, - $Res Function(_$PaymentIntentResponseImpl) then) = - __$$PaymentIntentResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({PaymentIntent? paymentIntent, StripeError? error}); - @override - $PaymentIntentCopyWith<$Res>? get paymentIntent; - @override - $StripeErrorCopyWith<$Res>? get error; +/// Adds pattern-matching-related methods to [PaymentIntentResponse]. +extension PaymentIntentResponsePatterns on PaymentIntentResponse { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentIntentResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentIntentResponse() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentIntentResponse value) $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentResponse(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentIntentResponse value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentIntentResponse() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentIntent? paymentIntent, StripeError? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentIntentResponse() when $default != null: +return $default(_that.paymentIntent,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentIntent? paymentIntent, StripeError? error) $default,) {final _that = this; +switch (_that) { +case _PaymentIntentResponse(): +return $default(_that.paymentIntent,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentIntent? paymentIntent, StripeError? error)? $default,) {final _that = this; +switch (_that) { +case _PaymentIntentResponse() when $default != null: +return $default(_that.paymentIntent,_that.error);case _: + return null; + +} } -/// @nodoc -class __$$PaymentIntentResponseImplCopyWithImpl<$Res> - extends _$PaymentIntentResponseCopyWithImpl<$Res, - _$PaymentIntentResponseImpl> - implements _$$PaymentIntentResponseImplCopyWith<$Res> { - __$$PaymentIntentResponseImplCopyWithImpl(_$PaymentIntentResponseImpl _value, - $Res Function(_$PaymentIntentResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentIntent = freezed, - Object? error = freezed, - }) { - return _then(_$PaymentIntentResponseImpl( - paymentIntent: freezed == paymentIntent - ? _value.paymentIntent - : paymentIntent // ignore: cast_nullable_to_non_nullable - as PaymentIntent?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentIntentResponseImpl implements _PaymentIntentResponse { - const _$PaymentIntentResponseImpl({this.paymentIntent, this.error}); - factory _$PaymentIntentResponseImpl.fromJson(Map json) => - _$$PaymentIntentResponseImplFromJson(json); +class _PaymentIntentResponse implements PaymentIntentResponse { + const _PaymentIntentResponse({this.paymentIntent, this.error}); + factory _PaymentIntentResponse.fromJson(Map json) => _$PaymentIntentResponseFromJson(json); - /// If not null, a PaymentIntent was retrieved successfully - @override - final PaymentIntent? paymentIntent; +/// If not null, a PaymentIntent was retrieved successfully +@override final PaymentIntent? paymentIntent; +/// If not null, an error occurred +@override final StripeError? error; - /// If not null, an error occurred - @override - final StripeError? error; +/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentIntentResponseCopyWith<_PaymentIntentResponse> get copyWith => __$PaymentIntentResponseCopyWithImpl<_PaymentIntentResponse>(this, _$identity); - @override - String toString() { - return 'PaymentIntentResponse(paymentIntent: $paymentIntent, error: $error)'; - } +@override +Map toJson() { + return _$PaymentIntentResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentIntentResponse&&(identical(other.paymentIntent, paymentIntent) || other.paymentIntent == paymentIntent)&&(identical(other.error, error) || other.error == error)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentIntent,error); + +@override +String toString() { + return 'PaymentIntentResponse(paymentIntent: $paymentIntent, error: $error)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentIntentResponseImpl && - (identical(other.paymentIntent, paymentIntent) || - other.paymentIntent == paymentIntent) && - (identical(other.error, error) || other.error == error)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentIntent, error); - - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentIntentResponseImplCopyWith<_$PaymentIntentResponseImpl> - get copyWith => __$$PaymentIntentResponseImplCopyWithImpl< - _$PaymentIntentResponseImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentIntentResponseImplToJson( - this, - ); - } } -abstract class _PaymentIntentResponse implements PaymentIntentResponse { - const factory _PaymentIntentResponse( - {final PaymentIntent? paymentIntent, - final StripeError? error}) = _$PaymentIntentResponseImpl; +/// @nodoc +abstract mixin class _$PaymentIntentResponseCopyWith<$Res> implements $PaymentIntentResponseCopyWith<$Res> { + factory _$PaymentIntentResponseCopyWith(_PaymentIntentResponse value, $Res Function(_PaymentIntentResponse) _then) = __$PaymentIntentResponseCopyWithImpl; +@override @useResult +$Res call({ + PaymentIntent? paymentIntent, StripeError? error +}); + + +@override $PaymentIntentCopyWith<$Res>? get paymentIntent;@override $StripeErrorCopyWith<$Res>? get error; - factory _PaymentIntentResponse.fromJson(Map json) = - _$PaymentIntentResponseImpl.fromJson; +} +/// @nodoc +class __$PaymentIntentResponseCopyWithImpl<$Res> + implements _$PaymentIntentResponseCopyWith<$Res> { + __$PaymentIntentResponseCopyWithImpl(this._self, this._then); + + final _PaymentIntentResponse _self; + final $Res Function(_PaymentIntentResponse) _then; + +/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentIntent = freezed,Object? error = freezed,}) { + return _then(_PaymentIntentResponse( +paymentIntent: freezed == paymentIntent ? _self.paymentIntent : paymentIntent // ignore: cast_nullable_to_non_nullable +as PaymentIntent?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} - /// If not null, a PaymentIntent was retrieved successfully - @override - PaymentIntent? get paymentIntent; +/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentIntentCopyWith<$Res>? get paymentIntent { + if (_self.paymentIntent == null) { + return null; + } - /// If not null, an error occurred - @override - StripeError? get error; + return $PaymentIntentCopyWith<$Res>(_self.paymentIntent!, (value) { + return _then(_self.copyWith(paymentIntent: value)); + }); +}/// Create a copy of PaymentIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } - /// Create a copy of PaymentIntentResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentIntentResponseImplCopyWith<_$PaymentIntentResponseImpl> - get copyWith => throw _privateConstructorUsedError; + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.g.dart b/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.g.dart index 0ebfcc890..2757cba6e 100644 --- a/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.g.dart +++ b/packages/stripe_js/lib/src/api/payment_intents/payment_intent_response.g.dart @@ -6,29 +6,23 @@ part of 'payment_intent_response.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentIntentResponseImpl _$$PaymentIntentResponseImplFromJson(Map json) => - _$PaymentIntentResponseImpl( +_PaymentIntentResponse _$PaymentIntentResponseFromJson(Map json) => + _PaymentIntentResponse( paymentIntent: json['paymentIntent'] == null ? null : PaymentIntent.fromJson( - Map.from(json['paymentIntent'] as Map)), + Map.from(json['paymentIntent'] as Map), + ), error: json['error'] == null ? null : StripeError.fromJson( - Map.from(json['error'] as Map)), + Map.from(json['error'] as Map), + ), ); -Map _$$PaymentIntentResponseImplToJson( - _$PaymentIntentResponseImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('paymentIntent', instance.paymentIntent?.toJson()); - writeNotNull('error', instance.error?.toJson()); - return val; -} +Map _$PaymentIntentResponseToJson( + _PaymentIntentResponse instance, +) => { + 'paymentIntent': ?instance.paymentIntent?.toJson(), + 'error': ?instance.error?.toJson(), +}; diff --git a/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.dart b/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.dart index 259507826..404f5897b 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.dart @@ -6,7 +6,7 @@ part 'create_payment_method_data.freezed.dart'; part 'create_payment_method_data.g.dart'; @freezed -class CreatePaymentMethodData with _$CreatePaymentMethodData { +abstract class CreatePaymentMethodData with _$CreatePaymentMethodData { const factory CreatePaymentMethodData({ /// Unique identifier for the object. required String type, @@ -39,11 +39,9 @@ class CreatePaymentMethodData with _$CreatePaymentMethodData { @JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban, /// The customer's VPA. - @JsonKey(name: "upi[vpa]") String? upiVpa, /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - @JsonKey(name: "billing_details") BillingDetails? billingDetails, }) = _CreatePaymentMethodData; diff --git a/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.freezed.dart b/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.freezed.dart index 4cf8af3c9..d07bcf991 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,535 +9,350 @@ part of 'create_payment_method_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$CreatePaymentMethodData { + +/// Unique identifier for the object. + String get type;/// A card or cardNumber Element. +@ElementConverter() Element? get card;/// An auBankAccount Element. +@JsonKey(name: "au_becs_debit")@ElementConverter() Element? get auBecsDebit;/// An fpx Element. +@ElementConverter() Element? get fpx;/// The customer's bank. +@JsonKey(name: "fpx[bank]") String? get fpxBank;/// The customer's bank. +@JsonKey(name: "netbanking[bank]") String? get netbankingBank;/// An idealBank Element. +@ElementConverter() Element? get ideal;/// The customer's bank. +@JsonKey(name: "ideal[bank]") String? get idealBank;/// An iban Element. +@JsonKey(name: "sepa_debit")@ElementConverter() Element? get sepaDebit;/// An IBAN account number. +@JsonKey(name: "sepa_debit[iban]") String? get sepaDebitIban;/// The customer's VPA. +@JsonKey(name: "upi[vpa]") String? get upiVpa;/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +@JsonKey(name: "billing_details") BillingDetails? get billingDetails; +/// Create a copy of CreatePaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CreatePaymentMethodDataCopyWith get copyWith => _$CreatePaymentMethodDataCopyWithImpl(this as CreatePaymentMethodData, _$identity); + + /// Serializes this CreatePaymentMethodData to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreatePaymentMethodData&&(identical(other.type, type) || other.type == type)&&(identical(other.card, card) || other.card == card)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.fpx, fpx) || other.fpx == fpx)&&(identical(other.fpxBank, fpxBank) || other.fpxBank == fpxBank)&&(identical(other.netbankingBank, netbankingBank) || other.netbankingBank == netbankingBank)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.idealBank, idealBank) || other.idealBank == idealBank)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.sepaDebitIban, sepaDebitIban) || other.sepaDebitIban == sepaDebitIban)&&(identical(other.upiVpa, upiVpa) || other.upiVpa == upiVpa)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,card,auBecsDebit,fpx,fpxBank,netbankingBank,ideal,idealBank,sepaDebit,sepaDebitIban,upiVpa,billingDetails); + +@override +String toString() { + return 'CreatePaymentMethodData(type: $type, card: $card, auBecsDebit: $auBecsDebit, fpx: $fpx, fpxBank: $fpxBank, netbankingBank: $netbankingBank, ideal: $ideal, idealBank: $idealBank, sepaDebit: $sepaDebit, sepaDebitIban: $sepaDebitIban, upiVpa: $upiVpa, billingDetails: $billingDetails)'; +} + -CreatePaymentMethodData _$CreatePaymentMethodDataFromJson( - Map json) { - return _CreatePaymentMethodData.fromJson(json); } /// @nodoc -mixin _$CreatePaymentMethodData { - /// Unique identifier for the object. - String get type => throw _privateConstructorUsedError; +abstract mixin class $CreatePaymentMethodDataCopyWith<$Res> { + factory $CreatePaymentMethodDataCopyWith(CreatePaymentMethodData value, $Res Function(CreatePaymentMethodData) _then) = _$CreatePaymentMethodDataCopyWithImpl; +@useResult +$Res call({ + String type,@ElementConverter() Element? card,@JsonKey(name: "au_becs_debit")@ElementConverter() Element? auBecsDebit,@ElementConverter() Element? fpx,@JsonKey(name: "fpx[bank]") String? fpxBank,@JsonKey(name: "netbanking[bank]") String? netbankingBank,@ElementConverter() Element? ideal,@JsonKey(name: "ideal[bank]") String? idealBank,@JsonKey(name: "sepa_debit")@ElementConverter() Element? sepaDebit,@JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban,@JsonKey(name: "upi[vpa]") String? upiVpa,@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); - /// A card or cardNumber Element. - @ElementConverter() - Element? get card => throw _privateConstructorUsedError; - /// An auBankAccount Element. - @JsonKey(name: "au_becs_debit") - @ElementConverter() - Element? get auBecsDebit => throw _privateConstructorUsedError; +$BillingDetailsCopyWith<$Res>? get billingDetails; - /// An fpx Element. - @ElementConverter() - Element? get fpx => throw _privateConstructorUsedError; +} +/// @nodoc +class _$CreatePaymentMethodDataCopyWithImpl<$Res> + implements $CreatePaymentMethodDataCopyWith<$Res> { + _$CreatePaymentMethodDataCopyWithImpl(this._self, this._then); + + final CreatePaymentMethodData _self; + final $Res Function(CreatePaymentMethodData) _then; + +/// Create a copy of CreatePaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? card = freezed,Object? auBecsDebit = freezed,Object? fpx = freezed,Object? fpxBank = freezed,Object? netbankingBank = freezed,Object? ideal = freezed,Object? idealBank = freezed,Object? sepaDebit = freezed,Object? sepaDebitIban = freezed,Object? upiVpa = freezed,Object? billingDetails = freezed,}) { + return _then(_self.copyWith( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as Element?,auBecsDebit: freezed == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as Element?,fpx: freezed == fpx ? _self.fpx : fpx // ignore: cast_nullable_to_non_nullable +as Element?,fpxBank: freezed == fpxBank ? _self.fpxBank : fpxBank // ignore: cast_nullable_to_non_nullable +as String?,netbankingBank: freezed == netbankingBank ? _self.netbankingBank : netbankingBank // ignore: cast_nullable_to_non_nullable +as String?,ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Element?,idealBank: freezed == idealBank ? _self.idealBank : idealBank // ignore: cast_nullable_to_non_nullable +as String?,sepaDebit: freezed == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as Element?,sepaDebitIban: freezed == sepaDebitIban ? _self.sepaDebitIban : sepaDebitIban // ignore: cast_nullable_to_non_nullable +as String?,upiVpa: freezed == upiVpa ? _self.upiVpa : upiVpa // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} +/// Create a copy of CreatePaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } - /// The customer's bank. - @JsonKey(name: "fpx[bank]") - String? get fpxBank => throw _privateConstructorUsedError; + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} +} - /// The customer's bank. - @JsonKey(name: "netbanking[bank]") - String? get netbankingBank => throw _privateConstructorUsedError; - /// An idealBank Element. - @ElementConverter() - Element? get ideal => throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [CreatePaymentMethodData]. +extension CreatePaymentMethodDataPatterns on CreatePaymentMethodData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreatePaymentMethodData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreatePaymentMethodData() when $default != null: +return $default(_that);case _: + return orElse(); - /// The customer's bank. - @JsonKey(name: "ideal[bank]") - String? get idealBank => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreatePaymentMethodData value) $default,){ +final _that = this; +switch (_that) { +case _CreatePaymentMethodData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// An iban Element. - @JsonKey(name: "sepa_debit") - @ElementConverter() - Element? get sepaDebit => throw _privateConstructorUsedError; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreatePaymentMethodData value)? $default,){ +final _that = this; +switch (_that) { +case _CreatePaymentMethodData() when $default != null: +return $default(_that);case _: + return null; - /// An IBAN account number. - @JsonKey(name: "sepa_debit[iban]") - String? get sepaDebitIban => throw _privateConstructorUsedError; +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String type, @ElementConverter() Element? card, @JsonKey(name: "au_becs_debit")@ElementConverter() Element? auBecsDebit, @ElementConverter() Element? fpx, @JsonKey(name: "fpx[bank]") String? fpxBank, @JsonKey(name: "netbanking[bank]") String? netbankingBank, @ElementConverter() Element? ideal, @JsonKey(name: "ideal[bank]") String? idealBank, @JsonKey(name: "sepa_debit")@ElementConverter() Element? sepaDebit, @JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban, @JsonKey(name: "upi[vpa]") String? upiVpa, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreatePaymentMethodData() when $default != null: +return $default(_that.type,_that.card,_that.auBecsDebit,_that.fpx,_that.fpxBank,_that.netbankingBank,_that.ideal,_that.idealBank,_that.sepaDebit,_that.sepaDebitIban,_that.upiVpa,_that.billingDetails);case _: + return orElse(); - /// The customer's VPA. - @JsonKey(name: "upi[vpa]") - String? get upiVpa => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String type, @ElementConverter() Element? card, @JsonKey(name: "au_becs_debit")@ElementConverter() Element? auBecsDebit, @ElementConverter() Element? fpx, @JsonKey(name: "fpx[bank]") String? fpxBank, @JsonKey(name: "netbanking[bank]") String? netbankingBank, @ElementConverter() Element? ideal, @JsonKey(name: "ideal[bank]") String? idealBank, @JsonKey(name: "sepa_debit")@ElementConverter() Element? sepaDebit, @JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban, @JsonKey(name: "upi[vpa]") String? upiVpa, @JsonKey(name: "billing_details") BillingDetails? billingDetails) $default,) {final _that = this; +switch (_that) { +case _CreatePaymentMethodData(): +return $default(_that.type,_that.card,_that.auBecsDebit,_that.fpx,_that.fpxBank,_that.netbankingBank,_that.ideal,_that.idealBank,_that.sepaDebit,_that.sepaDebitIban,_that.upiVpa,_that.billingDetails);case _: + throw StateError('Unexpected subclass'); - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String type, @ElementConverter() Element? card, @JsonKey(name: "au_becs_debit")@ElementConverter() Element? auBecsDebit, @ElementConverter() Element? fpx, @JsonKey(name: "fpx[bank]") String? fpxBank, @JsonKey(name: "netbanking[bank]") String? netbankingBank, @ElementConverter() Element? ideal, @JsonKey(name: "ideal[bank]") String? idealBank, @JsonKey(name: "sepa_debit")@ElementConverter() Element? sepaDebit, @JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban, @JsonKey(name: "upi[vpa]") String? upiVpa, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,) {final _that = this; +switch (_that) { +case _CreatePaymentMethodData() when $default != null: +return $default(_that.type,_that.card,_that.auBecsDebit,_that.fpx,_that.fpxBank,_that.netbankingBank,_that.ideal,_that.idealBank,_that.sepaDebit,_that.sepaDebitIban,_that.upiVpa,_that.billingDetails);case _: + return null; - /// Serializes this CreatePaymentMethodData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} - /// Create a copy of CreatePaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CreatePaymentMethodDataCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $CreatePaymentMethodDataCopyWith<$Res> { - factory $CreatePaymentMethodDataCopyWith(CreatePaymentMethodData value, - $Res Function(CreatePaymentMethodData) then) = - _$CreatePaymentMethodDataCopyWithImpl<$Res, CreatePaymentMethodData>; - @useResult - $Res call( - {String type, - @ElementConverter() Element? card, - @JsonKey(name: "au_becs_debit") @ElementConverter() Element? auBecsDebit, - @ElementConverter() Element? fpx, - @JsonKey(name: "fpx[bank]") String? fpxBank, - @JsonKey(name: "netbanking[bank]") String? netbankingBank, - @ElementConverter() Element? ideal, - @JsonKey(name: "ideal[bank]") String? idealBank, - @JsonKey(name: "sepa_debit") @ElementConverter() Element? sepaDebit, - @JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban, - @JsonKey(name: "upi[vpa]") String? upiVpa, - @JsonKey(name: "billing_details") BillingDetails? billingDetails}); - - $BillingDetailsCopyWith<$Res>? get billingDetails; +@JsonSerializable() + +class _CreatePaymentMethodData implements CreatePaymentMethodData { + const _CreatePaymentMethodData({required this.type, @ElementConverter() this.card, @JsonKey(name: "au_becs_debit")@ElementConverter() this.auBecsDebit, @ElementConverter() this.fpx, @JsonKey(name: "fpx[bank]") this.fpxBank, @JsonKey(name: "netbanking[bank]") this.netbankingBank, @ElementConverter() this.ideal, @JsonKey(name: "ideal[bank]") this.idealBank, @JsonKey(name: "sepa_debit")@ElementConverter() this.sepaDebit, @JsonKey(name: "sepa_debit[iban]") this.sepaDebitIban, @JsonKey(name: "upi[vpa]") this.upiVpa, @JsonKey(name: "billing_details") this.billingDetails}); + factory _CreatePaymentMethodData.fromJson(Map json) => _$CreatePaymentMethodDataFromJson(json); + +/// Unique identifier for the object. +@override final String type; +/// A card or cardNumber Element. +@override@ElementConverter() final Element? card; +/// An auBankAccount Element. +@override@JsonKey(name: "au_becs_debit")@ElementConverter() final Element? auBecsDebit; +/// An fpx Element. +@override@ElementConverter() final Element? fpx; +/// The customer's bank. +@override@JsonKey(name: "fpx[bank]") final String? fpxBank; +/// The customer's bank. +@override@JsonKey(name: "netbanking[bank]") final String? netbankingBank; +/// An idealBank Element. +@override@ElementConverter() final Element? ideal; +/// The customer's bank. +@override@JsonKey(name: "ideal[bank]") final String? idealBank; +/// An iban Element. +@override@JsonKey(name: "sepa_debit")@ElementConverter() final Element? sepaDebit; +/// An IBAN account number. +@override@JsonKey(name: "sepa_debit[iban]") final String? sepaDebitIban; +/// The customer's VPA. +@override@JsonKey(name: "upi[vpa]") final String? upiVpa; +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +@override@JsonKey(name: "billing_details") final BillingDetails? billingDetails; + +/// Create a copy of CreatePaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreatePaymentMethodDataCopyWith<_CreatePaymentMethodData> get copyWith => __$CreatePaymentMethodDataCopyWithImpl<_CreatePaymentMethodData>(this, _$identity); + +@override +Map toJson() { + return _$CreatePaymentMethodDataToJson(this, ); } -/// @nodoc -class _$CreatePaymentMethodDataCopyWithImpl<$Res, - $Val extends CreatePaymentMethodData> - implements $CreatePaymentMethodDataCopyWith<$Res> { - _$CreatePaymentMethodDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CreatePaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? card = freezed, - Object? auBecsDebit = freezed, - Object? fpx = freezed, - Object? fpxBank = freezed, - Object? netbankingBank = freezed, - Object? ideal = freezed, - Object? idealBank = freezed, - Object? sepaDebit = freezed, - Object? sepaDebitIban = freezed, - Object? upiVpa = freezed, - Object? billingDetails = freezed, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as Element?, - auBecsDebit: freezed == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as Element?, - fpx: freezed == fpx - ? _value.fpx - : fpx // ignore: cast_nullable_to_non_nullable - as Element?, - fpxBank: freezed == fpxBank - ? _value.fpxBank - : fpxBank // ignore: cast_nullable_to_non_nullable - as String?, - netbankingBank: freezed == netbankingBank - ? _value.netbankingBank - : netbankingBank // ignore: cast_nullable_to_non_nullable - as String?, - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Element?, - idealBank: freezed == idealBank - ? _value.idealBank - : idealBank // ignore: cast_nullable_to_non_nullable - as String?, - sepaDebit: freezed == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as Element?, - sepaDebitIban: freezed == sepaDebitIban - ? _value.sepaDebitIban - : sepaDebitIban // ignore: cast_nullable_to_non_nullable - as String?, - upiVpa: freezed == upiVpa - ? _value.upiVpa - : upiVpa // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - ) as $Val); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreatePaymentMethodData&&(identical(other.type, type) || other.type == type)&&(identical(other.card, card) || other.card == card)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.fpx, fpx) || other.fpx == fpx)&&(identical(other.fpxBank, fpxBank) || other.fpxBank == fpxBank)&&(identical(other.netbankingBank, netbankingBank) || other.netbankingBank == netbankingBank)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.idealBank, idealBank) || other.idealBank == idealBank)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.sepaDebitIban, sepaDebitIban) || other.sepaDebitIban == sepaDebitIban)&&(identical(other.upiVpa, upiVpa) || other.upiVpa == upiVpa)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - /// Create a copy of CreatePaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,card,auBecsDebit,fpx,fpxBank,netbankingBank,ideal,idealBank,sepaDebit,sepaDebitIban,upiVpa,billingDetails); + +@override +String toString() { + return 'CreatePaymentMethodData(type: $type, card: $card, auBecsDebit: $auBecsDebit, fpx: $fpx, fpxBank: $fpxBank, netbankingBank: $netbankingBank, ideal: $ideal, idealBank: $idealBank, sepaDebit: $sepaDebit, sepaDebitIban: $sepaDebitIban, upiVpa: $upiVpa, billingDetails: $billingDetails)'; } -/// @nodoc -abstract class _$$CreatePaymentMethodDataImplCopyWith<$Res> - implements $CreatePaymentMethodDataCopyWith<$Res> { - factory _$$CreatePaymentMethodDataImplCopyWith( - _$CreatePaymentMethodDataImpl value, - $Res Function(_$CreatePaymentMethodDataImpl) then) = - __$$CreatePaymentMethodDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String type, - @ElementConverter() Element? card, - @JsonKey(name: "au_becs_debit") @ElementConverter() Element? auBecsDebit, - @ElementConverter() Element? fpx, - @JsonKey(name: "fpx[bank]") String? fpxBank, - @JsonKey(name: "netbanking[bank]") String? netbankingBank, - @ElementConverter() Element? ideal, - @JsonKey(name: "ideal[bank]") String? idealBank, - @JsonKey(name: "sepa_debit") @ElementConverter() Element? sepaDebit, - @JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban, - @JsonKey(name: "upi[vpa]") String? upiVpa, - @JsonKey(name: "billing_details") BillingDetails? billingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; + } /// @nodoc -class __$$CreatePaymentMethodDataImplCopyWithImpl<$Res> - extends _$CreatePaymentMethodDataCopyWithImpl<$Res, - _$CreatePaymentMethodDataImpl> - implements _$$CreatePaymentMethodDataImplCopyWith<$Res> { - __$$CreatePaymentMethodDataImplCopyWithImpl( - _$CreatePaymentMethodDataImpl _value, - $Res Function(_$CreatePaymentMethodDataImpl) _then) - : super(_value, _then); - - /// Create a copy of CreatePaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? card = freezed, - Object? auBecsDebit = freezed, - Object? fpx = freezed, - Object? fpxBank = freezed, - Object? netbankingBank = freezed, - Object? ideal = freezed, - Object? idealBank = freezed, - Object? sepaDebit = freezed, - Object? sepaDebitIban = freezed, - Object? upiVpa = freezed, - Object? billingDetails = freezed, - }) { - return _then(_$CreatePaymentMethodDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as Element?, - auBecsDebit: freezed == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as Element?, - fpx: freezed == fpx - ? _value.fpx - : fpx // ignore: cast_nullable_to_non_nullable - as Element?, - fpxBank: freezed == fpxBank - ? _value.fpxBank - : fpxBank // ignore: cast_nullable_to_non_nullable - as String?, - netbankingBank: freezed == netbankingBank - ? _value.netbankingBank - : netbankingBank // ignore: cast_nullable_to_non_nullable - as String?, - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Element?, - idealBank: freezed == idealBank - ? _value.idealBank - : idealBank // ignore: cast_nullable_to_non_nullable - as String?, - sepaDebit: freezed == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as Element?, - sepaDebitIban: freezed == sepaDebitIban - ? _value.sepaDebitIban - : sepaDebitIban // ignore: cast_nullable_to_non_nullable - as String?, - upiVpa: freezed == upiVpa - ? _value.upiVpa - : upiVpa // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } -} +abstract mixin class _$CreatePaymentMethodDataCopyWith<$Res> implements $CreatePaymentMethodDataCopyWith<$Res> { + factory _$CreatePaymentMethodDataCopyWith(_CreatePaymentMethodData value, $Res Function(_CreatePaymentMethodData) _then) = __$CreatePaymentMethodDataCopyWithImpl; +@override @useResult +$Res call({ + String type,@ElementConverter() Element? card,@JsonKey(name: "au_becs_debit")@ElementConverter() Element? auBecsDebit,@ElementConverter() Element? fpx,@JsonKey(name: "fpx[bank]") String? fpxBank,@JsonKey(name: "netbanking[bank]") String? netbankingBank,@ElementConverter() Element? ideal,@JsonKey(name: "ideal[bank]") String? idealBank,@JsonKey(name: "sepa_debit")@ElementConverter() Element? sepaDebit,@JsonKey(name: "sepa_debit[iban]") String? sepaDebitIban,@JsonKey(name: "upi[vpa]") String? upiVpa,@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); + + +@override $BillingDetailsCopyWith<$Res>? get billingDetails; +} /// @nodoc -@JsonSerializable() -class _$CreatePaymentMethodDataImpl implements _CreatePaymentMethodData { - const _$CreatePaymentMethodDataImpl( - {required this.type, - @ElementConverter() this.card, - @JsonKey(name: "au_becs_debit") @ElementConverter() this.auBecsDebit, - @ElementConverter() this.fpx, - @JsonKey(name: "fpx[bank]") this.fpxBank, - @JsonKey(name: "netbanking[bank]") this.netbankingBank, - @ElementConverter() this.ideal, - @JsonKey(name: "ideal[bank]") this.idealBank, - @JsonKey(name: "sepa_debit") @ElementConverter() this.sepaDebit, - @JsonKey(name: "sepa_debit[iban]") this.sepaDebitIban, - @JsonKey(name: "upi[vpa]") this.upiVpa, - @JsonKey(name: "billing_details") this.billingDetails}); - - factory _$CreatePaymentMethodDataImpl.fromJson(Map json) => - _$$CreatePaymentMethodDataImplFromJson(json); - - /// Unique identifier for the object. - @override - final String type; - - /// A card or cardNumber Element. - @override - @ElementConverter() - final Element? card; - - /// An auBankAccount Element. - @override - @JsonKey(name: "au_becs_debit") - @ElementConverter() - final Element? auBecsDebit; - - /// An fpx Element. - @override - @ElementConverter() - final Element? fpx; - - /// The customer's bank. - @override - @JsonKey(name: "fpx[bank]") - final String? fpxBank; - - /// The customer's bank. - @override - @JsonKey(name: "netbanking[bank]") - final String? netbankingBank; - - /// An idealBank Element. - @override - @ElementConverter() - final Element? ideal; - - /// The customer's bank. - @override - @JsonKey(name: "ideal[bank]") - final String? idealBank; - - /// An iban Element. - @override - @JsonKey(name: "sepa_debit") - @ElementConverter() - final Element? sepaDebit; - - /// An IBAN account number. - @override - @JsonKey(name: "sepa_debit[iban]") - final String? sepaDebitIban; - - /// The customer's VPA. - @override - @JsonKey(name: "upi[vpa]") - final String? upiVpa; - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - @override - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails; - - @override - String toString() { - return 'CreatePaymentMethodData(type: $type, card: $card, auBecsDebit: $auBecsDebit, fpx: $fpx, fpxBank: $fpxBank, netbankingBank: $netbankingBank, ideal: $ideal, idealBank: $idealBank, sepaDebit: $sepaDebit, sepaDebitIban: $sepaDebitIban, upiVpa: $upiVpa, billingDetails: $billingDetails)'; - } +class __$CreatePaymentMethodDataCopyWithImpl<$Res> + implements _$CreatePaymentMethodDataCopyWith<$Res> { + __$CreatePaymentMethodDataCopyWithImpl(this._self, this._then); + + final _CreatePaymentMethodData _self; + final $Res Function(_CreatePaymentMethodData) _then; + +/// Create a copy of CreatePaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? card = freezed,Object? auBecsDebit = freezed,Object? fpx = freezed,Object? fpxBank = freezed,Object? netbankingBank = freezed,Object? ideal = freezed,Object? idealBank = freezed,Object? sepaDebit = freezed,Object? sepaDebitIban = freezed,Object? upiVpa = freezed,Object? billingDetails = freezed,}) { + return _then(_CreatePaymentMethodData( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as Element?,auBecsDebit: freezed == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as Element?,fpx: freezed == fpx ? _self.fpx : fpx // ignore: cast_nullable_to_non_nullable +as Element?,fpxBank: freezed == fpxBank ? _self.fpxBank : fpxBank // ignore: cast_nullable_to_non_nullable +as String?,netbankingBank: freezed == netbankingBank ? _self.netbankingBank : netbankingBank // ignore: cast_nullable_to_non_nullable +as String?,ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Element?,idealBank: freezed == idealBank ? _self.idealBank : idealBank // ignore: cast_nullable_to_non_nullable +as String?,sepaDebit: freezed == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as Element?,sepaDebitIban: freezed == sepaDebitIban ? _self.sepaDebitIban : sepaDebitIban // ignore: cast_nullable_to_non_nullable +as String?,upiVpa: freezed == upiVpa ? _self.upiVpa : upiVpa // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreatePaymentMethodDataImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.card, card) || other.card == card) && - (identical(other.auBecsDebit, auBecsDebit) || - other.auBecsDebit == auBecsDebit) && - (identical(other.fpx, fpx) || other.fpx == fpx) && - (identical(other.fpxBank, fpxBank) || other.fpxBank == fpxBank) && - (identical(other.netbankingBank, netbankingBank) || - other.netbankingBank == netbankingBank) && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.idealBank, idealBank) || - other.idealBank == idealBank) && - (identical(other.sepaDebit, sepaDebit) || - other.sepaDebit == sepaDebit) && - (identical(other.sepaDebitIban, sepaDebitIban) || - other.sepaDebitIban == sepaDebitIban) && - (identical(other.upiVpa, upiVpa) || other.upiVpa == upiVpa) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); +/// Create a copy of CreatePaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - type, - card, - auBecsDebit, - fpx, - fpxBank, - netbankingBank, - ideal, - idealBank, - sepaDebit, - sepaDebitIban, - upiVpa, - billingDetails); - - /// Create a copy of CreatePaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreatePaymentMethodDataImplCopyWith<_$CreatePaymentMethodDataImpl> - get copyWith => __$$CreatePaymentMethodDataImplCopyWithImpl< - _$CreatePaymentMethodDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CreatePaymentMethodDataImplToJson( - this, - ); - } + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); } - -abstract class _CreatePaymentMethodData implements CreatePaymentMethodData { - const factory _CreatePaymentMethodData( - {required final String type, - @ElementConverter() final Element? card, - @JsonKey(name: "au_becs_debit") - @ElementConverter() - final Element? auBecsDebit, - @ElementConverter() final Element? fpx, - @JsonKey(name: "fpx[bank]") final String? fpxBank, - @JsonKey(name: "netbanking[bank]") final String? netbankingBank, - @ElementConverter() final Element? ideal, - @JsonKey(name: "ideal[bank]") final String? idealBank, - @JsonKey(name: "sepa_debit") @ElementConverter() final Element? sepaDebit, - @JsonKey(name: "sepa_debit[iban]") final String? sepaDebitIban, - @JsonKey(name: "upi[vpa]") final String? upiVpa, - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails}) = _$CreatePaymentMethodDataImpl; - - factory _CreatePaymentMethodData.fromJson(Map json) = - _$CreatePaymentMethodDataImpl.fromJson; - - /// Unique identifier for the object. - @override - String get type; - - /// A card or cardNumber Element. - @override - @ElementConverter() - Element? get card; - - /// An auBankAccount Element. - @override - @JsonKey(name: "au_becs_debit") - @ElementConverter() - Element? get auBecsDebit; - - /// An fpx Element. - @override - @ElementConverter() - Element? get fpx; - - /// The customer's bank. - @override - @JsonKey(name: "fpx[bank]") - String? get fpxBank; - - /// The customer's bank. - @override - @JsonKey(name: "netbanking[bank]") - String? get netbankingBank; - - /// An idealBank Element. - @override - @ElementConverter() - Element? get ideal; - - /// The customer's bank. - @override - @JsonKey(name: "ideal[bank]") - String? get idealBank; - - /// An iban Element. - @override - @JsonKey(name: "sepa_debit") - @ElementConverter() - Element? get sepaDebit; - - /// An IBAN account number. - @override - @JsonKey(name: "sepa_debit[iban]") - String? get sepaDebitIban; - - /// The customer's VPA. - @override - @JsonKey(name: "upi[vpa]") - String? get upiVpa; - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - @override - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails; - - /// Create a copy of CreatePaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreatePaymentMethodDataImplCopyWith<_$CreatePaymentMethodDataImpl> - get copyWith => throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.g.dart b/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.g.dart index 1d6304ca1..496e21d89 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.g.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/create_payment_method_data.g.dart @@ -6,9 +6,8 @@ part of 'create_payment_method_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CreatePaymentMethodDataImpl _$$CreatePaymentMethodDataImplFromJson( - Map json) => - _$CreatePaymentMethodDataImpl( +_CreatePaymentMethodData _$CreatePaymentMethodDataFromJson(Map json) => + _CreatePaymentMethodData( type: json['type'] as String, card: const ElementConverter().fromJson(json['card']), auBecsDebit: const ElementConverter().fromJson(json['au_becs_debit']), @@ -23,52 +22,43 @@ _$CreatePaymentMethodDataImpl _$$CreatePaymentMethodDataImplFromJson( billingDetails: json['billing_details'] == null ? null : BillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), + Map.from(json['billing_details'] as Map), + ), ); -Map _$$CreatePaymentMethodDataImplToJson( - _$CreatePaymentMethodDataImpl instance) { - final val = { - 'type': instance.type, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'card', - _$JsonConverterToJson( - instance.card, const ElementConverter().toJson)); - writeNotNull( - 'au_becs_debit', - _$JsonConverterToJson( - instance.auBecsDebit, const ElementConverter().toJson)); - writeNotNull( - 'fpx', - _$JsonConverterToJson( - instance.fpx, const ElementConverter().toJson)); - writeNotNull('fpx[bank]', instance.fpxBank); - writeNotNull('netbanking[bank]', instance.netbankingBank); - writeNotNull( - 'ideal', - _$JsonConverterToJson( - instance.ideal, const ElementConverter().toJson)); - writeNotNull('ideal[bank]', instance.idealBank); - writeNotNull( - 'sepa_debit', - _$JsonConverterToJson( - instance.sepaDebit, const ElementConverter().toJson)); - writeNotNull('sepa_debit[iban]', instance.sepaDebitIban); - writeNotNull('upi[vpa]', instance.upiVpa); - writeNotNull('billing_details', instance.billingDetails?.toJson()); - return val; -} +Map _$CreatePaymentMethodDataToJson( + _CreatePaymentMethodData instance, +) => { + 'type': instance.type, + 'card': ?_$JsonConverterToJson( + instance.card, + const ElementConverter().toJson, + ), + 'au_becs_debit': ?_$JsonConverterToJson( + instance.auBecsDebit, + const ElementConverter().toJson, + ), + 'fpx': ?_$JsonConverterToJson( + instance.fpx, + const ElementConverter().toJson, + ), + 'fpx[bank]': ?instance.fpxBank, + 'netbanking[bank]': ?instance.netbankingBank, + 'ideal': ?_$JsonConverterToJson( + instance.ideal, + const ElementConverter().toJson, + ), + 'ideal[bank]': ?instance.idealBank, + 'sepa_debit': ?_$JsonConverterToJson( + instance.sepaDebit, + const ElementConverter().toJson, + ), + 'sepa_debit[iban]': ?instance.sepaDebitIban, + 'upi[vpa]': ?instance.upiVpa, + 'billing_details': ?instance.billingDetails?.toJson(), +}; Json? _$JsonConverterToJson( Value? value, Json? Function(Value value) toJson, -) => - value == null ? null : toJson(value); +) => value == null ? null : toJson(value); diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method.dart index c6704d8ac..55af2849a 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method.dart @@ -12,7 +12,7 @@ part 'payment_method.g.dart'; /// /// https://stripe.com/docs/payments/payment-methods for more info. @freezed -class PaymentMethod with _$PaymentMethod { +abstract class PaymentMethod with _$PaymentMethod { @JsonSerializable(explicitToJson: true) const factory PaymentMethod({ /// Unique identifier for the object. @@ -48,31 +48,21 @@ class PaymentMethod with _$PaymentMethod { CardPaymentMethod? card, /// Containing additional data in case paymentmethod type is sepa. - SepaDebit? sepaDebit, /// Containing additional data in case paymentmethod type is Bacs debit. - BacsDebit? bacsDebit, /// Containing additional data in case paymentmethod type is Aubecs debit. - AuBecsDebit? auBecsDebit, - /// Containing additional data in case paymentmethod type is sofort. - - Sofort? sofort, - /// Containing additional data in case paymentmethod type is Ideal. - Ideal? ideal, /// Containing additional data in case paymentmethod type is FPX. - Fpx? fpx, /// Containing additional data in case paymentmethod type is UPI. - Upi? upi, UsBankAccount? usBankAccount, @@ -88,10 +78,8 @@ class PaymentMethod with _$PaymentMethod { } @freezed - /// AubecsDebit data associated with the payment method - -class AuBecsDebit with _$AuBecsDebit { +abstract class AuBecsDebit with _$AuBecsDebit { @JsonSerializable(explicitToJson: true) const factory AuBecsDebit({ /// Unique identifier for the bankaccount. @@ -109,16 +97,14 @@ class AuBecsDebit with _$AuBecsDebit { } @freezed - /// BacsDebit data associated with the payment method -class BacsDebit with _$BacsDebit { +abstract class BacsDebit with _$BacsDebit { @JsonSerializable(explicitToJson: true) const factory BacsDebit({ /// Sort code of the bankaccount. String? sortCode, /// Unique identifier for the bankaccount. - String? fingerprint, /// Last 4 digits of the bank account. @@ -129,9 +115,8 @@ class BacsDebit with _$BacsDebit { } @freezed - /// Card data associated with the payment method -class CardPaymentMethod with _$CardPaymentMethod { +abstract class CardPaymentMethod with _$CardPaymentMethod { @JsonSerializable(explicitToJson: true) const factory CardPaymentMethod({ /// The brand associated to the card e.g. (visa, amex). @@ -164,7 +149,7 @@ class CardPaymentMethod with _$CardPaymentMethod { } @freezed -class Fpx with _$Fpx { +abstract class Fpx with _$Fpx { /// Fpx data associated with the payment method @JsonSerializable(explicitToJson: true) @@ -180,9 +165,8 @@ class Fpx with _$Fpx { } @freezed - /// Ideal data associated with the payment method -class Ideal with _$Ideal { +abstract class Ideal with _$Ideal { @JsonSerializable(explicitToJson: true) const factory Ideal({ /// The BIC code of the bank @@ -195,10 +179,8 @@ class Ideal with _$Ideal { } @freezed - /// SepaDebit data associated with the payment method - -class SepaDebit with _$SepaDebit { +abstract class SepaDebit with _$SepaDebit { @JsonSerializable(explicitToJson: true) const factory SepaDebit({ /// Two letter ISO code representing the country of the bank account. @@ -219,24 +201,8 @@ class SepaDebit with _$SepaDebit { } @freezed - -/// Sofort data associated with the payment method - -class Sofort with _$Sofort { - @JsonSerializable(explicitToJson: true) - const factory Sofort({ - /// Two letter ISO code representing the country of the bank account. - String? country, - }) = _Sofort; - - factory Sofort.fromJson(Map json) => _$SofortFromJson(json); -} - -@freezed - /// Upi data associated with the payment method. - -class Upi with _$Upi { +abstract class Upi with _$Upi { @JsonSerializable(explicitToJson: true) const factory Upi({ /// The customer's vpa. @@ -259,7 +225,7 @@ enum UsBankAccountHolderType { /// Data associated with the payment method Us bank account. @freezed -class UsBankAccount with _$UsBankAccount { +abstract class UsBankAccount with _$UsBankAccount { @JsonSerializable(explicitToJson: true) const factory UsBankAccount({ /// Routing number of the bank account @@ -294,8 +260,4 @@ class UsBankAccount with _$UsBankAccount { _$UsBankAccountFromJson(json); } -enum UsBankAccountType { - Savings, - Checking, - Unknown, -} +enum UsBankAccountType { Savings, Checking, Unknown } diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method.freezed.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method.freezed.dart index 9dff56802..fc617dece 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,2853 +9,2858 @@ part of 'payment_method.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentMethod _$PaymentMethodFromJson(Map json) { - return _PaymentMethod.fromJson(json); -} - /// @nodoc mixin _$PaymentMethod { - /// Unique identifier for the object. - String get id => throw _privateConstructorUsedError; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - String get object => throw _privateConstructorUsedError; - /// Billing information associated with the PaymentMethod that may be used - /// or required by particular types of payment methods. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +/// Unique identifier for the object. + String get id;/// String representing the object’s type. +/// Objects of the same type share the same value. + String get object;/// Billing information associated with the PaymentMethod that may be used +/// or required by particular types of payment methods. + BillingDetails? get billingDetails;/// The ID of the Customer to which this PaymentMethod is saved. +/// This will not be set when the PaymentMethod has not been saved to a +/// Customer. + String? get customer;/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the object +/// in a structured format. + Map get metadata;/// Has the value true if the object exists in live mode or the value false +/// if the object exists in test mode. + bool get livemode;/// Time at which the object was created. +/// Measured in seconds since the Unix epoch. + int? get created;/// Containing additional data in case paymentmethod type is card. + CardPaymentMethod? get card;/// Containing additional data in case paymentmethod type is sepa. + SepaDebit? get sepaDebit;/// Containing additional data in case paymentmethod type is Bacs debit. + BacsDebit? get bacsDebit;/// Containing additional data in case paymentmethod type is Aubecs debit. + AuBecsDebit? get auBecsDebit;/// Containing additional data in case paymentmethod type is Ideal. + Ideal? get ideal;/// Containing additional data in case paymentmethod type is FPX. + Fpx? get fpx;/// Containing additional data in case paymentmethod type is UPI. + Upi? get upi; UsBankAccount? get usBankAccount;/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name +/// matching this value. +/// It contains additional information specific to the PaymentMethod type. + PaymentMethodType get type; +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith get copyWith => _$PaymentMethodCopyWithImpl(this as PaymentMethod, _$identity); - /// The ID of the Customer to which this PaymentMethod is saved. - /// This will not be set when the PaymentMethod has not been saved to a - /// Customer. - String? get customer => throw _privateConstructorUsedError; + /// Serializes this PaymentMethod to a JSON map. + Map toJson(); - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured format. - Map get metadata => throw _privateConstructorUsedError; - /// Has the value true if the object exists in live mode or the value false - /// if the object exists in test mode. - bool get livemode => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethod&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.customer, customer) || other.customer == customer)&&const DeepCollectionEquality().equals(other.metadata, metadata)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.created, created) || other.created == created)&&(identical(other.card, card) || other.card == card)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.bacsDebit, bacsDebit) || other.bacsDebit == bacsDebit)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.fpx, fpx) || other.fpx == fpx)&&(identical(other.upi, upi) || other.upi == upi)&&(identical(other.usBankAccount, usBankAccount) || other.usBankAccount == usBankAccount)&&(identical(other.type, type) || other.type == type)); +} - /// Time at which the object was created. - /// Measured in seconds since the Unix epoch. - int? get created => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,object,billingDetails,customer,const DeepCollectionEquality().hash(metadata),livemode,created,card,sepaDebit,bacsDebit,auBecsDebit,ideal,fpx,upi,usBankAccount,type); - /// Containing additional data in case paymentmethod type is card. - CardPaymentMethod? get card => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethod(id: $id, object: $object, billingDetails: $billingDetails, customer: $customer, metadata: $metadata, livemode: $livemode, created: $created, card: $card, sepaDebit: $sepaDebit, bacsDebit: $bacsDebit, auBecsDebit: $auBecsDebit, ideal: $ideal, fpx: $fpx, upi: $upi, usBankAccount: $usBankAccount, type: $type)'; +} - /// Containing additional data in case paymentmethod type is sepa. - SepaDebit? get sepaDebit => throw _privateConstructorUsedError; - /// Containing additional data in case paymentmethod type is Bacs debit. - BacsDebit? get bacsDebit => throw _privateConstructorUsedError; +} - /// Containing additional data in case paymentmethod type is Aubecs debit. - AuBecsDebit? get auBecsDebit => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $PaymentMethodCopyWith<$Res> { + factory $PaymentMethodCopyWith(PaymentMethod value, $Res Function(PaymentMethod) _then) = _$PaymentMethodCopyWithImpl; +@useResult +$Res call({ + String id, String object, BillingDetails? billingDetails, String? customer, Map metadata, bool livemode, int? created, CardPaymentMethod? card, SepaDebit? sepaDebit, BacsDebit? bacsDebit, AuBecsDebit? auBecsDebit, Ideal? ideal, Fpx? fpx, Upi? upi, UsBankAccount? usBankAccount, PaymentMethodType type +}); - /// Containing additional data in case paymentmethod type is sofort. - Sofort? get sofort => throw _privateConstructorUsedError; - /// Containing additional data in case paymentmethod type is Ideal. - Ideal? get ideal => throw _privateConstructorUsedError; +$BillingDetailsCopyWith<$Res>? get billingDetails;$CardPaymentMethodCopyWith<$Res>? get card;$SepaDebitCopyWith<$Res>? get sepaDebit;$BacsDebitCopyWith<$Res>? get bacsDebit;$AuBecsDebitCopyWith<$Res>? get auBecsDebit;$IdealCopyWith<$Res>? get ideal;$FpxCopyWith<$Res>? get fpx;$UpiCopyWith<$Res>? get upi;$UsBankAccountCopyWith<$Res>? get usBankAccount; - /// Containing additional data in case paymentmethod type is FPX. - Fpx? get fpx => throw _privateConstructorUsedError; +} +/// @nodoc +class _$PaymentMethodCopyWithImpl<$Res> + implements $PaymentMethodCopyWith<$Res> { + _$PaymentMethodCopyWithImpl(this._self, this._then); + + final PaymentMethod _self; + final $Res Function(PaymentMethod) _then; + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? object = null,Object? billingDetails = freezed,Object? customer = freezed,Object? metadata = null,Object? livemode = null,Object? created = freezed,Object? card = freezed,Object? sepaDebit = freezed,Object? bacsDebit = freezed,Object? auBecsDebit = freezed,Object? ideal = freezed,Object? fpx = freezed,Object? upi = freezed,Object? usBankAccount = freezed,Object? type = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable +as String?,metadata: null == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardPaymentMethod?,sepaDebit: freezed == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as SepaDebit?,bacsDebit: freezed == bacsDebit ? _self.bacsDebit : bacsDebit // ignore: cast_nullable_to_non_nullable +as BacsDebit?,auBecsDebit: freezed == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as AuBecsDebit?,ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Ideal?,fpx: freezed == fpx ? _self.fpx : fpx // ignore: cast_nullable_to_non_nullable +as Fpx?,upi: freezed == upi ? _self.upi : upi // ignore: cast_nullable_to_non_nullable +as Upi?,usBankAccount: freezed == usBankAccount ? _self.usBankAccount : usBankAccount // ignore: cast_nullable_to_non_nullable +as UsBankAccount?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as PaymentMethodType, + )); +} +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardPaymentMethodCopyWith<$Res>? get card { + if (_self.card == null) { + return null; + } + + return $CardPaymentMethodCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitCopyWith<$Res>? get sepaDebit { + if (_self.sepaDebit == null) { + return null; + } + + return $SepaDebitCopyWith<$Res>(_self.sepaDebit!, (value) { + return _then(_self.copyWith(sepaDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BacsDebitCopyWith<$Res>? get bacsDebit { + if (_self.bacsDebit == null) { + return null; + } + + return $BacsDebitCopyWith<$Res>(_self.bacsDebit!, (value) { + return _then(_self.copyWith(bacsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AuBecsDebitCopyWith<$Res>? get auBecsDebit { + if (_self.auBecsDebit == null) { + return null; + } + + return $AuBecsDebitCopyWith<$Res>(_self.auBecsDebit!, (value) { + return _then(_self.copyWith(auBecsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealCopyWith<$Res>? get ideal { + if (_self.ideal == null) { + return null; + } + + return $IdealCopyWith<$Res>(_self.ideal!, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FpxCopyWith<$Res>? get fpx { + if (_self.fpx == null) { + return null; + } + + return $FpxCopyWith<$Res>(_self.fpx!, (value) { + return _then(_self.copyWith(fpx: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UpiCopyWith<$Res>? get upi { + if (_self.upi == null) { + return null; + } + + return $UpiCopyWith<$Res>(_self.upi!, (value) { + return _then(_self.copyWith(upi: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UsBankAccountCopyWith<$Res>? get usBankAccount { + if (_self.usBankAccount == null) { + return null; + } + + return $UsBankAccountCopyWith<$Res>(_self.usBankAccount!, (value) { + return _then(_self.copyWith(usBankAccount: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethod]. +extension PaymentMethodPatterns on PaymentMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethod value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethod value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String object, BillingDetails? billingDetails, String? customer, Map metadata, bool livemode, int? created, CardPaymentMethod? card, SepaDebit? sepaDebit, BacsDebit? bacsDebit, AuBecsDebit? auBecsDebit, Ideal? ideal, Fpx? fpx, Upi? upi, UsBankAccount? usBankAccount, PaymentMethodType type)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that.id,_that.object,_that.billingDetails,_that.customer,_that.metadata,_that.livemode,_that.created,_that.card,_that.sepaDebit,_that.bacsDebit,_that.auBecsDebit,_that.ideal,_that.fpx,_that.upi,_that.usBankAccount,_that.type);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String object, BillingDetails? billingDetails, String? customer, Map metadata, bool livemode, int? created, CardPaymentMethod? card, SepaDebit? sepaDebit, BacsDebit? bacsDebit, AuBecsDebit? auBecsDebit, Ideal? ideal, Fpx? fpx, Upi? upi, UsBankAccount? usBankAccount, PaymentMethodType type) $default,) {final _that = this; +switch (_that) { +case _PaymentMethod(): +return $default(_that.id,_that.object,_that.billingDetails,_that.customer,_that.metadata,_that.livemode,_that.created,_that.card,_that.sepaDebit,_that.bacsDebit,_that.auBecsDebit,_that.ideal,_that.fpx,_that.upi,_that.usBankAccount,_that.type);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String object, BillingDetails? billingDetails, String? customer, Map metadata, bool livemode, int? created, CardPaymentMethod? card, SepaDebit? sepaDebit, BacsDebit? bacsDebit, AuBecsDebit? auBecsDebit, Ideal? ideal, Fpx? fpx, Upi? upi, UsBankAccount? usBankAccount, PaymentMethodType type)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that.id,_that.object,_that.billingDetails,_that.customer,_that.metadata,_that.livemode,_that.created,_that.card,_that.sepaDebit,_that.bacsDebit,_that.auBecsDebit,_that.ideal,_that.fpx,_that.upi,_that.usBankAccount,_that.type);case _: + return null; - /// Containing additional data in case paymentmethod type is UPI. - Upi? get upi => throw _privateConstructorUsedError; - UsBankAccount? get usBankAccount => throw _privateConstructorUsedError; +} +} - /// The type of the PaymentMethod. - /// An additional hash is included on the PaymentMethod with a name - /// matching this value. - /// It contains additional information specific to the PaymentMethod type. - PaymentMethodType get type => throw _privateConstructorUsedError; +} - /// Serializes this PaymentMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// @nodoc - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodCopyWith get copyWith => - throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethod implements PaymentMethod { + const _PaymentMethod({required this.id, this.object = "payment_method", this.billingDetails, this.customer, final Map metadata = const {}, this.livemode = true, this.created, this.card, this.sepaDebit, this.bacsDebit, this.auBecsDebit, this.ideal, this.fpx, this.upi, this.usBankAccount, required this.type}): _metadata = metadata; + factory _PaymentMethod.fromJson(Map json) => _$PaymentMethodFromJson(json); + +/// Unique identifier for the object. +@override final String id; +/// String representing the object’s type. +/// Objects of the same type share the same value. +@override@JsonKey() final String object; +/// Billing information associated with the PaymentMethod that may be used +/// or required by particular types of payment methods. +@override final BillingDetails? billingDetails; +/// The ID of the Customer to which this PaymentMethod is saved. +/// This will not be set when the PaymentMethod has not been saved to a +/// Customer. +@override final String? customer; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the object +/// in a structured format. + final Map _metadata; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the object +/// in a structured format. +@override@JsonKey() Map get metadata { + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_metadata); +} + +/// Has the value true if the object exists in live mode or the value false +/// if the object exists in test mode. +@override@JsonKey() final bool livemode; +/// Time at which the object was created. +/// Measured in seconds since the Unix epoch. +@override final int? created; +/// Containing additional data in case paymentmethod type is card. +@override final CardPaymentMethod? card; +/// Containing additional data in case paymentmethod type is sepa. +@override final SepaDebit? sepaDebit; +/// Containing additional data in case paymentmethod type is Bacs debit. +@override final BacsDebit? bacsDebit; +/// Containing additional data in case paymentmethod type is Aubecs debit. +@override final AuBecsDebit? auBecsDebit; +/// Containing additional data in case paymentmethod type is Ideal. +@override final Ideal? ideal; +/// Containing additional data in case paymentmethod type is FPX. +@override final Fpx? fpx; +/// Containing additional data in case paymentmethod type is UPI. +@override final Upi? upi; +@override final UsBankAccount? usBankAccount; +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name +/// matching this value. +/// It contains additional information specific to the PaymentMethod type. +@override final PaymentMethodType type; + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodCopyWith<_PaymentMethod> get copyWith => __$PaymentMethodCopyWithImpl<_PaymentMethod>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethod&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.customer, customer) || other.customer == customer)&&const DeepCollectionEquality().equals(other._metadata, _metadata)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.created, created) || other.created == created)&&(identical(other.card, card) || other.card == card)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.bacsDebit, bacsDebit) || other.bacsDebit == bacsDebit)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.fpx, fpx) || other.fpx == fpx)&&(identical(other.upi, upi) || other.upi == upi)&&(identical(other.usBankAccount, usBankAccount) || other.usBankAccount == usBankAccount)&&(identical(other.type, type) || other.type == type)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,object,billingDetails,customer,const DeepCollectionEquality().hash(_metadata),livemode,created,card,sepaDebit,bacsDebit,auBecsDebit,ideal,fpx,upi,usBankAccount,type); + +@override +String toString() { + return 'PaymentMethod(id: $id, object: $object, billingDetails: $billingDetails, customer: $customer, metadata: $metadata, livemode: $livemode, created: $created, card: $card, sepaDebit: $sepaDebit, bacsDebit: $bacsDebit, auBecsDebit: $auBecsDebit, ideal: $ideal, fpx: $fpx, upi: $upi, usBankAccount: $usBankAccount, type: $type)'; } -/// @nodoc -abstract class $PaymentMethodCopyWith<$Res> { - factory $PaymentMethodCopyWith( - PaymentMethod value, $Res Function(PaymentMethod) then) = - _$PaymentMethodCopyWithImpl<$Res, PaymentMethod>; - @useResult - $Res call( - {String id, - String object, - BillingDetails? billingDetails, - String? customer, - Map metadata, - bool livemode, - int? created, - CardPaymentMethod? card, - SepaDebit? sepaDebit, - BacsDebit? bacsDebit, - AuBecsDebit? auBecsDebit, - Sofort? sofort, - Ideal? ideal, - Fpx? fpx, - Upi? upi, - UsBankAccount? usBankAccount, - PaymentMethodType type}); - - $BillingDetailsCopyWith<$Res>? get billingDetails; - $CardPaymentMethodCopyWith<$Res>? get card; - $SepaDebitCopyWith<$Res>? get sepaDebit; - $BacsDebitCopyWith<$Res>? get bacsDebit; - $AuBecsDebitCopyWith<$Res>? get auBecsDebit; - $SofortCopyWith<$Res>? get sofort; - $IdealCopyWith<$Res>? get ideal; - $FpxCopyWith<$Res>? get fpx; - $UpiCopyWith<$Res>? get upi; - $UsBankAccountCopyWith<$Res>? get usBankAccount; + } /// @nodoc -class _$PaymentMethodCopyWithImpl<$Res, $Val extends PaymentMethod> - implements $PaymentMethodCopyWith<$Res> { - _$PaymentMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? billingDetails = freezed, - Object? customer = freezed, - Object? metadata = null, - Object? livemode = null, - Object? created = freezed, - Object? card = freezed, - Object? sepaDebit = freezed, - Object? bacsDebit = freezed, - Object? auBecsDebit = freezed, - Object? sofort = freezed, - Object? ideal = freezed, - Object? fpx = freezed, - Object? upi = freezed, - Object? usBankAccount = freezed, - Object? type = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardPaymentMethod?, - sepaDebit: freezed == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as SepaDebit?, - bacsDebit: freezed == bacsDebit - ? _value.bacsDebit - : bacsDebit // ignore: cast_nullable_to_non_nullable - as BacsDebit?, - auBecsDebit: freezed == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as AuBecsDebit?, - sofort: freezed == sofort - ? _value.sofort - : sofort // ignore: cast_nullable_to_non_nullable - as Sofort?, - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Ideal?, - fpx: freezed == fpx - ? _value.fpx - : fpx // ignore: cast_nullable_to_non_nullable - as Fpx?, - upi: freezed == upi - ? _value.upi - : upi // ignore: cast_nullable_to_non_nullable - as Upi?, - usBankAccount: freezed == usBankAccount - ? _value.usBankAccount - : usBankAccount // ignore: cast_nullable_to_non_nullable - as UsBankAccount?, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as PaymentMethodType, - ) as $Val); - } - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +abstract mixin class _$PaymentMethodCopyWith<$Res> implements $PaymentMethodCopyWith<$Res> { + factory _$PaymentMethodCopyWith(_PaymentMethod value, $Res Function(_PaymentMethod) _then) = __$PaymentMethodCopyWithImpl; +@override @useResult +$Res call({ + String id, String object, BillingDetails? billingDetails, String? customer, Map metadata, bool livemode, int? created, CardPaymentMethod? card, SepaDebit? sepaDebit, BacsDebit? bacsDebit, AuBecsDebit? auBecsDebit, Ideal? ideal, Fpx? fpx, Upi? upi, UsBankAccount? usBankAccount, PaymentMethodType type +}); - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardPaymentMethodCopyWith<$Res>? get card { - if (_value.card == null) { - return null; - } - - return $CardPaymentMethodCopyWith<$Res>(_value.card!, (value) { - return _then(_value.copyWith(card: value) as $Val); - }); - } - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SepaDebitCopyWith<$Res>? get sepaDebit { - if (_value.sepaDebit == null) { - return null; - } - - return $SepaDebitCopyWith<$Res>(_value.sepaDebit!, (value) { - return _then(_value.copyWith(sepaDebit: value) as $Val); - }); - } +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $CardPaymentMethodCopyWith<$Res>? get card;@override $SepaDebitCopyWith<$Res>? get sepaDebit;@override $BacsDebitCopyWith<$Res>? get bacsDebit;@override $AuBecsDebitCopyWith<$Res>? get auBecsDebit;@override $IdealCopyWith<$Res>? get ideal;@override $FpxCopyWith<$Res>? get fpx;@override $UpiCopyWith<$Res>? get upi;@override $UsBankAccountCopyWith<$Res>? get usBankAccount; - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BacsDebitCopyWith<$Res>? get bacsDebit { - if (_value.bacsDebit == null) { - return null; - } - - return $BacsDebitCopyWith<$Res>(_value.bacsDebit!, (value) { - return _then(_value.copyWith(bacsDebit: value) as $Val); - }); - } +} +/// @nodoc +class __$PaymentMethodCopyWithImpl<$Res> + implements _$PaymentMethodCopyWith<$Res> { + __$PaymentMethodCopyWithImpl(this._self, this._then); + + final _PaymentMethod _self; + final $Res Function(_PaymentMethod) _then; + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? object = null,Object? billingDetails = freezed,Object? customer = freezed,Object? metadata = null,Object? livemode = null,Object? created = freezed,Object? card = freezed,Object? sepaDebit = freezed,Object? bacsDebit = freezed,Object? auBecsDebit = freezed,Object? ideal = freezed,Object? fpx = freezed,Object? upi = freezed,Object? usBankAccount = freezed,Object? type = null,}) { + return _then(_PaymentMethod( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable +as String?,metadata: null == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardPaymentMethod?,sepaDebit: freezed == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as SepaDebit?,bacsDebit: freezed == bacsDebit ? _self.bacsDebit : bacsDebit // ignore: cast_nullable_to_non_nullable +as BacsDebit?,auBecsDebit: freezed == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as AuBecsDebit?,ideal: freezed == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Ideal?,fpx: freezed == fpx ? _self.fpx : fpx // ignore: cast_nullable_to_non_nullable +as Fpx?,upi: freezed == upi ? _self.upi : upi // ignore: cast_nullable_to_non_nullable +as Upi?,usBankAccount: freezed == usBankAccount ? _self.usBankAccount : usBankAccount // ignore: cast_nullable_to_non_nullable +as UsBankAccount?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as PaymentMethodType, + )); +} + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardPaymentMethodCopyWith<$Res>? get card { + if (_self.card == null) { + return null; + } + + return $CardPaymentMethodCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitCopyWith<$Res>? get sepaDebit { + if (_self.sepaDebit == null) { + return null; + } + + return $SepaDebitCopyWith<$Res>(_self.sepaDebit!, (value) { + return _then(_self.copyWith(sepaDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BacsDebitCopyWith<$Res>? get bacsDebit { + if (_self.bacsDebit == null) { + return null; + } + + return $BacsDebitCopyWith<$Res>(_self.bacsDebit!, (value) { + return _then(_self.copyWith(bacsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AuBecsDebitCopyWith<$Res>? get auBecsDebit { + if (_self.auBecsDebit == null) { + return null; + } + + return $AuBecsDebitCopyWith<$Res>(_self.auBecsDebit!, (value) { + return _then(_self.copyWith(auBecsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealCopyWith<$Res>? get ideal { + if (_self.ideal == null) { + return null; + } + + return $IdealCopyWith<$Res>(_self.ideal!, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FpxCopyWith<$Res>? get fpx { + if (_self.fpx == null) { + return null; + } + + return $FpxCopyWith<$Res>(_self.fpx!, (value) { + return _then(_self.copyWith(fpx: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UpiCopyWith<$Res>? get upi { + if (_self.upi == null) { + return null; + } + + return $UpiCopyWith<$Res>(_self.upi!, (value) { + return _then(_self.copyWith(upi: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UsBankAccountCopyWith<$Res>? get usBankAccount { + if (_self.usBankAccount == null) { + return null; + } + + return $UsBankAccountCopyWith<$Res>(_self.usBankAccount!, (value) { + return _then(_self.copyWith(usBankAccount: value)); + }); +} +} - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AuBecsDebitCopyWith<$Res>? get auBecsDebit { - if (_value.auBecsDebit == null) { - return null; - } - - return $AuBecsDebitCopyWith<$Res>(_value.auBecsDebit!, (value) { - return _then(_value.copyWith(auBecsDebit: value) as $Val); - }); - } - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SofortCopyWith<$Res>? get sofort { - if (_value.sofort == null) { - return null; - } - - return $SofortCopyWith<$Res>(_value.sofort!, (value) { - return _then(_value.copyWith(sofort: value) as $Val); - }); - } +/// @nodoc +mixin _$AuBecsDebit { - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $IdealCopyWith<$Res>? get ideal { - if (_value.ideal == null) { - return null; - } - - return $IdealCopyWith<$Res>(_value.ideal!, (value) { - return _then(_value.copyWith(ideal: value) as $Val); - }); - } +/// Unique identifier for the bankaccount. + String? get fingerprint;/// Last 4 digits of the bankaccount number. + String? get last4;/// Six digit number identifying the bank or branch for this account. + String? get bsbNumber; +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AuBecsDebitCopyWith get copyWith => _$AuBecsDebitCopyWithImpl(this as AuBecsDebit, _$identity); - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $FpxCopyWith<$Res>? get fpx { - if (_value.fpx == null) { - return null; - } - - return $FpxCopyWith<$Res>(_value.fpx!, (value) { - return _then(_value.copyWith(fpx: value) as $Val); - }); - } + /// Serializes this AuBecsDebit to a JSON map. + Map toJson(); - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $UpiCopyWith<$Res>? get upi { - if (_value.upi == null) { - return null; - } - - return $UpiCopyWith<$Res>(_value.upi!, (value) { - return _then(_value.copyWith(upi: value) as $Val); - }); - } - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $UsBankAccountCopyWith<$Res>? get usBankAccount { - if (_value.usBankAccount == null) { - return null; - } - - return $UsBankAccountCopyWith<$Res>(_value.usBankAccount!, (value) { - return _then(_value.copyWith(usBankAccount: value) as $Val); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AuBecsDebit&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.bsbNumber, bsbNumber) || other.bsbNumber == bsbNumber)); } -/// @nodoc -abstract class _$$PaymentMethodImplCopyWith<$Res> - implements $PaymentMethodCopyWith<$Res> { - factory _$$PaymentMethodImplCopyWith( - _$PaymentMethodImpl value, $Res Function(_$PaymentMethodImpl) then) = - __$$PaymentMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String object, - BillingDetails? billingDetails, - String? customer, - Map metadata, - bool livemode, - int? created, - CardPaymentMethod? card, - SepaDebit? sepaDebit, - BacsDebit? bacsDebit, - AuBecsDebit? auBecsDebit, - Sofort? sofort, - Ideal? ideal, - Fpx? fpx, - Upi? upi, - UsBankAccount? usBankAccount, - PaymentMethodType type}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $CardPaymentMethodCopyWith<$Res>? get card; - @override - $SepaDebitCopyWith<$Res>? get sepaDebit; - @override - $BacsDebitCopyWith<$Res>? get bacsDebit; - @override - $AuBecsDebitCopyWith<$Res>? get auBecsDebit; - @override - $SofortCopyWith<$Res>? get sofort; - @override - $IdealCopyWith<$Res>? get ideal; - @override - $FpxCopyWith<$Res>? get fpx; - @override - $UpiCopyWith<$Res>? get upi; - @override - $UsBankAccountCopyWith<$Res>? get usBankAccount; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fingerprint,last4,bsbNumber); + +@override +String toString() { + return 'AuBecsDebit(fingerprint: $fingerprint, last4: $last4, bsbNumber: $bsbNumber)'; } -/// @nodoc -class __$$PaymentMethodImplCopyWithImpl<$Res> - extends _$PaymentMethodCopyWithImpl<$Res, _$PaymentMethodImpl> - implements _$$PaymentMethodImplCopyWith<$Res> { - __$$PaymentMethodImplCopyWithImpl( - _$PaymentMethodImpl _value, $Res Function(_$PaymentMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? billingDetails = freezed, - Object? customer = freezed, - Object? metadata = null, - Object? livemode = null, - Object? created = freezed, - Object? card = freezed, - Object? sepaDebit = freezed, - Object? bacsDebit = freezed, - Object? auBecsDebit = freezed, - Object? sofort = freezed, - Object? ideal = freezed, - Object? fpx = freezed, - Object? upi = freezed, - Object? usBankAccount = freezed, - Object? type = null, - }) { - return _then(_$PaymentMethodImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - metadata: null == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardPaymentMethod?, - sepaDebit: freezed == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as SepaDebit?, - bacsDebit: freezed == bacsDebit - ? _value.bacsDebit - : bacsDebit // ignore: cast_nullable_to_non_nullable - as BacsDebit?, - auBecsDebit: freezed == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as AuBecsDebit?, - sofort: freezed == sofort - ? _value.sofort - : sofort // ignore: cast_nullable_to_non_nullable - as Sofort?, - ideal: freezed == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Ideal?, - fpx: freezed == fpx - ? _value.fpx - : fpx // ignore: cast_nullable_to_non_nullable - as Fpx?, - upi: freezed == upi - ? _value.upi - : upi // ignore: cast_nullable_to_non_nullable - as Upi?, - usBankAccount: freezed == usBankAccount - ? _value.usBankAccount - : usBankAccount // ignore: cast_nullable_to_non_nullable - as UsBankAccount?, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as PaymentMethodType, - )); - } + } /// @nodoc +abstract mixin class $AuBecsDebitCopyWith<$Res> { + factory $AuBecsDebitCopyWith(AuBecsDebit value, $Res Function(AuBecsDebit) _then) = _$AuBecsDebitCopyWithImpl; +@useResult +$Res call({ + String? fingerprint, String? last4, String? bsbNumber +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodImpl implements _PaymentMethod { - const _$PaymentMethodImpl( - {required this.id, - this.object = "payment_method", - this.billingDetails, - this.customer, - final Map metadata = const {}, - this.livemode = true, - this.created, - this.card, - this.sepaDebit, - this.bacsDebit, - this.auBecsDebit, - this.sofort, - this.ideal, - this.fpx, - this.upi, - this.usBankAccount, - required this.type}) - : _metadata = metadata; - - factory _$PaymentMethodImpl.fromJson(Map json) => - _$$PaymentMethodImplFromJson(json); - - /// Unique identifier for the object. - @override - final String id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - @override - @JsonKey() - final String object; - - /// Billing information associated with the PaymentMethod that may be used - /// or required by particular types of payment methods. - @override - final BillingDetails? billingDetails; - - /// The ID of the Customer to which this PaymentMethod is saved. - /// This will not be set when the PaymentMethod has not been saved to a - /// Customer. - @override - final String? customer; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured format. - final Map _metadata; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured format. - @override - @JsonKey() - Map get metadata { - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_metadata); - } - /// Has the value true if the object exists in live mode or the value false - /// if the object exists in test mode. - @override - @JsonKey() - final bool livemode; - - /// Time at which the object was created. - /// Measured in seconds since the Unix epoch. - @override - final int? created; - - /// Containing additional data in case paymentmethod type is card. - @override - final CardPaymentMethod? card; - - /// Containing additional data in case paymentmethod type is sepa. - @override - final SepaDebit? sepaDebit; - - /// Containing additional data in case paymentmethod type is Bacs debit. - @override - final BacsDebit? bacsDebit; - - /// Containing additional data in case paymentmethod type is Aubecs debit. - @override - final AuBecsDebit? auBecsDebit; - - /// Containing additional data in case paymentmethod type is sofort. - @override - final Sofort? sofort; - - /// Containing additional data in case paymentmethod type is Ideal. - @override - final Ideal? ideal; - - /// Containing additional data in case paymentmethod type is FPX. - @override - final Fpx? fpx; - - /// Containing additional data in case paymentmethod type is UPI. - @override - final Upi? upi; - @override - final UsBankAccount? usBankAccount; - - /// The type of the PaymentMethod. - /// An additional hash is included on the PaymentMethod with a name - /// matching this value. - /// It contains additional information specific to the PaymentMethod type. - @override - final PaymentMethodType type; - - @override - String toString() { - return 'PaymentMethod(id: $id, object: $object, billingDetails: $billingDetails, customer: $customer, metadata: $metadata, livemode: $livemode, created: $created, card: $card, sepaDebit: $sepaDebit, bacsDebit: $bacsDebit, auBecsDebit: $auBecsDebit, sofort: $sofort, ideal: $ideal, fpx: $fpx, upi: $upi, usBankAccount: $usBankAccount, type: $type)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.object, object) || other.object == object) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.customer, customer) || - other.customer == customer) && - const DeepCollectionEquality().equals(other._metadata, _metadata) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.created, created) || other.created == created) && - (identical(other.card, card) || other.card == card) && - (identical(other.sepaDebit, sepaDebit) || - other.sepaDebit == sepaDebit) && - (identical(other.bacsDebit, bacsDebit) || - other.bacsDebit == bacsDebit) && - (identical(other.auBecsDebit, auBecsDebit) || - other.auBecsDebit == auBecsDebit) && - (identical(other.sofort, sofort) || other.sofort == sofort) && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.fpx, fpx) || other.fpx == fpx) && - (identical(other.upi, upi) || other.upi == upi) && - (identical(other.usBankAccount, usBankAccount) || - other.usBankAccount == usBankAccount) && - (identical(other.type, type) || other.type == type)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - object, - billingDetails, - customer, - const DeepCollectionEquality().hash(_metadata), - livemode, - created, - card, - sepaDebit, - bacsDebit, - auBecsDebit, - sofort, - ideal, - fpx, - upi, - usBankAccount, - type); - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodImplCopyWith<_$PaymentMethodImpl> get copyWith => - __$$PaymentMethodImplCopyWithImpl<_$PaymentMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodImplToJson( - this, - ); - } +} +/// @nodoc +class _$AuBecsDebitCopyWithImpl<$Res> + implements $AuBecsDebitCopyWith<$Res> { + _$AuBecsDebitCopyWithImpl(this._self, this._then); + + final AuBecsDebit _self; + final $Res Function(AuBecsDebit) _then; + +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fingerprint = freezed,Object? last4 = freezed,Object? bsbNumber = freezed,}) { + return _then(_self.copyWith( +fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,bsbNumber: freezed == bsbNumber ? _self.bsbNumber : bsbNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AuBecsDebit]. +extension AuBecsDebitPatterns on AuBecsDebit { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AuBecsDebit value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AuBecsDebit value) $default,){ +final _that = this; +switch (_that) { +case _AuBecsDebit(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AuBecsDebit value)? $default,){ +final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fingerprint, String? last4, String? bsbNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that.fingerprint,_that.last4,_that.bsbNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fingerprint, String? last4, String? bsbNumber) $default,) {final _that = this; +switch (_that) { +case _AuBecsDebit(): +return $default(_that.fingerprint,_that.last4,_that.bsbNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fingerprint, String? last4, String? bsbNumber)? $default,) {final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that.fingerprint,_that.last4,_that.bsbNumber);case _: + return null; + +} } -abstract class _PaymentMethod implements PaymentMethod { - const factory _PaymentMethod( - {required final String id, - final String object, - final BillingDetails? billingDetails, - final String? customer, - final Map metadata, - final bool livemode, - final int? created, - final CardPaymentMethod? card, - final SepaDebit? sepaDebit, - final BacsDebit? bacsDebit, - final AuBecsDebit? auBecsDebit, - final Sofort? sofort, - final Ideal? ideal, - final Fpx? fpx, - final Upi? upi, - final UsBankAccount? usBankAccount, - required final PaymentMethodType type}) = _$PaymentMethodImpl; - - factory _PaymentMethod.fromJson(Map json) = - _$PaymentMethodImpl.fromJson; - - /// Unique identifier for the object. - @override - String get id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - @override - String get object; - - /// Billing information associated with the PaymentMethod that may be used - /// or required by particular types of payment methods. - @override - BillingDetails? get billingDetails; - - /// The ID of the Customer to which this PaymentMethod is saved. - /// This will not be set when the PaymentMethod has not been saved to a - /// Customer. - @override - String? get customer; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured format. - @override - Map get metadata; - - /// Has the value true if the object exists in live mode or the value false - /// if the object exists in test mode. - @override - bool get livemode; - - /// Time at which the object was created. - /// Measured in seconds since the Unix epoch. - @override - int? get created; - - /// Containing additional data in case paymentmethod type is card. - @override - CardPaymentMethod? get card; - - /// Containing additional data in case paymentmethod type is sepa. - @override - SepaDebit? get sepaDebit; - - /// Containing additional data in case paymentmethod type is Bacs debit. - @override - BacsDebit? get bacsDebit; - - /// Containing additional data in case paymentmethod type is Aubecs debit. - @override - AuBecsDebit? get auBecsDebit; - - /// Containing additional data in case paymentmethod type is sofort. - @override - Sofort? get sofort; - - /// Containing additional data in case paymentmethod type is Ideal. - @override - Ideal? get ideal; - - /// Containing additional data in case paymentmethod type is FPX. - @override - Fpx? get fpx; - - /// Containing additional data in case paymentmethod type is UPI. - @override - Upi? get upi; - @override - UsBankAccount? get usBankAccount; - - /// The type of the PaymentMethod. - /// An additional hash is included on the PaymentMethod with a name - /// matching this value. - /// It contains additional information specific to the PaymentMethod type. - @override - PaymentMethodType get type; - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodImplCopyWith<_$PaymentMethodImpl> get copyWith => - throw _privateConstructorUsedError; -} - -AuBecsDebit _$AuBecsDebitFromJson(Map json) { - return _AuBecsDebit.fromJson(json); } /// @nodoc -mixin _$AuBecsDebit { - /// Unique identifier for the bankaccount. - String? get fingerprint => throw _privateConstructorUsedError; - /// Last 4 digits of the bankaccount number. - String? get last4 => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _AuBecsDebit implements AuBecsDebit { + const _AuBecsDebit({this.fingerprint, this.last4, this.bsbNumber}); + factory _AuBecsDebit.fromJson(Map json) => _$AuBecsDebitFromJson(json); - /// Six digit number identifying the bank or branch for this account. - String? get bsbNumber => throw _privateConstructorUsedError; +/// Unique identifier for the bankaccount. +@override final String? fingerprint; +/// Last 4 digits of the bankaccount number. +@override final String? last4; +/// Six digit number identifying the bank or branch for this account. +@override final String? bsbNumber; - /// Serializes this AuBecsDebit to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AuBecsDebitCopyWith<_AuBecsDebit> get copyWith => __$AuBecsDebitCopyWithImpl<_AuBecsDebit>(this, _$identity); - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AuBecsDebitCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +Map toJson() { + return _$AuBecsDebitToJson(this, ); } -/// @nodoc -abstract class $AuBecsDebitCopyWith<$Res> { - factory $AuBecsDebitCopyWith( - AuBecsDebit value, $Res Function(AuBecsDebit) then) = - _$AuBecsDebitCopyWithImpl<$Res, AuBecsDebit>; - @useResult - $Res call({String? fingerprint, String? last4, String? bsbNumber}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuBecsDebit&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.bsbNumber, bsbNumber) || other.bsbNumber == bsbNumber)); } -/// @nodoc -class _$AuBecsDebitCopyWithImpl<$Res, $Val extends AuBecsDebit> - implements $AuBecsDebitCopyWith<$Res> { - _$AuBecsDebitCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? fingerprint = freezed, - Object? last4 = freezed, - Object? bsbNumber = freezed, - }) { - return _then(_value.copyWith( - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - bsbNumber: freezed == bsbNumber - ? _value.bsbNumber - : bsbNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fingerprint,last4,bsbNumber); -/// @nodoc -abstract class _$$AuBecsDebitImplCopyWith<$Res> - implements $AuBecsDebitCopyWith<$Res> { - factory _$$AuBecsDebitImplCopyWith( - _$AuBecsDebitImpl value, $Res Function(_$AuBecsDebitImpl) then) = - __$$AuBecsDebitImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? fingerprint, String? last4, String? bsbNumber}); +@override +String toString() { + return 'AuBecsDebit(fingerprint: $fingerprint, last4: $last4, bsbNumber: $bsbNumber)'; } -/// @nodoc -class __$$AuBecsDebitImplCopyWithImpl<$Res> - extends _$AuBecsDebitCopyWithImpl<$Res, _$AuBecsDebitImpl> - implements _$$AuBecsDebitImplCopyWith<$Res> { - __$$AuBecsDebitImplCopyWithImpl( - _$AuBecsDebitImpl _value, $Res Function(_$AuBecsDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? fingerprint = freezed, - Object? last4 = freezed, - Object? bsbNumber = freezed, - }) { - return _then(_$AuBecsDebitImpl( - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - bsbNumber: freezed == bsbNumber - ? _value.bsbNumber - : bsbNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc +abstract mixin class _$AuBecsDebitCopyWith<$Res> implements $AuBecsDebitCopyWith<$Res> { + factory _$AuBecsDebitCopyWith(_AuBecsDebit value, $Res Function(_AuBecsDebit) _then) = __$AuBecsDebitCopyWithImpl; +@override @useResult +$Res call({ + String? fingerprint, String? last4, String? bsbNumber +}); -@JsonSerializable(explicitToJson: true) -class _$AuBecsDebitImpl implements _AuBecsDebit { - const _$AuBecsDebitImpl({this.fingerprint, this.last4, this.bsbNumber}); - factory _$AuBecsDebitImpl.fromJson(Map json) => - _$$AuBecsDebitImplFromJson(json); - /// Unique identifier for the bankaccount. - @override - final String? fingerprint; - /// Last 4 digits of the bankaccount number. - @override - final String? last4; +} +/// @nodoc +class __$AuBecsDebitCopyWithImpl<$Res> + implements _$AuBecsDebitCopyWith<$Res> { + __$AuBecsDebitCopyWithImpl(this._self, this._then); - /// Six digit number identifying the bank or branch for this account. - @override - final String? bsbNumber; + final _AuBecsDebit _self; + final $Res Function(_AuBecsDebit) _then; - @override - String toString() { - return 'AuBecsDebit(fingerprint: $fingerprint, last4: $last4, bsbNumber: $bsbNumber)'; - } +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fingerprint = freezed,Object? last4 = freezed,Object? bsbNumber = freezed,}) { + return _then(_AuBecsDebit( +fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,bsbNumber: freezed == bsbNumber ? _self.bsbNumber : bsbNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AuBecsDebitImpl && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.bsbNumber, bsbNumber) || - other.bsbNumber == bsbNumber)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, fingerprint, last4, bsbNumber); - - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AuBecsDebitImplCopyWith<_$AuBecsDebitImpl> get copyWith => - __$$AuBecsDebitImplCopyWithImpl<_$AuBecsDebitImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AuBecsDebitImplToJson( - this, - ); - } } -abstract class _AuBecsDebit implements AuBecsDebit { - const factory _AuBecsDebit( - {final String? fingerprint, - final String? last4, - final String? bsbNumber}) = _$AuBecsDebitImpl; - factory _AuBecsDebit.fromJson(Map json) = - _$AuBecsDebitImpl.fromJson; +/// @nodoc +mixin _$BacsDebit { - /// Unique identifier for the bankaccount. - @override - String? get fingerprint; +/// Sort code of the bankaccount. + String? get sortCode;/// Unique identifier for the bankaccount. + String? get fingerprint;/// Last 4 digits of the bank account. + String? get last4; +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BacsDebitCopyWith get copyWith => _$BacsDebitCopyWithImpl(this as BacsDebit, _$identity); - /// Last 4 digits of the bankaccount number. - @override - String? get last4; + /// Serializes this BacsDebit to a JSON map. + Map toJson(); - /// Six digit number identifying the bank or branch for this account. - @override - String? get bsbNumber; - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AuBecsDebitImplCopyWith<_$AuBecsDebitImpl> get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BacsDebit&&(identical(other.sortCode, sortCode) || other.sortCode == sortCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); } -BacsDebit _$BacsDebitFromJson(Map json) { - return _BacsDebit.fromJson(json); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sortCode,fingerprint,last4); + +@override +String toString() { + return 'BacsDebit(sortCode: $sortCode, fingerprint: $fingerprint, last4: $last4)'; } -/// @nodoc -mixin _$BacsDebit { - /// Sort code of the bankaccount. - String? get sortCode => throw _privateConstructorUsedError; - /// Unique identifier for the bankaccount. - String? get fingerprint => throw _privateConstructorUsedError; +} - /// Last 4 digits of the bank account. - String? get last4 => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $BacsDebitCopyWith<$Res> { + factory $BacsDebitCopyWith(BacsDebit value, $Res Function(BacsDebit) _then) = _$BacsDebitCopyWithImpl; +@useResult +$Res call({ + String? sortCode, String? fingerprint, String? last4 +}); - /// Serializes this BacsDebit to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BacsDebitCopyWith get copyWith => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $BacsDebitCopyWith<$Res> { - factory $BacsDebitCopyWith(BacsDebit value, $Res Function(BacsDebit) then) = - _$BacsDebitCopyWithImpl<$Res, BacsDebit>; - @useResult - $Res call({String? sortCode, String? fingerprint, String? last4}); -} -/// @nodoc -class _$BacsDebitCopyWithImpl<$Res, $Val extends BacsDebit> - implements $BacsDebitCopyWith<$Res> { - _$BacsDebitCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sortCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_value.copyWith( - sortCode: freezed == sortCode - ? _value.sortCode - : sortCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } } - /// @nodoc -abstract class _$$BacsDebitImplCopyWith<$Res> +class _$BacsDebitCopyWithImpl<$Res> implements $BacsDebitCopyWith<$Res> { - factory _$$BacsDebitImplCopyWith( - _$BacsDebitImpl value, $Res Function(_$BacsDebitImpl) then) = - __$$BacsDebitImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? sortCode, String? fingerprint, String? last4}); + _$BacsDebitCopyWithImpl(this._self, this._then); + + final BacsDebit _self; + final $Res Function(BacsDebit) _then; + +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? sortCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_self.copyWith( +sortCode: freezed == sortCode ? _self.sortCode : sortCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BacsDebit]. +extension BacsDebitPatterns on BacsDebit { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BacsDebit value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BacsDebit value) $default,){ +final _that = this; +switch (_that) { +case _BacsDebit(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BacsDebit value)? $default,){ +final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? sortCode, String? fingerprint, String? last4)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that.sortCode,_that.fingerprint,_that.last4);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? sortCode, String? fingerprint, String? last4) $default,) {final _that = this; +switch (_that) { +case _BacsDebit(): +return $default(_that.sortCode,_that.fingerprint,_that.last4);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? sortCode, String? fingerprint, String? last4)? $default,) {final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that.sortCode,_that.fingerprint,_that.last4);case _: + return null; + +} } -/// @nodoc -class __$$BacsDebitImplCopyWithImpl<$Res> - extends _$BacsDebitCopyWithImpl<$Res, _$BacsDebitImpl> - implements _$$BacsDebitImplCopyWith<$Res> { - __$$BacsDebitImplCopyWithImpl( - _$BacsDebitImpl _value, $Res Function(_$BacsDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sortCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_$BacsDebitImpl( - sortCode: freezed == sortCode - ? _value.sortCode - : sortCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$BacsDebitImpl implements _BacsDebit { - const _$BacsDebitImpl({this.sortCode, this.fingerprint, this.last4}); +class _BacsDebit implements BacsDebit { + const _BacsDebit({this.sortCode, this.fingerprint, this.last4}); + factory _BacsDebit.fromJson(Map json) => _$BacsDebitFromJson(json); - factory _$BacsDebitImpl.fromJson(Map json) => - _$$BacsDebitImplFromJson(json); +/// Sort code of the bankaccount. +@override final String? sortCode; +/// Unique identifier for the bankaccount. +@override final String? fingerprint; +/// Last 4 digits of the bank account. +@override final String? last4; - /// Sort code of the bankaccount. - @override - final String? sortCode; +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BacsDebitCopyWith<_BacsDebit> get copyWith => __$BacsDebitCopyWithImpl<_BacsDebit>(this, _$identity); - /// Unique identifier for the bankaccount. - @override - final String? fingerprint; +@override +Map toJson() { + return _$BacsDebitToJson(this, ); +} - /// Last 4 digits of the bank account. - @override - final String? last4; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BacsDebit&&(identical(other.sortCode, sortCode) || other.sortCode == sortCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} - @override - String toString() { - return 'BacsDebit(sortCode: $sortCode, fingerprint: $fingerprint, last4: $last4)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sortCode,fingerprint,last4); + +@override +String toString() { + return 'BacsDebit(sortCode: $sortCode, fingerprint: $fingerprint, last4: $last4)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BacsDebitImpl && - (identical(other.sortCode, sortCode) || - other.sortCode == sortCode) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, sortCode, fingerprint, last4); - - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BacsDebitImplCopyWith<_$BacsDebitImpl> get copyWith => - __$$BacsDebitImplCopyWithImpl<_$BacsDebitImpl>(this, _$identity); - - @override - Map toJson() { - return _$$BacsDebitImplToJson( - this, - ); - } } -abstract class _BacsDebit implements BacsDebit { - const factory _BacsDebit( - {final String? sortCode, - final String? fingerprint, - final String? last4}) = _$BacsDebitImpl; +/// @nodoc +abstract mixin class _$BacsDebitCopyWith<$Res> implements $BacsDebitCopyWith<$Res> { + factory _$BacsDebitCopyWith(_BacsDebit value, $Res Function(_BacsDebit) _then) = __$BacsDebitCopyWithImpl; +@override @useResult +$Res call({ + String? sortCode, String? fingerprint, String? last4 +}); + - factory _BacsDebit.fromJson(Map json) = - _$BacsDebitImpl.fromJson; - /// Sort code of the bankaccount. - @override - String? get sortCode; - /// Unique identifier for the bankaccount. - @override - String? get fingerprint; +} +/// @nodoc +class __$BacsDebitCopyWithImpl<$Res> + implements _$BacsDebitCopyWith<$Res> { + __$BacsDebitCopyWithImpl(this._self, this._then); - /// Last 4 digits of the bank account. - @override - String? get last4; + final _BacsDebit _self; + final $Res Function(_BacsDebit) _then; - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BacsDebitImplCopyWith<_$BacsDebitImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? sortCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_BacsDebit( +sortCode: freezed == sortCode ? _self.sortCode : sortCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); } -CardPaymentMethod _$CardPaymentMethodFromJson(Map json) { - return _CardPaymentMethod.fromJson(json); + } + /// @nodoc mixin _$CardPaymentMethod { - /// The brand associated to the card e.g. (visa, amex). - String? get brand => throw _privateConstructorUsedError; - /// Two letter iso code. - String? get country => throw _privateConstructorUsedError; +/// The brand associated to the card e.g. (visa, amex). + String? get brand;/// Two letter iso code. + String? get country;/// four digit number representing the year of expiry of the card. + int? get expYear;/// two digit number representing the month of expire of the card. + int? get expMonth;/// card funding type e.g. (credit, debit). + String? get funding;/// last four digits of the card. + String? get last4;/// The preffered card brand for payment + String? get preferredNetwork;/// The available networks the card can run. + List? get availableNetworks; +/// Create a copy of CardPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardPaymentMethodCopyWith get copyWith => _$CardPaymentMethodCopyWithImpl(this as CardPaymentMethod, _$identity); - /// four digit number representing the year of expiry of the card. - int? get expYear => throw _privateConstructorUsedError; - - /// two digit number representing the month of expire of the card. - int? get expMonth => throw _privateConstructorUsedError; + /// Serializes this CardPaymentMethod to a JSON map. + Map toJson(); - /// card funding type e.g. (credit, debit). - String? get funding => throw _privateConstructorUsedError; - /// last four digits of the card. - String? get last4 => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardPaymentMethod&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork)&&const DeepCollectionEquality().equals(other.availableNetworks, availableNetworks)); +} - /// The preffered card brand for payment - String? get preferredNetwork => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,brand,country,expYear,expMonth,funding,last4,preferredNetwork,const DeepCollectionEquality().hash(availableNetworks)); - /// The available networks the card can run. - List? get availableNetworks => throw _privateConstructorUsedError; +@override +String toString() { + return 'CardPaymentMethod(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks)'; +} - /// Serializes this CardPaymentMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of CardPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardPaymentMethodCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $CardPaymentMethodCopyWith<$Res> { - factory $CardPaymentMethodCopyWith( - CardPaymentMethod value, $Res Function(CardPaymentMethod) then) = - _$CardPaymentMethodCopyWithImpl<$Res, CardPaymentMethod>; - @useResult - $Res call( - {String? brand, - String? country, - int? expYear, - int? expMonth, - String? funding, - String? last4, - String? preferredNetwork, - List? availableNetworks}); -} +abstract mixin class $CardPaymentMethodCopyWith<$Res> { + factory $CardPaymentMethodCopyWith(CardPaymentMethod value, $Res Function(CardPaymentMethod) _then) = _$CardPaymentMethodCopyWithImpl; +@useResult +$Res call({ + String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks +}); -/// @nodoc -class _$CardPaymentMethodCopyWithImpl<$Res, $Val extends CardPaymentMethod> - implements $CardPaymentMethodCopyWith<$Res> { - _$CardPaymentMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? brand = freezed, - Object? country = freezed, - Object? expYear = freezed, - Object? expMonth = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? preferredNetwork = freezed, - Object? availableNetworks = freezed, - }) { - return _then(_value.copyWith( - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetwork: freezed == preferredNetwork - ? _value.preferredNetwork - : preferredNetwork // ignore: cast_nullable_to_non_nullable - as String?, - availableNetworks: freezed == availableNetworks - ? _value.availableNetworks - : availableNetworks // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); - } -} + + +} /// @nodoc -abstract class _$$CardPaymentMethodImplCopyWith<$Res> +class _$CardPaymentMethodCopyWithImpl<$Res> implements $CardPaymentMethodCopyWith<$Res> { - factory _$$CardPaymentMethodImplCopyWith(_$CardPaymentMethodImpl value, - $Res Function(_$CardPaymentMethodImpl) then) = - __$$CardPaymentMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? brand, - String? country, - int? expYear, - int? expMonth, - String? funding, - String? last4, - String? preferredNetwork, - List? availableNetworks}); + _$CardPaymentMethodCopyWithImpl(this._self, this._then); + + final CardPaymentMethod _self; + final $Res Function(CardPaymentMethod) _then; + +/// Create a copy of CardPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? brand = freezed,Object? country = freezed,Object? expYear = freezed,Object? expMonth = freezed,Object? funding = freezed,Object? last4 = freezed,Object? preferredNetwork = freezed,Object? availableNetworks = freezed,}) { + return _then(_self.copyWith( +brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,preferredNetwork: freezed == preferredNetwork ? _self.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable +as String?,availableNetworks: freezed == availableNetworks ? _self.availableNetworks : availableNetworks // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardPaymentMethod]. +extension CardPaymentMethodPatterns on CardPaymentMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardPaymentMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardPaymentMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardPaymentMethod value) $default,){ +final _that = this; +switch (_that) { +case _CardPaymentMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardPaymentMethod value)? $default,){ +final _that = this; +switch (_that) { +case _CardPaymentMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardPaymentMethod() when $default != null: +return $default(_that.brand,_that.country,_that.expYear,_that.expMonth,_that.funding,_that.last4,_that.preferredNetwork,_that.availableNetworks);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks) $default,) {final _that = this; +switch (_that) { +case _CardPaymentMethod(): +return $default(_that.brand,_that.country,_that.expYear,_that.expMonth,_that.funding,_that.last4,_that.preferredNetwork,_that.availableNetworks);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks)? $default,) {final _that = this; +switch (_that) { +case _CardPaymentMethod() when $default != null: +return $default(_that.brand,_that.country,_that.expYear,_that.expMonth,_that.funding,_that.last4,_that.preferredNetwork,_that.availableNetworks);case _: + return null; + +} } -/// @nodoc -class __$$CardPaymentMethodImplCopyWithImpl<$Res> - extends _$CardPaymentMethodCopyWithImpl<$Res, _$CardPaymentMethodImpl> - implements _$$CardPaymentMethodImplCopyWith<$Res> { - __$$CardPaymentMethodImplCopyWithImpl(_$CardPaymentMethodImpl _value, - $Res Function(_$CardPaymentMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of CardPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? brand = freezed, - Object? country = freezed, - Object? expYear = freezed, - Object? expMonth = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? preferredNetwork = freezed, - Object? availableNetworks = freezed, - }) { - return _then(_$CardPaymentMethodImpl( - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetwork: freezed == preferredNetwork - ? _value.preferredNetwork - : preferredNetwork // ignore: cast_nullable_to_non_nullable - as String?, - availableNetworks: freezed == availableNetworks - ? _value._availableNetworks - : availableNetworks // ignore: cast_nullable_to_non_nullable - as List?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardPaymentMethodImpl implements _CardPaymentMethod { - const _$CardPaymentMethodImpl( - {this.brand, - this.country, - this.expYear, - this.expMonth, - this.funding, - this.last4, - this.preferredNetwork, - final List? availableNetworks}) - : _availableNetworks = availableNetworks; - - factory _$CardPaymentMethodImpl.fromJson(Map json) => - _$$CardPaymentMethodImplFromJson(json); - - /// The brand associated to the card e.g. (visa, amex). - @override - final String? brand; - - /// Two letter iso code. - @override - final String? country; - - /// four digit number representing the year of expiry of the card. - @override - final int? expYear; - - /// two digit number representing the month of expire of the card. - @override - final int? expMonth; - - /// card funding type e.g. (credit, debit). - @override - final String? funding; - - /// last four digits of the card. - @override - final String? last4; - - /// The preffered card brand for payment - @override - final String? preferredNetwork; - - /// The available networks the card can run. - final List? _availableNetworks; - - /// The available networks the card can run. - @override - List? get availableNetworks { - final value = _availableNetworks; - if (value == null) return null; - if (_availableNetworks is EqualUnmodifiableListView) - return _availableNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _CardPaymentMethod implements CardPaymentMethod { + const _CardPaymentMethod({this.brand, this.country, this.expYear, this.expMonth, this.funding, this.last4, this.preferredNetwork, final List? availableNetworks}): _availableNetworks = availableNetworks; + factory _CardPaymentMethod.fromJson(Map json) => _$CardPaymentMethodFromJson(json); - @override - String toString() { - return 'CardPaymentMethod(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks)'; - } +/// The brand associated to the card e.g. (visa, amex). +@override final String? brand; +/// Two letter iso code. +@override final String? country; +/// four digit number representing the year of expiry of the card. +@override final int? expYear; +/// two digit number representing the month of expire of the card. +@override final int? expMonth; +/// card funding type e.g. (credit, debit). +@override final String? funding; +/// last four digits of the card. +@override final String? last4; +/// The preffered card brand for payment +@override final String? preferredNetwork; +/// The available networks the card can run. + final List? _availableNetworks; +/// The available networks the card can run. +@override List? get availableNetworks { + final value = _availableNetworks; + if (value == null) return null; + if (_availableNetworks is EqualUnmodifiableListView) return _availableNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardPaymentMethodImpl && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.country, country) || other.country == country) && - (identical(other.expYear, expYear) || other.expYear == expYear) && - (identical(other.expMonth, expMonth) || - other.expMonth == expMonth) && - (identical(other.funding, funding) || other.funding == funding) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.preferredNetwork, preferredNetwork) || - other.preferredNetwork == preferredNetwork) && - const DeepCollectionEquality() - .equals(other._availableNetworks, _availableNetworks)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - brand, - country, - expYear, - expMonth, - funding, - last4, - preferredNetwork, - const DeepCollectionEquality().hash(_availableNetworks)); - - /// Create a copy of CardPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardPaymentMethodImplCopyWith<_$CardPaymentMethodImpl> get copyWith => - __$$CardPaymentMethodImplCopyWithImpl<_$CardPaymentMethodImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CardPaymentMethodImplToJson( - this, - ); - } +/// Create a copy of CardPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardPaymentMethodCopyWith<_CardPaymentMethod> get copyWith => __$CardPaymentMethodCopyWithImpl<_CardPaymentMethod>(this, _$identity); + +@override +Map toJson() { + return _$CardPaymentMethodToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardPaymentMethod&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork)&&const DeepCollectionEquality().equals(other._availableNetworks, _availableNetworks)); } -abstract class _CardPaymentMethod implements CardPaymentMethod { - const factory _CardPaymentMethod( - {final String? brand, - final String? country, - final int? expYear, - final int? expMonth, - final String? funding, - final String? last4, - final String? preferredNetwork, - final List? availableNetworks}) = _$CardPaymentMethodImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,brand,country,expYear,expMonth,funding,last4,preferredNetwork,const DeepCollectionEquality().hash(_availableNetworks)); - factory _CardPaymentMethod.fromJson(Map json) = - _$CardPaymentMethodImpl.fromJson; +@override +String toString() { + return 'CardPaymentMethod(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks)'; +} - /// The brand associated to the card e.g. (visa, amex). - @override - String? get brand; - /// Two letter iso code. - @override - String? get country; +} - /// four digit number representing the year of expiry of the card. - @override - int? get expYear; +/// @nodoc +abstract mixin class _$CardPaymentMethodCopyWith<$Res> implements $CardPaymentMethodCopyWith<$Res> { + factory _$CardPaymentMethodCopyWith(_CardPaymentMethod value, $Res Function(_CardPaymentMethod) _then) = __$CardPaymentMethodCopyWithImpl; +@override @useResult +$Res call({ + String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks +}); - /// two digit number representing the month of expire of the card. - @override - int? get expMonth; - /// card funding type e.g. (credit, debit). - @override - String? get funding; - /// last four digits of the card. - @override - String? get last4; - /// The preffered card brand for payment - @override - String? get preferredNetwork; +} +/// @nodoc +class __$CardPaymentMethodCopyWithImpl<$Res> + implements _$CardPaymentMethodCopyWith<$Res> { + __$CardPaymentMethodCopyWithImpl(this._self, this._then); - /// The available networks the card can run. - @override - List? get availableNetworks; + final _CardPaymentMethod _self; + final $Res Function(_CardPaymentMethod) _then; - /// Create a copy of CardPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardPaymentMethodImplCopyWith<_$CardPaymentMethodImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of CardPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? brand = freezed,Object? country = freezed,Object? expYear = freezed,Object? expMonth = freezed,Object? funding = freezed,Object? last4 = freezed,Object? preferredNetwork = freezed,Object? availableNetworks = freezed,}) { + return _then(_CardPaymentMethod( +brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,preferredNetwork: freezed == preferredNetwork ? _self.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable +as String?,availableNetworks: freezed == availableNetworks ? _self._availableNetworks : availableNetworks // ignore: cast_nullable_to_non_nullable +as List?, + )); } -Fpx _$FpxFromJson(Map json) { - return _Fpx.fromJson(json); + } + /// @nodoc mixin _$Fpx { - /// the customer bank - String? get bank => throw _privateConstructorUsedError; - /// accountholder type - String? get accountHolderType => throw _privateConstructorUsedError; +/// the customer bank + String? get bank;/// accountholder type + String? get accountHolderType; +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FpxCopyWith get copyWith => _$FpxCopyWithImpl(this as Fpx, _$identity); /// Serializes this Fpx to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FpxCopyWith get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Fpx&&(identical(other.bank, bank) || other.bank == bank)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)); } -/// @nodoc -abstract class $FpxCopyWith<$Res> { - factory $FpxCopyWith(Fpx value, $Res Function(Fpx) then) = - _$FpxCopyWithImpl<$Res, Fpx>; - @useResult - $Res call({String? bank, String? accountHolderType}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank,accountHolderType); + +@override +String toString() { + return 'Fpx(bank: $bank, accountHolderType: $accountHolderType)'; } -/// @nodoc -class _$FpxCopyWithImpl<$Res, $Val extends Fpx> implements $FpxCopyWith<$Res> { - _$FpxCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - Object? accountHolderType = freezed, - }) { - return _then(_value.copyWith( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$FpxImplCopyWith<$Res> implements $FpxCopyWith<$Res> { - factory _$$FpxImplCopyWith(_$FpxImpl value, $Res Function(_$FpxImpl) then) = - __$$FpxImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? bank, String? accountHolderType}); -} +abstract mixin class $FpxCopyWith<$Res> { + factory $FpxCopyWith(Fpx value, $Res Function(Fpx) _then) = _$FpxCopyWithImpl; +@useResult +$Res call({ + String? bank, String? accountHolderType +}); + + + +} /// @nodoc -class __$$FpxImplCopyWithImpl<$Res> extends _$FpxCopyWithImpl<$Res, _$FpxImpl> - implements _$$FpxImplCopyWith<$Res> { - __$$FpxImplCopyWithImpl(_$FpxImpl _value, $Res Function(_$FpxImpl) _then) - : super(_value, _then); - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - Object? accountHolderType = freezed, - }) { - return _then(_$FpxImpl( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class _$FpxCopyWithImpl<$Res> + implements $FpxCopyWith<$Res> { + _$FpxCopyWithImpl(this._self, this._then); + + final Fpx _self; + final $Res Function(Fpx) _then; + +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bank = freezed,Object? accountHolderType = freezed,}) { + return _then(_self.copyWith( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Fpx]. +extension FpxPatterns on Fpx { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Fpx value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Fpx value) $default,){ +final _that = this; +switch (_that) { +case _Fpx(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Fpx value)? $default,){ +final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bank, String? accountHolderType)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that.bank,_that.accountHolderType);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bank, String? accountHolderType) $default,) {final _that = this; +switch (_that) { +case _Fpx(): +return $default(_that.bank,_that.accountHolderType);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bank, String? accountHolderType)? $default,) {final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that.bank,_that.accountHolderType);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FpxImpl implements _Fpx { - const _$FpxImpl({this.bank, this.accountHolderType}); +class _Fpx implements Fpx { + const _Fpx({this.bank, this.accountHolderType}); + factory _Fpx.fromJson(Map json) => _$FpxFromJson(json); - factory _$FpxImpl.fromJson(Map json) => - _$$FpxImplFromJson(json); +/// the customer bank +@override final String? bank; +/// accountholder type +@override final String? accountHolderType; - /// the customer bank - @override - final String? bank; +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FpxCopyWith<_Fpx> get copyWith => __$FpxCopyWithImpl<_Fpx>(this, _$identity); - /// accountholder type - @override - final String? accountHolderType; +@override +Map toJson() { + return _$FpxToJson(this, ); +} - @override - String toString() { - return 'Fpx(bank: $bank, accountHolderType: $accountHolderType)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Fpx&&(identical(other.bank, bank) || other.bank == bank)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank,accountHolderType); + +@override +String toString() { + return 'Fpx(bank: $bank, accountHolderType: $accountHolderType)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FpxImpl && - (identical(other.bank, bank) || other.bank == bank) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, bank, accountHolderType); - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FpxImplCopyWith<_$FpxImpl> get copyWith => - __$$FpxImplCopyWithImpl<_$FpxImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FpxImplToJson( - this, - ); - } } -abstract class _Fpx implements Fpx { - const factory _Fpx({final String? bank, final String? accountHolderType}) = - _$FpxImpl; +/// @nodoc +abstract mixin class _$FpxCopyWith<$Res> implements $FpxCopyWith<$Res> { + factory _$FpxCopyWith(_Fpx value, $Res Function(_Fpx) _then) = __$FpxCopyWithImpl; +@override @useResult +$Res call({ + String? bank, String? accountHolderType +}); + - factory _Fpx.fromJson(Map json) = _$FpxImpl.fromJson; - /// the customer bank - @override - String? get bank; - /// accountholder type - @override - String? get accountHolderType; +} +/// @nodoc +class __$FpxCopyWithImpl<$Res> + implements _$FpxCopyWith<$Res> { + __$FpxCopyWithImpl(this._self, this._then); + + final _Fpx _self; + final $Res Function(_Fpx) _then; - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FpxImplCopyWith<_$FpxImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bank = freezed,Object? accountHolderType = freezed,}) { + return _then(_Fpx( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as String?, + )); } -Ideal _$IdealFromJson(Map json) { - return _Ideal.fromJson(json); + } + /// @nodoc mixin _$Ideal { - /// The BIC code of the bank - String? get bankIdentifierCode => throw _privateConstructorUsedError; - /// The bank of the customer - String? get bank => throw _privateConstructorUsedError; +/// The BIC code of the bank + String? get bankIdentifierCode;/// The bank of the customer + String? get bank; +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IdealCopyWith get copyWith => _$IdealCopyWithImpl(this as Ideal, _$identity); /// Serializes this Ideal to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IdealCopyWith get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Ideal&&(identical(other.bankIdentifierCode, bankIdentifierCode) || other.bankIdentifierCode == bankIdentifierCode)&&(identical(other.bank, bank) || other.bank == bank)); } -/// @nodoc -abstract class $IdealCopyWith<$Res> { - factory $IdealCopyWith(Ideal value, $Res Function(Ideal) then) = - _$IdealCopyWithImpl<$Res, Ideal>; - @useResult - $Res call({String? bankIdentifierCode, String? bank}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankIdentifierCode,bank); + +@override +String toString() { + return 'Ideal(bankIdentifierCode: $bankIdentifierCode, bank: $bank)'; } -/// @nodoc -class _$IdealCopyWithImpl<$Res, $Val extends Ideal> - implements $IdealCopyWith<$Res> { - _$IdealCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankIdentifierCode = freezed, - Object? bank = freezed, - }) { - return _then(_value.copyWith( - bankIdentifierCode: freezed == bankIdentifierCode - ? _value.bankIdentifierCode - : bankIdentifierCode // ignore: cast_nullable_to_non_nullable - as String?, - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$IdealImplCopyWith<$Res> implements $IdealCopyWith<$Res> { - factory _$$IdealImplCopyWith( - _$IdealImpl value, $Res Function(_$IdealImpl) then) = - __$$IdealImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? bankIdentifierCode, String? bank}); -} +abstract mixin class $IdealCopyWith<$Res> { + factory $IdealCopyWith(Ideal value, $Res Function(Ideal) _then) = _$IdealCopyWithImpl; +@useResult +$Res call({ + String? bankIdentifierCode, String? bank +}); + + + +} /// @nodoc -class __$$IdealImplCopyWithImpl<$Res> - extends _$IdealCopyWithImpl<$Res, _$IdealImpl> - implements _$$IdealImplCopyWith<$Res> { - __$$IdealImplCopyWithImpl( - _$IdealImpl _value, $Res Function(_$IdealImpl) _then) - : super(_value, _then); - - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankIdentifierCode = freezed, - Object? bank = freezed, - }) { - return _then(_$IdealImpl( - bankIdentifierCode: freezed == bankIdentifierCode - ? _value.bankIdentifierCode - : bankIdentifierCode // ignore: cast_nullable_to_non_nullable - as String?, - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class _$IdealCopyWithImpl<$Res> + implements $IdealCopyWith<$Res> { + _$IdealCopyWithImpl(this._self, this._then); + + final Ideal _self; + final $Res Function(Ideal) _then; + +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bankIdentifierCode = freezed,Object? bank = freezed,}) { + return _then(_self.copyWith( +bankIdentifierCode: freezed == bankIdentifierCode ? _self.bankIdentifierCode : bankIdentifierCode // ignore: cast_nullable_to_non_nullable +as String?,bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Ideal]. +extension IdealPatterns on Ideal { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Ideal value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Ideal value) $default,){ +final _that = this; +switch (_that) { +case _Ideal(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Ideal value)? $default,){ +final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bankIdentifierCode, String? bank)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that.bankIdentifierCode,_that.bank);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bankIdentifierCode, String? bank) $default,) {final _that = this; +switch (_that) { +case _Ideal(): +return $default(_that.bankIdentifierCode,_that.bank);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bankIdentifierCode, String? bank)? $default,) {final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that.bankIdentifierCode,_that.bank);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$IdealImpl implements _Ideal { - const _$IdealImpl({this.bankIdentifierCode, this.bank}); +class _Ideal implements Ideal { + const _Ideal({this.bankIdentifierCode, this.bank}); + factory _Ideal.fromJson(Map json) => _$IdealFromJson(json); - factory _$IdealImpl.fromJson(Map json) => - _$$IdealImplFromJson(json); +/// The BIC code of the bank +@override final String? bankIdentifierCode; +/// The bank of the customer +@override final String? bank; - /// The BIC code of the bank - @override - final String? bankIdentifierCode; +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdealCopyWith<_Ideal> get copyWith => __$IdealCopyWithImpl<_Ideal>(this, _$identity); - /// The bank of the customer - @override - final String? bank; +@override +Map toJson() { + return _$IdealToJson(this, ); +} - @override - String toString() { - return 'Ideal(bankIdentifierCode: $bankIdentifierCode, bank: $bank)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Ideal&&(identical(other.bankIdentifierCode, bankIdentifierCode) || other.bankIdentifierCode == bankIdentifierCode)&&(identical(other.bank, bank) || other.bank == bank)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdealImpl && - (identical(other.bankIdentifierCode, bankIdentifierCode) || - other.bankIdentifierCode == bankIdentifierCode) && - (identical(other.bank, bank) || other.bank == bank)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankIdentifierCode,bank); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, bankIdentifierCode, bank); - - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdealImplCopyWith<_$IdealImpl> get copyWith => - __$$IdealImplCopyWithImpl<_$IdealImpl>(this, _$identity); - - @override - Map toJson() { - return _$$IdealImplToJson( - this, - ); - } +@override +String toString() { + return 'Ideal(bankIdentifierCode: $bankIdentifierCode, bank: $bank)'; } -abstract class _Ideal implements Ideal { - const factory _Ideal({final String? bankIdentifierCode, final String? bank}) = - _$IdealImpl; - factory _Ideal.fromJson(Map json) = _$IdealImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$IdealCopyWith<$Res> implements $IdealCopyWith<$Res> { + factory _$IdealCopyWith(_Ideal value, $Res Function(_Ideal) _then) = __$IdealCopyWithImpl; +@override @useResult +$Res call({ + String? bankIdentifierCode, String? bank +}); + + - /// The BIC code of the bank - @override - String? get bankIdentifierCode; - /// The bank of the customer - @override - String? get bank; +} +/// @nodoc +class __$IdealCopyWithImpl<$Res> + implements _$IdealCopyWith<$Res> { + __$IdealCopyWithImpl(this._self, this._then); - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdealImplCopyWith<_$IdealImpl> get copyWith => - throw _privateConstructorUsedError; + final _Ideal _self; + final $Res Function(_Ideal) _then; + +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bankIdentifierCode = freezed,Object? bank = freezed,}) { + return _then(_Ideal( +bankIdentifierCode: freezed == bankIdentifierCode ? _self.bankIdentifierCode : bankIdentifierCode // ignore: cast_nullable_to_non_nullable +as String?,bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); } -SepaDebit _$SepaDebitFromJson(Map json) { - return _SepaDebit.fromJson(json); + } + /// @nodoc mixin _$SepaDebit { - /// Two letter ISO code representing the country of the bank account. - String? get country => throw _privateConstructorUsedError; - /// Bank code associated with the bankaccount. - String? get bankCode => throw _privateConstructorUsedError; +/// Two letter ISO code representing the country of the bank account. + String? get country;/// Bank code associated with the bankaccount. + String? get bankCode;/// Unique ID for the bank account. + String? get fingerprint;/// Last four characters of IBAN. + String? get last4; +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SepaDebitCopyWith get copyWith => _$SepaDebitCopyWithImpl(this as SepaDebit, _$identity); - /// Unique ID for the bank account. - String? get fingerprint => throw _privateConstructorUsedError; + /// Serializes this SepaDebit to a JSON map. + Map toJson(); - /// Last four characters of IBAN. - String? get last4 => throw _privateConstructorUsedError; - /// Serializes this SepaDebit to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SepaDebit&&(identical(other.country, country) || other.country == country)&&(identical(other.bankCode, bankCode) || other.bankCode == bankCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,bankCode,fingerprint,last4); - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SepaDebitCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'SepaDebit(country: $country, bankCode: $bankCode, fingerprint: $fingerprint, last4: $last4)'; } -/// @nodoc -abstract class $SepaDebitCopyWith<$Res> { - factory $SepaDebitCopyWith(SepaDebit value, $Res Function(SepaDebit) then) = - _$SepaDebitCopyWithImpl<$Res, SepaDebit>; - @useResult - $Res call( - {String? country, String? bankCode, String? fingerprint, String? last4}); + } /// @nodoc -class _$SepaDebitCopyWithImpl<$Res, $Val extends SepaDebit> - implements $SepaDebitCopyWith<$Res> { - _$SepaDebitCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - Object? bankCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_value.copyWith( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - bankCode: freezed == bankCode - ? _value.bankCode - : bankCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} +abstract mixin class $SepaDebitCopyWith<$Res> { + factory $SepaDebitCopyWith(SepaDebit value, $Res Function(SepaDebit) _then) = _$SepaDebitCopyWithImpl; +@useResult +$Res call({ + String? country, String? bankCode, String? fingerprint, String? last4 +}); + + + +} /// @nodoc -abstract class _$$SepaDebitImplCopyWith<$Res> +class _$SepaDebitCopyWithImpl<$Res> implements $SepaDebitCopyWith<$Res> { - factory _$$SepaDebitImplCopyWith( - _$SepaDebitImpl value, $Res Function(_$SepaDebitImpl) then) = - __$$SepaDebitImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? country, String? bankCode, String? fingerprint, String? last4}); + _$SepaDebitCopyWithImpl(this._self, this._then); + + final SepaDebit _self; + final $Res Function(SepaDebit) _then; + +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? country = freezed,Object? bankCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_self.copyWith( +country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,bankCode: freezed == bankCode ? _self.bankCode : bankCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [SepaDebit]. +extension SepaDebitPatterns on SepaDebit { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SepaDebit value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SepaDebit value) $default,){ +final _that = this; +switch (_that) { +case _SepaDebit(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SepaDebit value)? $default,){ +final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? country, String? bankCode, String? fingerprint, String? last4)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that.country,_that.bankCode,_that.fingerprint,_that.last4);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? country, String? bankCode, String? fingerprint, String? last4) $default,) {final _that = this; +switch (_that) { +case _SepaDebit(): +return $default(_that.country,_that.bankCode,_that.fingerprint,_that.last4);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? country, String? bankCode, String? fingerprint, String? last4)? $default,) {final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that.country,_that.bankCode,_that.fingerprint,_that.last4);case _: + return null; + +} } -/// @nodoc -class __$$SepaDebitImplCopyWithImpl<$Res> - extends _$SepaDebitCopyWithImpl<$Res, _$SepaDebitImpl> - implements _$$SepaDebitImplCopyWith<$Res> { - __$$SepaDebitImplCopyWithImpl( - _$SepaDebitImpl _value, $Res Function(_$SepaDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - Object? bankCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_$SepaDebitImpl( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - bankCode: freezed == bankCode - ? _value.bankCode - : bankCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$SepaDebitImpl implements _SepaDebit { - const _$SepaDebitImpl( - {this.country, this.bankCode, this.fingerprint, this.last4}); +class _SepaDebit implements SepaDebit { + const _SepaDebit({this.country, this.bankCode, this.fingerprint, this.last4}); + factory _SepaDebit.fromJson(Map json) => _$SepaDebitFromJson(json); - factory _$SepaDebitImpl.fromJson(Map json) => - _$$SepaDebitImplFromJson(json); +/// Two letter ISO code representing the country of the bank account. +@override final String? country; +/// Bank code associated with the bankaccount. +@override final String? bankCode; +/// Unique ID for the bank account. +@override final String? fingerprint; +/// Last four characters of IBAN. +@override final String? last4; - /// Two letter ISO code representing the country of the bank account. - @override - final String? country; +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SepaDebitCopyWith<_SepaDebit> get copyWith => __$SepaDebitCopyWithImpl<_SepaDebit>(this, _$identity); - /// Bank code associated with the bankaccount. - @override - final String? bankCode; +@override +Map toJson() { + return _$SepaDebitToJson(this, ); +} - /// Unique ID for the bank account. - @override - final String? fingerprint; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SepaDebit&&(identical(other.country, country) || other.country == country)&&(identical(other.bankCode, bankCode) || other.bankCode == bankCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} - /// Last four characters of IBAN. - @override - final String? last4; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,bankCode,fingerprint,last4); - @override - String toString() { - return 'SepaDebit(country: $country, bankCode: $bankCode, fingerprint: $fingerprint, last4: $last4)'; - } +@override +String toString() { + return 'SepaDebit(country: $country, bankCode: $bankCode, fingerprint: $fingerprint, last4: $last4)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SepaDebitImpl && - (identical(other.country, country) || other.country == country) && - (identical(other.bankCode, bankCode) || - other.bankCode == bankCode) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, country, bankCode, fingerprint, last4); - - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SepaDebitImplCopyWith<_$SepaDebitImpl> get copyWith => - __$$SepaDebitImplCopyWithImpl<_$SepaDebitImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SepaDebitImplToJson( - this, - ); - } } -abstract class _SepaDebit implements SepaDebit { - const factory _SepaDebit( - {final String? country, - final String? bankCode, - final String? fingerprint, - final String? last4}) = _$SepaDebitImpl; +/// @nodoc +abstract mixin class _$SepaDebitCopyWith<$Res> implements $SepaDebitCopyWith<$Res> { + factory _$SepaDebitCopyWith(_SepaDebit value, $Res Function(_SepaDebit) _then) = __$SepaDebitCopyWithImpl; +@override @useResult +$Res call({ + String? country, String? bankCode, String? fingerprint, String? last4 +}); - factory _SepaDebit.fromJson(Map json) = - _$SepaDebitImpl.fromJson; - /// Two letter ISO code representing the country of the bank account. - @override - String? get country; - /// Bank code associated with the bankaccount. - @override - String? get bankCode; - /// Unique ID for the bank account. - @override - String? get fingerprint; +} +/// @nodoc +class __$SepaDebitCopyWithImpl<$Res> + implements _$SepaDebitCopyWith<$Res> { + __$SepaDebitCopyWithImpl(this._self, this._then); - /// Last four characters of IBAN. - @override - String? get last4; + final _SepaDebit _self; + final $Res Function(_SepaDebit) _then; - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SepaDebitImplCopyWith<_$SepaDebitImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? country = freezed,Object? bankCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_SepaDebit( +country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,bankCode: freezed == bankCode ? _self.bankCode : bankCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); } -Sofort _$SofortFromJson(Map json) { - return _Sofort.fromJson(json); + } + /// @nodoc -mixin _$Sofort { - /// Two letter ISO code representing the country of the bank account. - String? get country => throw _privateConstructorUsedError; +mixin _$Upi { - /// Serializes this Sofort to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// The customer's vpa. + String? get vpa; +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UpiCopyWith get copyWith => _$UpiCopyWithImpl(this as Upi, _$identity); - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SofortCopyWith get copyWith => throw _privateConstructorUsedError; -} + /// Serializes this Upi to a JSON map. + Map toJson(); -/// @nodoc -abstract class $SofortCopyWith<$Res> { - factory $SofortCopyWith(Sofort value, $Res Function(Sofort) then) = - _$SofortCopyWithImpl<$Res, Sofort>; - @useResult - $Res call({String? country}); -} -/// @nodoc -class _$SofortCopyWithImpl<$Res, $Val extends Sofort> - implements $SofortCopyWith<$Res> { - _$SofortCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - }) { - return _then(_value.copyWith( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Upi&&(identical(other.vpa, vpa) || other.vpa == vpa)); } -/// @nodoc -abstract class _$$SofortImplCopyWith<$Res> implements $SofortCopyWith<$Res> { - factory _$$SofortImplCopyWith( - _$SofortImpl value, $Res Function(_$SofortImpl) then) = - __$$SofortImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? country}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,vpa); + +@override +String toString() { + return 'Upi(vpa: $vpa)'; } -/// @nodoc -class __$$SofortImplCopyWithImpl<$Res> - extends _$SofortCopyWithImpl<$Res, _$SofortImpl> - implements _$$SofortImplCopyWith<$Res> { - __$$SofortImplCopyWithImpl( - _$SofortImpl _value, $Res Function(_$SofortImpl) _then) - : super(_value, _then); - - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - }) { - return _then(_$SofortImpl( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc +abstract mixin class $UpiCopyWith<$Res> { + factory $UpiCopyWith(Upi value, $Res Function(Upi) _then) = _$UpiCopyWithImpl; +@useResult +$Res call({ + String? vpa +}); -@JsonSerializable(explicitToJson: true) -class _$SofortImpl implements _Sofort { - const _$SofortImpl({this.country}); - factory _$SofortImpl.fromJson(Map json) => - _$$SofortImplFromJson(json); - /// Two letter ISO code representing the country of the bank account. - @override - final String? country; - @override - String toString() { - return 'Sofort(country: $country)'; - } +} +/// @nodoc +class _$UpiCopyWithImpl<$Res> + implements $UpiCopyWith<$Res> { + _$UpiCopyWithImpl(this._self, this._then); + + final Upi _self; + final $Res Function(Upi) _then; + +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? vpa = freezed,}) { + return _then(_self.copyWith( +vpa: freezed == vpa ? _self.vpa : vpa // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Upi]. +extension UpiPatterns on Upi { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Upi value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Upi value) $default,){ +final _that = this; +switch (_that) { +case _Upi(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Upi value)? $default,){ +final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? vpa)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that.vpa);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? vpa) $default,) {final _that = this; +switch (_that) { +case _Upi(): +return $default(_that.vpa);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? vpa)? $default,) {final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that.vpa);case _: + return null; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SofortImpl && - (identical(other.country, country) || other.country == country)); - } +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, country); - - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SofortImplCopyWith<_$SofortImpl> get copyWith => - __$$SofortImplCopyWithImpl<_$SofortImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SofortImplToJson( - this, - ); - } } -abstract class _Sofort implements Sofort { - const factory _Sofort({final String? country}) = _$SofortImpl; +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _Upi implements Upi { + const _Upi({this.vpa}); + factory _Upi.fromJson(Map json) => _$UpiFromJson(json); - factory _Sofort.fromJson(Map json) = _$SofortImpl.fromJson; +/// The customer's vpa. +@override final String? vpa; - /// Two letter ISO code representing the country of the bank account. - @override - String? get country; +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UpiCopyWith<_Upi> get copyWith => __$UpiCopyWithImpl<_Upi>(this, _$identity); - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SofortImplCopyWith<_$SofortImpl> get copyWith => - throw _privateConstructorUsedError; +@override +Map toJson() { + return _$UpiToJson(this, ); } -Upi _$UpiFromJson(Map json) { - return _Upi.fromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Upi&&(identical(other.vpa, vpa) || other.vpa == vpa)); } -/// @nodoc -mixin _$Upi { - /// The customer's vpa. - String? get vpa => throw _privateConstructorUsedError; - - /// Serializes this Upi to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,vpa); - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $UpiCopyWith get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'Upi(vpa: $vpa)'; } -/// @nodoc -abstract class $UpiCopyWith<$Res> { - factory $UpiCopyWith(Upi value, $Res Function(Upi) then) = - _$UpiCopyWithImpl<$Res, Upi>; - @useResult - $Res call({String? vpa}); -} -/// @nodoc -class _$UpiCopyWithImpl<$Res, $Val extends Upi> implements $UpiCopyWith<$Res> { - _$UpiCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? vpa = freezed, - }) { - return _then(_value.copyWith( - vpa: freezed == vpa - ? _value.vpa - : vpa // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } } /// @nodoc -abstract class _$$UpiImplCopyWith<$Res> implements $UpiCopyWith<$Res> { - factory _$$UpiImplCopyWith(_$UpiImpl value, $Res Function(_$UpiImpl) then) = - __$$UpiImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? vpa}); -} +abstract mixin class _$UpiCopyWith<$Res> implements $UpiCopyWith<$Res> { + factory _$UpiCopyWith(_Upi value, $Res Function(_Upi) _then) = __$UpiCopyWithImpl; +@override @useResult +$Res call({ + String? vpa +}); -/// @nodoc -class __$$UpiImplCopyWithImpl<$Res> extends _$UpiCopyWithImpl<$Res, _$UpiImpl> - implements _$$UpiImplCopyWith<$Res> { - __$$UpiImplCopyWithImpl(_$UpiImpl _value, $Res Function(_$UpiImpl) _then) - : super(_value, _then); - - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? vpa = freezed, - }) { - return _then(_$UpiImpl( - vpa: freezed == vpa - ? _value.vpa - : vpa // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$UpiImpl implements _Upi { - const _$UpiImpl({this.vpa}); - factory _$UpiImpl.fromJson(Map json) => - _$$UpiImplFromJson(json); +} +/// @nodoc +class __$UpiCopyWithImpl<$Res> + implements _$UpiCopyWith<$Res> { + __$UpiCopyWithImpl(this._self, this._then); - /// The customer's vpa. - @override - final String? vpa; + final _Upi _self; + final $Res Function(_Upi) _then; - @override - String toString() { - return 'Upi(vpa: $vpa)'; - } +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? vpa = freezed,}) { + return _then(_Upi( +vpa: freezed == vpa ? _self.vpa : vpa // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UpiImpl && - (identical(other.vpa, vpa) || other.vpa == vpa)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, vpa); - - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$UpiImplCopyWith<_$UpiImpl> get copyWith => - __$$UpiImplCopyWithImpl<_$UpiImpl>(this, _$identity); - - @override - Map toJson() { - return _$$UpiImplToJson( - this, - ); - } } -abstract class _Upi implements Upi { - const factory _Upi({final String? vpa}) = _$UpiImpl; - factory _Upi.fromJson(Map json) = _$UpiImpl.fromJson; +/// @nodoc +mixin _$UsBankAccount { + +/// Routing number of the bank account + String? get routingNumber;/// Last 4 digits of the account + String? get last4;/// The bank account type of the holder + UsBankAccountHolderType get accountHolderType;/// The account type + UsBankAccountType get accountType;/// The name of the bank of the account + String? get bankName;/// Unique identifier for the bankaccount. + String? get fingerprint;/// Number of linkedaccount + String? get linkedAccount;/// list of preferred network names + List? get preferredNetworks;/// list of preferred network names + List? get supportedNetworks; +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UsBankAccountCopyWith get copyWith => _$UsBankAccountCopyWithImpl(this as UsBankAccount, _$identity); + + /// Serializes this UsBankAccount to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UsBankAccount&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.linkedAccount, linkedAccount) || other.linkedAccount == linkedAccount)&&const DeepCollectionEquality().equals(other.preferredNetworks, preferredNetworks)&&const DeepCollectionEquality().equals(other.supportedNetworks, supportedNetworks)); +} - /// The customer's vpa. - @override - String? get vpa; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,routingNumber,last4,accountHolderType,accountType,bankName,fingerprint,linkedAccount,const DeepCollectionEquality().hash(preferredNetworks),const DeepCollectionEquality().hash(supportedNetworks)); - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$UpiImplCopyWith<_$UpiImpl> get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'UsBankAccount(routingNumber: $routingNumber, last4: $last4, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, fingerprint: $fingerprint, linkedAccount: $linkedAccount, preferredNetworks: $preferredNetworks, supportedNetworks: $supportedNetworks)'; } -UsBankAccount _$UsBankAccountFromJson(Map json) { - return _UsBankAccount.fromJson(json); + } /// @nodoc -mixin _$UsBankAccount { - /// Routing number of the bank account - String? get routingNumber => throw _privateConstructorUsedError; +abstract mixin class $UsBankAccountCopyWith<$Res> { + factory $UsBankAccountCopyWith(UsBankAccount value, $Res Function(UsBankAccount) _then) = _$UsBankAccountCopyWithImpl; +@useResult +$Res call({ + String? routingNumber, String? last4, UsBankAccountHolderType accountHolderType, UsBankAccountType accountType, String? bankName, String? fingerprint, String? linkedAccount, List? preferredNetworks, List? supportedNetworks +}); - /// Last 4 digits of the account - String? get last4 => throw _privateConstructorUsedError; - /// The bank account type of the holder - UsBankAccountHolderType get accountHolderType => - throw _privateConstructorUsedError; - /// The account type - UsBankAccountType get accountType => throw _privateConstructorUsedError; - /// The name of the bank of the account - String? get bankName => throw _privateConstructorUsedError; +} +/// @nodoc +class _$UsBankAccountCopyWithImpl<$Res> + implements $UsBankAccountCopyWith<$Res> { + _$UsBankAccountCopyWithImpl(this._self, this._then); + + final UsBankAccount _self; + final $Res Function(UsBankAccount) _then; + +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? routingNumber = freezed,Object? last4 = freezed,Object? accountHolderType = null,Object? accountType = null,Object? bankName = freezed,Object? fingerprint = freezed,Object? linkedAccount = freezed,Object? preferredNetworks = freezed,Object? supportedNetworks = freezed,}) { + return _then(_self.copyWith( +routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: null == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as UsBankAccountHolderType,accountType: null == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,linkedAccount: freezed == linkedAccount ? _self.linkedAccount : linkedAccount // ignore: cast_nullable_to_non_nullable +as String?,preferredNetworks: freezed == preferredNetworks ? _self.preferredNetworks : preferredNetworks // ignore: cast_nullable_to_non_nullable +as List?,supportedNetworks: freezed == supportedNetworks ? _self.supportedNetworks : supportedNetworks // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [UsBankAccount]. +extension UsBankAccountPatterns on UsBankAccount { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UsBankAccount value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UsBankAccount value) $default,){ +final _that = this; +switch (_that) { +case _UsBankAccount(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UsBankAccount value)? $default,){ +final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? routingNumber, String? last4, UsBankAccountHolderType accountHolderType, UsBankAccountType accountType, String? bankName, String? fingerprint, String? linkedAccount, List? preferredNetworks, List? supportedNetworks)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that.routingNumber,_that.last4,_that.accountHolderType,_that.accountType,_that.bankName,_that.fingerprint,_that.linkedAccount,_that.preferredNetworks,_that.supportedNetworks);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? routingNumber, String? last4, UsBankAccountHolderType accountHolderType, UsBankAccountType accountType, String? bankName, String? fingerprint, String? linkedAccount, List? preferredNetworks, List? supportedNetworks) $default,) {final _that = this; +switch (_that) { +case _UsBankAccount(): +return $default(_that.routingNumber,_that.last4,_that.accountHolderType,_that.accountType,_that.bankName,_that.fingerprint,_that.linkedAccount,_that.preferredNetworks,_that.supportedNetworks);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? routingNumber, String? last4, UsBankAccountHolderType accountHolderType, UsBankAccountType accountType, String? bankName, String? fingerprint, String? linkedAccount, List? preferredNetworks, List? supportedNetworks)? $default,) {final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that.routingNumber,_that.last4,_that.accountHolderType,_that.accountType,_that.bankName,_that.fingerprint,_that.linkedAccount,_that.preferredNetworks,_that.supportedNetworks);case _: + return null; - /// Unique identifier for the bankaccount. - String? get fingerprint => throw _privateConstructorUsedError; +} +} - /// Number of linkedaccount - String? get linkedAccount => throw _privateConstructorUsedError; +} - /// list of preferred network names - List? get preferredNetworks => throw _privateConstructorUsedError; +/// @nodoc - /// list of preferred network names - List? get supportedNetworks => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _UsBankAccount implements UsBankAccount { + const _UsBankAccount({this.routingNumber, this.last4, required this.accountHolderType, required this.accountType, this.bankName, this.fingerprint, this.linkedAccount, final List? preferredNetworks, final List? supportedNetworks}): _preferredNetworks = preferredNetworks,_supportedNetworks = supportedNetworks; + factory _UsBankAccount.fromJson(Map json) => _$UsBankAccountFromJson(json); - /// Serializes this UsBankAccount to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Routing number of the bank account +@override final String? routingNumber; +/// Last 4 digits of the account +@override final String? last4; +/// The bank account type of the holder +@override final UsBankAccountHolderType accountHolderType; +/// The account type +@override final UsBankAccountType accountType; +/// The name of the bank of the account +@override final String? bankName; +/// Unique identifier for the bankaccount. +@override final String? fingerprint; +/// Number of linkedaccount +@override final String? linkedAccount; +/// list of preferred network names + final List? _preferredNetworks; +/// list of preferred network names +@override List? get preferredNetworks { + final value = _preferredNetworks; + if (value == null) return null; + if (_preferredNetworks is EqualUnmodifiableListView) return _preferredNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $UsBankAccountCopyWith get copyWith => - throw _privateConstructorUsedError; +/// list of preferred network names + final List? _supportedNetworks; +/// list of preferred network names +@override List? get supportedNetworks { + final value = _supportedNetworks; + if (value == null) return null; + if (_supportedNetworks is EqualUnmodifiableListView) return _supportedNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); } -/// @nodoc -abstract class $UsBankAccountCopyWith<$Res> { - factory $UsBankAccountCopyWith( - UsBankAccount value, $Res Function(UsBankAccount) then) = - _$UsBankAccountCopyWithImpl<$Res, UsBankAccount>; - @useResult - $Res call( - {String? routingNumber, - String? last4, - UsBankAccountHolderType accountHolderType, - UsBankAccountType accountType, - String? bankName, - String? fingerprint, - String? linkedAccount, - List? preferredNetworks, - List? supportedNetworks}); + +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UsBankAccountCopyWith<_UsBankAccount> get copyWith => __$UsBankAccountCopyWithImpl<_UsBankAccount>(this, _$identity); + +@override +Map toJson() { + return _$UsBankAccountToJson(this, ); } -/// @nodoc -class _$UsBankAccountCopyWithImpl<$Res, $Val extends UsBankAccount> - implements $UsBankAccountCopyWith<$Res> { - _$UsBankAccountCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? routingNumber = freezed, - Object? last4 = freezed, - Object? accountHolderType = null, - Object? accountType = null, - Object? bankName = freezed, - Object? fingerprint = freezed, - Object? linkedAccount = freezed, - Object? preferredNetworks = freezed, - Object? supportedNetworks = freezed, - }) { - return _then(_value.copyWith( - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: null == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as UsBankAccountHolderType, - accountType: null == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - linkedAccount: freezed == linkedAccount - ? _value.linkedAccount - : linkedAccount // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetworks: freezed == preferredNetworks - ? _value.preferredNetworks - : preferredNetworks // ignore: cast_nullable_to_non_nullable - as List?, - supportedNetworks: freezed == supportedNetworks - ? _value.supportedNetworks - : supportedNetworks // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UsBankAccount&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.linkedAccount, linkedAccount) || other.linkedAccount == linkedAccount)&&const DeepCollectionEquality().equals(other._preferredNetworks, _preferredNetworks)&&const DeepCollectionEquality().equals(other._supportedNetworks, _supportedNetworks)); } -/// @nodoc -abstract class _$$UsBankAccountImplCopyWith<$Res> - implements $UsBankAccountCopyWith<$Res> { - factory _$$UsBankAccountImplCopyWith( - _$UsBankAccountImpl value, $Res Function(_$UsBankAccountImpl) then) = - __$$UsBankAccountImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? routingNumber, - String? last4, - UsBankAccountHolderType accountHolderType, - UsBankAccountType accountType, - String? bankName, - String? fingerprint, - String? linkedAccount, - List? preferredNetworks, - List? supportedNetworks}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,routingNumber,last4,accountHolderType,accountType,bankName,fingerprint,linkedAccount,const DeepCollectionEquality().hash(_preferredNetworks),const DeepCollectionEquality().hash(_supportedNetworks)); + +@override +String toString() { + return 'UsBankAccount(routingNumber: $routingNumber, last4: $last4, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, fingerprint: $fingerprint, linkedAccount: $linkedAccount, preferredNetworks: $preferredNetworks, supportedNetworks: $supportedNetworks)'; } -/// @nodoc -class __$$UsBankAccountImplCopyWithImpl<$Res> - extends _$UsBankAccountCopyWithImpl<$Res, _$UsBankAccountImpl> - implements _$$UsBankAccountImplCopyWith<$Res> { - __$$UsBankAccountImplCopyWithImpl( - _$UsBankAccountImpl _value, $Res Function(_$UsBankAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? routingNumber = freezed, - Object? last4 = freezed, - Object? accountHolderType = null, - Object? accountType = null, - Object? bankName = freezed, - Object? fingerprint = freezed, - Object? linkedAccount = freezed, - Object? preferredNetworks = freezed, - Object? supportedNetworks = freezed, - }) { - return _then(_$UsBankAccountImpl( - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: null == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as UsBankAccountHolderType, - accountType: null == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - linkedAccount: freezed == linkedAccount - ? _value.linkedAccount - : linkedAccount // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetworks: freezed == preferredNetworks - ? _value._preferredNetworks - : preferredNetworks // ignore: cast_nullable_to_non_nullable - as List?, - supportedNetworks: freezed == supportedNetworks - ? _value._supportedNetworks - : supportedNetworks // ignore: cast_nullable_to_non_nullable - as List?, - )); - } + } /// @nodoc +abstract mixin class _$UsBankAccountCopyWith<$Res> implements $UsBankAccountCopyWith<$Res> { + factory _$UsBankAccountCopyWith(_UsBankAccount value, $Res Function(_UsBankAccount) _then) = __$UsBankAccountCopyWithImpl; +@override @useResult +$Res call({ + String? routingNumber, String? last4, UsBankAccountHolderType accountHolderType, UsBankAccountType accountType, String? bankName, String? fingerprint, String? linkedAccount, List? preferredNetworks, List? supportedNetworks +}); -@JsonSerializable(explicitToJson: true) -class _$UsBankAccountImpl implements _UsBankAccount { - const _$UsBankAccountImpl( - {this.routingNumber, - this.last4, - required this.accountHolderType, - required this.accountType, - this.bankName, - this.fingerprint, - this.linkedAccount, - final List? preferredNetworks, - final List? supportedNetworks}) - : _preferredNetworks = preferredNetworks, - _supportedNetworks = supportedNetworks; - - factory _$UsBankAccountImpl.fromJson(Map json) => - _$$UsBankAccountImplFromJson(json); - - /// Routing number of the bank account - @override - final String? routingNumber; - - /// Last 4 digits of the account - @override - final String? last4; - - /// The bank account type of the holder - @override - final UsBankAccountHolderType accountHolderType; - - /// The account type - @override - final UsBankAccountType accountType; - - /// The name of the bank of the account - @override - final String? bankName; - - /// Unique identifier for the bankaccount. - @override - final String? fingerprint; - - /// Number of linkedaccount - @override - final String? linkedAccount; - - /// list of preferred network names - final List? _preferredNetworks; - - /// list of preferred network names - @override - List? get preferredNetworks { - final value = _preferredNetworks; - if (value == null) return null; - if (_preferredNetworks is EqualUnmodifiableListView) - return _preferredNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - /// list of preferred network names - final List? _supportedNetworks; - - /// list of preferred network names - @override - List? get supportedNetworks { - final value = _supportedNetworks; - if (value == null) return null; - if (_supportedNetworks is EqualUnmodifiableListView) - return _supportedNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - @override - String toString() { - return 'UsBankAccount(routingNumber: $routingNumber, last4: $last4, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, fingerprint: $fingerprint, linkedAccount: $linkedAccount, preferredNetworks: $preferredNetworks, supportedNetworks: $supportedNetworks)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UsBankAccountImpl && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.accountType, accountType) || - other.accountType == accountType) && - (identical(other.bankName, bankName) || - other.bankName == bankName) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.linkedAccount, linkedAccount) || - other.linkedAccount == linkedAccount) && - const DeepCollectionEquality() - .equals(other._preferredNetworks, _preferredNetworks) && - const DeepCollectionEquality() - .equals(other._supportedNetworks, _supportedNetworks)); - } +} +/// @nodoc +class __$UsBankAccountCopyWithImpl<$Res> + implements _$UsBankAccountCopyWith<$Res> { + __$UsBankAccountCopyWithImpl(this._self, this._then); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - routingNumber, - last4, - accountHolderType, - accountType, - bankName, - fingerprint, - linkedAccount, - const DeepCollectionEquality().hash(_preferredNetworks), - const DeepCollectionEquality().hash(_supportedNetworks)); - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$UsBankAccountImplCopyWith<_$UsBankAccountImpl> get copyWith => - __$$UsBankAccountImplCopyWithImpl<_$UsBankAccountImpl>(this, _$identity); - - @override - Map toJson() { - return _$$UsBankAccountImplToJson( - this, - ); - } + final _UsBankAccount _self; + final $Res Function(_UsBankAccount) _then; + +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? routingNumber = freezed,Object? last4 = freezed,Object? accountHolderType = null,Object? accountType = null,Object? bankName = freezed,Object? fingerprint = freezed,Object? linkedAccount = freezed,Object? preferredNetworks = freezed,Object? supportedNetworks = freezed,}) { + return _then(_UsBankAccount( +routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: null == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as UsBankAccountHolderType,accountType: null == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,linkedAccount: freezed == linkedAccount ? _self.linkedAccount : linkedAccount // ignore: cast_nullable_to_non_nullable +as String?,preferredNetworks: freezed == preferredNetworks ? _self._preferredNetworks : preferredNetworks // ignore: cast_nullable_to_non_nullable +as List?,supportedNetworks: freezed == supportedNetworks ? _self._supportedNetworks : supportedNetworks // ignore: cast_nullable_to_non_nullable +as List?, + )); } -abstract class _UsBankAccount implements UsBankAccount { - const factory _UsBankAccount( - {final String? routingNumber, - final String? last4, - required final UsBankAccountHolderType accountHolderType, - required final UsBankAccountType accountType, - final String? bankName, - final String? fingerprint, - final String? linkedAccount, - final List? preferredNetworks, - final List? supportedNetworks}) = _$UsBankAccountImpl; - - factory _UsBankAccount.fromJson(Map json) = - _$UsBankAccountImpl.fromJson; - - /// Routing number of the bank account - @override - String? get routingNumber; - - /// Last 4 digits of the account - @override - String? get last4; - - /// The bank account type of the holder - @override - UsBankAccountHolderType get accountHolderType; - - /// The account type - @override - UsBankAccountType get accountType; - - /// The name of the bank of the account - @override - String? get bankName; - - /// Unique identifier for the bankaccount. - @override - String? get fingerprint; - - /// Number of linkedaccount - @override - String? get linkedAccount; - - /// list of preferred network names - @override - List? get preferredNetworks; - - /// list of preferred network names - @override - List? get supportedNetworks; - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsBankAccountImplCopyWith<_$UsBankAccountImpl> get copyWith => - throw _privateConstructorUsedError; + } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method.g.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method.g.dart index 1658020c6..3b1b165d9 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method.g.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method.g.dart @@ -6,85 +6,72 @@ part of 'payment_method.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentMethodImpl _$$PaymentMethodImplFromJson(Map json) => - _$PaymentMethodImpl( - id: json['id'] as String, - object: json['object'] as String? ?? "payment_method", - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), - customer: json['customer'] as String?, - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k as String, e), - ) ?? - const {}, - livemode: json['livemode'] as bool? ?? true, - created: (json['created'] as num?)?.toInt(), - card: json['card'] == null - ? null - : CardPaymentMethod.fromJson( - Map.from(json['card'] as Map)), - sepaDebit: json['sepaDebit'] == null - ? null - : SepaDebit.fromJson( - Map.from(json['sepaDebit'] as Map)), - bacsDebit: json['bacsDebit'] == null - ? null - : BacsDebit.fromJson( - Map.from(json['bacsDebit'] as Map)), - auBecsDebit: json['auBecsDebit'] == null - ? null - : AuBecsDebit.fromJson( - Map.from(json['auBecsDebit'] as Map)), - sofort: json['sofort'] == null - ? null - : Sofort.fromJson(Map.from(json['sofort'] as Map)), - ideal: json['ideal'] == null - ? null - : Ideal.fromJson(Map.from(json['ideal'] as Map)), - fpx: json['fpx'] == null - ? null - : Fpx.fromJson(Map.from(json['fpx'] as Map)), - upi: json['upi'] == null - ? null - : Upi.fromJson(Map.from(json['upi'] as Map)), - usBankAccount: json['usBankAccount'] == null - ? null - : UsBankAccount.fromJson( - Map.from(json['usBankAccount'] as Map)), - type: $enumDecode(_$PaymentMethodTypeEnumMap, json['type']), - ); - -Map _$$PaymentMethodImplToJson(_$PaymentMethodImpl instance) { - final val = { - 'id': instance.id, - 'object': instance.object, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('customer', instance.customer); - val['metadata'] = instance.metadata; - val['livemode'] = instance.livemode; - writeNotNull('created', instance.created); - writeNotNull('card', instance.card?.toJson()); - writeNotNull('sepaDebit', instance.sepaDebit?.toJson()); - writeNotNull('bacsDebit', instance.bacsDebit?.toJson()); - writeNotNull('auBecsDebit', instance.auBecsDebit?.toJson()); - writeNotNull('sofort', instance.sofort?.toJson()); - writeNotNull('ideal', instance.ideal?.toJson()); - writeNotNull('fpx', instance.fpx?.toJson()); - writeNotNull('upi', instance.upi?.toJson()); - writeNotNull('usBankAccount', instance.usBankAccount?.toJson()); - val['type'] = _$PaymentMethodTypeEnumMap[instance.type]!; - return val; -} +_PaymentMethod _$PaymentMethodFromJson(Map json) => _PaymentMethod( + id: json['id'] as String, + object: json['object'] as String? ?? "payment_method", + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson( + Map.from(json['billingDetails'] as Map), + ), + customer: json['customer'] as String?, + metadata: + (json['metadata'] as Map?)?.map((k, e) => MapEntry(k as String, e)) ?? + const {}, + livemode: json['livemode'] as bool? ?? true, + created: (json['created'] as num?)?.toInt(), + card: json['card'] == null + ? null + : CardPaymentMethod.fromJson( + Map.from(json['card'] as Map), + ), + sepaDebit: json['sepaDebit'] == null + ? null + : SepaDebit.fromJson(Map.from(json['sepaDebit'] as Map)), + bacsDebit: json['bacsDebit'] == null + ? null + : BacsDebit.fromJson(Map.from(json['bacsDebit'] as Map)), + auBecsDebit: json['auBecsDebit'] == null + ? null + : AuBecsDebit.fromJson( + Map.from(json['auBecsDebit'] as Map), + ), + ideal: json['ideal'] == null + ? null + : Ideal.fromJson(Map.from(json['ideal'] as Map)), + fpx: json['fpx'] == null + ? null + : Fpx.fromJson(Map.from(json['fpx'] as Map)), + upi: json['upi'] == null + ? null + : Upi.fromJson(Map.from(json['upi'] as Map)), + usBankAccount: json['usBankAccount'] == null + ? null + : UsBankAccount.fromJson( + Map.from(json['usBankAccount'] as Map), + ), + type: $enumDecode(_$PaymentMethodTypeEnumMap, json['type']), +); + +Map _$PaymentMethodToJson(_PaymentMethod instance) => + { + 'id': instance.id, + 'object': instance.object, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'customer': ?instance.customer, + 'metadata': instance.metadata, + 'livemode': instance.livemode, + 'created': ?instance.created, + 'card': ?instance.card?.toJson(), + 'sepaDebit': ?instance.sepaDebit?.toJson(), + 'bacsDebit': ?instance.bacsDebit?.toJson(), + 'auBecsDebit': ?instance.auBecsDebit?.toJson(), + 'ideal': ?instance.ideal?.toJson(), + 'fpx': ?instance.fpx?.toJson(), + 'upi': ?instance.upi?.toJson(), + 'usBankAccount': ?instance.usBankAccount?.toJson(), + 'type': _$PaymentMethodTypeEnumMap[instance.type]!, + }; const _$PaymentMethodTypeEnumMap = { PaymentMethodType.acssDebit: 'acss_debit', @@ -115,223 +102,135 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.pix: 'pix', PaymentMethodType.promptpay: 'promptpay', PaymentMethodType.sepaDebit: 'sepa_debit', - PaymentMethodType.sofort: 'sofort', PaymentMethodType.usBankAccount: 'us_bank_account', PaymentMethodType.wechatPay: 'wechat_pay', PaymentMethodType.unknown: 'unknown', }; -_$AuBecsDebitImpl _$$AuBecsDebitImplFromJson(Map json) => _$AuBecsDebitImpl( - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - bsbNumber: json['bsbNumber'] as String?, - ); - -Map _$$AuBecsDebitImplToJson(_$AuBecsDebitImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('fingerprint', instance.fingerprint); - writeNotNull('last4', instance.last4); - writeNotNull('bsbNumber', instance.bsbNumber); - return val; -} - -_$BacsDebitImpl _$$BacsDebitImplFromJson(Map json) => _$BacsDebitImpl( - sortCode: json['sortCode'] as String?, - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - ); - -Map _$$BacsDebitImplToJson(_$BacsDebitImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('sortCode', instance.sortCode); - writeNotNull('fingerprint', instance.fingerprint); - writeNotNull('last4', instance.last4); - return val; -} - -_$CardPaymentMethodImpl _$$CardPaymentMethodImplFromJson(Map json) => - _$CardPaymentMethodImpl( - brand: json['brand'] as String?, - country: json['country'] as String?, - expYear: (json['expYear'] as num?)?.toInt(), - expMonth: (json['expMonth'] as num?)?.toInt(), - funding: json['funding'] as String?, - last4: json['last4'] as String?, - preferredNetwork: json['preferredNetwork'] as String?, - availableNetworks: (json['availableNetworks'] as List?) - ?.map((e) => e as String) - .toList(), - ); - -Map _$$CardPaymentMethodImplToJson( - _$CardPaymentMethodImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('brand', instance.brand); - writeNotNull('country', instance.country); - writeNotNull('expYear', instance.expYear); - writeNotNull('expMonth', instance.expMonth); - writeNotNull('funding', instance.funding); - writeNotNull('last4', instance.last4); - writeNotNull('preferredNetwork', instance.preferredNetwork); - writeNotNull('availableNetworks', instance.availableNetworks); - return val; -} - -_$FpxImpl _$$FpxImplFromJson(Map json) => _$FpxImpl( - bank: json['bank'] as String?, - accountHolderType: json['accountHolderType'] as String?, - ); - -Map _$$FpxImplToJson(_$FpxImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('bank', instance.bank); - writeNotNull('accountHolderType', instance.accountHolderType); - return val; -} - -_$IdealImpl _$$IdealImplFromJson(Map json) => _$IdealImpl( - bankIdentifierCode: json['bankIdentifierCode'] as String?, - bank: json['bank'] as String?, - ); - -Map _$$IdealImplToJson(_$IdealImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('bankIdentifierCode', instance.bankIdentifierCode); - writeNotNull('bank', instance.bank); - return val; -} - -_$SepaDebitImpl _$$SepaDebitImplFromJson(Map json) => _$SepaDebitImpl( - country: json['country'] as String?, - bankCode: json['bankCode'] as String?, - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - ); - -Map _$$SepaDebitImplToJson(_$SepaDebitImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('country', instance.country); - writeNotNull('bankCode', instance.bankCode); - writeNotNull('fingerprint', instance.fingerprint); - writeNotNull('last4', instance.last4); - return val; -} - -_$SofortImpl _$$SofortImplFromJson(Map json) => _$SofortImpl( - country: json['country'] as String?, - ); - -Map _$$SofortImplToJson(_$SofortImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('country', instance.country); - return val; -} - -_$UpiImpl _$$UpiImplFromJson(Map json) => _$UpiImpl( - vpa: json['vpa'] as String?, - ); - -Map _$$UpiImplToJson(_$UpiImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('vpa', instance.vpa); - return val; -} +_AuBecsDebit _$AuBecsDebitFromJson(Map json) => _AuBecsDebit( + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, + bsbNumber: json['bsbNumber'] as String?, +); + +Map _$AuBecsDebitToJson(_AuBecsDebit instance) => + { + 'fingerprint': ?instance.fingerprint, + 'last4': ?instance.last4, + 'bsbNumber': ?instance.bsbNumber, + }; + +_BacsDebit _$BacsDebitFromJson(Map json) => _BacsDebit( + sortCode: json['sortCode'] as String?, + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, +); + +Map _$BacsDebitToJson(_BacsDebit instance) => + { + 'sortCode': ?instance.sortCode, + 'fingerprint': ?instance.fingerprint, + 'last4': ?instance.last4, + }; + +_CardPaymentMethod _$CardPaymentMethodFromJson(Map json) => _CardPaymentMethod( + brand: json['brand'] as String?, + country: json['country'] as String?, + expYear: (json['expYear'] as num?)?.toInt(), + expMonth: (json['expMonth'] as num?)?.toInt(), + funding: json['funding'] as String?, + last4: json['last4'] as String?, + preferredNetwork: json['preferredNetwork'] as String?, + availableNetworks: (json['availableNetworks'] as List?) + ?.map((e) => e as String) + .toList(), +); + +Map _$CardPaymentMethodToJson(_CardPaymentMethod instance) => + { + 'brand': ?instance.brand, + 'country': ?instance.country, + 'expYear': ?instance.expYear, + 'expMonth': ?instance.expMonth, + 'funding': ?instance.funding, + 'last4': ?instance.last4, + 'preferredNetwork': ?instance.preferredNetwork, + 'availableNetworks': ?instance.availableNetworks, + }; + +_Fpx _$FpxFromJson(Map json) => _Fpx( + bank: json['bank'] as String?, + accountHolderType: json['accountHolderType'] as String?, +); + +Map _$FpxToJson(_Fpx instance) => { + 'bank': ?instance.bank, + 'accountHolderType': ?instance.accountHolderType, +}; -_$UsBankAccountImpl _$$UsBankAccountImplFromJson(Map json) => - _$UsBankAccountImpl( - routingNumber: json['routingNumber'] as String?, - last4: json['last4'] as String?, - accountHolderType: $enumDecode( - _$UsBankAccountHolderTypeEnumMap, json['accountHolderType']), - accountType: $enumDecode(_$UsBankAccountTypeEnumMap, json['accountType']), - bankName: json['bankName'] as String?, - fingerprint: json['fingerprint'] as String?, - linkedAccount: json['linkedAccount'] as String?, - preferredNetworks: (json['preferredNetworks'] as List?) - ?.map((e) => e as String) - .toList(), - supportedNetworks: (json['supportedNetworks'] as List?) - ?.map((e) => e as String) - .toList(), - ); +_Ideal _$IdealFromJson(Map json) => _Ideal( + bankIdentifierCode: json['bankIdentifierCode'] as String?, + bank: json['bank'] as String?, +); -Map _$$UsBankAccountImplToJson(_$UsBankAccountImpl instance) { - final val = {}; +Map _$IdealToJson(_Ideal instance) => { + 'bankIdentifierCode': ?instance.bankIdentifierCode, + 'bank': ?instance.bank, +}; - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +_SepaDebit _$SepaDebitFromJson(Map json) => _SepaDebit( + country: json['country'] as String?, + bankCode: json['bankCode'] as String?, + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, +); + +Map _$SepaDebitToJson(_SepaDebit instance) => + { + 'country': ?instance.country, + 'bankCode': ?instance.bankCode, + 'fingerprint': ?instance.fingerprint, + 'last4': ?instance.last4, + }; + +_Upi _$UpiFromJson(Map json) => _Upi(vpa: json['vpa'] as String?); + +Map _$UpiToJson(_Upi instance) => { + 'vpa': ?instance.vpa, +}; - writeNotNull('routingNumber', instance.routingNumber); - writeNotNull('last4', instance.last4); - val['accountHolderType'] = - _$UsBankAccountHolderTypeEnumMap[instance.accountHolderType]!; - val['accountType'] = _$UsBankAccountTypeEnumMap[instance.accountType]!; - writeNotNull('bankName', instance.bankName); - writeNotNull('fingerprint', instance.fingerprint); - writeNotNull('linkedAccount', instance.linkedAccount); - writeNotNull('preferredNetworks', instance.preferredNetworks); - writeNotNull('supportedNetworks', instance.supportedNetworks); - return val; -} +_UsBankAccount _$UsBankAccountFromJson(Map json) => _UsBankAccount( + routingNumber: json['routingNumber'] as String?, + last4: json['last4'] as String?, + accountHolderType: $enumDecode( + _$UsBankAccountHolderTypeEnumMap, + json['accountHolderType'], + ), + accountType: $enumDecode(_$UsBankAccountTypeEnumMap, json['accountType']), + bankName: json['bankName'] as String?, + fingerprint: json['fingerprint'] as String?, + linkedAccount: json['linkedAccount'] as String?, + preferredNetworks: (json['preferredNetworks'] as List?) + ?.map((e) => e as String) + .toList(), + supportedNetworks: (json['supportedNetworks'] as List?) + ?.map((e) => e as String) + .toList(), +); + +Map _$UsBankAccountToJson(_UsBankAccount instance) => + { + 'routingNumber': ?instance.routingNumber, + 'last4': ?instance.last4, + 'accountHolderType': + _$UsBankAccountHolderTypeEnumMap[instance.accountHolderType]!, + 'accountType': _$UsBankAccountTypeEnumMap[instance.accountType]!, + 'bankName': ?instance.bankName, + 'fingerprint': ?instance.fingerprint, + 'linkedAccount': ?instance.linkedAccount, + 'preferredNetworks': ?instance.preferredNetworks, + 'supportedNetworks': ?instance.supportedNetworks, + }; const _$UsBankAccountHolderTypeEnumMap = { UsBankAccountHolderType.Company: 'Company', diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.dart index 4dcbe3b6f..cc212c06a 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.dart @@ -38,7 +38,7 @@ const paymentMethodDetailJsonKey = JsonKey( ); @Freezed(unionKey: 'type') -class CardPaymentMethodDetails +sealed class CardPaymentMethodDetails with _$CardPaymentMethodDetails implements PaymentMethodDetails { @FreezedUnionValue('card') @@ -78,13 +78,13 @@ class CardPaymentMethodDetails } @Freezed(unionKey: 'type') -class IdealPaymentMethodDetails +abstract class IdealPaymentMethodDetails with _$IdealPaymentMethodDetails implements PaymentMethodDetails { @FreezedUnionValue('ideal') @Implements() const factory IdealPaymentMethodDetails.id(String id) = - _IdIdealPaymentMethodDetails; + _IdIdealPaymentMethodDetailsIdOnly; /// Use stripe.confirmCardPayment with payment data from an Element by /// passing a card or cardNumber Element as payment_method[card] in the @@ -99,7 +99,7 @@ class IdealPaymentMethodDetails /// The billing_details associated with the card. @JsonKey(name: "billing_details") BillingDetails? billingDetails, - }) = _IdealPaymentMethodDetails; + }) = _IdealPaymentMethodDetailsWithBilling; /// If you already know the customer’s bank or want to collect it yourself, /// then you do not need to use the idealBank Element. @@ -119,13 +119,13 @@ class IdealPaymentMethodDetails } @Freezed(unionKey: 'type') -class P24PaymentMethodDetails +abstract class P24PaymentMethodDetails with _$P24PaymentMethodDetails implements PaymentMethodDetails { @FreezedUnionValue('p24') @Implements() const factory P24PaymentMethodDetails.id(String id) = - _IdP24PaymentMethodDetails; + _IdP24PaymentMethodDetailsIdOnly; /// Use stripe.confirmCardPayment with payment data from an Element by /// passing a card or cardNumber Element as payment_method[card] in the @@ -137,7 +137,7 @@ class P24PaymentMethodDetails const factory P24PaymentMethodDetails({ /// The billing_details associated with the card. @JsonKey(name: "billing_details") required BillingDetails? billingDetails, - }) = _P24PaymentMethodDetails; + }) = _P24PaymentMethodDetailsWithBilling; factory P24PaymentMethodDetails.fromJson(Map json) => _$P24PaymentMethodDetailsFromJson(json); @@ -145,7 +145,7 @@ class P24PaymentMethodDetails /// An object detailing the customer's iDEAL bank. @freezed -class IdealBankData with _$IdealBankData { +abstract class IdealBankData with _$IdealBankData { const factory IdealBankData({ /// The customer's bank. String? bank, @@ -156,11 +156,10 @@ class IdealBankData with _$IdealBankData { } @freezed -class CardTokenPaymentMethod with _$CardTokenPaymentMethod { +abstract class CardTokenPaymentMethod with _$CardTokenPaymentMethod { /// Config parameters for card payment method. - const factory CardTokenPaymentMethod({ - required String token, - }) = _CardTokenPaymentMethod; + const factory CardTokenPaymentMethod({required String token}) = + _CardTokenPaymentMethod; factory CardTokenPaymentMethod.fromJson(Map json) => _$CardTokenPaymentMethodFromJson(json); diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.freezed.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.freezed.dart index b8fabe508..35bb2195e 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,2264 +9,1803 @@ part of 'payment_method_details.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - CardPaymentMethodDetails _$CardPaymentMethodDetailsFromJson( - Map json) { - switch (json['type']) { - case 'card': - return _CardPaymentMethodRef.fromJson(json); - case 'card': - return _CardPaymentMethodDefault.fromJson(json); - case 'card': - return _CardPaymentMethodDetailsToken.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'type', 'CardPaymentMethodDetails', - 'Invalid union type "${json['type']}"!'); - } + Map json +) { + switch (json['type']) { + case 'card': + return _CardPaymentMethodRef.fromJson( + json + ); + case 'card': + return _CardPaymentMethodDefault.fromJson( + json + ); + case 'card': + return _CardPaymentMethodDetailsToken.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'type', + 'CardPaymentMethodDetails', + 'Invalid union type "${json['type']}"!' +); + } + } /// @nodoc mixin _$CardPaymentMethodDetails { - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - token, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map( - TResult Function(_CardPaymentMethodDefault value) $default, { - required TResult Function(_CardPaymentMethodRef value) id, - required TResult Function(_CardPaymentMethodDetailsToken value) token, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CardPaymentMethodDefault value)? $default, { - TResult? Function(_CardPaymentMethodRef value)? id, - TResult? Function(_CardPaymentMethodDetailsToken value)? token, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CardPaymentMethodDefault value)? $default, { - TResult Function(_CardPaymentMethodRef value)? id, - TResult Function(_CardPaymentMethodDetailsToken value)? token, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + /// Serializes this CardPaymentMethodDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardPaymentMethodDetails); } -/// @nodoc -abstract class $CardPaymentMethodDetailsCopyWith<$Res> { - factory $CardPaymentMethodDetailsCopyWith(CardPaymentMethodDetails value, - $Res Function(CardPaymentMethodDetails) then) = - _$CardPaymentMethodDetailsCopyWithImpl<$Res, CardPaymentMethodDetails>; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'CardPaymentMethodDetails()'; +} + + } /// @nodoc -class _$CardPaymentMethodDetailsCopyWithImpl<$Res, - $Val extends CardPaymentMethodDetails> - implements $CardPaymentMethodDetailsCopyWith<$Res> { - _$CardPaymentMethodDetailsCopyWithImpl(this._value, this._then); +class $CardPaymentMethodDetailsCopyWith<$Res> { +$CardPaymentMethodDetailsCopyWith(CardPaymentMethodDetails _, $Res Function(CardPaymentMethodDetails) __); +} - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. +/// Adds pattern-matching-related methods to [CardPaymentMethodDetails]. +extension CardPaymentMethodDetailsPatterns on CardPaymentMethodDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardPaymentMethodDefault value)? $default,{TResult Function( _CardPaymentMethodRef value)? id,TResult Function( _CardPaymentMethodDetailsToken value)? token,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardPaymentMethodRef() when id != null: +return id(_that);case _CardPaymentMethodDefault() when $default != null: +return $default(_that);case _CardPaymentMethodDetailsToken() when token != null: +return token(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardPaymentMethodDefault value) $default,{required TResult Function( _CardPaymentMethodRef value) id,required TResult Function( _CardPaymentMethodDetailsToken value) token,}){ +final _that = this; +switch (_that) { +case _CardPaymentMethodRef(): +return id(_that);case _CardPaymentMethodDefault(): +return $default(_that);case _CardPaymentMethodDetailsToken(): +return token(_that);} } +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardPaymentMethodDefault value)? $default,{TResult? Function( _CardPaymentMethodRef value)? id,TResult? Function( _CardPaymentMethodDetailsToken value)? token,}){ +final _that = this; +switch (_that) { +case _CardPaymentMethodRef() when id != null: +return id(_that);case _CardPaymentMethodDefault() when $default != null: +return $default(_that);case _CardPaymentMethodDetailsToken() when token != null: +return token(_that);case _: + return null; -/// @nodoc -abstract class _$$CardPaymentMethodRefImplCopyWith<$Res> { - factory _$$CardPaymentMethodRefImplCopyWith(_$CardPaymentMethodRefImpl value, - $Res Function(_$CardPaymentMethodRefImpl) then) = - __$$CardPaymentMethodRefImplCopyWithImpl<$Res>; - @useResult - $Res call({String id}); +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@ElementConverter() Element card, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{TResult Function( String id)? id,TResult Function( CardTokenPaymentMethod card, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? token,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardPaymentMethodRef() when id != null: +return id(_that.id);case _CardPaymentMethodDefault() when $default != null: +return $default(_that.card,_that.billingDetails);case _CardPaymentMethodDetailsToken() when token != null: +return token(_that.card,_that.billingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@ElementConverter() Element card, @JsonKey(name: "billing_details") BillingDetails? billingDetails) $default,{required TResult Function( String id) id,required TResult Function( CardTokenPaymentMethod card, @JsonKey(name: "billing_details") BillingDetails? billingDetails) token,}) {final _that = this; +switch (_that) { +case _CardPaymentMethodRef(): +return id(_that.id);case _CardPaymentMethodDefault(): +return $default(_that.card,_that.billingDetails);case _CardPaymentMethodDetailsToken(): +return token(_that.card,_that.billingDetails);} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@ElementConverter() Element card, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{TResult? Function( String id)? id,TResult? Function( CardTokenPaymentMethod card, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? token,}) {final _that = this; +switch (_that) { +case _CardPaymentMethodRef() when id != null: +return id(_that.id);case _CardPaymentMethodDefault() when $default != null: +return $default(_that.card,_that.billingDetails);case _CardPaymentMethodDetailsToken() when token != null: +return token(_that.card,_that.billingDetails);case _: + return null; + +} } -/// @nodoc -class __$$CardPaymentMethodRefImplCopyWithImpl<$Res> - extends _$CardPaymentMethodDetailsCopyWithImpl<$Res, - _$CardPaymentMethodRefImpl> - implements _$$CardPaymentMethodRefImplCopyWith<$Res> { - __$$CardPaymentMethodRefImplCopyWithImpl(_$CardPaymentMethodRefImpl _value, - $Res Function(_$CardPaymentMethodRefImpl) _then) - : super(_value, _then); - - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_$CardPaymentMethodRefImpl( - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$CardPaymentMethodRefImpl implements _CardPaymentMethodRef { - const _$CardPaymentMethodRefImpl(this.id, {final String? $type}) - : $type = $type ?? 'card'; - factory _$CardPaymentMethodRefImpl.fromJson(Map json) => - _$$CardPaymentMethodRefImplFromJson(json); +class _CardPaymentMethodRef implements CardPaymentMethodDetails, IdPaymentMethodDetails { + const _CardPaymentMethodRef(this.id, {final String? $type}): $type = $type ?? 'card'; + factory _CardPaymentMethodRef.fromJson(Map json) => _$CardPaymentMethodRefFromJson(json); - @override - final String id; + final String id; - @JsonKey(name: 'type') - final String $type; +@JsonKey(name: 'type') +final String $type; - @override - String toString() { - return 'CardPaymentMethodDetails.id(id: $id)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardPaymentMethodRefImpl && - (identical(other.id, id) || other.id == id)); - } +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardPaymentMethodRefCopyWith<_CardPaymentMethodRef> get copyWith => __$CardPaymentMethodRefCopyWithImpl<_CardPaymentMethodRef>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id); - - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardPaymentMethodRefImplCopyWith<_$CardPaymentMethodRefImpl> - get copyWith => - __$$CardPaymentMethodRefImplCopyWithImpl<_$CardPaymentMethodRefImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - token, - }) { - return id(this.id); - } - - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - }) { - return id?.call(this.id); - } +@override +Map toJson() { + return _$CardPaymentMethodRefToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - required TResult orElse(), - }) { - if (id != null) { - return id(this.id); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardPaymentMethodRef&&(identical(other.id, id) || other.id == id)); +} - @override - @optionalTypeArgs - TResult map( - TResult Function(_CardPaymentMethodDefault value) $default, { - required TResult Function(_CardPaymentMethodRef value) id, - required TResult Function(_CardPaymentMethodDetailsToken value) token, - }) { - return id(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CardPaymentMethodDefault value)? $default, { - TResult? Function(_CardPaymentMethodRef value)? id, - TResult? Function(_CardPaymentMethodDetailsToken value)? token, - }) { - return id?.call(this); - } +@override +String toString() { + return 'CardPaymentMethodDetails.id(id: $id)'; +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CardPaymentMethodDefault value)? $default, { - TResult Function(_CardPaymentMethodRef value)? id, - TResult Function(_CardPaymentMethodDetailsToken value)? token, - required TResult orElse(), - }) { - if (id != null) { - return id(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$CardPaymentMethodRefImplToJson( - this, - ); - } } -abstract class _CardPaymentMethodRef - implements CardPaymentMethodDetails, IdPaymentMethodDetails { - const factory _CardPaymentMethodRef(final String id) = - _$CardPaymentMethodRefImpl; +/// @nodoc +abstract mixin class _$CardPaymentMethodRefCopyWith<$Res> implements $CardPaymentMethodDetailsCopyWith<$Res> { + factory _$CardPaymentMethodRefCopyWith(_CardPaymentMethodRef value, $Res Function(_CardPaymentMethodRef) _then) = __$CardPaymentMethodRefCopyWithImpl; +@useResult +$Res call({ + String id +}); - factory _CardPaymentMethodRef.fromJson(Map json) = - _$CardPaymentMethodRefImpl.fromJson; - String get id; - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardPaymentMethodRefImplCopyWith<_$CardPaymentMethodRefImpl> - get copyWith => throw _privateConstructorUsedError; -} +} /// @nodoc -abstract class _$$CardPaymentMethodDefaultImplCopyWith<$Res> { - factory _$$CardPaymentMethodDefaultImplCopyWith( - _$CardPaymentMethodDefaultImpl value, - $Res Function(_$CardPaymentMethodDefaultImpl) then) = - __$$CardPaymentMethodDefaultImplCopyWithImpl<$Res>; - @useResult - $Res call( - {@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails}); - - $BillingDetailsCopyWith<$Res>? get billingDetails; +class __$CardPaymentMethodRefCopyWithImpl<$Res> + implements _$CardPaymentMethodRefCopyWith<$Res> { + __$CardPaymentMethodRefCopyWithImpl(this._self, this._then); + + final _CardPaymentMethodRef _self; + final $Res Function(_CardPaymentMethodRef) _then; + +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? id = null,}) { + return _then(_CardPaymentMethodRef( +null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String, + )); } -/// @nodoc -class __$$CardPaymentMethodDefaultImplCopyWithImpl<$Res> - extends _$CardPaymentMethodDetailsCopyWithImpl<$Res, - _$CardPaymentMethodDefaultImpl> - implements _$$CardPaymentMethodDefaultImplCopyWith<$Res> { - __$$CardPaymentMethodDefaultImplCopyWithImpl( - _$CardPaymentMethodDefaultImpl _value, - $Res Function(_$CardPaymentMethodDefaultImpl) _then) - : super(_value, _then); - - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? card = null, - Object? billingDetails = freezed, - }) { - return _then(_$CardPaymentMethodDefaultImpl( - card: null == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as Element, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } } /// @nodoc @JsonSerializable() -class _$CardPaymentMethodDefaultImpl implements _CardPaymentMethodDefault { - const _$CardPaymentMethodDefaultImpl( - {@ElementConverter() required this.card, - @JsonKey(name: "billing_details") this.billingDetails, - final String? $type}) - : $type = $type ?? 'card'; - - factory _$CardPaymentMethodDefaultImpl.fromJson(Map json) => - _$$CardPaymentMethodDefaultImplFromJson(json); - - /// Uses the provided card or cardNumber Element for confirmation. - @override - @ElementConverter() - final Element card; - - /// The billing_details associated with the card. - @override - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'CardPaymentMethodDetails(card: $card, billingDetails: $billingDetails)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardPaymentMethodDefaultImpl && - (identical(other.card, card) || other.card == card) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, card, billingDetails); - - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardPaymentMethodDefaultImplCopyWith<_$CardPaymentMethodDefaultImpl> - get copyWith => __$$CardPaymentMethodDefaultImplCopyWithImpl< - _$CardPaymentMethodDefaultImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - token, - }) { - return $default(card, billingDetails); - } +class _CardPaymentMethodDefault implements CardPaymentMethodDetails { + const _CardPaymentMethodDefault({@ElementConverter() required this.card, @JsonKey(name: "billing_details") this.billingDetails, final String? $type}): $type = $type ?? 'card'; + factory _CardPaymentMethodDefault.fromJson(Map json) => _$CardPaymentMethodDefaultFromJson(json); - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - }) { - return $default?.call(card, billingDetails); - } +/// Uses the provided card or cardNumber Element for confirmation. +@ElementConverter() final Element card; +/// The billing_details associated with the card. +@JsonKey(name: "billing_details") final BillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - required TResult orElse(), - }) { - if ($default != null) { - return $default(card, billingDetails); - } - return orElse(); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult map( - TResult Function(_CardPaymentMethodDefault value) $default, { - required TResult Function(_CardPaymentMethodRef value) id, - required TResult Function(_CardPaymentMethodDetailsToken value) token, - }) { - return $default(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CardPaymentMethodDefault value)? $default, { - TResult? Function(_CardPaymentMethodRef value)? id, - TResult? Function(_CardPaymentMethodDetailsToken value)? token, - }) { - return $default?.call(this); - } +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardPaymentMethodDefaultCopyWith<_CardPaymentMethodDefault> get copyWith => __$CardPaymentMethodDefaultCopyWithImpl<_CardPaymentMethodDefault>(this, _$identity); - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CardPaymentMethodDefault value)? $default, { - TResult Function(_CardPaymentMethodRef value)? id, - TResult Function(_CardPaymentMethodDetailsToken value)? token, - required TResult orElse(), - }) { - if ($default != null) { - return $default(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$CardPaymentMethodDefaultImplToJson( - this, - ); - } +@override +Map toJson() { + return _$CardPaymentMethodDefaultToJson(this, ); } -abstract class _CardPaymentMethodDefault implements CardPaymentMethodDetails { - const factory _CardPaymentMethodDefault( - {@ElementConverter() required final Element card, - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails}) = _$CardPaymentMethodDefaultImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardPaymentMethodDefault&&(identical(other.card, card) || other.card == card)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - factory _CardPaymentMethodDefault.fromJson(Map json) = - _$CardPaymentMethodDefaultImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,card,billingDetails); - /// Uses the provided card or cardNumber Element for confirmation. - @ElementConverter() - Element get card; +@override +String toString() { + return 'CardPaymentMethodDetails(card: $card, billingDetails: $billingDetails)'; +} - /// The billing_details associated with the card. - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails; - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardPaymentMethodDefaultImplCopyWith<_$CardPaymentMethodDefaultImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$CardPaymentMethodDetailsTokenImplCopyWith<$Res> { - factory _$$CardPaymentMethodDetailsTokenImplCopyWith( - _$CardPaymentMethodDetailsTokenImpl value, - $Res Function(_$CardPaymentMethodDetailsTokenImpl) then) = - __$$CardPaymentMethodDetailsTokenImplCopyWithImpl<$Res>; - @useResult - $Res call( - {CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails}); +abstract mixin class _$CardPaymentMethodDefaultCopyWith<$Res> implements $CardPaymentMethodDetailsCopyWith<$Res> { + factory _$CardPaymentMethodDefaultCopyWith(_CardPaymentMethodDefault value, $Res Function(_CardPaymentMethodDefault) _then) = __$CardPaymentMethodDefaultCopyWithImpl; +@useResult +$Res call({ +@ElementConverter() Element card,@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); - $CardTokenPaymentMethodCopyWith<$Res> get card; - $BillingDetailsCopyWith<$Res>? get billingDetails; -} +$BillingDetailsCopyWith<$Res>? get billingDetails; + +} /// @nodoc -class __$$CardPaymentMethodDetailsTokenImplCopyWithImpl<$Res> - extends _$CardPaymentMethodDetailsCopyWithImpl<$Res, - _$CardPaymentMethodDetailsTokenImpl> - implements _$$CardPaymentMethodDetailsTokenImplCopyWith<$Res> { - __$$CardPaymentMethodDetailsTokenImplCopyWithImpl( - _$CardPaymentMethodDetailsTokenImpl _value, - $Res Function(_$CardPaymentMethodDetailsTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? card = null, - Object? billingDetails = freezed, - }) { - return _then(_$CardPaymentMethodDetailsTokenImpl( - card: null == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardTokenPaymentMethod, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } +class __$CardPaymentMethodDefaultCopyWithImpl<$Res> + implements _$CardPaymentMethodDefaultCopyWith<$Res> { + __$CardPaymentMethodDefaultCopyWithImpl(this._self, this._then); + + final _CardPaymentMethodDefault _self; + final $Res Function(_CardPaymentMethodDefault) _then; + +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? card = null,Object? billingDetails = freezed,}) { + return _then(_CardPaymentMethodDefault( +card: null == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as Element,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardTokenPaymentMethodCopyWith<$Res> get card { - return $CardTokenPaymentMethodCopyWith<$Res>(_value.card, (value) { - return _then(_value.copyWith(card: value)); - }); +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } /// @nodoc @JsonSerializable() -class _$CardPaymentMethodDetailsTokenImpl - implements _CardPaymentMethodDetailsToken { - const _$CardPaymentMethodDetailsTokenImpl( - {required this.card, - @JsonKey(name: "billing_details") this.billingDetails, - final String? $type}) - : $type = $type ?? 'card'; - - factory _$CardPaymentMethodDetailsTokenImpl.fromJson( - Map json) => - _$$CardPaymentMethodDetailsTokenImplFromJson(json); - - /// Uses the provided card or cardNumber Element for confirmation. - @override - final CardTokenPaymentMethod card; - - /// The billing_details associated with the card. - @override - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'CardPaymentMethodDetails.token(card: $card, billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardPaymentMethodDetailsTokenImpl && - (identical(other.card, card) || other.card == card) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _CardPaymentMethodDetailsToken implements CardPaymentMethodDetails { + const _CardPaymentMethodDetailsToken({required this.card, @JsonKey(name: "billing_details") this.billingDetails, final String? $type}): $type = $type ?? 'card'; + factory _CardPaymentMethodDetailsToken.fromJson(Map json) => _$CardPaymentMethodDetailsTokenFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, card, billingDetails); - - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardPaymentMethodDetailsTokenImplCopyWith< - _$CardPaymentMethodDetailsTokenImpl> - get copyWith => __$$CardPaymentMethodDetailsTokenImplCopyWithImpl< - _$CardPaymentMethodDetailsTokenImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - token, - }) { - return token(card, billingDetails); - } +/// Uses the provided card or cardNumber Element for confirmation. + final CardTokenPaymentMethod card; +/// The billing_details associated with the card. +@JsonKey(name: "billing_details") final BillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - }) { - return token?.call(card, billingDetails); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - token, - required TResult orElse(), - }) { - if (token != null) { - return token(card, billingDetails); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map( - TResult Function(_CardPaymentMethodDefault value) $default, { - required TResult Function(_CardPaymentMethodRef value) id, - required TResult Function(_CardPaymentMethodDetailsToken value) token, - }) { - return token(this); - } +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardPaymentMethodDetailsTokenCopyWith<_CardPaymentMethodDetailsToken> get copyWith => __$CardPaymentMethodDetailsTokenCopyWithImpl<_CardPaymentMethodDetailsToken>(this, _$identity); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CardPaymentMethodDefault value)? $default, { - TResult? Function(_CardPaymentMethodRef value)? id, - TResult? Function(_CardPaymentMethodDetailsToken value)? token, - }) { - return token?.call(this); - } +@override +Map toJson() { + return _$CardPaymentMethodDetailsTokenToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CardPaymentMethodDefault value)? $default, { - TResult Function(_CardPaymentMethodRef value)? id, - TResult Function(_CardPaymentMethodDetailsToken value)? token, - required TResult orElse(), - }) { - if (token != null) { - return token(this); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardPaymentMethodDetailsToken&&(identical(other.card, card) || other.card == card)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - @override - Map toJson() { - return _$$CardPaymentMethodDetailsTokenImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,card,billingDetails); + +@override +String toString() { + return 'CardPaymentMethodDetails.token(card: $card, billingDetails: $billingDetails)'; } -abstract class _CardPaymentMethodDetailsToken - implements CardPaymentMethodDetails { - const factory _CardPaymentMethodDetailsToken( - {required final CardTokenPaymentMethod card, - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails}) = - _$CardPaymentMethodDetailsTokenImpl; - factory _CardPaymentMethodDetailsToken.fromJson(Map json) = - _$CardPaymentMethodDetailsTokenImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$CardPaymentMethodDetailsTokenCopyWith<$Res> implements $CardPaymentMethodDetailsCopyWith<$Res> { + factory _$CardPaymentMethodDetailsTokenCopyWith(_CardPaymentMethodDetailsToken value, $Res Function(_CardPaymentMethodDetailsToken) _then) = __$CardPaymentMethodDetailsTokenCopyWithImpl; +@useResult +$Res call({ + CardTokenPaymentMethod card,@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); - /// Uses the provided card or cardNumber Element for confirmation. - CardTokenPaymentMethod get card; - /// The billing_details associated with the card. - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails; +$CardTokenPaymentMethodCopyWith<$Res> get card;$BillingDetailsCopyWith<$Res>? get billingDetails; - /// Create a copy of CardPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardPaymentMethodDetailsTokenImplCopyWith< - _$CardPaymentMethodDetailsTokenImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$CardPaymentMethodDetailsTokenCopyWithImpl<$Res> + implements _$CardPaymentMethodDetailsTokenCopyWith<$Res> { + __$CardPaymentMethodDetailsTokenCopyWithImpl(this._self, this._then); + + final _CardPaymentMethodDetailsToken _self; + final $Res Function(_CardPaymentMethodDetailsToken) _then; + +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? card = null,Object? billingDetails = freezed,}) { + return _then(_CardPaymentMethodDetailsToken( +card: null == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardTokenPaymentMethod,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} + +/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardTokenPaymentMethodCopyWith<$Res> get card { + + return $CardTokenPaymentMethodCopyWith<$Res>(_self.card, (value) { + return _then(_self.copyWith(card: value)); + }); +}/// Create a copy of CardPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } IdealPaymentMethodDetails _$IdealPaymentMethodDetailsFromJson( - Map json) { - switch (json['type']) { - case 'ideal': - return _IdIdealPaymentMethodDetails.fromJson(json); - case 'ideal': - return _IdealPaymentMethodDetails.fromJson(json); - case 'ideal': - return _IdealPaymentMethodDetailsSelfCollect.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'type', 'IdealPaymentMethodDetails', - 'Invalid union type "${json['type']}"!'); - } + Map json +) { + switch (json['type']) { + case 'ideal': + return _IdIdealPaymentMethodDetailsIdOnly.fromJson( + json + ); + case 'ideal': + return _IdealPaymentMethodDetailsWithBilling.fromJson( + json + ); + case 'ideal': + return _IdealPaymentMethodDetailsSelfCollect.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'type', + 'IdealPaymentMethodDetails', + 'Invalid union type "${json['type']}"!' +); + } + } /// @nodoc mixin _$IdealPaymentMethodDetails { - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - withBank, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map( - TResult Function(_IdealPaymentMethodDetails value) $default, { - required TResult Function(_IdIdealPaymentMethodDetails value) id, - required TResult Function(_IdealPaymentMethodDetailsSelfCollect value) - withBank, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_IdealPaymentMethodDetails value)? $default, { - TResult? Function(_IdIdealPaymentMethodDetails value)? id, - TResult? Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap( - TResult Function(_IdealPaymentMethodDetails value)? $default, { - TResult Function(_IdIdealPaymentMethodDetails value)? id, - TResult Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + /// Serializes this IdealPaymentMethodDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} + Map toJson(); -/// @nodoc -abstract class $IdealPaymentMethodDetailsCopyWith<$Res> { - factory $IdealPaymentMethodDetailsCopyWith(IdealPaymentMethodDetails value, - $Res Function(IdealPaymentMethodDetails) then) = - _$IdealPaymentMethodDetailsCopyWithImpl<$Res, IdealPaymentMethodDetails>; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IdealPaymentMethodDetails); } -/// @nodoc -class _$IdealPaymentMethodDetailsCopyWithImpl<$Res, - $Val extends IdealPaymentMethodDetails> - implements $IdealPaymentMethodDetailsCopyWith<$Res> { - _$IdealPaymentMethodDetailsCopyWithImpl(this._value, this._then); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'IdealPaymentMethodDetails()'; +} - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. } /// @nodoc -abstract class _$$IdIdealPaymentMethodDetailsImplCopyWith<$Res> { - factory _$$IdIdealPaymentMethodDetailsImplCopyWith( - _$IdIdealPaymentMethodDetailsImpl value, - $Res Function(_$IdIdealPaymentMethodDetailsImpl) then) = - __$$IdIdealPaymentMethodDetailsImplCopyWithImpl<$Res>; - @useResult - $Res call({String id}); +class $IdealPaymentMethodDetailsCopyWith<$Res> { +$IdealPaymentMethodDetailsCopyWith(IdealPaymentMethodDetails _, $Res Function(IdealPaymentMethodDetails) __); } -/// @nodoc -class __$$IdIdealPaymentMethodDetailsImplCopyWithImpl<$Res> - extends _$IdealPaymentMethodDetailsCopyWithImpl<$Res, - _$IdIdealPaymentMethodDetailsImpl> - implements _$$IdIdealPaymentMethodDetailsImplCopyWith<$Res> { - __$$IdIdealPaymentMethodDetailsImplCopyWithImpl( - _$IdIdealPaymentMethodDetailsImpl _value, - $Res Function(_$IdIdealPaymentMethodDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_$IdIdealPaymentMethodDetailsImpl( - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - )); - } + +/// Adds pattern-matching-related methods to [IdealPaymentMethodDetails]. +extension IdealPaymentMethodDetailsPatterns on IdealPaymentMethodDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IdealPaymentMethodDetailsWithBilling value)? $default,{TResult Function( _IdIdealPaymentMethodDetailsIdOnly value)? id,TResult Function( _IdealPaymentMethodDetailsSelfCollect value)? withBank,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IdIdealPaymentMethodDetailsIdOnly() when id != null: +return id(_that);case _IdealPaymentMethodDetailsWithBilling() when $default != null: +return $default(_that);case _IdealPaymentMethodDetailsSelfCollect() when withBank != null: +return withBank(_that);case _: + return orElse(); + } +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IdealPaymentMethodDetailsWithBilling value) $default,{required TResult Function( _IdIdealPaymentMethodDetailsIdOnly value) id,required TResult Function( _IdealPaymentMethodDetailsSelfCollect value) withBank,}){ +final _that = this; +switch (_that) { +case _IdIdealPaymentMethodDetailsIdOnly(): +return id(_that);case _IdealPaymentMethodDetailsWithBilling(): +return $default(_that);case _IdealPaymentMethodDetailsSelfCollect(): +return withBank(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -@JsonSerializable() -class _$IdIdealPaymentMethodDetailsImpl - implements _IdIdealPaymentMethodDetails { - const _$IdIdealPaymentMethodDetailsImpl(this.id, {final String? $type}) - : $type = $type ?? 'ideal'; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IdealPaymentMethodDetailsWithBilling value)? $default,{TResult? Function( _IdIdealPaymentMethodDetailsIdOnly value)? id,TResult? Function( _IdealPaymentMethodDetailsSelfCollect value)? withBank,}){ +final _that = this; +switch (_that) { +case _IdIdealPaymentMethodDetailsIdOnly() when id != null: +return id(_that);case _IdealPaymentMethodDetailsWithBilling() when $default != null: +return $default(_that);case _IdealPaymentMethodDetailsSelfCollect() when withBank != null: +return withBank(_that);case _: + return null; - factory _$IdIdealPaymentMethodDetailsImpl.fromJson( - Map json) => - _$$IdIdealPaymentMethodDetailsImplFromJson(json); +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@ElementConverter() Element ideal, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{TResult Function( String id)? id,TResult Function( IdealBankData ideal, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? withBank,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IdIdealPaymentMethodDetailsIdOnly() when id != null: +return id(_that.id);case _IdealPaymentMethodDetailsWithBilling() when $default != null: +return $default(_that.ideal,_that.billingDetails);case _IdealPaymentMethodDetailsSelfCollect() when withBank != null: +return withBank(_that.ideal,_that.billingDetails);case _: + return orElse(); - @override - final String id; +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@ElementConverter() Element ideal, @JsonKey(name: "billing_details") BillingDetails? billingDetails) $default,{required TResult Function( String id) id,required TResult Function( IdealBankData ideal, @JsonKey(name: "billing_details") BillingDetails? billingDetails) withBank,}) {final _that = this; +switch (_that) { +case _IdIdealPaymentMethodDetailsIdOnly(): +return id(_that.id);case _IdealPaymentMethodDetailsWithBilling(): +return $default(_that.ideal,_that.billingDetails);case _IdealPaymentMethodDetailsSelfCollect(): +return withBank(_that.ideal,_that.billingDetails);case _: + throw StateError('Unexpected subclass'); - @JsonKey(name: 'type') - final String $type; +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@ElementConverter() Element ideal, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{TResult? Function( String id)? id,TResult? Function( IdealBankData ideal, @JsonKey(name: "billing_details") BillingDetails? billingDetails)? withBank,}) {final _that = this; +switch (_that) { +case _IdIdealPaymentMethodDetailsIdOnly() when id != null: +return id(_that.id);case _IdealPaymentMethodDetailsWithBilling() when $default != null: +return $default(_that.ideal,_that.billingDetails);case _IdealPaymentMethodDetailsSelfCollect() when withBank != null: +return withBank(_that.ideal,_that.billingDetails);case _: + return null; - @override - String toString() { - return 'IdealPaymentMethodDetails.id(id: $id)'; - } +} +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdIdealPaymentMethodDetailsImpl && - (identical(other.id, id) || other.id == id)); - } +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id); - - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdIdealPaymentMethodDetailsImplCopyWith<_$IdIdealPaymentMethodDetailsImpl> - get copyWith => __$$IdIdealPaymentMethodDetailsImplCopyWithImpl< - _$IdIdealPaymentMethodDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - withBank, - }) { - return id(this.id); - } +/// @nodoc +@JsonSerializable() - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - }) { - return id?.call(this.id); - } +class _IdIdealPaymentMethodDetailsIdOnly implements IdealPaymentMethodDetails, IdPaymentMethodDetails { + const _IdIdealPaymentMethodDetailsIdOnly(this.id, {final String? $type}): $type = $type ?? 'ideal'; + factory _IdIdealPaymentMethodDetailsIdOnly.fromJson(Map json) => _$IdIdealPaymentMethodDetailsIdOnlyFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - required TResult orElse(), - }) { - if (id != null) { - return id(this.id); - } - return orElse(); - } + final String id; - @override - @optionalTypeArgs - TResult map( - TResult Function(_IdealPaymentMethodDetails value) $default, { - required TResult Function(_IdIdealPaymentMethodDetails value) id, - required TResult Function(_IdealPaymentMethodDetailsSelfCollect value) - withBank, - }) { - return id(this); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_IdealPaymentMethodDetails value)? $default, { - TResult? Function(_IdIdealPaymentMethodDetails value)? id, - TResult? Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - }) { - return id?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_IdealPaymentMethodDetails value)? $default, { - TResult Function(_IdIdealPaymentMethodDetails value)? id, - TResult Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - required TResult orElse(), - }) { - if (id != null) { - return id(this); - } - return orElse(); - } +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdIdealPaymentMethodDetailsIdOnlyCopyWith<_IdIdealPaymentMethodDetailsIdOnly> get copyWith => __$IdIdealPaymentMethodDetailsIdOnlyCopyWithImpl<_IdIdealPaymentMethodDetailsIdOnly>(this, _$identity); - @override - Map toJson() { - return _$$IdIdealPaymentMethodDetailsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$IdIdealPaymentMethodDetailsIdOnlyToJson(this, ); } -abstract class _IdIdealPaymentMethodDetails - implements IdealPaymentMethodDetails, IdPaymentMethodDetails { - const factory _IdIdealPaymentMethodDetails(final String id) = - _$IdIdealPaymentMethodDetailsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IdIdealPaymentMethodDetailsIdOnly&&(identical(other.id, id) || other.id == id)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id); - factory _IdIdealPaymentMethodDetails.fromJson(Map json) = - _$IdIdealPaymentMethodDetailsImpl.fromJson; +@override +String toString() { + return 'IdealPaymentMethodDetails.id(id: $id)'; +} - String get id; - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdIdealPaymentMethodDetailsImplCopyWith<_$IdIdealPaymentMethodDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$IdealPaymentMethodDetailsImplCopyWith<$Res> { - factory _$$IdealPaymentMethodDetailsImplCopyWith( - _$IdealPaymentMethodDetailsImpl value, - $Res Function(_$IdealPaymentMethodDetailsImpl) then) = - __$$IdealPaymentMethodDetailsImplCopyWithImpl<$Res>; - @useResult - $Res call( - {@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails}); +abstract mixin class _$IdIdealPaymentMethodDetailsIdOnlyCopyWith<$Res> implements $IdealPaymentMethodDetailsCopyWith<$Res> { + factory _$IdIdealPaymentMethodDetailsIdOnlyCopyWith(_IdIdealPaymentMethodDetailsIdOnly value, $Res Function(_IdIdealPaymentMethodDetailsIdOnly) _then) = __$IdIdealPaymentMethodDetailsIdOnlyCopyWithImpl; +@useResult +$Res call({ + String id +}); + + - $BillingDetailsCopyWith<$Res>? get billingDetails; -} +} /// @nodoc -class __$$IdealPaymentMethodDetailsImplCopyWithImpl<$Res> - extends _$IdealPaymentMethodDetailsCopyWithImpl<$Res, - _$IdealPaymentMethodDetailsImpl> - implements _$$IdealPaymentMethodDetailsImplCopyWith<$Res> { - __$$IdealPaymentMethodDetailsImplCopyWithImpl( - _$IdealPaymentMethodDetailsImpl _value, - $Res Function(_$IdealPaymentMethodDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ideal = null, - Object? billingDetails = freezed, - }) { - return _then(_$IdealPaymentMethodDetailsImpl( - ideal: null == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Element, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } +class __$IdIdealPaymentMethodDetailsIdOnlyCopyWithImpl<$Res> + implements _$IdIdealPaymentMethodDetailsIdOnlyCopyWith<$Res> { + __$IdIdealPaymentMethodDetailsIdOnlyCopyWithImpl(this._self, this._then); + + final _IdIdealPaymentMethodDetailsIdOnly _self; + final $Res Function(_IdIdealPaymentMethodDetailsIdOnly) _then; + +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? id = null,}) { + return _then(_IdIdealPaymentMethodDetailsIdOnly( +null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String, + )); +} + - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } } /// @nodoc @JsonSerializable() -class _$IdealPaymentMethodDetailsImpl implements _IdealPaymentMethodDetails { - const _$IdealPaymentMethodDetailsImpl( - {@ElementConverter() required this.ideal, - @JsonKey(name: "billing_details") this.billingDetails, - final String? $type}) - : $type = $type ?? 'ideal'; - - factory _$IdealPaymentMethodDetailsImpl.fromJson(Map json) => - _$$IdealPaymentMethodDetailsImplFromJson(json); - - /// Uses the provided card or cardNumber Element for confirmation. - @override - @ElementConverter() - final Element ideal; - - /// The billing_details associated with the card. - @override - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'IdealPaymentMethodDetails(ideal: $ideal, billingDetails: $billingDetails)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdealPaymentMethodDetailsImpl && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, ideal, billingDetails); - - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdealPaymentMethodDetailsImplCopyWith<_$IdealPaymentMethodDetailsImpl> - get copyWith => __$$IdealPaymentMethodDetailsImplCopyWithImpl< - _$IdealPaymentMethodDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - withBank, - }) { - return $default(ideal, billingDetails); - } +class _IdealPaymentMethodDetailsWithBilling implements IdealPaymentMethodDetails { + const _IdealPaymentMethodDetailsWithBilling({@ElementConverter() required this.ideal, @JsonKey(name: "billing_details") this.billingDetails, final String? $type}): $type = $type ?? 'ideal'; + factory _IdealPaymentMethodDetailsWithBilling.fromJson(Map json) => _$IdealPaymentMethodDetailsWithBillingFromJson(json); - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - }) { - return $default?.call(ideal, billingDetails); - } +/// Uses the provided card or cardNumber Element for confirmation. +@ElementConverter() final Element ideal; +/// The billing_details associated with the card. +@JsonKey(name: "billing_details") final BillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - required TResult orElse(), - }) { - if ($default != null) { - return $default(ideal, billingDetails); - } - return orElse(); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult map( - TResult Function(_IdealPaymentMethodDetails value) $default, { - required TResult Function(_IdIdealPaymentMethodDetails value) id, - required TResult Function(_IdealPaymentMethodDetailsSelfCollect value) - withBank, - }) { - return $default(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_IdealPaymentMethodDetails value)? $default, { - TResult? Function(_IdIdealPaymentMethodDetails value)? id, - TResult? Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - }) { - return $default?.call(this); - } +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdealPaymentMethodDetailsWithBillingCopyWith<_IdealPaymentMethodDetailsWithBilling> get copyWith => __$IdealPaymentMethodDetailsWithBillingCopyWithImpl<_IdealPaymentMethodDetailsWithBilling>(this, _$identity); - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_IdealPaymentMethodDetails value)? $default, { - TResult Function(_IdIdealPaymentMethodDetails value)? id, - TResult Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - required TResult orElse(), - }) { - if ($default != null) { - return $default(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$IdealPaymentMethodDetailsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$IdealPaymentMethodDetailsWithBillingToJson(this, ); } -abstract class _IdealPaymentMethodDetails implements IdealPaymentMethodDetails { - const factory _IdealPaymentMethodDetails( - {@ElementConverter() required final Element ideal, - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails}) = _$IdealPaymentMethodDetailsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IdealPaymentMethodDetailsWithBilling&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - factory _IdealPaymentMethodDetails.fromJson(Map json) = - _$IdealPaymentMethodDetailsImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,ideal,billingDetails); - /// Uses the provided card or cardNumber Element for confirmation. - @ElementConverter() - Element get ideal; +@override +String toString() { + return 'IdealPaymentMethodDetails(ideal: $ideal, billingDetails: $billingDetails)'; +} - /// The billing_details associated with the card. - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails; - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdealPaymentMethodDetailsImplCopyWith<_$IdealPaymentMethodDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$IdealPaymentMethodDetailsSelfCollectImplCopyWith<$Res> { - factory _$$IdealPaymentMethodDetailsSelfCollectImplCopyWith( - _$IdealPaymentMethodDetailsSelfCollectImpl value, - $Res Function(_$IdealPaymentMethodDetailsSelfCollectImpl) then) = - __$$IdealPaymentMethodDetailsSelfCollectImplCopyWithImpl<$Res>; - @useResult - $Res call( - {IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails}); +abstract mixin class _$IdealPaymentMethodDetailsWithBillingCopyWith<$Res> implements $IdealPaymentMethodDetailsCopyWith<$Res> { + factory _$IdealPaymentMethodDetailsWithBillingCopyWith(_IdealPaymentMethodDetailsWithBilling value, $Res Function(_IdealPaymentMethodDetailsWithBilling) _then) = __$IdealPaymentMethodDetailsWithBillingCopyWithImpl; +@useResult +$Res call({ +@ElementConverter() Element ideal,@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); - $IdealBankDataCopyWith<$Res> get ideal; - $BillingDetailsCopyWith<$Res>? get billingDetails; -} +$BillingDetailsCopyWith<$Res>? get billingDetails; + +} /// @nodoc -class __$$IdealPaymentMethodDetailsSelfCollectImplCopyWithImpl<$Res> - extends _$IdealPaymentMethodDetailsCopyWithImpl<$Res, - _$IdealPaymentMethodDetailsSelfCollectImpl> - implements _$$IdealPaymentMethodDetailsSelfCollectImplCopyWith<$Res> { - __$$IdealPaymentMethodDetailsSelfCollectImplCopyWithImpl( - _$IdealPaymentMethodDetailsSelfCollectImpl _value, - $Res Function(_$IdealPaymentMethodDetailsSelfCollectImpl) _then) - : super(_value, _then); - - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ideal = null, - Object? billingDetails = freezed, - }) { - return _then(_$IdealPaymentMethodDetailsSelfCollectImpl( - ideal: null == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as IdealBankData, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } +class __$IdealPaymentMethodDetailsWithBillingCopyWithImpl<$Res> + implements _$IdealPaymentMethodDetailsWithBillingCopyWith<$Res> { + __$IdealPaymentMethodDetailsWithBillingCopyWithImpl(this._self, this._then); + + final _IdealPaymentMethodDetailsWithBilling _self; + final $Res Function(_IdealPaymentMethodDetailsWithBilling) _then; + +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? ideal = null,Object? billingDetails = freezed,}) { + return _then(_IdealPaymentMethodDetailsWithBilling( +ideal: null == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Element,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $IdealBankDataCopyWith<$Res> get ideal { - return $IdealBankDataCopyWith<$Res>(_value.ideal, (value) { - return _then(_value.copyWith(ideal: value)); - }); +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } /// @nodoc @JsonSerializable() -class _$IdealPaymentMethodDetailsSelfCollectImpl - implements _IdealPaymentMethodDetailsSelfCollect { - const _$IdealPaymentMethodDetailsSelfCollectImpl( - {required this.ideal, - @JsonKey(name: "billing_details") this.billingDetails, - final String? $type}) - : $type = $type ?? 'ideal'; - - factory _$IdealPaymentMethodDetailsSelfCollectImpl.fromJson( - Map json) => - _$$IdealPaymentMethodDetailsSelfCollectImplFromJson(json); - - /// Uses the provided card or cardNumber Element for confirmation. - @override - final IdealBankData ideal; - - /// The billing_details associated with the card. - @override - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'IdealPaymentMethodDetails.withBank(ideal: $ideal, billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdealPaymentMethodDetailsSelfCollectImpl && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _IdealPaymentMethodDetailsSelfCollect implements IdealPaymentMethodDetails { + const _IdealPaymentMethodDetailsSelfCollect({required this.ideal, @JsonKey(name: "billing_details") this.billingDetails, final String? $type}): $type = $type ?? 'ideal'; + factory _IdealPaymentMethodDetailsSelfCollect.fromJson(Map json) => _$IdealPaymentMethodDetailsSelfCollectFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, ideal, billingDetails); - - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdealPaymentMethodDetailsSelfCollectImplCopyWith< - _$IdealPaymentMethodDetailsSelfCollectImpl> - get copyWith => __$$IdealPaymentMethodDetailsSelfCollectImplCopyWithImpl< - _$IdealPaymentMethodDetailsSelfCollectImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - required TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - withBank, - }) { - return withBank(ideal, billingDetails); - } +/// Uses the provided card or cardNumber Element for confirmation. + final IdealBankData ideal; +/// The billing_details associated with the card. +@JsonKey(name: "billing_details") final BillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - TResult? Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - }) { - return withBank?.call(ideal, billingDetails); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(@ElementConverter() Element ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - TResult Function(IdealBankData ideal, - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - withBank, - required TResult orElse(), - }) { - if (withBank != null) { - return withBank(ideal, billingDetails); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map( - TResult Function(_IdealPaymentMethodDetails value) $default, { - required TResult Function(_IdIdealPaymentMethodDetails value) id, - required TResult Function(_IdealPaymentMethodDetailsSelfCollect value) - withBank, - }) { - return withBank(this); - } +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdealPaymentMethodDetailsSelfCollectCopyWith<_IdealPaymentMethodDetailsSelfCollect> get copyWith => __$IdealPaymentMethodDetailsSelfCollectCopyWithImpl<_IdealPaymentMethodDetailsSelfCollect>(this, _$identity); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_IdealPaymentMethodDetails value)? $default, { - TResult? Function(_IdIdealPaymentMethodDetails value)? id, - TResult? Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - }) { - return withBank?.call(this); - } +@override +Map toJson() { + return _$IdealPaymentMethodDetailsSelfCollectToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_IdealPaymentMethodDetails value)? $default, { - TResult Function(_IdIdealPaymentMethodDetails value)? id, - TResult Function(_IdealPaymentMethodDetailsSelfCollect value)? withBank, - required TResult orElse(), - }) { - if (withBank != null) { - return withBank(this); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IdealPaymentMethodDetailsSelfCollect&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} - @override - Map toJson() { - return _$$IdealPaymentMethodDetailsSelfCollectImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,ideal,billingDetails); + +@override +String toString() { + return 'IdealPaymentMethodDetails.withBank(ideal: $ideal, billingDetails: $billingDetails)'; } -abstract class _IdealPaymentMethodDetailsSelfCollect - implements IdealPaymentMethodDetails { - const factory _IdealPaymentMethodDetailsSelfCollect( - {required final IdealBankData ideal, - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails}) = - _$IdealPaymentMethodDetailsSelfCollectImpl; - factory _IdealPaymentMethodDetailsSelfCollect.fromJson( - Map json) = - _$IdealPaymentMethodDetailsSelfCollectImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$IdealPaymentMethodDetailsSelfCollectCopyWith<$Res> implements $IdealPaymentMethodDetailsCopyWith<$Res> { + factory _$IdealPaymentMethodDetailsSelfCollectCopyWith(_IdealPaymentMethodDetailsSelfCollect value, $Res Function(_IdealPaymentMethodDetailsSelfCollect) _then) = __$IdealPaymentMethodDetailsSelfCollectCopyWithImpl; +@useResult +$Res call({ + IdealBankData ideal,@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); - /// Uses the provided card or cardNumber Element for confirmation. - IdealBankData get ideal; - /// The billing_details associated with the card. - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails; +$IdealBankDataCopyWith<$Res> get ideal;$BillingDetailsCopyWith<$Res>? get billingDetails; - /// Create a copy of IdealPaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdealPaymentMethodDetailsSelfCollectImplCopyWith< - _$IdealPaymentMethodDetailsSelfCollectImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$IdealPaymentMethodDetailsSelfCollectCopyWithImpl<$Res> + implements _$IdealPaymentMethodDetailsSelfCollectCopyWith<$Res> { + __$IdealPaymentMethodDetailsSelfCollectCopyWithImpl(this._self, this._then); + + final _IdealPaymentMethodDetailsSelfCollect _self; + final $Res Function(_IdealPaymentMethodDetailsSelfCollect) _then; + +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? ideal = null,Object? billingDetails = freezed,}) { + return _then(_IdealPaymentMethodDetailsSelfCollect( +ideal: null == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as IdealBankData,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); +} + +/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealBankDataCopyWith<$Res> get ideal { + + return $IdealBankDataCopyWith<$Res>(_self.ideal, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of IdealPaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } P24PaymentMethodDetails _$P24PaymentMethodDetailsFromJson( - Map json) { - switch (json['type']) { - case 'p24': - return _IdP24PaymentMethodDetails.fromJson(json); - case 'p24': - return _P24PaymentMethodDetails.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'type', 'P24PaymentMethodDetails', - 'Invalid union type "${json['type']}"!'); - } + Map json +) { + switch (json['type']) { + case 'p24': + return _IdP24PaymentMethodDetailsIdOnly.fromJson( + json + ); + case 'p24': + return _P24PaymentMethodDetailsWithBilling.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'type', + 'P24PaymentMethodDetails', + 'Invalid union type "${json['type']}"!' +); + } + } /// @nodoc mixin _$P24PaymentMethodDetails { - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map( - TResult Function(_P24PaymentMethodDetails value) $default, { - required TResult Function(_IdP24PaymentMethodDetails value) id, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_P24PaymentMethodDetails value)? $default, { - TResult? Function(_IdP24PaymentMethodDetails value)? id, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap( - TResult Function(_P24PaymentMethodDetails value)? $default, { - TResult Function(_IdP24PaymentMethodDetails value)? id, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + /// Serializes this P24PaymentMethodDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} + Map toJson(); -/// @nodoc -abstract class $P24PaymentMethodDetailsCopyWith<$Res> { - factory $P24PaymentMethodDetailsCopyWith(P24PaymentMethodDetails value, - $Res Function(P24PaymentMethodDetails) then) = - _$P24PaymentMethodDetailsCopyWithImpl<$Res, P24PaymentMethodDetails>; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is P24PaymentMethodDetails); } -/// @nodoc -class _$P24PaymentMethodDetailsCopyWithImpl<$Res, - $Val extends P24PaymentMethodDetails> - implements $P24PaymentMethodDetailsCopyWith<$Res> { - _$P24PaymentMethodDetailsCopyWithImpl(this._value, this._then); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'P24PaymentMethodDetails()'; +} - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. } /// @nodoc -abstract class _$$IdP24PaymentMethodDetailsImplCopyWith<$Res> { - factory _$$IdP24PaymentMethodDetailsImplCopyWith( - _$IdP24PaymentMethodDetailsImpl value, - $Res Function(_$IdP24PaymentMethodDetailsImpl) then) = - __$$IdP24PaymentMethodDetailsImplCopyWithImpl<$Res>; - @useResult - $Res call({String id}); +class $P24PaymentMethodDetailsCopyWith<$Res> { +$P24PaymentMethodDetailsCopyWith(P24PaymentMethodDetails _, $Res Function(P24PaymentMethodDetails) __); } -/// @nodoc -class __$$IdP24PaymentMethodDetailsImplCopyWithImpl<$Res> - extends _$P24PaymentMethodDetailsCopyWithImpl<$Res, - _$IdP24PaymentMethodDetailsImpl> - implements _$$IdP24PaymentMethodDetailsImplCopyWith<$Res> { - __$$IdP24PaymentMethodDetailsImplCopyWithImpl( - _$IdP24PaymentMethodDetailsImpl _value, - $Res Function(_$IdP24PaymentMethodDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_$IdP24PaymentMethodDetailsImpl( - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - )); - } + +/// Adds pattern-matching-related methods to [P24PaymentMethodDetails]. +extension P24PaymentMethodDetailsPatterns on P24PaymentMethodDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _P24PaymentMethodDetailsWithBilling value)? $default,{TResult Function( _IdP24PaymentMethodDetailsIdOnly value)? id,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IdP24PaymentMethodDetailsIdOnly() when id != null: +return id(_that);case _P24PaymentMethodDetailsWithBilling() when $default != null: +return $default(_that);case _: + return orElse(); + +} } +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _P24PaymentMethodDetailsWithBilling value) $default,{required TResult Function( _IdP24PaymentMethodDetailsIdOnly value) id,}){ +final _that = this; +switch (_that) { +case _IdP24PaymentMethodDetailsIdOnly(): +return id(_that);case _P24PaymentMethodDetailsWithBilling(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -@JsonSerializable() -class _$IdP24PaymentMethodDetailsImpl implements _IdP24PaymentMethodDetails { - const _$IdP24PaymentMethodDetailsImpl(this.id, {final String? $type}) - : $type = $type ?? 'p24'; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _P24PaymentMethodDetailsWithBilling value)? $default,{TResult? Function( _IdP24PaymentMethodDetailsIdOnly value)? id,}){ +final _that = this; +switch (_that) { +case _IdP24PaymentMethodDetailsIdOnly() when id != null: +return id(_that);case _P24PaymentMethodDetailsWithBilling() when $default != null: +return $default(_that);case _: + return null; - factory _$IdP24PaymentMethodDetailsImpl.fromJson(Map json) => - _$$IdP24PaymentMethodDetailsImplFromJson(json); +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{TResult Function( String id)? id,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IdP24PaymentMethodDetailsIdOnly() when id != null: +return id(_that.id);case _P24PaymentMethodDetailsWithBilling() when $default != null: +return $default(_that.billingDetails);case _: + return orElse(); - @override - final String id; +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "billing_details") BillingDetails? billingDetails) $default,{required TResult Function( String id) id,}) {final _that = this; +switch (_that) { +case _IdP24PaymentMethodDetailsIdOnly(): +return id(_that.id);case _P24PaymentMethodDetailsWithBilling(): +return $default(_that.billingDetails);case _: + throw StateError('Unexpected subclass'); - @JsonKey(name: 'type') - final String $type; +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "billing_details") BillingDetails? billingDetails)? $default,{TResult? Function( String id)? id,}) {final _that = this; +switch (_that) { +case _IdP24PaymentMethodDetailsIdOnly() when id != null: +return id(_that.id);case _P24PaymentMethodDetailsWithBilling() when $default != null: +return $default(_that.billingDetails);case _: + return null; - @override - String toString() { - return 'P24PaymentMethodDetails.id(id: $id)'; - } +} +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdP24PaymentMethodDetailsImpl && - (identical(other.id, id) || other.id == id)); - } +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id); - - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdP24PaymentMethodDetailsImplCopyWith<_$IdP24PaymentMethodDetailsImpl> - get copyWith => __$$IdP24PaymentMethodDetailsImplCopyWithImpl< - _$IdP24PaymentMethodDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - }) { - return id(this.id); - } +/// @nodoc +@JsonSerializable() - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - }) { - return id?.call(this.id); - } +class _IdP24PaymentMethodDetailsIdOnly implements P24PaymentMethodDetails, IdPaymentMethodDetails { + const _IdP24PaymentMethodDetailsIdOnly(this.id, {final String? $type}): $type = $type ?? 'p24'; + factory _IdP24PaymentMethodDetailsIdOnly.fromJson(Map json) => _$IdP24PaymentMethodDetailsIdOnlyFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - required TResult orElse(), - }) { - if (id != null) { - return id(this.id); - } - return orElse(); - } + final String id; - @override - @optionalTypeArgs - TResult map( - TResult Function(_P24PaymentMethodDetails value) $default, { - required TResult Function(_IdP24PaymentMethodDetails value) id, - }) { - return id(this); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_P24PaymentMethodDetails value)? $default, { - TResult? Function(_IdP24PaymentMethodDetails value)? id, - }) { - return id?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_P24PaymentMethodDetails value)? $default, { - TResult Function(_IdP24PaymentMethodDetails value)? id, - required TResult orElse(), - }) { - if (id != null) { - return id(this); - } - return orElse(); - } +/// Create a copy of P24PaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdP24PaymentMethodDetailsIdOnlyCopyWith<_IdP24PaymentMethodDetailsIdOnly> get copyWith => __$IdP24PaymentMethodDetailsIdOnlyCopyWithImpl<_IdP24PaymentMethodDetailsIdOnly>(this, _$identity); - @override - Map toJson() { - return _$$IdP24PaymentMethodDetailsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$IdP24PaymentMethodDetailsIdOnlyToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IdP24PaymentMethodDetailsIdOnly&&(identical(other.id, id) || other.id == id)); } -abstract class _IdP24PaymentMethodDetails - implements P24PaymentMethodDetails, IdPaymentMethodDetails { - const factory _IdP24PaymentMethodDetails(final String id) = - _$IdP24PaymentMethodDetailsImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id); - factory _IdP24PaymentMethodDetails.fromJson(Map json) = - _$IdP24PaymentMethodDetailsImpl.fromJson; +@override +String toString() { + return 'P24PaymentMethodDetails.id(id: $id)'; +} - String get id; - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdP24PaymentMethodDetailsImplCopyWith<_$IdP24PaymentMethodDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$P24PaymentMethodDetailsImplCopyWith<$Res> { - factory _$$P24PaymentMethodDetailsImplCopyWith( - _$P24PaymentMethodDetailsImpl value, - $Res Function(_$P24PaymentMethodDetailsImpl) then) = - __$$P24PaymentMethodDetailsImplCopyWithImpl<$Res>; - @useResult - $Res call({@JsonKey(name: "billing_details") BillingDetails? billingDetails}); +abstract mixin class _$IdP24PaymentMethodDetailsIdOnlyCopyWith<$Res> implements $P24PaymentMethodDetailsCopyWith<$Res> { + factory _$IdP24PaymentMethodDetailsIdOnlyCopyWith(_IdP24PaymentMethodDetailsIdOnly value, $Res Function(_IdP24PaymentMethodDetailsIdOnly) _then) = __$IdP24PaymentMethodDetailsIdOnlyCopyWithImpl; +@useResult +$Res call({ + String id +}); - $BillingDetailsCopyWith<$Res>? get billingDetails; -} + + +} /// @nodoc -class __$$P24PaymentMethodDetailsImplCopyWithImpl<$Res> - extends _$P24PaymentMethodDetailsCopyWithImpl<$Res, - _$P24PaymentMethodDetailsImpl> - implements _$$P24PaymentMethodDetailsImplCopyWith<$Res> { - __$$P24PaymentMethodDetailsImplCopyWithImpl( - _$P24PaymentMethodDetailsImpl _value, - $Res Function(_$P24PaymentMethodDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - }) { - return _then(_$P24PaymentMethodDetailsImpl( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - )); - } +class __$IdP24PaymentMethodDetailsIdOnlyCopyWithImpl<$Res> + implements _$IdP24PaymentMethodDetailsIdOnlyCopyWith<$Res> { + __$IdP24PaymentMethodDetailsIdOnlyCopyWithImpl(this._self, this._then); + + final _IdP24PaymentMethodDetailsIdOnly _self; + final $Res Function(_IdP24PaymentMethodDetailsIdOnly) _then; + +/// Create a copy of P24PaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? id = null,}) { + return _then(_IdP24PaymentMethodDetailsIdOnly( +null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String, + )); +} + - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value)); - }); - } } /// @nodoc @JsonSerializable() -class _$P24PaymentMethodDetailsImpl implements _P24PaymentMethodDetails { - const _$P24PaymentMethodDetailsImpl( - {@JsonKey(name: "billing_details") required this.billingDetails, - final String? $type}) - : $type = $type ?? 'p24'; - - factory _$P24PaymentMethodDetailsImpl.fromJson(Map json) => - _$$P24PaymentMethodDetailsImplFromJson(json); - - /// The billing_details associated with the card. - @override - @JsonKey(name: "billing_details") - final BillingDetails? billingDetails; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'P24PaymentMethodDetails(billingDetails: $billingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$P24PaymentMethodDetailsImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } +class _P24PaymentMethodDetailsWithBilling implements P24PaymentMethodDetails { + const _P24PaymentMethodDetailsWithBilling({@JsonKey(name: "billing_details") required this.billingDetails, final String? $type}): $type = $type ?? 'p24'; + factory _P24PaymentMethodDetailsWithBilling.fromJson(Map json) => _$P24PaymentMethodDetailsWithBillingFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails); - - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$P24PaymentMethodDetailsImplCopyWith<_$P24PaymentMethodDetailsImpl> - get copyWith => __$$P24PaymentMethodDetailsImplCopyWithImpl< - _$P24PaymentMethodDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails) - $default, { - required TResult Function(String id) id, - }) { - return $default(billingDetails); - } +/// The billing_details associated with the card. +@JsonKey(name: "billing_details") final BillingDetails? billingDetails; - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult? Function(String id)? id, - }) { - return $default?.call(billingDetails); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function( - @JsonKey(name: "billing_details") BillingDetails? billingDetails)? - $default, { - TResult Function(String id)? id, - required TResult orElse(), - }) { - if ($default != null) { - return $default(billingDetails); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map( - TResult Function(_P24PaymentMethodDetails value) $default, { - required TResult Function(_IdP24PaymentMethodDetails value) id, - }) { - return $default(this); - } +/// Create a copy of P24PaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$P24PaymentMethodDetailsWithBillingCopyWith<_P24PaymentMethodDetailsWithBilling> get copyWith => __$P24PaymentMethodDetailsWithBillingCopyWithImpl<_P24PaymentMethodDetailsWithBilling>(this, _$identity); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_P24PaymentMethodDetails value)? $default, { - TResult? Function(_IdP24PaymentMethodDetails value)? id, - }) { - return $default?.call(this); - } +@override +Map toJson() { + return _$P24PaymentMethodDetailsWithBillingToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _P24PaymentMethodDetailsWithBilling&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails); + +@override +String toString() { + return 'P24PaymentMethodDetails(billingDetails: $billingDetails)'; +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_P24PaymentMethodDetails value)? $default, { - TResult Function(_IdP24PaymentMethodDetails value)? id, - required TResult orElse(), - }) { - if ($default != null) { - return $default(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$P24PaymentMethodDetailsImplToJson( - this, - ); - } } -abstract class _P24PaymentMethodDetails implements P24PaymentMethodDetails { - const factory _P24PaymentMethodDetails( - {@JsonKey(name: "billing_details") - required final BillingDetails? billingDetails}) = - _$P24PaymentMethodDetailsImpl; +/// @nodoc +abstract mixin class _$P24PaymentMethodDetailsWithBillingCopyWith<$Res> implements $P24PaymentMethodDetailsCopyWith<$Res> { + factory _$P24PaymentMethodDetailsWithBillingCopyWith(_P24PaymentMethodDetailsWithBilling value, $Res Function(_P24PaymentMethodDetailsWithBilling) _then) = __$P24PaymentMethodDetailsWithBillingCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "billing_details") BillingDetails? billingDetails +}); - factory _P24PaymentMethodDetails.fromJson(Map json) = - _$P24PaymentMethodDetailsImpl.fromJson; - /// The billing_details associated with the card. - @JsonKey(name: "billing_details") - BillingDetails? get billingDetails; +$BillingDetailsCopyWith<$Res>? get billingDetails; - /// Create a copy of P24PaymentMethodDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$P24PaymentMethodDetailsImplCopyWith<_$P24PaymentMethodDetailsImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$P24PaymentMethodDetailsWithBillingCopyWithImpl<$Res> + implements _$P24PaymentMethodDetailsWithBillingCopyWith<$Res> { + __$P24PaymentMethodDetailsWithBillingCopyWithImpl(this._self, this._then); + + final _P24PaymentMethodDetailsWithBilling _self; + final $Res Function(_P24PaymentMethodDetailsWithBilling) _then; + +/// Create a copy of P24PaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? billingDetails = freezed,}) { + return _then(_P24PaymentMethodDetailsWithBilling( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?, + )); } -IdealBankData _$IdealBankDataFromJson(Map json) { - return _IdealBankData.fromJson(json); +/// Create a copy of P24PaymentMethodDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} } + /// @nodoc mixin _$IdealBankData { - /// The customer's bank. - String? get bank => throw _privateConstructorUsedError; + +/// The customer's bank. + String? get bank; +/// Create a copy of IdealBankData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IdealBankDataCopyWith get copyWith => _$IdealBankDataCopyWithImpl(this as IdealBankData, _$identity); /// Serializes this IdealBankData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of IdealBankData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IdealBankDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IdealBankData&&(identical(other.bank, bank) || other.bank == bank)); } -/// @nodoc -abstract class $IdealBankDataCopyWith<$Res> { - factory $IdealBankDataCopyWith( - IdealBankData value, $Res Function(IdealBankData) then) = - _$IdealBankDataCopyWithImpl<$Res, IdealBankData>; - @useResult - $Res call({String? bank}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank); + +@override +String toString() { + return 'IdealBankData(bank: $bank)'; } -/// @nodoc -class _$IdealBankDataCopyWithImpl<$Res, $Val extends IdealBankData> - implements $IdealBankDataCopyWith<$Res> { - _$IdealBankDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of IdealBankData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - }) { - return _then(_value.copyWith( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$IdealBankDataImplCopyWith<$Res> +abstract mixin class $IdealBankDataCopyWith<$Res> { + factory $IdealBankDataCopyWith(IdealBankData value, $Res Function(IdealBankData) _then) = _$IdealBankDataCopyWithImpl; +@useResult +$Res call({ + String? bank +}); + + + + +} +/// @nodoc +class _$IdealBankDataCopyWithImpl<$Res> implements $IdealBankDataCopyWith<$Res> { - factory _$$IdealBankDataImplCopyWith( - _$IdealBankDataImpl value, $Res Function(_$IdealBankDataImpl) then) = - __$$IdealBankDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? bank}); + _$IdealBankDataCopyWithImpl(this._self, this._then); + + final IdealBankData _self; + final $Res Function(IdealBankData) _then; + +/// Create a copy of IdealBankData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bank = freezed,}) { + return _then(_self.copyWith( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [IdealBankData]. +extension IdealBankDataPatterns on IdealBankData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IdealBankData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IdealBankData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IdealBankData value) $default,){ +final _that = this; +switch (_that) { +case _IdealBankData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IdealBankData value)? $default,){ +final _that = this; +switch (_that) { +case _IdealBankData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bank)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IdealBankData() when $default != null: +return $default(_that.bank);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bank) $default,) {final _that = this; +switch (_that) { +case _IdealBankData(): +return $default(_that.bank);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bank)? $default,) {final _that = this; +switch (_that) { +case _IdealBankData() when $default != null: +return $default(_that.bank);case _: + return null; + +} } -/// @nodoc -class __$$IdealBankDataImplCopyWithImpl<$Res> - extends _$IdealBankDataCopyWithImpl<$Res, _$IdealBankDataImpl> - implements _$$IdealBankDataImplCopyWith<$Res> { - __$$IdealBankDataImplCopyWithImpl( - _$IdealBankDataImpl _value, $Res Function(_$IdealBankDataImpl) _then) - : super(_value, _then); - - /// Create a copy of IdealBankData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - }) { - return _then(_$IdealBankDataImpl( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$IdealBankDataImpl implements _IdealBankData { - const _$IdealBankDataImpl({this.bank}); - factory _$IdealBankDataImpl.fromJson(Map json) => - _$$IdealBankDataImplFromJson(json); +class _IdealBankData implements IdealBankData { + const _IdealBankData({this.bank}); + factory _IdealBankData.fromJson(Map json) => _$IdealBankDataFromJson(json); - /// The customer's bank. - @override - final String? bank; +/// The customer's bank. +@override final String? bank; - @override - String toString() { - return 'IdealBankData(bank: $bank)'; - } +/// Create a copy of IdealBankData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdealBankDataCopyWith<_IdealBankData> get copyWith => __$IdealBankDataCopyWithImpl<_IdealBankData>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdealBankDataImpl && - (identical(other.bank, bank) || other.bank == bank)); - } +@override +Map toJson() { + return _$IdealBankDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, bank); - - /// Create a copy of IdealBankData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdealBankDataImplCopyWith<_$IdealBankDataImpl> get copyWith => - __$$IdealBankDataImplCopyWithImpl<_$IdealBankDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$IdealBankDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IdealBankData&&(identical(other.bank, bank) || other.bank == bank)); } -abstract class _IdealBankData implements IdealBankData { - const factory _IdealBankData({final String? bank}) = _$IdealBankDataImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank); - factory _IdealBankData.fromJson(Map json) = - _$IdealBankDataImpl.fromJson; +@override +String toString() { + return 'IdealBankData(bank: $bank)'; +} - /// The customer's bank. - @override - String? get bank; - /// Create a copy of IdealBankData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdealBankDataImplCopyWith<_$IdealBankDataImpl> get copyWith => - throw _privateConstructorUsedError; } -CardTokenPaymentMethod _$CardTokenPaymentMethodFromJson( - Map json) { - return _CardTokenPaymentMethod.fromJson(json); +/// @nodoc +abstract mixin class _$IdealBankDataCopyWith<$Res> implements $IdealBankDataCopyWith<$Res> { + factory _$IdealBankDataCopyWith(_IdealBankData value, $Res Function(_IdealBankData) _then) = __$IdealBankDataCopyWithImpl; +@override @useResult +$Res call({ + String? bank +}); + + + + +} +/// @nodoc +class __$IdealBankDataCopyWithImpl<$Res> + implements _$IdealBankDataCopyWith<$Res> { + __$IdealBankDataCopyWithImpl(this._self, this._then); + + final _IdealBankData _self; + final $Res Function(_IdealBankData) _then; + +/// Create a copy of IdealBankData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bank = freezed,}) { + return _then(_IdealBankData( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); } + +} + + /// @nodoc mixin _$CardTokenPaymentMethod { - String get token => throw _privateConstructorUsedError; + + String get token; +/// Create a copy of CardTokenPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardTokenPaymentMethodCopyWith get copyWith => _$CardTokenPaymentMethodCopyWithImpl(this as CardTokenPaymentMethod, _$identity); /// Serializes this CardTokenPaymentMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CardTokenPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardTokenPaymentMethodCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardTokenPaymentMethod&&(identical(other.token, token) || other.token == token)); } -/// @nodoc -abstract class $CardTokenPaymentMethodCopyWith<$Res> { - factory $CardTokenPaymentMethodCopyWith(CardTokenPaymentMethod value, - $Res Function(CardTokenPaymentMethod) then) = - _$CardTokenPaymentMethodCopyWithImpl<$Res, CardTokenPaymentMethod>; - @useResult - $Res call({String token}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token); + +@override +String toString() { + return 'CardTokenPaymentMethod(token: $token)'; } -/// @nodoc -class _$CardTokenPaymentMethodCopyWithImpl<$Res, - $Val extends CardTokenPaymentMethod> - implements $CardTokenPaymentMethodCopyWith<$Res> { - _$CardTokenPaymentMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardTokenPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = null, - }) { - return _then(_value.copyWith( - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardTokenPaymentMethodImplCopyWith<$Res> +abstract mixin class $CardTokenPaymentMethodCopyWith<$Res> { + factory $CardTokenPaymentMethodCopyWith(CardTokenPaymentMethod value, $Res Function(CardTokenPaymentMethod) _then) = _$CardTokenPaymentMethodCopyWithImpl; +@useResult +$Res call({ + String token +}); + + + + +} +/// @nodoc +class _$CardTokenPaymentMethodCopyWithImpl<$Res> implements $CardTokenPaymentMethodCopyWith<$Res> { - factory _$$CardTokenPaymentMethodImplCopyWith( - _$CardTokenPaymentMethodImpl value, - $Res Function(_$CardTokenPaymentMethodImpl) then) = - __$$CardTokenPaymentMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String token}); + _$CardTokenPaymentMethodCopyWithImpl(this._self, this._then); + + final CardTokenPaymentMethod _self; + final $Res Function(CardTokenPaymentMethod) _then; + +/// Create a copy of CardTokenPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? token = null,}) { + return _then(_self.copyWith( +token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardTokenPaymentMethod]. +extension CardTokenPaymentMethodPatterns on CardTokenPaymentMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardTokenPaymentMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardTokenPaymentMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardTokenPaymentMethod value) $default,){ +final _that = this; +switch (_that) { +case _CardTokenPaymentMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardTokenPaymentMethod value)? $default,){ +final _that = this; +switch (_that) { +case _CardTokenPaymentMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String token)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardTokenPaymentMethod() when $default != null: +return $default(_that.token);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String token) $default,) {final _that = this; +switch (_that) { +case _CardTokenPaymentMethod(): +return $default(_that.token);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String token)? $default,) {final _that = this; +switch (_that) { +case _CardTokenPaymentMethod() when $default != null: +return $default(_that.token);case _: + return null; + +} } -/// @nodoc -class __$$CardTokenPaymentMethodImplCopyWithImpl<$Res> - extends _$CardTokenPaymentMethodCopyWithImpl<$Res, - _$CardTokenPaymentMethodImpl> - implements _$$CardTokenPaymentMethodImplCopyWith<$Res> { - __$$CardTokenPaymentMethodImplCopyWithImpl( - _$CardTokenPaymentMethodImpl _value, - $Res Function(_$CardTokenPaymentMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of CardTokenPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = null, - }) { - return _then(_$CardTokenPaymentMethodImpl( - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$CardTokenPaymentMethodImpl implements _CardTokenPaymentMethod { - const _$CardTokenPaymentMethodImpl({required this.token}); - factory _$CardTokenPaymentMethodImpl.fromJson(Map json) => - _$$CardTokenPaymentMethodImplFromJson(json); +class _CardTokenPaymentMethod implements CardTokenPaymentMethod { + const _CardTokenPaymentMethod({required this.token}); + factory _CardTokenPaymentMethod.fromJson(Map json) => _$CardTokenPaymentMethodFromJson(json); - @override - final String token; +@override final String token; - @override - String toString() { - return 'CardTokenPaymentMethod(token: $token)'; - } +/// Create a copy of CardTokenPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardTokenPaymentMethodCopyWith<_CardTokenPaymentMethod> get copyWith => __$CardTokenPaymentMethodCopyWithImpl<_CardTokenPaymentMethod>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardTokenPaymentMethodImpl && - (identical(other.token, token) || other.token == token)); - } +@override +Map toJson() { + return _$CardTokenPaymentMethodToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, token); - - /// Create a copy of CardTokenPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardTokenPaymentMethodImplCopyWith<_$CardTokenPaymentMethodImpl> - get copyWith => __$$CardTokenPaymentMethodImplCopyWithImpl< - _$CardTokenPaymentMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardTokenPaymentMethodImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardTokenPaymentMethod&&(identical(other.token, token) || other.token == token)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token); + +@override +String toString() { + return 'CardTokenPaymentMethod(token: $token)'; } -abstract class _CardTokenPaymentMethod implements CardTokenPaymentMethod { - const factory _CardTokenPaymentMethod({required final String token}) = - _$CardTokenPaymentMethodImpl; - factory _CardTokenPaymentMethod.fromJson(Map json) = - _$CardTokenPaymentMethodImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$CardTokenPaymentMethodCopyWith<$Res> implements $CardTokenPaymentMethodCopyWith<$Res> { + factory _$CardTokenPaymentMethodCopyWith(_CardTokenPaymentMethod value, $Res Function(_CardTokenPaymentMethod) _then) = __$CardTokenPaymentMethodCopyWithImpl; +@override @useResult +$Res call({ + String token +}); + + - @override - String get token; - /// Create a copy of CardTokenPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardTokenPaymentMethodImplCopyWith<_$CardTokenPaymentMethodImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$CardTokenPaymentMethodCopyWithImpl<$Res> + implements _$CardTokenPaymentMethodCopyWith<$Res> { + __$CardTokenPaymentMethodCopyWithImpl(this._self, this._then); + + final _CardTokenPaymentMethod _self; + final $Res Function(_CardTokenPaymentMethod) _then; + +/// Create a copy of CardTokenPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? token = null,}) { + return _then(_CardTokenPaymentMethod( +token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.g.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.g.dart index 49f3d3a7d..499171557 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.g.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_details.g.dart @@ -6,166 +6,145 @@ part of 'payment_method_details.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CardPaymentMethodRefImpl _$$CardPaymentMethodRefImplFromJson(Map json) => - _$CardPaymentMethodRefImpl( - json['id'] as String, - $type: json['type'] as String?, - ); +_CardPaymentMethodRef _$CardPaymentMethodRefFromJson(Map json) => + _CardPaymentMethodRef(json['id'] as String, $type: json['type'] as String?); -Map _$$CardPaymentMethodRefImplToJson( - _$CardPaymentMethodRefImpl instance) => - { - 'id': instance.id, - 'type': instance.$type, - }; +Map _$CardPaymentMethodRefToJson( + _CardPaymentMethodRef instance, +) => {'id': instance.id, 'type': instance.$type}; -_$CardPaymentMethodDefaultImpl _$$CardPaymentMethodDefaultImplFromJson( - Map json) => - _$CardPaymentMethodDefaultImpl( +_CardPaymentMethodDefault _$CardPaymentMethodDefaultFromJson(Map json) => + _CardPaymentMethodDefault( card: const ElementConverter().fromJson(json['card']), billingDetails: json['billing_details'] == null ? null : BillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), + Map.from(json['billing_details'] as Map), + ), $type: json['type'] as String?, ); -Map _$$CardPaymentMethodDefaultImplToJson( - _$CardPaymentMethodDefaultImpl instance) => - { - if (const ElementConverter().toJson(instance.card) case final value?) - 'card': value, - if (instance.billingDetails?.toJson() case final value?) - 'billing_details': value, - 'type': instance.$type, - }; - -_$CardPaymentMethodDetailsTokenImpl - _$$CardPaymentMethodDetailsTokenImplFromJson(Map json) => - _$CardPaymentMethodDetailsTokenImpl( - card: CardTokenPaymentMethod.fromJson( - Map.from(json['card'] as Map)), - billingDetails: json['billing_details'] == null - ? null - : BillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), - $type: json['type'] as String?, - ); - -Map _$$CardPaymentMethodDetailsTokenImplToJson( - _$CardPaymentMethodDetailsTokenImpl instance) => - { - 'card': instance.card.toJson(), - if (instance.billingDetails?.toJson() case final value?) - 'billing_details': value, - 'type': instance.$type, - }; - -_$IdIdealPaymentMethodDetailsImpl _$$IdIdealPaymentMethodDetailsImplFromJson( - Map json) => - _$IdIdealPaymentMethodDetailsImpl( - json['id'] as String, - $type: json['type'] as String?, - ); - -Map _$$IdIdealPaymentMethodDetailsImplToJson( - _$IdIdealPaymentMethodDetailsImpl instance) => - { - 'id': instance.id, - 'type': instance.$type, - }; - -_$IdealPaymentMethodDetailsImpl _$$IdealPaymentMethodDetailsImplFromJson( - Map json) => - _$IdealPaymentMethodDetailsImpl( +Map _$CardPaymentMethodDefaultToJson( + _CardPaymentMethodDefault instance, +) => { + 'card': ?const ElementConverter().toJson(instance.card), + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; + +_CardPaymentMethodDetailsToken _$CardPaymentMethodDetailsTokenFromJson( + Map json, +) => _CardPaymentMethodDetailsToken( + card: CardTokenPaymentMethod.fromJson( + Map.from(json['card'] as Map), + ), + billingDetails: json['billing_details'] == null + ? null + : BillingDetails.fromJson( + Map.from(json['billing_details'] as Map), + ), + $type: json['type'] as String?, +); + +Map _$CardPaymentMethodDetailsTokenToJson( + _CardPaymentMethodDetailsToken instance, +) => { + 'card': instance.card.toJson(), + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; + +_IdIdealPaymentMethodDetailsIdOnly _$IdIdealPaymentMethodDetailsIdOnlyFromJson( + Map json, +) => _IdIdealPaymentMethodDetailsIdOnly( + json['id'] as String, + $type: json['type'] as String?, +); + +Map _$IdIdealPaymentMethodDetailsIdOnlyToJson( + _IdIdealPaymentMethodDetailsIdOnly instance, +) => {'id': instance.id, 'type': instance.$type}; + +_IdealPaymentMethodDetailsWithBilling +_$IdealPaymentMethodDetailsWithBillingFromJson(Map json) => + _IdealPaymentMethodDetailsWithBilling( ideal: const ElementConverter().fromJson(json['ideal']), billingDetails: json['billing_details'] == null ? null : BillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), + Map.from(json['billing_details'] as Map), + ), $type: json['type'] as String?, ); -Map _$$IdealPaymentMethodDetailsImplToJson( - _$IdealPaymentMethodDetailsImpl instance) => - { - if (const ElementConverter().toJson(instance.ideal) case final value?) - 'ideal': value, - if (instance.billingDetails?.toJson() case final value?) - 'billing_details': value, - 'type': instance.$type, - }; - -_$IdealPaymentMethodDetailsSelfCollectImpl - _$$IdealPaymentMethodDetailsSelfCollectImplFromJson(Map json) => - _$IdealPaymentMethodDetailsSelfCollectImpl( - ideal: IdealBankData.fromJson( - Map.from(json['ideal'] as Map)), - billingDetails: json['billing_details'] == null - ? null - : BillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), - $type: json['type'] as String?, - ); - -Map _$$IdealPaymentMethodDetailsSelfCollectImplToJson( - _$IdealPaymentMethodDetailsSelfCollectImpl instance) => - { - 'ideal': instance.ideal.toJson(), - if (instance.billingDetails?.toJson() case final value?) - 'billing_details': value, - 'type': instance.$type, - }; - -_$IdP24PaymentMethodDetailsImpl _$$IdP24PaymentMethodDetailsImplFromJson( - Map json) => - _$IdP24PaymentMethodDetailsImpl( - json['id'] as String, +Map _$IdealPaymentMethodDetailsWithBillingToJson( + _IdealPaymentMethodDetailsWithBilling instance, +) => { + 'ideal': ?const ElementConverter().toJson(instance.ideal), + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; + +_IdealPaymentMethodDetailsSelfCollect +_$IdealPaymentMethodDetailsSelfCollectFromJson(Map json) => + _IdealPaymentMethodDetailsSelfCollect( + ideal: IdealBankData.fromJson( + Map.from(json['ideal'] as Map), + ), + billingDetails: json['billing_details'] == null + ? null + : BillingDetails.fromJson( + Map.from(json['billing_details'] as Map), + ), $type: json['type'] as String?, ); -Map _$$IdP24PaymentMethodDetailsImplToJson( - _$IdP24PaymentMethodDetailsImpl instance) => - { - 'id': instance.id, - 'type': instance.$type, - }; - -_$P24PaymentMethodDetailsImpl _$$P24PaymentMethodDetailsImplFromJson( - Map json) => - _$P24PaymentMethodDetailsImpl( +Map _$IdealPaymentMethodDetailsSelfCollectToJson( + _IdealPaymentMethodDetailsSelfCollect instance, +) => { + 'ideal': instance.ideal.toJson(), + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; + +_IdP24PaymentMethodDetailsIdOnly _$IdP24PaymentMethodDetailsIdOnlyFromJson( + Map json, +) => _IdP24PaymentMethodDetailsIdOnly( + json['id'] as String, + $type: json['type'] as String?, +); + +Map _$IdP24PaymentMethodDetailsIdOnlyToJson( + _IdP24PaymentMethodDetailsIdOnly instance, +) => {'id': instance.id, 'type': instance.$type}; + +_P24PaymentMethodDetailsWithBilling +_$P24PaymentMethodDetailsWithBillingFromJson(Map json) => + _P24PaymentMethodDetailsWithBilling( billingDetails: json['billing_details'] == null ? null : BillingDetails.fromJson( - Map.from(json['billing_details'] as Map)), + Map.from(json['billing_details'] as Map), + ), $type: json['type'] as String?, ); -Map _$$P24PaymentMethodDetailsImplToJson( - _$P24PaymentMethodDetailsImpl instance) => - { - if (instance.billingDetails?.toJson() case final value?) - 'billing_details': value, - 'type': instance.$type, - }; - -_$IdealBankDataImpl _$$IdealBankDataImplFromJson(Map json) => - _$IdealBankDataImpl( - bank: json['bank'] as String?, - ); +Map _$P24PaymentMethodDetailsWithBillingToJson( + _P24PaymentMethodDetailsWithBilling instance, +) => { + 'billing_details': ?instance.billingDetails?.toJson(), + 'type': instance.$type, +}; -Map _$$IdealBankDataImplToJson(_$IdealBankDataImpl instance) => - { - if (instance.bank case final value?) 'bank': value, - }; +_IdealBankData _$IdealBankDataFromJson(Map json) => + _IdealBankData(bank: json['bank'] as String?); -_$CardTokenPaymentMethodImpl _$$CardTokenPaymentMethodImplFromJson(Map json) => - _$CardTokenPaymentMethodImpl( - token: json['token'] as String, - ); +Map _$IdealBankDataToJson(_IdealBankData instance) => + {'bank': ?instance.bank}; + +_CardTokenPaymentMethod _$CardTokenPaymentMethodFromJson(Map json) => + _CardTokenPaymentMethod(token: json['token'] as String); -Map _$$CardTokenPaymentMethodImplToJson( - _$CardTokenPaymentMethodImpl instance) => - { - 'token': instance.token, - }; +Map _$CardTokenPaymentMethodToJson( + _CardTokenPaymentMethod instance, +) => {'token': instance.token}; diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.dart index 6cf9639e4..71ee4a901 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.dart @@ -5,12 +5,10 @@ part 'payment_method_params.freezed.dart'; part 'payment_method_params.g.dart'; @Freezed(unionKey: 'paymentMethodType') - /// Parameters that specify the desired configuration of a specific payment method. -class PaymentMethodParams with _$PaymentMethodParams { +abstract class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Card') - /// Config parameters for card payment method. const factory PaymentMethodParams.card({ /// Paymentmethod data for this paymentmethod. @@ -19,7 +17,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Card') - /// Config parameters for card with token payment method. const factory PaymentMethodParams.cardFromToken({ /// Paymentmethod data for this paymentmethod. @@ -28,7 +25,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Card') - /// Config parameters for card from method id payment method. const factory PaymentMethodParams.cardFromMethodId({ /// Payment method data object for card from payment method. @@ -37,7 +33,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Alipay') - /// Config parameters for Alipay card payment method. const factory PaymentMethodParams.alipay({ /// Paymentmethod data for this paymentmethod. @@ -46,9 +41,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Ideal') - /// Config parameters for ideal payment method. - const factory PaymentMethodParams.ideal({ /// Paymentmethod data for this paymentmethod. required PaymentMethodDataIdeal paymentMethodData, @@ -56,7 +49,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('AuBecsDebit') - /// Config parameters for aubecs debit payment method. const factory PaymentMethodParams.aubecs({ /// Paymentmethod data for this paymentmethod. @@ -65,9 +57,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Bancontact') - /// Config parameters for bankcontact payment method. - const factory PaymentMethodParams.bancontact({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -75,9 +65,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Giropay') - /// Config parameters for giropay payment method. - const factory PaymentMethodParams.giroPay({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -85,9 +73,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Eps') - /// Config parameters for eps payment method. - const factory PaymentMethodParams.eps({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -95,7 +81,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Affirm') - /// Config parameters for affirm payment method. /// Shipping details are required most of the time. const factory PaymentMethodParams.affirm({ @@ -105,9 +90,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('GrabPay') - /// Config parameters for GrabPay payment method. - const factory PaymentMethodParams.grabPay({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -115,9 +98,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('P24') - /// Config parameters for P24 payment method. - const factory PaymentMethodParams.p24({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -137,12 +118,6 @@ class PaymentMethodParams with _$PaymentMethodParams { required PaymentMethodDataSepa paymentMethodData, }) = _PaymentMethodParamsSepaDebit; - @JsonSerializable(explicitToJson: true) - @FreezedUnionValue('Sofort') - const factory PaymentMethodParams.sofort({ - required PaymentMethodDataSofort paymentMethodData, - }) = _PaymentMethodParamsSofort; - @JsonSerializable(explicitToJson: true) @FreezedUnionValue('AfterpayClearpay') const factory PaymentMethodParams.afterpayClearpay({ @@ -168,7 +143,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('PayPal') - /// Paypal is in private beta make sure to request access at Stripe to try it out. const factory PaymentMethodParams.payPal({ /// Paymentmethod data for this paymentmethod. @@ -197,9 +171,8 @@ class PaymentMethodParams with _$PaymentMethodParams { } @freezed - /// Generic payment method data object that holds the billingdetails. -class PaymentMethodData with _$PaymentMethodData { +abstract class PaymentMethodData with _$PaymentMethodData { @JsonSerializable(explicitToJson: true) const factory PaymentMethodData({ /// Billing information. @@ -214,9 +187,9 @@ class PaymentMethodData with _$PaymentMethodData { } @freezed - /// Payment method data object for card with token payment method. -class PaymentMethodDataCardFromToken with _$PaymentMethodDataCardFromToken { +abstract class PaymentMethodDataCardFromToken + with _$PaymentMethodDataCardFromToken { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataCardFromToken({ /// Token. @@ -234,9 +207,9 @@ class PaymentMethodDataCardFromToken with _$PaymentMethodDataCardFromToken { } @freezed - /// Payment method data object for card from payment method. -class PaymentMethodDataCardFromMethod with _$PaymentMethodDataCardFromMethod { +abstract class PaymentMethodDataCardFromMethod + with _$PaymentMethodDataCardFromMethod { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataCardFromMethod({ /// Payment method id. @@ -257,9 +230,8 @@ class PaymentMethodDataCardFromMethod with _$PaymentMethodDataCardFromMethod { } @freezed - /// Payment method data object for ideal payment method. -class PaymentMethodDataIdeal with _$PaymentMethodDataIdeal { +abstract class PaymentMethodDataIdeal with _$PaymentMethodDataIdeal { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataIdeal({ /// The name of bank. @@ -277,9 +249,8 @@ class PaymentMethodDataIdeal with _$PaymentMethodDataIdeal { } @freezed - /// Payment method data object for Aubecs payment method. -class PaymentMethodDataAubecs with _$PaymentMethodDataAubecs { +abstract class PaymentMethodDataAubecs with _$PaymentMethodDataAubecs { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataAubecs({ /// form input details @@ -297,9 +268,8 @@ class PaymentMethodDataAubecs with _$PaymentMethodDataAubecs { } @freezed - /// Payment method data object for Fpx payment method. -class PaymentMethodDataFpx with _$PaymentMethodDataFpx { +abstract class PaymentMethodDataFpx with _$PaymentMethodDataFpx { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataFpx({ /// When set to true you can test offline payment. @@ -317,9 +287,8 @@ class PaymentMethodDataFpx with _$PaymentMethodDataFpx { } @freezed - /// Payment method data object for Sofort payment method. -class PaymentMethodDataSofort with _$PaymentMethodDataSofort { +abstract class PaymentMethodDataSofort with _$PaymentMethodDataSofort { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataSofort({ /// Country of the accountholder @@ -337,9 +306,8 @@ class PaymentMethodDataSofort with _$PaymentMethodDataSofort { } @freezed - /// Payment method data object for Sepa debit payment method. -class PaymentMethodDataSepa with _$PaymentMethodDataSepa { +abstract class PaymentMethodDataSepa with _$PaymentMethodDataSepa { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataSepa({ /// Iban number of the accountholder @@ -357,9 +325,8 @@ class PaymentMethodDataSepa with _$PaymentMethodDataSepa { } @freezed - /// Payment method data object for Afterpay / clearpay payment method. -class PaymentMethodDataAfterPay with _$PaymentMethodDataAfterPay { +abstract class PaymentMethodDataAfterPay with _$PaymentMethodDataAfterPay { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataAfterPay({ /// Billing information. @@ -375,7 +342,7 @@ class PaymentMethodDataAfterPay with _$PaymentMethodDataAfterPay { /// Payment method data object forUsbankaccount payment method. @freezed -class PaymentMethodDataUsBank with _$PaymentMethodDataUsBank { +abstract class PaymentMethodDataUsBank with _$PaymentMethodDataUsBank { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataUsBank({ /// The account number of the bank account. @@ -401,17 +368,3 @@ class PaymentMethodDataUsBank with _$PaymentMethodDataUsBank { factory PaymentMethodDataUsBank.fromJson(Map json) => _$PaymentMethodDataUsBankFromJson(json); } - -/// @freezed -/// -/// /// Data object that holds the payment options for a payment method. -/// class PaymentMethodOptions with _$PaymentMethodOptions { -/// @JsonSerializable(explicitToJson: true) -/// const factory PaymentMethodOptions({ -/// /// Indicates whether or not you want to reuse this method for future payments. -/// PaymentIntentSetupFutureUsage? setupFutureUsage, -/// }) = _PaymentMethodOptions; -/// -/// factory PaymentMethodOptions.fromJson(Map json) => -/// _$PaymentMethodOptionsFromJson(json); -/// } diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.freezed.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.freezed.dart index 17c5e9d76..412266ab9 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,9073 +9,5187 @@ part of 'payment_method_params.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentMethodParams _$PaymentMethodParamsFromJson(Map json) { - switch (json['paymentMethodType']) { - case 'Card': - return _PaymentMethodParamsCard.fromJson(json); - case 'Card': - return _PaymentMethodParamsCardWithToken.fromJson(json); - case 'Card': - return _PaymentMethodParamsCardWithMethodId.fromJson(json); - case 'Alipay': - return _PaymentMethodParamsAlipay.fromJson(json); - case 'Ideal': - return _PaymentMethodParamsIdeal.fromJson(json); - case 'AuBecsDebit': - return _PaymentMethodParamsAubecs.fromJson(json); - case 'Bancontact': - return _PaymentMethodParamsBankContact.fromJson(json); - case 'Giropay': - return _PaymentMethodParamsGiroPay.fromJson(json); - case 'Eps': - return _PaymentMethodParamsEps.fromJson(json); - case 'Affirm': - return _PaymentMethodParamsAffirm.fromJson(json); - case 'GrabPay': - return _PaymentMethodParamsPay.fromJson(json); - case 'P24': - return _PaymentMethodParamsP24.fromJson(json); - case 'Fpx': - return _PaymentMethodParamsFpx.fromJson(json); - case 'SepaDebit': - return _PaymentMethodParamsSepaDebit.fromJson(json); - case 'Sofort': - return _PaymentMethodParamsSofort.fromJson(json); - case 'AfterpayClearpay': - return _PaymentMethodParamsAfterpayClearpay.fromJson(json); - case 'Oxxo': - return _PaymentMethodParamsOxxo.fromJson(json); - case 'Klarna': - return _PaymentMethodParamsKlarna.fromJson(json); - case 'PayPal': - return _PaymentMethodParamsPayPal.fromJson(json); - case 'USBankAccount': - return _PaymentMethodParamsUsBankAccount.fromJson(json); - - default: - throw CheckedFromJsonException( - json, - 'paymentMethodType', - 'PaymentMethodParams', - 'Invalid union type "${json['paymentMethodType']}"!'); - } +PaymentMethodParams _$PaymentMethodParamsFromJson( + Map json +) { + switch (json['paymentMethodType']) { + case 'Card': + return _PaymentMethodParamsCard.fromJson( + json + ); + case 'Card': + return _PaymentMethodParamsCardWithToken.fromJson( + json + ); + case 'Card': + return _PaymentMethodParamsCardWithMethodId.fromJson( + json + ); + case 'Alipay': + return _PaymentMethodParamsAlipay.fromJson( + json + ); + case 'Ideal': + return _PaymentMethodParamsIdeal.fromJson( + json + ); + case 'AuBecsDebit': + return _PaymentMethodParamsAubecs.fromJson( + json + ); + case 'Bancontact': + return _PaymentMethodParamsBankContact.fromJson( + json + ); + case 'Giropay': + return _PaymentMethodParamsGiroPay.fromJson( + json + ); + case 'Eps': + return _PaymentMethodParamsEps.fromJson( + json + ); + case 'Affirm': + return _PaymentMethodParamsAffirm.fromJson( + json + ); + case 'GrabPay': + return _PaymentMethodParamsPay.fromJson( + json + ); + case 'P24': + return _PaymentMethodParamsP24.fromJson( + json + ); + case 'Fpx': + return _PaymentMethodParamsFpx.fromJson( + json + ); + case 'SepaDebit': + return _PaymentMethodParamsSepaDebit.fromJson( + json + ); + case 'AfterpayClearpay': + return _PaymentMethodParamsAfterpayClearpay.fromJson( + json + ); + case 'Oxxo': + return _PaymentMethodParamsOxxo.fromJson( + json + ); + case 'Klarna': + return _PaymentMethodParamsKlarna.fromJson( + json + ); + case 'PayPal': + return _PaymentMethodParamsPayPal.fromJson( + json + ); + case 'USBankAccount': + return _PaymentMethodParamsUsBankAccount.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'paymentMethodType', + 'PaymentMethodParams', + 'Invalid union type "${json['paymentMethodType']}"!' +); + } + } /// @nodoc mixin _$PaymentMethodParams { - /// Paymentmethod data for this paymentmethod. - Object get paymentMethodData => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + +/// Paymentmethod data for this paymentmethod. + Object get paymentMethodData; /// Serializes this PaymentMethodParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} + Map toJson(); -/// @nodoc -abstract class $PaymentMethodParamsCopyWith<$Res> { - factory $PaymentMethodParamsCopyWith( - PaymentMethodParams value, $Res Function(PaymentMethodParams) then) = - _$PaymentMethodParamsCopyWithImpl<$Res, PaymentMethodParams>; -} -/// @nodoc -class _$PaymentMethodParamsCopyWithImpl<$Res, $Val extends PaymentMethodParams> - implements $PaymentMethodParamsCopyWith<$Res> { - _$PaymentMethodParamsCopyWithImpl(this._value, this._then); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodParams&&const DeepCollectionEquality().equals(other.paymentMethodData, paymentMethodData)); +} - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(paymentMethodData)); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. +@override +String toString() { + return 'PaymentMethodParams(paymentMethodData: $paymentMethodData)'; } -/// @nodoc -abstract class _$$PaymentMethodParamsCardImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCardImplCopyWith( - _$PaymentMethodParamsCardImpl value, - $Res Function(_$PaymentMethodParamsCardImpl) then) = - __$$PaymentMethodParamsCardImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; } /// @nodoc -class __$$PaymentMethodParamsCardImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCardImpl> - implements _$$PaymentMethodParamsCardImplCopyWith<$Res> { - __$$PaymentMethodParamsCardImplCopyWithImpl( - _$PaymentMethodParamsCardImpl _value, - $Res Function(_$PaymentMethodParamsCardImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCardImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +class $PaymentMethodParamsCopyWith<$Res> { +$PaymentMethodParamsCopyWith(PaymentMethodParams _, $Res Function(PaymentMethodParams) __); +} + + +/// Adds pattern-matching-related methods to [PaymentMethodParams]. +extension PaymentMethodParamsPatterns on PaymentMethodParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _PaymentMethodParamsCard value)? card,TResult Function( _PaymentMethodParamsCardWithToken value)? cardFromToken,TResult Function( _PaymentMethodParamsCardWithMethodId value)? cardFromMethodId,TResult Function( _PaymentMethodParamsAlipay value)? alipay,TResult Function( _PaymentMethodParamsIdeal value)? ideal,TResult Function( _PaymentMethodParamsAubecs value)? aubecs,TResult Function( _PaymentMethodParamsBankContact value)? bancontact,TResult Function( _PaymentMethodParamsGiroPay value)? giroPay,TResult Function( _PaymentMethodParamsEps value)? eps,TResult Function( _PaymentMethodParamsAffirm value)? affirm,TResult Function( _PaymentMethodParamsPay value)? grabPay,TResult Function( _PaymentMethodParamsP24 value)? p24,TResult Function( _PaymentMethodParamsFpx value)? fpx,TResult Function( _PaymentMethodParamsSepaDebit value)? sepaDebit,TResult Function( _PaymentMethodParamsAfterpayClearpay value)? afterpayClearpay,TResult Function( _PaymentMethodParamsOxxo value)? oxxo,TResult Function( _PaymentMethodParamsKlarna value)? klarna,TResult Function( _PaymentMethodParamsPayPal value)? payPal,TResult Function( _PaymentMethodParamsUsBankAccount value)? usBankAccount,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that);case _PaymentMethodParamsEps() when eps != null: +return eps(_that);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _PaymentMethodParamsCard value) card,required TResult Function( _PaymentMethodParamsCardWithToken value) cardFromToken,required TResult Function( _PaymentMethodParamsCardWithMethodId value) cardFromMethodId,required TResult Function( _PaymentMethodParamsAlipay value) alipay,required TResult Function( _PaymentMethodParamsIdeal value) ideal,required TResult Function( _PaymentMethodParamsAubecs value) aubecs,required TResult Function( _PaymentMethodParamsBankContact value) bancontact,required TResult Function( _PaymentMethodParamsGiroPay value) giroPay,required TResult Function( _PaymentMethodParamsEps value) eps,required TResult Function( _PaymentMethodParamsAffirm value) affirm,required TResult Function( _PaymentMethodParamsPay value) grabPay,required TResult Function( _PaymentMethodParamsP24 value) p24,required TResult Function( _PaymentMethodParamsFpx value) fpx,required TResult Function( _PaymentMethodParamsSepaDebit value) sepaDebit,required TResult Function( _PaymentMethodParamsAfterpayClearpay value) afterpayClearpay,required TResult Function( _PaymentMethodParamsOxxo value) oxxo,required TResult Function( _PaymentMethodParamsKlarna value) klarna,required TResult Function( _PaymentMethodParamsPayPal value) payPal,required TResult Function( _PaymentMethodParamsUsBankAccount value) usBankAccount,}){ +final _that = this; +switch (_that) { +case _PaymentMethodParamsCard(): +return card(_that);case _PaymentMethodParamsCardWithToken(): +return cardFromToken(_that);case _PaymentMethodParamsCardWithMethodId(): +return cardFromMethodId(_that);case _PaymentMethodParamsAlipay(): +return alipay(_that);case _PaymentMethodParamsIdeal(): +return ideal(_that);case _PaymentMethodParamsAubecs(): +return aubecs(_that);case _PaymentMethodParamsBankContact(): +return bancontact(_that);case _PaymentMethodParamsGiroPay(): +return giroPay(_that);case _PaymentMethodParamsEps(): +return eps(_that);case _PaymentMethodParamsAffirm(): +return affirm(_that);case _PaymentMethodParamsPay(): +return grabPay(_that);case _PaymentMethodParamsP24(): +return p24(_that);case _PaymentMethodParamsFpx(): +return fpx(_that);case _PaymentMethodParamsSepaDebit(): +return sepaDebit(_that);case _PaymentMethodParamsAfterpayClearpay(): +return afterpayClearpay(_that);case _PaymentMethodParamsOxxo(): +return oxxo(_that);case _PaymentMethodParamsKlarna(): +return klarna(_that);case _PaymentMethodParamsPayPal(): +return payPal(_that);case _PaymentMethodParamsUsBankAccount(): +return usBankAccount(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _PaymentMethodParamsCard value)? card,TResult? Function( _PaymentMethodParamsCardWithToken value)? cardFromToken,TResult? Function( _PaymentMethodParamsCardWithMethodId value)? cardFromMethodId,TResult? Function( _PaymentMethodParamsAlipay value)? alipay,TResult? Function( _PaymentMethodParamsIdeal value)? ideal,TResult? Function( _PaymentMethodParamsAubecs value)? aubecs,TResult? Function( _PaymentMethodParamsBankContact value)? bancontact,TResult? Function( _PaymentMethodParamsGiroPay value)? giroPay,TResult? Function( _PaymentMethodParamsEps value)? eps,TResult? Function( _PaymentMethodParamsAffirm value)? affirm,TResult? Function( _PaymentMethodParamsPay value)? grabPay,TResult? Function( _PaymentMethodParamsP24 value)? p24,TResult? Function( _PaymentMethodParamsFpx value)? fpx,TResult? Function( _PaymentMethodParamsSepaDebit value)? sepaDebit,TResult? Function( _PaymentMethodParamsAfterpayClearpay value)? afterpayClearpay,TResult? Function( _PaymentMethodParamsOxxo value)? oxxo,TResult? Function( _PaymentMethodParamsKlarna value)? klarna,TResult? Function( _PaymentMethodParamsPayPal value)? payPal,TResult? Function( _PaymentMethodParamsUsBankAccount value)? usBankAccount,}){ +final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that);case _PaymentMethodParamsEps() when eps != null: +return eps(_that);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( PaymentMethodData paymentMethodData)? card,TResult Function( PaymentMethodDataCardFromToken paymentMethodData)? cardFromToken,TResult Function( PaymentMethodDataCardFromMethod paymentMethodData)? cardFromMethodId,TResult Function( PaymentMethodData paymentMethodData)? alipay,TResult Function( PaymentMethodDataIdeal paymentMethodData)? ideal,TResult Function( PaymentMethodDataAubecs paymentMethodData)? aubecs,TResult Function( PaymentMethodData paymentMethodData)? bancontact,TResult Function( PaymentMethodData paymentMethodData)? giroPay,TResult Function( PaymentMethodData paymentMethodData)? eps,TResult Function( PaymentMethodData paymentMethodData)? affirm,TResult Function( PaymentMethodData paymentMethodData)? grabPay,TResult Function( PaymentMethodData paymentMethodData)? p24,TResult Function( PaymentMethodDataFpx paymentMethodData)? fpx,TResult Function( PaymentMethodDataSepa paymentMethodData)? sepaDebit,TResult Function( PaymentMethodDataAfterPay paymentMethodData)? afterpayClearpay,TResult Function( PaymentMethodData paymentMethodData)? oxxo,TResult Function( PaymentMethodData paymentMethodData)? klarna,TResult Function( PaymentMethodData paymentMethodData)? payPal,TResult Function( PaymentMethodDataUsBank paymentMethodData)? usBankAccount,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that.paymentMethodData);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that.paymentMethodData);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that.paymentMethodData);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that.paymentMethodData);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that.paymentMethodData);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that.paymentMethodData);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that.paymentMethodData);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that.paymentMethodData);case _PaymentMethodParamsEps() when eps != null: +return eps(_that.paymentMethodData);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that.paymentMethodData);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that.paymentMethodData);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that.paymentMethodData);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that.paymentMethodData);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that.paymentMethodData);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that.paymentMethodData);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that.paymentMethodData);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that.paymentMethodData);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that.paymentMethodData);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that.paymentMethodData);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( PaymentMethodData paymentMethodData) card,required TResult Function( PaymentMethodDataCardFromToken paymentMethodData) cardFromToken,required TResult Function( PaymentMethodDataCardFromMethod paymentMethodData) cardFromMethodId,required TResult Function( PaymentMethodData paymentMethodData) alipay,required TResult Function( PaymentMethodDataIdeal paymentMethodData) ideal,required TResult Function( PaymentMethodDataAubecs paymentMethodData) aubecs,required TResult Function( PaymentMethodData paymentMethodData) bancontact,required TResult Function( PaymentMethodData paymentMethodData) giroPay,required TResult Function( PaymentMethodData paymentMethodData) eps,required TResult Function( PaymentMethodData paymentMethodData) affirm,required TResult Function( PaymentMethodData paymentMethodData) grabPay,required TResult Function( PaymentMethodData paymentMethodData) p24,required TResult Function( PaymentMethodDataFpx paymentMethodData) fpx,required TResult Function( PaymentMethodDataSepa paymentMethodData) sepaDebit,required TResult Function( PaymentMethodDataAfterPay paymentMethodData) afterpayClearpay,required TResult Function( PaymentMethodData paymentMethodData) oxxo,required TResult Function( PaymentMethodData paymentMethodData) klarna,required TResult Function( PaymentMethodData paymentMethodData) payPal,required TResult Function( PaymentMethodDataUsBank paymentMethodData) usBankAccount,}) {final _that = this; +switch (_that) { +case _PaymentMethodParamsCard(): +return card(_that.paymentMethodData);case _PaymentMethodParamsCardWithToken(): +return cardFromToken(_that.paymentMethodData);case _PaymentMethodParamsCardWithMethodId(): +return cardFromMethodId(_that.paymentMethodData);case _PaymentMethodParamsAlipay(): +return alipay(_that.paymentMethodData);case _PaymentMethodParamsIdeal(): +return ideal(_that.paymentMethodData);case _PaymentMethodParamsAubecs(): +return aubecs(_that.paymentMethodData);case _PaymentMethodParamsBankContact(): +return bancontact(_that.paymentMethodData);case _PaymentMethodParamsGiroPay(): +return giroPay(_that.paymentMethodData);case _PaymentMethodParamsEps(): +return eps(_that.paymentMethodData);case _PaymentMethodParamsAffirm(): +return affirm(_that.paymentMethodData);case _PaymentMethodParamsPay(): +return grabPay(_that.paymentMethodData);case _PaymentMethodParamsP24(): +return p24(_that.paymentMethodData);case _PaymentMethodParamsFpx(): +return fpx(_that.paymentMethodData);case _PaymentMethodParamsSepaDebit(): +return sepaDebit(_that.paymentMethodData);case _PaymentMethodParamsAfterpayClearpay(): +return afterpayClearpay(_that.paymentMethodData);case _PaymentMethodParamsOxxo(): +return oxxo(_that.paymentMethodData);case _PaymentMethodParamsKlarna(): +return klarna(_that.paymentMethodData);case _PaymentMethodParamsPayPal(): +return payPal(_that.paymentMethodData);case _PaymentMethodParamsUsBankAccount(): +return usBankAccount(_that.paymentMethodData);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( PaymentMethodData paymentMethodData)? card,TResult? Function( PaymentMethodDataCardFromToken paymentMethodData)? cardFromToken,TResult? Function( PaymentMethodDataCardFromMethod paymentMethodData)? cardFromMethodId,TResult? Function( PaymentMethodData paymentMethodData)? alipay,TResult? Function( PaymentMethodDataIdeal paymentMethodData)? ideal,TResult? Function( PaymentMethodDataAubecs paymentMethodData)? aubecs,TResult? Function( PaymentMethodData paymentMethodData)? bancontact,TResult? Function( PaymentMethodData paymentMethodData)? giroPay,TResult? Function( PaymentMethodData paymentMethodData)? eps,TResult? Function( PaymentMethodData paymentMethodData)? affirm,TResult? Function( PaymentMethodData paymentMethodData)? grabPay,TResult? Function( PaymentMethodData paymentMethodData)? p24,TResult? Function( PaymentMethodDataFpx paymentMethodData)? fpx,TResult? Function( PaymentMethodDataSepa paymentMethodData)? sepaDebit,TResult? Function( PaymentMethodDataAfterPay paymentMethodData)? afterpayClearpay,TResult? Function( PaymentMethodData paymentMethodData)? oxxo,TResult? Function( PaymentMethodData paymentMethodData)? klarna,TResult? Function( PaymentMethodData paymentMethodData)? payPal,TResult? Function( PaymentMethodDataUsBank paymentMethodData)? usBankAccount,}) {final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that.paymentMethodData);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that.paymentMethodData);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that.paymentMethodData);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that.paymentMethodData);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that.paymentMethodData);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that.paymentMethodData);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that.paymentMethodData);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that.paymentMethodData);case _PaymentMethodParamsEps() when eps != null: +return eps(_that.paymentMethodData);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that.paymentMethodData);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that.paymentMethodData);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that.paymentMethodData);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that.paymentMethodData);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that.paymentMethodData);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that.paymentMethodData);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that.paymentMethodData);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that.paymentMethodData);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that.paymentMethodData);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that.paymentMethodData);case _: + return null; + +} +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCardImpl implements _PaymentMethodParamsCard { - const _$PaymentMethodParamsCardImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Card'; +class _PaymentMethodParamsCard implements PaymentMethodParams { + const _PaymentMethodParamsCard({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Card'; + factory _PaymentMethodParamsCard.fromJson(Map json) => _$PaymentMethodParamsCardFromJson(json); - factory _$PaymentMethodParamsCardImpl.fromJson(Map json) => - _$$PaymentMethodParamsCardImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.card(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCardImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCardImplCopyWith<_$PaymentMethodParamsCardImpl> - get copyWith => __$$PaymentMethodParamsCardImplCopyWithImpl< - _$PaymentMethodParamsCardImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return card(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCardCopyWith<_PaymentMethodParamsCard> get copyWith => __$PaymentMethodParamsCardCopyWithImpl<_PaymentMethodParamsCard>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return card?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsCardToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (card != null) { - return card(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCard&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return card(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return card?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.card(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (card != null) { - return card(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsCardImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsCard implements PaymentMethodParams { - const factory _PaymentMethodParamsCard( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsCardImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsCardCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCardCopyWith(_PaymentMethodParamsCard value, $Res Function(_PaymentMethodParamsCard) _then) = __$PaymentMethodParamsCardCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsCard.fromJson(Map json) = - _$PaymentMethodParamsCardImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCardImplCopyWith<_$PaymentMethodParamsCardImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsCardWithTokenImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCardWithTokenImplCopyWith( - _$PaymentMethodParamsCardWithTokenImpl value, - $Res Function(_$PaymentMethodParamsCardWithTokenImpl) then) = - __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataCardFromToken paymentMethodData}); +class __$PaymentMethodParamsCardCopyWithImpl<$Res> + implements _$PaymentMethodParamsCardCopyWith<$Res> { + __$PaymentMethodParamsCardCopyWithImpl(this._self, this._then); - $PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsCard _self; + final $Res Function(_PaymentMethodParamsCard) _then; -/// @nodoc -class __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCardWithTokenImpl> - implements _$$PaymentMethodParamsCardWithTokenImplCopyWith<$Res> { - __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl( - _$PaymentMethodParamsCardWithTokenImpl _value, - $Res Function(_$PaymentMethodParamsCardWithTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCardWithTokenImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataCardFromToken, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCard( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCardFromTokenCopyWith<$Res>( - _value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCardWithTokenImpl - implements _PaymentMethodParamsCardWithToken { - const _$PaymentMethodParamsCardWithTokenImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Card'; - - factory _$PaymentMethodParamsCardWithTokenImpl.fromJson( - Map json) => - _$$PaymentMethodParamsCardWithTokenImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataCardFromToken paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.cardFromToken(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCardWithTokenImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCardWithTokenImplCopyWith< - _$PaymentMethodParamsCardWithTokenImpl> - get copyWith => __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl< - _$PaymentMethodParamsCardWithTokenImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return cardFromToken(paymentMethodData); - } +class _PaymentMethodParamsCardWithToken implements PaymentMethodParams { + const _PaymentMethodParamsCardWithToken({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Card'; + factory _PaymentMethodParamsCardWithToken.fromJson(Map json) => _$PaymentMethodParamsCardWithTokenFromJson(json); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return cardFromToken?.call(paymentMethodData); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataCardFromToken paymentMethodData; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromToken != null) { - return cardFromToken(paymentMethodData); - } - return orElse(); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return cardFromToken(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return cardFromToken?.call(this); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCardWithTokenCopyWith<_PaymentMethodParamsCardWithToken> get copyWith => __$PaymentMethodParamsCardWithTokenCopyWithImpl<_PaymentMethodParamsCardWithToken>(this, _$identity); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromToken != null) { - return cardFromToken(this); - } - return orElse(); - } +@override +Map toJson() { + return _$PaymentMethodParamsCardWithTokenToJson(this, ); +} - @override - Map toJson() { - return _$$PaymentMethodParamsCardWithTokenImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCardWithToken&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -abstract class _PaymentMethodParamsCardWithToken - implements PaymentMethodParams { - const factory _PaymentMethodParamsCardWithToken( - {required final PaymentMethodDataCardFromToken paymentMethodData}) = - _$PaymentMethodParamsCardWithTokenImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - factory _PaymentMethodParamsCardWithToken.fromJson( - Map json) = - _$PaymentMethodParamsCardWithTokenImpl.fromJson; +@override +String toString() { + return 'PaymentMethodParams.cardFromToken(paymentMethodData: $paymentMethodData)'; +} - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataCardFromToken get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCardWithTokenImplCopyWith< - _$PaymentMethodParamsCardWithTokenImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsCardWithMethodIdImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCardWithMethodIdImplCopyWith( - _$PaymentMethodParamsCardWithMethodIdImpl value, - $Res Function(_$PaymentMethodParamsCardWithMethodIdImpl) then) = - __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataCardFromMethod paymentMethodData}); +abstract mixin class _$PaymentMethodParamsCardWithTokenCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCardWithTokenCopyWith(_PaymentMethodParamsCardWithToken value, $Res Function(_PaymentMethodParamsCardWithToken) _then) = __$PaymentMethodParamsCardWithTokenCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataCardFromToken paymentMethodData +}); - $PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData; -} +$PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCardWithMethodIdImpl> - implements _$$PaymentMethodParamsCardWithMethodIdImplCopyWith<$Res> { - __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl( - _$PaymentMethodParamsCardWithMethodIdImpl _value, - $Res Function(_$PaymentMethodParamsCardWithMethodIdImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCardWithMethodIdImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataCardFromMethod, - )); - } +class __$PaymentMethodParamsCardWithTokenCopyWithImpl<$Res> + implements _$PaymentMethodParamsCardWithTokenCopyWith<$Res> { + __$PaymentMethodParamsCardWithTokenCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCardFromMethodCopyWith<$Res>( - _value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsCardWithToken _self; + final $Res Function(_PaymentMethodParamsCardWithToken) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCardWithToken( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataCardFromToken, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCardFromTokenCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCardWithMethodIdImpl - implements _PaymentMethodParamsCardWithMethodId { - const _$PaymentMethodParamsCardWithMethodIdImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Card'; - - factory _$PaymentMethodParamsCardWithMethodIdImpl.fromJson( - Map json) => - _$$PaymentMethodParamsCardWithMethodIdImplFromJson(json); - - /// Payment method data object for card from payment method. - @override - final PaymentMethodDataCardFromMethod paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.cardFromMethodId(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCardWithMethodIdImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCardWithMethodIdImplCopyWith< - _$PaymentMethodParamsCardWithMethodIdImpl> - get copyWith => __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl< - _$PaymentMethodParamsCardWithMethodIdImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return cardFromMethodId(paymentMethodData); - } +class _PaymentMethodParamsCardWithMethodId implements PaymentMethodParams { + const _PaymentMethodParamsCardWithMethodId({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Card'; + factory _PaymentMethodParamsCardWithMethodId.fromJson(Map json) => _$PaymentMethodParamsCardWithMethodIdFromJson(json); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return cardFromMethodId?.call(paymentMethodData); - } +/// Payment method data object for card from payment method. +@override final PaymentMethodDataCardFromMethod paymentMethodData; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromMethodId != null) { - return cardFromMethodId(paymentMethodData); - } - return orElse(); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return cardFromMethodId(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return cardFromMethodId?.call(this); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCardWithMethodIdCopyWith<_PaymentMethodParamsCardWithMethodId> get copyWith => __$PaymentMethodParamsCardWithMethodIdCopyWithImpl<_PaymentMethodParamsCardWithMethodId>(this, _$identity); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromMethodId != null) { - return cardFromMethodId(this); - } - return orElse(); - } +@override +Map toJson() { + return _$PaymentMethodParamsCardWithMethodIdToJson(this, ); +} - @override - Map toJson() { - return _$$PaymentMethodParamsCardWithMethodIdImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCardWithMethodId&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -abstract class _PaymentMethodParamsCardWithMethodId - implements PaymentMethodParams { - const factory _PaymentMethodParamsCardWithMethodId( - {required final PaymentMethodDataCardFromMethod paymentMethodData}) = - _$PaymentMethodParamsCardWithMethodIdImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - factory _PaymentMethodParamsCardWithMethodId.fromJson( - Map json) = - _$PaymentMethodParamsCardWithMethodIdImpl.fromJson; +@override +String toString() { + return 'PaymentMethodParams.cardFromMethodId(paymentMethodData: $paymentMethodData)'; +} - /// Payment method data object for card from payment method. - @override - PaymentMethodDataCardFromMethod get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCardWithMethodIdImplCopyWith< - _$PaymentMethodParamsCardWithMethodIdImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsAlipayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAlipayImplCopyWith( - _$PaymentMethodParamsAlipayImpl value, - $Res Function(_$PaymentMethodParamsAlipayImpl) then) = - __$$PaymentMethodParamsAlipayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +abstract mixin class _$PaymentMethodParamsCardWithMethodIdCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCardWithMethodIdCopyWith(_PaymentMethodParamsCardWithMethodId value, $Res Function(_PaymentMethodParamsCardWithMethodId) _then) = __$PaymentMethodParamsCardWithMethodIdCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataCardFromMethod paymentMethodData +}); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} +$PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class __$$PaymentMethodParamsAlipayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAlipayImpl> - implements _$$PaymentMethodParamsAlipayImplCopyWith<$Res> { - __$$PaymentMethodParamsAlipayImplCopyWithImpl( - _$PaymentMethodParamsAlipayImpl _value, - $Res Function(_$PaymentMethodParamsAlipayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAlipayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +class __$PaymentMethodParamsCardWithMethodIdCopyWithImpl<$Res> + implements _$PaymentMethodParamsCardWithMethodIdCopyWith<$Res> { + __$PaymentMethodParamsCardWithMethodIdCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsCardWithMethodId _self; + final $Res Function(_PaymentMethodParamsCardWithMethodId) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCardWithMethodId( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataCardFromMethod, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCardFromMethodCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAlipayImpl implements _PaymentMethodParamsAlipay { - const _$PaymentMethodParamsAlipayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Alipay'; - - factory _$PaymentMethodParamsAlipayImpl.fromJson(Map json) => - _$$PaymentMethodParamsAlipayImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +class _PaymentMethodParamsAlipay implements PaymentMethodParams { + const _PaymentMethodParamsAlipay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Alipay'; + factory _PaymentMethodParamsAlipay.fromJson(Map json) => _$PaymentMethodParamsAlipayFromJson(json); - @JsonKey(name: 'paymentMethodType') - final String $type; +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - String toString() { - return 'PaymentMethodParams.alipay(paymentMethodData: $paymentMethodData)'; - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAlipayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAlipayImplCopyWith<_$PaymentMethodParamsAlipayImpl> - get copyWith => __$$PaymentMethodParamsAlipayImplCopyWithImpl< - _$PaymentMethodParamsAlipayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return alipay(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAlipayCopyWith<_PaymentMethodParamsAlipay> get copyWith => __$PaymentMethodParamsAlipayCopyWithImpl<_PaymentMethodParamsAlipay>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return alipay?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsAlipayToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (alipay != null) { - return alipay(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAlipay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return alipay(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return alipay?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.alipay(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (alipay != null) { - return alipay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsAlipayImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsAlipay implements PaymentMethodParams { - const factory _PaymentMethodParamsAlipay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsAlipayImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsAlipayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAlipayCopyWith(_PaymentMethodParamsAlipay value, $Res Function(_PaymentMethodParamsAlipay) _then) = __$PaymentMethodParamsAlipayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsAlipay.fromJson(Map json) = - _$PaymentMethodParamsAlipayImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAlipayImplCopyWith<_$PaymentMethodParamsAlipayImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsIdealImplCopyWith<$Res> { - factory _$$PaymentMethodParamsIdealImplCopyWith( - _$PaymentMethodParamsIdealImpl value, - $Res Function(_$PaymentMethodParamsIdealImpl) then) = - __$$PaymentMethodParamsIdealImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataIdeal paymentMethodData}); +class __$PaymentMethodParamsAlipayCopyWithImpl<$Res> + implements _$PaymentMethodParamsAlipayCopyWith<$Res> { + __$PaymentMethodParamsAlipayCopyWithImpl(this._self, this._then); - $PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsAlipay _self; + final $Res Function(_PaymentMethodParamsAlipay) _then; -/// @nodoc -class __$$PaymentMethodParamsIdealImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsIdealImpl> - implements _$$PaymentMethodParamsIdealImplCopyWith<$Res> { - __$$PaymentMethodParamsIdealImplCopyWithImpl( - _$PaymentMethodParamsIdealImpl _value, - $Res Function(_$PaymentMethodParamsIdealImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsIdealImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataIdeal, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAlipay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataIdealCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsIdealImpl implements _PaymentMethodParamsIdeal { - const _$PaymentMethodParamsIdealImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Ideal'; +class _PaymentMethodParamsIdeal implements PaymentMethodParams { + const _PaymentMethodParamsIdeal({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Ideal'; + factory _PaymentMethodParamsIdeal.fromJson(Map json) => _$PaymentMethodParamsIdealFromJson(json); - factory _$PaymentMethodParamsIdealImpl.fromJson(Map json) => - _$$PaymentMethodParamsIdealImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataIdeal paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataIdeal paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.ideal(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsIdealImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsIdealImplCopyWith<_$PaymentMethodParamsIdealImpl> - get copyWith => __$$PaymentMethodParamsIdealImplCopyWithImpl< - _$PaymentMethodParamsIdealImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return ideal(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsIdealCopyWith<_PaymentMethodParamsIdeal> get copyWith => __$PaymentMethodParamsIdealCopyWithImpl<_PaymentMethodParamsIdeal>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return ideal?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsIdealToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (ideal != null) { - return ideal(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsIdeal&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return ideal(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return ideal?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.ideal(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (ideal != null) { - return ideal(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsIdealImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsIdeal implements PaymentMethodParams { - const factory _PaymentMethodParamsIdeal( - {required final PaymentMethodDataIdeal paymentMethodData}) = - _$PaymentMethodParamsIdealImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsIdealCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsIdealCopyWith(_PaymentMethodParamsIdeal value, $Res Function(_PaymentMethodParamsIdeal) _then) = __$PaymentMethodParamsIdealCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataIdeal paymentMethodData +}); - factory _PaymentMethodParamsIdeal.fromJson(Map json) = - _$PaymentMethodParamsIdealImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataIdeal get paymentMethodData; +$PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsIdealImplCopyWith<_$PaymentMethodParamsIdealImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsAubecsImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAubecsImplCopyWith( - _$PaymentMethodParamsAubecsImpl value, - $Res Function(_$PaymentMethodParamsAubecsImpl) then) = - __$$PaymentMethodParamsAubecsImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataAubecs paymentMethodData}); +class __$PaymentMethodParamsIdealCopyWithImpl<$Res> + implements _$PaymentMethodParamsIdealCopyWith<$Res> { + __$PaymentMethodParamsIdealCopyWithImpl(this._self, this._then); - $PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsIdeal _self; + final $Res Function(_PaymentMethodParamsIdeal) _then; -/// @nodoc -class __$$PaymentMethodParamsAubecsImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAubecsImpl> - implements _$$PaymentMethodParamsAubecsImplCopyWith<$Res> { - __$$PaymentMethodParamsAubecsImplCopyWithImpl( - _$PaymentMethodParamsAubecsImpl _value, - $Res Function(_$PaymentMethodParamsAubecsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAubecsImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataAubecs, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsIdeal( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataIdeal, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataAubecsCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataIdealCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAubecsImpl implements _PaymentMethodParamsAubecs { - const _$PaymentMethodParamsAubecsImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'AuBecsDebit'; - - factory _$PaymentMethodParamsAubecsImpl.fromJson(Map json) => - _$$PaymentMethodParamsAubecsImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataAubecs paymentMethodData; +class _PaymentMethodParamsAubecs implements PaymentMethodParams { + const _PaymentMethodParamsAubecs({required this.paymentMethodData, final String? $type}): $type = $type ?? 'AuBecsDebit'; + factory _PaymentMethodParamsAubecs.fromJson(Map json) => _$PaymentMethodParamsAubecsFromJson(json); - @JsonKey(name: 'paymentMethodType') - final String $type; +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataAubecs paymentMethodData; - @override - String toString() { - return 'PaymentMethodParams.aubecs(paymentMethodData: $paymentMethodData)'; - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAubecsImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAubecsImplCopyWith<_$PaymentMethodParamsAubecsImpl> - get copyWith => __$$PaymentMethodParamsAubecsImplCopyWithImpl< - _$PaymentMethodParamsAubecsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return aubecs(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAubecsCopyWith<_PaymentMethodParamsAubecs> get copyWith => __$PaymentMethodParamsAubecsCopyWithImpl<_PaymentMethodParamsAubecs>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return aubecs?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsAubecsToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (aubecs != null) { - return aubecs(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAubecs&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return aubecs(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return aubecs?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.aubecs(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (aubecs != null) { - return aubecs(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsAubecsImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsAubecs implements PaymentMethodParams { - const factory _PaymentMethodParamsAubecs( - {required final PaymentMethodDataAubecs paymentMethodData}) = - _$PaymentMethodParamsAubecsImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsAubecsCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAubecsCopyWith(_PaymentMethodParamsAubecs value, $Res Function(_PaymentMethodParamsAubecs) _then) = __$PaymentMethodParamsAubecsCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataAubecs paymentMethodData +}); - factory _PaymentMethodParamsAubecs.fromJson(Map json) = - _$PaymentMethodParamsAubecsImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataAubecs get paymentMethodData; +$PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAubecsImplCopyWith<_$PaymentMethodParamsAubecsImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsBankContactImplCopyWith<$Res> { - factory _$$PaymentMethodParamsBankContactImplCopyWith( - _$PaymentMethodParamsBankContactImpl value, - $Res Function(_$PaymentMethodParamsBankContactImpl) then) = - __$$PaymentMethodParamsBankContactImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsAubecsCopyWithImpl<$Res> + implements _$PaymentMethodParamsAubecsCopyWith<$Res> { + __$PaymentMethodParamsAubecsCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsAubecs _self; + final $Res Function(_PaymentMethodParamsAubecs) _then; -/// @nodoc -class __$$PaymentMethodParamsBankContactImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsBankContactImpl> - implements _$$PaymentMethodParamsBankContactImplCopyWith<$Res> { - __$$PaymentMethodParamsBankContactImplCopyWithImpl( - _$PaymentMethodParamsBankContactImpl _value, - $Res Function(_$PaymentMethodParamsBankContactImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsBankContactImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAubecs( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataAubecs, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataAubecsCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsBankContactImpl - implements _PaymentMethodParamsBankContact { - const _$PaymentMethodParamsBankContactImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Bancontact'; - - factory _$PaymentMethodParamsBankContactImpl.fromJson( - Map json) => - _$$PaymentMethodParamsBankContactImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.bancontact(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsBankContactImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsBankContactImplCopyWith< - _$PaymentMethodParamsBankContactImpl> - get copyWith => __$$PaymentMethodParamsBankContactImplCopyWithImpl< - _$PaymentMethodParamsBankContactImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return bancontact(paymentMethodData); - } +class _PaymentMethodParamsBankContact implements PaymentMethodParams { + const _PaymentMethodParamsBankContact({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Bancontact'; + factory _PaymentMethodParamsBankContact.fromJson(Map json) => _$PaymentMethodParamsBankContactFromJson(json); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return bancontact?.call(paymentMethodData); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (bancontact != null) { - return bancontact(paymentMethodData); - } - return orElse(); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return bancontact(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return bancontact?.call(this); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsBankContactCopyWith<_PaymentMethodParamsBankContact> get copyWith => __$PaymentMethodParamsBankContactCopyWithImpl<_PaymentMethodParamsBankContact>(this, _$identity); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (bancontact != null) { - return bancontact(this); - } - return orElse(); - } +@override +Map toJson() { + return _$PaymentMethodParamsBankContactToJson(this, ); +} - @override - Map toJson() { - return _$$PaymentMethodParamsBankContactImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsBankContact&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -abstract class _PaymentMethodParamsBankContact implements PaymentMethodParams { - const factory _PaymentMethodParamsBankContact( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsBankContactImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - factory _PaymentMethodParamsBankContact.fromJson(Map json) = - _$PaymentMethodParamsBankContactImpl.fromJson; +@override +String toString() { + return 'PaymentMethodParams.bancontact(paymentMethodData: $paymentMethodData)'; +} - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsBankContactImplCopyWith< - _$PaymentMethodParamsBankContactImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsGiroPayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsGiroPayImplCopyWith( - _$PaymentMethodParamsGiroPayImpl value, - $Res Function(_$PaymentMethodParamsGiroPayImpl) then) = - __$$PaymentMethodParamsGiroPayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +abstract mixin class _$PaymentMethodParamsBankContactCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsBankContactCopyWith(_PaymentMethodParamsBankContact value, $Res Function(_PaymentMethodParamsBankContact) _then) = __$PaymentMethodParamsBankContactCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class __$$PaymentMethodParamsGiroPayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsGiroPayImpl> - implements _$$PaymentMethodParamsGiroPayImplCopyWith<$Res> { - __$$PaymentMethodParamsGiroPayImplCopyWithImpl( - _$PaymentMethodParamsGiroPayImpl _value, - $Res Function(_$PaymentMethodParamsGiroPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsGiroPayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +class __$PaymentMethodParamsBankContactCopyWithImpl<$Res> + implements _$PaymentMethodParamsBankContactCopyWith<$Res> { + __$PaymentMethodParamsBankContactCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsBankContact _self; + final $Res Function(_PaymentMethodParamsBankContact) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsBankContact( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsGiroPayImpl implements _PaymentMethodParamsGiroPay { - const _$PaymentMethodParamsGiroPayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Giropay'; - - factory _$PaymentMethodParamsGiroPayImpl.fromJson( - Map json) => - _$$PaymentMethodParamsGiroPayImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +class _PaymentMethodParamsGiroPay implements PaymentMethodParams { + const _PaymentMethodParamsGiroPay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Giropay'; + factory _PaymentMethodParamsGiroPay.fromJson(Map json) => _$PaymentMethodParamsGiroPayFromJson(json); - @JsonKey(name: 'paymentMethodType') - final String $type; +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - String toString() { - return 'PaymentMethodParams.giroPay(paymentMethodData: $paymentMethodData)'; - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsGiroPayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsGiroPayImplCopyWith<_$PaymentMethodParamsGiroPayImpl> - get copyWith => __$$PaymentMethodParamsGiroPayImplCopyWithImpl< - _$PaymentMethodParamsGiroPayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return giroPay(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsGiroPayCopyWith<_PaymentMethodParamsGiroPay> get copyWith => __$PaymentMethodParamsGiroPayCopyWithImpl<_PaymentMethodParamsGiroPay>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return giroPay?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsGiroPayToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (giroPay != null) { - return giroPay(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsGiroPay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return giroPay(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return giroPay?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.giroPay(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (giroPay != null) { - return giroPay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsGiroPayImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsGiroPay implements PaymentMethodParams { - const factory _PaymentMethodParamsGiroPay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsGiroPayImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsGiroPayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsGiroPayCopyWith(_PaymentMethodParamsGiroPay value, $Res Function(_PaymentMethodParamsGiroPay) _then) = __$PaymentMethodParamsGiroPayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsGiroPay.fromJson(Map json) = - _$PaymentMethodParamsGiroPayImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsGiroPayImplCopyWith<_$PaymentMethodParamsGiroPayImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsEpsImplCopyWith<$Res> { - factory _$$PaymentMethodParamsEpsImplCopyWith( - _$PaymentMethodParamsEpsImpl value, - $Res Function(_$PaymentMethodParamsEpsImpl) then) = - __$$PaymentMethodParamsEpsImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsGiroPayCopyWithImpl<$Res> + implements _$PaymentMethodParamsGiroPayCopyWith<$Res> { + __$PaymentMethodParamsGiroPayCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsGiroPay _self; + final $Res Function(_PaymentMethodParamsGiroPay) _then; -/// @nodoc -class __$$PaymentMethodParamsEpsImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsEpsImpl> - implements _$$PaymentMethodParamsEpsImplCopyWith<$Res> { - __$$PaymentMethodParamsEpsImplCopyWithImpl( - _$PaymentMethodParamsEpsImpl _value, - $Res Function(_$PaymentMethodParamsEpsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsEpsImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsGiroPay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsEpsImpl implements _PaymentMethodParamsEps { - const _$PaymentMethodParamsEpsImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Eps'; +class _PaymentMethodParamsEps implements PaymentMethodParams { + const _PaymentMethodParamsEps({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Eps'; + factory _PaymentMethodParamsEps.fromJson(Map json) => _$PaymentMethodParamsEpsFromJson(json); - factory _$PaymentMethodParamsEpsImpl.fromJson(Map json) => - _$$PaymentMethodParamsEpsImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.eps(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsEpsImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsEpsImplCopyWith<_$PaymentMethodParamsEpsImpl> - get copyWith => __$$PaymentMethodParamsEpsImplCopyWithImpl< - _$PaymentMethodParamsEpsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return eps(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsEpsCopyWith<_PaymentMethodParamsEps> get copyWith => __$PaymentMethodParamsEpsCopyWithImpl<_PaymentMethodParamsEps>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return eps?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsEpsToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (eps != null) { - return eps(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsEps&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return eps(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return eps?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.eps(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (eps != null) { - return eps(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsEpsImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsEps implements PaymentMethodParams { - const factory _PaymentMethodParamsEps( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsEpsImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsEpsCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsEpsCopyWith(_PaymentMethodParamsEps value, $Res Function(_PaymentMethodParamsEps) _then) = __$PaymentMethodParamsEpsCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsEps.fromJson(Map json) = - _$PaymentMethodParamsEpsImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsEpsImplCopyWith<_$PaymentMethodParamsEpsImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsAffirmImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAffirmImplCopyWith( - _$PaymentMethodParamsAffirmImpl value, - $Res Function(_$PaymentMethodParamsAffirmImpl) then) = - __$$PaymentMethodParamsAffirmImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsEpsCopyWithImpl<$Res> + implements _$PaymentMethodParamsEpsCopyWith<$Res> { + __$PaymentMethodParamsEpsCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsEps _self; + final $Res Function(_PaymentMethodParamsEps) _then; -/// @nodoc -class __$$PaymentMethodParamsAffirmImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAffirmImpl> - implements _$$PaymentMethodParamsAffirmImplCopyWith<$Res> { - __$$PaymentMethodParamsAffirmImplCopyWithImpl( - _$PaymentMethodParamsAffirmImpl _value, - $Res Function(_$PaymentMethodParamsAffirmImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAffirmImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsEps( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAffirmImpl implements _PaymentMethodParamsAffirm { - const _$PaymentMethodParamsAffirmImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Affirm'; - - factory _$PaymentMethodParamsAffirmImpl.fromJson(Map json) => - _$$PaymentMethodParamsAffirmImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +class _PaymentMethodParamsAffirm implements PaymentMethodParams { + const _PaymentMethodParamsAffirm({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Affirm'; + factory _PaymentMethodParamsAffirm.fromJson(Map json) => _$PaymentMethodParamsAffirmFromJson(json); - @JsonKey(name: 'paymentMethodType') - final String $type; +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - String toString() { - return 'PaymentMethodParams.affirm(paymentMethodData: $paymentMethodData)'; - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAffirmImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAffirmImplCopyWith<_$PaymentMethodParamsAffirmImpl> - get copyWith => __$$PaymentMethodParamsAffirmImplCopyWithImpl< - _$PaymentMethodParamsAffirmImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return affirm(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAffirmCopyWith<_PaymentMethodParamsAffirm> get copyWith => __$PaymentMethodParamsAffirmCopyWithImpl<_PaymentMethodParamsAffirm>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return affirm?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsAffirmToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (affirm != null) { - return affirm(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAffirm&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return affirm(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return affirm?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.affirm(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (affirm != null) { - return affirm(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsAffirmImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsAffirm implements PaymentMethodParams { - const factory _PaymentMethodParamsAffirm( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsAffirmImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsAffirmCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAffirmCopyWith(_PaymentMethodParamsAffirm value, $Res Function(_PaymentMethodParamsAffirm) _then) = __$PaymentMethodParamsAffirmCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsAffirm.fromJson(Map json) = - _$PaymentMethodParamsAffirmImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAffirmImplCopyWith<_$PaymentMethodParamsAffirmImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsPayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsPayImplCopyWith( - _$PaymentMethodParamsPayImpl value, - $Res Function(_$PaymentMethodParamsPayImpl) then) = - __$$PaymentMethodParamsPayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsAffirmCopyWithImpl<$Res> + implements _$PaymentMethodParamsAffirmCopyWith<$Res> { + __$PaymentMethodParamsAffirmCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsAffirm _self; + final $Res Function(_PaymentMethodParamsAffirm) _then; -/// @nodoc -class __$$PaymentMethodParamsPayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsPayImpl> - implements _$$PaymentMethodParamsPayImplCopyWith<$Res> { - __$$PaymentMethodParamsPayImplCopyWithImpl( - _$PaymentMethodParamsPayImpl _value, - $Res Function(_$PaymentMethodParamsPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsPayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAffirm( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsPayImpl implements _PaymentMethodParamsPay { - const _$PaymentMethodParamsPayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'GrabPay'; +class _PaymentMethodParamsPay implements PaymentMethodParams { + const _PaymentMethodParamsPay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'GrabPay'; + factory _PaymentMethodParamsPay.fromJson(Map json) => _$PaymentMethodParamsPayFromJson(json); - factory _$PaymentMethodParamsPayImpl.fromJson(Map json) => - _$$PaymentMethodParamsPayImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.grabPay(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsPayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsPayImplCopyWith<_$PaymentMethodParamsPayImpl> - get copyWith => __$$PaymentMethodParamsPayImplCopyWithImpl< - _$PaymentMethodParamsPayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return grabPay(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsPayCopyWith<_PaymentMethodParamsPay> get copyWith => __$PaymentMethodParamsPayCopyWithImpl<_PaymentMethodParamsPay>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return grabPay?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsPayToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (grabPay != null) { - return grabPay(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsPay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return grabPay(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return grabPay?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.grabPay(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (grabPay != null) { - return grabPay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsPayImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsPay implements PaymentMethodParams { - const factory _PaymentMethodParamsPay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsPayImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsPayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsPayCopyWith(_PaymentMethodParamsPay value, $Res Function(_PaymentMethodParamsPay) _then) = __$PaymentMethodParamsPayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsPay.fromJson(Map json) = - _$PaymentMethodParamsPayImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsPayImplCopyWith<_$PaymentMethodParamsPayImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsP24ImplCopyWith<$Res> { - factory _$$PaymentMethodParamsP24ImplCopyWith( - _$PaymentMethodParamsP24Impl value, - $Res Function(_$PaymentMethodParamsP24Impl) then) = - __$$PaymentMethodParamsP24ImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsPayCopyWithImpl<$Res> + implements _$PaymentMethodParamsPayCopyWith<$Res> { + __$PaymentMethodParamsPayCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsP24ImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsP24Impl> - implements _$$PaymentMethodParamsP24ImplCopyWith<$Res> { - __$$PaymentMethodParamsP24ImplCopyWithImpl( - _$PaymentMethodParamsP24Impl _value, - $Res Function(_$PaymentMethodParamsP24Impl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsP24Impl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsPay _self; + final $Res Function(_PaymentMethodParamsPay) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsPay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsP24Impl implements _PaymentMethodParamsP24 { - const _$PaymentMethodParamsP24Impl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'P24'; - - factory _$PaymentMethodParamsP24Impl.fromJson(Map json) => - _$$PaymentMethodParamsP24ImplFromJson(json); +class _PaymentMethodParamsP24 implements PaymentMethodParams { + const _PaymentMethodParamsP24({required this.paymentMethodData, final String? $type}): $type = $type ?? 'P24'; + factory _PaymentMethodParamsP24.fromJson(Map json) => _$PaymentMethodParamsP24FromJson(json); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @JsonKey(name: 'paymentMethodType') - final String $type; +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - String toString() { - return 'PaymentMethodParams.p24(paymentMethodData: $paymentMethodData)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsP24Impl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsP24CopyWith<_PaymentMethodParamsP24> get copyWith => __$PaymentMethodParamsP24CopyWithImpl<_PaymentMethodParamsP24>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsP24ImplCopyWith<_$PaymentMethodParamsP24Impl> - get copyWith => __$$PaymentMethodParamsP24ImplCopyWithImpl< - _$PaymentMethodParamsP24Impl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return p24(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsP24ToJson(this, ); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return p24?.call(paymentMethodData); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsP24&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (p24 != null) { - return p24(paymentMethodData); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return p24(this); - } +@override +String toString() { + return 'PaymentMethodParams.p24(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return p24?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (p24 != null) { - return p24(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$PaymentMethodParamsP24ImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsP24 implements PaymentMethodParams { - const factory _PaymentMethodParamsP24( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsP24Impl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsP24CopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsP24CopyWith(_PaymentMethodParamsP24 value, $Res Function(_PaymentMethodParamsP24) _then) = __$PaymentMethodParamsP24CopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsP24.fromJson(Map json) = - _$PaymentMethodParamsP24Impl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsP24ImplCopyWith<_$PaymentMethodParamsP24Impl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsFpxImplCopyWith<$Res> { - factory _$$PaymentMethodParamsFpxImplCopyWith( - _$PaymentMethodParamsFpxImpl value, - $Res Function(_$PaymentMethodParamsFpxImpl) then) = - __$$PaymentMethodParamsFpxImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataFpx paymentMethodData}); +class __$PaymentMethodParamsP24CopyWithImpl<$Res> + implements _$PaymentMethodParamsP24CopyWith<$Res> { + __$PaymentMethodParamsP24CopyWithImpl(this._self, this._then); - $PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsP24 _self; + final $Res Function(_PaymentMethodParamsP24) _then; -/// @nodoc -class __$$PaymentMethodParamsFpxImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsFpxImpl> - implements _$$PaymentMethodParamsFpxImplCopyWith<$Res> { - __$$PaymentMethodParamsFpxImplCopyWithImpl( - _$PaymentMethodParamsFpxImpl _value, - $Res Function(_$PaymentMethodParamsFpxImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsFpxImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataFpx, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsP24( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataFpxCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsFpxImpl implements _PaymentMethodParamsFpx { - const _$PaymentMethodParamsFpxImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Fpx'; - - factory _$PaymentMethodParamsFpxImpl.fromJson(Map json) => - _$$PaymentMethodParamsFpxImplFromJson(json); +class _PaymentMethodParamsFpx implements PaymentMethodParams { + const _PaymentMethodParamsFpx({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Fpx'; + factory _PaymentMethodParamsFpx.fromJson(Map json) => _$PaymentMethodParamsFpxFromJson(json); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataFpx paymentMethodData; +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataFpx paymentMethodData; - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.fpx(paymentMethodData: $paymentMethodData)'; - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsFpxImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsFpxImplCopyWith<_$PaymentMethodParamsFpxImpl> - get copyWith => __$$PaymentMethodParamsFpxImplCopyWithImpl< - _$PaymentMethodParamsFpxImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return fpx(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsFpxCopyWith<_PaymentMethodParamsFpx> get copyWith => __$PaymentMethodParamsFpxCopyWithImpl<_PaymentMethodParamsFpx>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return fpx?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsFpxToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (fpx != null) { - return fpx(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsFpx&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return fpx(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return fpx?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.fpx(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (fpx != null) { - return fpx(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsFpxImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsFpx implements PaymentMethodParams { - const factory _PaymentMethodParamsFpx( - {required final PaymentMethodDataFpx paymentMethodData}) = - _$PaymentMethodParamsFpxImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsFpxCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsFpxCopyWith(_PaymentMethodParamsFpx value, $Res Function(_PaymentMethodParamsFpx) _then) = __$PaymentMethodParamsFpxCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataFpx paymentMethodData +}); - factory _PaymentMethodParamsFpx.fromJson(Map json) = - _$PaymentMethodParamsFpxImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataFpx get paymentMethodData; +$PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsFpxImplCopyWith<_$PaymentMethodParamsFpxImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsSepaDebitImplCopyWith<$Res> { - factory _$$PaymentMethodParamsSepaDebitImplCopyWith( - _$PaymentMethodParamsSepaDebitImpl value, - $Res Function(_$PaymentMethodParamsSepaDebitImpl) then) = - __$$PaymentMethodParamsSepaDebitImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataSepa paymentMethodData}); +class __$PaymentMethodParamsFpxCopyWithImpl<$Res> + implements _$PaymentMethodParamsFpxCopyWith<$Res> { + __$PaymentMethodParamsFpxCopyWithImpl(this._self, this._then); - $PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsFpx _self; + final $Res Function(_PaymentMethodParamsFpx) _then; -/// @nodoc -class __$$PaymentMethodParamsSepaDebitImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsSepaDebitImpl> - implements _$$PaymentMethodParamsSepaDebitImplCopyWith<$Res> { - __$$PaymentMethodParamsSepaDebitImplCopyWithImpl( - _$PaymentMethodParamsSepaDebitImpl _value, - $Res Function(_$PaymentMethodParamsSepaDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsSepaDebitImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataSepa, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsFpx( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataFpx, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataSepaCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataFpxCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsSepaDebitImpl - implements _PaymentMethodParamsSepaDebit { - const _$PaymentMethodParamsSepaDebitImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'SepaDebit'; - - factory _$PaymentMethodParamsSepaDebitImpl.fromJson( - Map json) => - _$$PaymentMethodParamsSepaDebitImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataSepa paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.sepaDebit(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsSepaDebitImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +class _PaymentMethodParamsSepaDebit implements PaymentMethodParams { + const _PaymentMethodParamsSepaDebit({required this.paymentMethodData, final String? $type}): $type = $type ?? 'SepaDebit'; + factory _PaymentMethodParamsSepaDebit.fromJson(Map json) => _$PaymentMethodParamsSepaDebitFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsSepaDebitImplCopyWith< - _$PaymentMethodParamsSepaDebitImpl> - get copyWith => __$$PaymentMethodParamsSepaDebitImplCopyWithImpl< - _$PaymentMethodParamsSepaDebitImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return sepaDebit(paymentMethodData); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataSepa paymentMethodData; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return sepaDebit?.call(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (sepaDebit != null) { - return sepaDebit(paymentMethodData); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return sepaDebit(this); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsSepaDebitCopyWith<_PaymentMethodParamsSepaDebit> get copyWith => __$PaymentMethodParamsSepaDebitCopyWithImpl<_PaymentMethodParamsSepaDebit>(this, _$identity); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return sepaDebit?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (sepaDebit != null) { - return sepaDebit(this); - } - return orElse(); - } +@override +Map toJson() { + return _$PaymentMethodParamsSepaDebitToJson(this, ); +} - @override - Map toJson() { - return _$$PaymentMethodParamsSepaDebitImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsSepaDebit&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -abstract class _PaymentMethodParamsSepaDebit implements PaymentMethodParams { - const factory _PaymentMethodParamsSepaDebit( - {required final PaymentMethodDataSepa paymentMethodData}) = - _$PaymentMethodParamsSepaDebitImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - factory _PaymentMethodParamsSepaDebit.fromJson(Map json) = - _$PaymentMethodParamsSepaDebitImpl.fromJson; +@override +String toString() { + return 'PaymentMethodParams.sepaDebit(paymentMethodData: $paymentMethodData)'; +} - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataSepa get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsSepaDebitImplCopyWith< - _$PaymentMethodParamsSepaDebitImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsSofortImplCopyWith<$Res> { - factory _$$PaymentMethodParamsSofortImplCopyWith( - _$PaymentMethodParamsSofortImpl value, - $Res Function(_$PaymentMethodParamsSofortImpl) then) = - __$$PaymentMethodParamsSofortImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataSofort paymentMethodData}); +abstract mixin class _$PaymentMethodParamsSepaDebitCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsSepaDebitCopyWith(_PaymentMethodParamsSepaDebit value, $Res Function(_PaymentMethodParamsSepaDebit) _then) = __$PaymentMethodParamsSepaDebitCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataSepa paymentMethodData +}); - $PaymentMethodDataSofortCopyWith<$Res> get paymentMethodData; -} +$PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class __$$PaymentMethodParamsSofortImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsSofortImpl> - implements _$$PaymentMethodParamsSofortImplCopyWith<$Res> { - __$$PaymentMethodParamsSofortImplCopyWithImpl( - _$PaymentMethodParamsSofortImpl _value, - $Res Function(_$PaymentMethodParamsSofortImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsSofortImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataSofort, - )); - } +class __$PaymentMethodParamsSepaDebitCopyWithImpl<$Res> + implements _$PaymentMethodParamsSepaDebitCopyWith<$Res> { + __$PaymentMethodParamsSepaDebitCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataSofortCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataSofortCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsSepaDebit _self; + final $Res Function(_PaymentMethodParamsSepaDebit) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsSepaDebit( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataSepa, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataSepaCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsSofortImpl implements _PaymentMethodParamsSofort { - const _$PaymentMethodParamsSofortImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Sofort'; +class _PaymentMethodParamsAfterpayClearpay implements PaymentMethodParams { + const _PaymentMethodParamsAfterpayClearpay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'AfterpayClearpay'; + factory _PaymentMethodParamsAfterpayClearpay.fromJson(Map json) => _$PaymentMethodParamsAfterpayClearpayFromJson(json); - factory _$PaymentMethodParamsSofortImpl.fromJson(Map json) => - _$$PaymentMethodParamsSofortImplFromJson(json); +@override final PaymentMethodDataAfterPay paymentMethodData; - @override - final PaymentMethodDataSofort paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.sofort(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAfterpayClearpayCopyWith<_PaymentMethodParamsAfterpayClearpay> get copyWith => __$PaymentMethodParamsAfterpayClearpayCopyWithImpl<_PaymentMethodParamsAfterpayClearpay>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsSofortImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsSofortImplCopyWith<_$PaymentMethodParamsSofortImpl> - get copyWith => __$$PaymentMethodParamsSofortImplCopyWithImpl< - _$PaymentMethodParamsSofortImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return sofort(paymentMethodData); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return sofort?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsAfterpayClearpayToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (sofort != null) { - return sofort(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAfterpayClearpay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return sofort(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return sofort?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.afterpayClearpay(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (sofort != null) { - return sofort(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsSofortImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsSofort implements PaymentMethodParams { - const factory _PaymentMethodParamsSofort( - {required final PaymentMethodDataSofort paymentMethodData}) = - _$PaymentMethodParamsSofortImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsAfterpayClearpayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAfterpayClearpayCopyWith(_PaymentMethodParamsAfterpayClearpay value, $Res Function(_PaymentMethodParamsAfterpayClearpay) _then) = __$PaymentMethodParamsAfterpayClearpayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataAfterPay paymentMethodData +}); - factory _PaymentMethodParamsSofort.fromJson(Map json) = - _$PaymentMethodParamsSofortImpl.fromJson; - @override - PaymentMethodDataSofort get paymentMethodData; +$PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsSofortImplCopyWith<_$PaymentMethodParamsSofortImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsAfterpayClearpayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAfterpayClearpayImplCopyWith( - _$PaymentMethodParamsAfterpayClearpayImpl value, - $Res Function(_$PaymentMethodParamsAfterpayClearpayImpl) then) = - __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataAfterPay paymentMethodData}); +class __$PaymentMethodParamsAfterpayClearpayCopyWithImpl<$Res> + implements _$PaymentMethodParamsAfterpayClearpayCopyWith<$Res> { + __$PaymentMethodParamsAfterpayClearpayCopyWithImpl(this._self, this._then); - $PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsAfterpayClearpay _self; + final $Res Function(_PaymentMethodParamsAfterpayClearpay) _then; -/// @nodoc -class __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAfterpayClearpayImpl> - implements _$$PaymentMethodParamsAfterpayClearpayImplCopyWith<$Res> { - __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl( - _$PaymentMethodParamsAfterpayClearpayImpl _value, - $Res Function(_$PaymentMethodParamsAfterpayClearpayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAfterpayClearpayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataAfterPay, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAfterpayClearpay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataAfterPay, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataAfterPayCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataAfterPayCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAfterpayClearpayImpl - implements _PaymentMethodParamsAfterpayClearpay { - const _$PaymentMethodParamsAfterpayClearpayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'AfterpayClearpay'; +class _PaymentMethodParamsOxxo implements PaymentMethodParams { + const _PaymentMethodParamsOxxo({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Oxxo'; + factory _PaymentMethodParamsOxxo.fromJson(Map json) => _$PaymentMethodParamsOxxoFromJson(json); - factory _$PaymentMethodParamsAfterpayClearpayImpl.fromJson( - Map json) => - _$$PaymentMethodParamsAfterpayClearpayImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - final PaymentMethodDataAfterPay paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.afterpayClearpay(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsOxxoCopyWith<_PaymentMethodParamsOxxo> get copyWith => __$PaymentMethodParamsOxxoCopyWithImpl<_PaymentMethodParamsOxxo>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAfterpayClearpayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAfterpayClearpayImplCopyWith< - _$PaymentMethodParamsAfterpayClearpayImpl> - get copyWith => __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl< - _$PaymentMethodParamsAfterpayClearpayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return afterpayClearpay(paymentMethodData); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return afterpayClearpay?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsOxxoToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (afterpayClearpay != null) { - return afterpayClearpay(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsOxxo&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return afterpayClearpay(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return afterpayClearpay?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.oxxo(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (afterpayClearpay != null) { - return afterpayClearpay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsAfterpayClearpayImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsAfterpayClearpay - implements PaymentMethodParams { - const factory _PaymentMethodParamsAfterpayClearpay( - {required final PaymentMethodDataAfterPay paymentMethodData}) = - _$PaymentMethodParamsAfterpayClearpayImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsOxxoCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsOxxoCopyWith(_PaymentMethodParamsOxxo value, $Res Function(_PaymentMethodParamsOxxo) _then) = __$PaymentMethodParamsOxxoCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsAfterpayClearpay.fromJson( - Map json) = - _$PaymentMethodParamsAfterpayClearpayImpl.fromJson; - @override - PaymentMethodDataAfterPay get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAfterpayClearpayImplCopyWith< - _$PaymentMethodParamsAfterpayClearpayImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsOxxoImplCopyWith<$Res> { - factory _$$PaymentMethodParamsOxxoImplCopyWith( - _$PaymentMethodParamsOxxoImpl value, - $Res Function(_$PaymentMethodParamsOxxoImpl) then) = - __$$PaymentMethodParamsOxxoImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsOxxoCopyWithImpl<$Res> + implements _$PaymentMethodParamsOxxoCopyWith<$Res> { + __$PaymentMethodParamsOxxoCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsOxxo _self; + final $Res Function(_PaymentMethodParamsOxxo) _then; -/// @nodoc -class __$$PaymentMethodParamsOxxoImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsOxxoImpl> - implements _$$PaymentMethodParamsOxxoImplCopyWith<$Res> { - __$$PaymentMethodParamsOxxoImplCopyWithImpl( - _$PaymentMethodParamsOxxoImpl _value, - $Res Function(_$PaymentMethodParamsOxxoImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsOxxoImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsOxxo( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsOxxoImpl implements _PaymentMethodParamsOxxo { - const _$PaymentMethodParamsOxxoImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Oxxo'; - - factory _$PaymentMethodParamsOxxoImpl.fromJson(Map json) => - _$$PaymentMethodParamsOxxoImplFromJson(json); +class _PaymentMethodParamsKlarna implements PaymentMethodParams { + const _PaymentMethodParamsKlarna({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Klarna'; + factory _PaymentMethodParamsKlarna.fromJson(Map json) => _$PaymentMethodParamsKlarnaFromJson(json); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +/// Paymentmethod data for this paymentmethod. +/// +/// Make sure to add an email and country (part of the address) in the +/// billingdetails which is required for using Klarna. +@override final PaymentMethodData paymentMethodData; - @JsonKey(name: 'paymentMethodType') - final String $type; +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - String toString() { - return 'PaymentMethodParams.oxxo(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsOxxoImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsOxxoImplCopyWith<_$PaymentMethodParamsOxxoImpl> - get copyWith => __$$PaymentMethodParamsOxxoImplCopyWithImpl< - _$PaymentMethodParamsOxxoImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return oxxo(paymentMethodData); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsKlarnaCopyWith<_PaymentMethodParamsKlarna> get copyWith => __$PaymentMethodParamsKlarnaCopyWithImpl<_PaymentMethodParamsKlarna>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return oxxo?.call(paymentMethodData); - } +@override +Map toJson() { + return _$PaymentMethodParamsKlarnaToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (oxxo != null) { - return oxxo(paymentMethodData); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsKlarna&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return oxxo(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return oxxo?.call(this); - } +@override +String toString() { + return 'PaymentMethodParams.klarna(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (oxxo != null) { - return oxxo(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsOxxoImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsOxxo implements PaymentMethodParams { - const factory _PaymentMethodParamsOxxo( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsOxxoImpl; +/// @nodoc +abstract mixin class _$PaymentMethodParamsKlarnaCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsKlarnaCopyWith(_PaymentMethodParamsKlarna value, $Res Function(_PaymentMethodParamsKlarna) _then) = __$PaymentMethodParamsKlarnaCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - factory _PaymentMethodParamsOxxo.fromJson(Map json) = - _$PaymentMethodParamsOxxoImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsOxxoImplCopyWith<_$PaymentMethodParamsOxxoImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentMethodParamsKlarnaImplCopyWith<$Res> { - factory _$$PaymentMethodParamsKlarnaImplCopyWith( - _$PaymentMethodParamsKlarnaImpl value, - $Res Function(_$PaymentMethodParamsKlarnaImpl) then) = - __$$PaymentMethodParamsKlarnaImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +class __$PaymentMethodParamsKlarnaCopyWithImpl<$Res> + implements _$PaymentMethodParamsKlarnaCopyWith<$Res> { + __$PaymentMethodParamsKlarnaCopyWithImpl(this._self, this._then); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} + final _PaymentMethodParamsKlarna _self; + final $Res Function(_PaymentMethodParamsKlarna) _then; -/// @nodoc -class __$$PaymentMethodParamsKlarnaImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsKlarnaImpl> - implements _$$PaymentMethodParamsKlarnaImplCopyWith<$Res> { - __$$PaymentMethodParamsKlarnaImplCopyWithImpl( - _$PaymentMethodParamsKlarnaImpl _value, - $Res Function(_$PaymentMethodParamsKlarnaImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsKlarnaImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsKlarna( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsKlarnaImpl implements _PaymentMethodParamsKlarna { - const _$PaymentMethodParamsKlarnaImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Klarna'; - - factory _$PaymentMethodParamsKlarnaImpl.fromJson(Map json) => - _$$PaymentMethodParamsKlarnaImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - /// - /// Make sure to add an email and country (part of the address) in the - /// billingdetails which is required for using Klarna. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.klarna(paymentMethodData: $paymentMethodData)'; - } +class _PaymentMethodParamsPayPal implements PaymentMethodParams { + const _PaymentMethodParamsPayPal({required this.paymentMethodData, final String? $type}): $type = $type ?? 'PayPal'; + factory _PaymentMethodParamsPayPal.fromJson(Map json) => _$PaymentMethodParamsPayPalFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsKlarnaImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Paymentmethod data for this paymentmethod. +/// +/// Make sure to add an email and country (part of the address) in the +/// billingdetails which is required for using Klarna. +@override final PaymentMethodData paymentMethodData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsKlarnaImplCopyWith<_$PaymentMethodParamsKlarnaImpl> - get copyWith => __$$PaymentMethodParamsKlarnaImplCopyWithImpl< - _$PaymentMethodParamsKlarnaImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return klarna(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return klarna?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (klarna != null) { - return klarna(paymentMethodData); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return klarna(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return klarna?.call(this); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsPayPalCopyWith<_PaymentMethodParamsPayPal> get copyWith => __$PaymentMethodParamsPayPalCopyWithImpl<_PaymentMethodParamsPayPal>(this, _$identity); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (klarna != null) { - return klarna(this); - } - return orElse(); - } +@override +Map toJson() { + return _$PaymentMethodParamsPayPalToJson(this, ); +} - @override - Map toJson() { - return _$$PaymentMethodParamsKlarnaImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsPayPal&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -abstract class _PaymentMethodParamsKlarna implements PaymentMethodParams { - const factory _PaymentMethodParamsKlarna( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsKlarnaImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - factory _PaymentMethodParamsKlarna.fromJson(Map json) = - _$PaymentMethodParamsKlarnaImpl.fromJson; +@override +String toString() { + return 'PaymentMethodParams.payPal(paymentMethodData: $paymentMethodData)'; +} - /// Paymentmethod data for this paymentmethod. - /// - /// Make sure to add an email and country (part of the address) in the - /// billingdetails which is required for using Klarna. - @override - PaymentMethodData get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsKlarnaImplCopyWith<_$PaymentMethodParamsKlarnaImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsPayPalImplCopyWith<$Res> { - factory _$$PaymentMethodParamsPayPalImplCopyWith( - _$PaymentMethodParamsPayPalImpl value, - $Res Function(_$PaymentMethodParamsPayPalImpl) then) = - __$$PaymentMethodParamsPayPalImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); +abstract mixin class _$PaymentMethodParamsPayPalCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsPayPalCopyWith(_PaymentMethodParamsPayPal value, $Res Function(_PaymentMethodParamsPayPal) _then) = __$PaymentMethodParamsPayPalCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class __$$PaymentMethodParamsPayPalImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsPayPalImpl> - implements _$$PaymentMethodParamsPayPalImplCopyWith<$Res> { - __$$PaymentMethodParamsPayPalImplCopyWithImpl( - _$PaymentMethodParamsPayPalImpl _value, - $Res Function(_$PaymentMethodParamsPayPalImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsPayPalImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +class __$PaymentMethodParamsPayPalCopyWithImpl<$Res> + implements _$PaymentMethodParamsPayPalCopyWith<$Res> { + __$PaymentMethodParamsPayPalCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsPayPal _self; + final $Res Function(_PaymentMethodParamsPayPal) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsPayPal( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsPayPalImpl implements _PaymentMethodParamsPayPal { - const _$PaymentMethodParamsPayPalImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'PayPal'; - - factory _$PaymentMethodParamsPayPalImpl.fromJson(Map json) => - _$$PaymentMethodParamsPayPalImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - /// - /// Make sure to add an email and country (part of the address) in the - /// billingdetails which is required for using Klarna. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.payPal(paymentMethodData: $paymentMethodData)'; - } +class _PaymentMethodParamsUsBankAccount implements PaymentMethodParams { + const _PaymentMethodParamsUsBankAccount({required this.paymentMethodData, final String? $type}): $type = $type ?? 'USBankAccount'; + factory _PaymentMethodParamsUsBankAccount.fromJson(Map json) => _$PaymentMethodParamsUsBankAccountFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsPayPalImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataUsBank paymentMethodData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsPayPalImplCopyWith<_$PaymentMethodParamsPayPalImpl> - get copyWith => __$$PaymentMethodParamsPayPalImplCopyWithImpl< - _$PaymentMethodParamsPayPalImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return payPal(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return payPal?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (payPal != null) { - return payPal(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsUsBankAccountCopyWith<_PaymentMethodParamsUsBankAccount> get copyWith => __$PaymentMethodParamsUsBankAccountCopyWithImpl<_PaymentMethodParamsUsBankAccount>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return payPal(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return payPal?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (payPal != null) { - return payPal(this); - } - return orElse(); - } +@override +Map toJson() { + return _$PaymentMethodParamsUsBankAccountToJson(this, ); +} - @override - Map toJson() { - return _$$PaymentMethodParamsPayPalImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsUsBankAccount&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -abstract class _PaymentMethodParamsPayPal implements PaymentMethodParams { - const factory _PaymentMethodParamsPayPal( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsPayPalImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - factory _PaymentMethodParamsPayPal.fromJson(Map json) = - _$PaymentMethodParamsPayPalImpl.fromJson; +@override +String toString() { + return 'PaymentMethodParams.usBankAccount(paymentMethodData: $paymentMethodData)'; +} - /// Paymentmethod data for this paymentmethod. - /// - /// Make sure to add an email and country (part of the address) in the - /// billingdetails which is required for using Klarna. - @override - PaymentMethodData get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsPayPalImplCopyWith<_$PaymentMethodParamsPayPalImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsUsBankAccountImplCopyWith<$Res> { - factory _$$PaymentMethodParamsUsBankAccountImplCopyWith( - _$PaymentMethodParamsUsBankAccountImpl value, - $Res Function(_$PaymentMethodParamsUsBankAccountImpl) then) = - __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataUsBank paymentMethodData}); +abstract mixin class _$PaymentMethodParamsUsBankAccountCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsUsBankAccountCopyWith(_PaymentMethodParamsUsBankAccount value, $Res Function(_PaymentMethodParamsUsBankAccount) _then) = __$PaymentMethodParamsUsBankAccountCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataUsBank paymentMethodData +}); - $PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData; -} +$PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsUsBankAccountImpl> - implements _$$PaymentMethodParamsUsBankAccountImplCopyWith<$Res> { - __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl( - _$PaymentMethodParamsUsBankAccountImpl _value, - $Res Function(_$PaymentMethodParamsUsBankAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsUsBankAccountImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataUsBank, - )); - } +class __$PaymentMethodParamsUsBankAccountCopyWithImpl<$Res> + implements _$PaymentMethodParamsUsBankAccountCopyWith<$Res> { + __$PaymentMethodParamsUsBankAccountCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataUsBankCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } + final _PaymentMethodParamsUsBankAccount _self; + final $Res Function(_PaymentMethodParamsUsBankAccount) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsUsBankAccount( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataUsBank, + )); } -/// @nodoc +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataUsBankCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsUsBankAccountImpl - implements _PaymentMethodParamsUsBankAccount { - const _$PaymentMethodParamsUsBankAccountImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'USBankAccount'; - - factory _$PaymentMethodParamsUsBankAccountImpl.fromJson( - Map json) => - _$$PaymentMethodParamsUsBankAccountImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataUsBank paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.usBankAccount(paymentMethodData: $paymentMethodData)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsUsBankAccountImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// @nodoc +mixin _$PaymentMethodData { - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsUsBankAccountImplCopyWith< - _$PaymentMethodParamsUsBankAccountImpl> - get copyWith => __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl< - _$PaymentMethodParamsUsBankAccountImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return usBankAccount(paymentMethodData); - } +/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith get copyWith => _$PaymentMethodDataCopyWithImpl(this as PaymentMethodData, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return usBankAccount?.call(paymentMethodData); - } + /// Serializes this PaymentMethodData to a JSON map. + Map toJson(); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (usBankAccount != null) { - return usBankAccount(paymentMethodData); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return usBankAccount(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodData&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return usBankAccount?.call(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodData(billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (usBankAccount != null) { - return usBankAccount(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsUsBankAccountImplToJson( - this, - ); - } } -abstract class _PaymentMethodParamsUsBankAccount - implements PaymentMethodParams { - const factory _PaymentMethodParamsUsBankAccount( - {required final PaymentMethodDataUsBank paymentMethodData}) = - _$PaymentMethodParamsUsBankAccountImpl; +/// @nodoc +abstract mixin class $PaymentMethodDataCopyWith<$Res> { + factory $PaymentMethodDataCopyWith(PaymentMethodData value, $Res Function(PaymentMethodData) _then) = _$PaymentMethodDataCopyWithImpl; +@useResult +$Res call({ + BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodParamsUsBankAccount.fromJson( - Map json) = - _$PaymentMethodParamsUsBankAccountImpl.fromJson; - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataUsBank get paymentMethodData; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsUsBankAccountImplCopyWith< - _$PaymentMethodParamsUsBankAccountImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class _$PaymentMethodDataCopyWithImpl<$Res> + implements $PaymentMethodDataCopyWith<$Res> { + _$PaymentMethodDataCopyWithImpl(this._self, this._then); + + final PaymentMethodData _self; + final $Res Function(PaymentMethodData) _then; + +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodData]. +extension PaymentMethodDataPatterns on PaymentMethodData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodData value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodData value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodData(): +return $default(_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -PaymentMethodData _$PaymentMethodDataFromJson(Map json) { - return _PaymentMethodData.fromJson(json); } /// @nodoc -mixin _$PaymentMethodData { - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodData implements PaymentMethodData { + const _PaymentMethodData({this.billingDetails, this.shippingDetails}); + factory _PaymentMethodData.fromJson(Map json) => _$PaymentMethodDataFromJson(json); - /// Serializes this PaymentMethodData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataCopyWith get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataCopyWith<_PaymentMethodData> get copyWith => __$PaymentMethodDataCopyWithImpl<_PaymentMethodData>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodData&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodData(billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataCopyWith<$Res> { - factory $PaymentMethodDataCopyWith( - PaymentMethodData value, $Res Function(PaymentMethodData) then) = - _$PaymentMethodDataCopyWithImpl<$Res, PaymentMethodData>; - @useResult - $Res call({BillingDetails? billingDetails, ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataCopyWithImpl<$Res, $Val extends PaymentMethodData> - implements $PaymentMethodDataCopyWith<$Res> { - _$PaymentMethodDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class _$PaymentMethodDataCopyWith<$Res> implements $PaymentMethodDataCopyWith<$Res> { + factory _$PaymentMethodDataCopyWith(_PaymentMethodData value, $Res Function(_PaymentMethodData) _then) = __$PaymentMethodDataCopyWithImpl; +@override @useResult +$Res call({ + BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataImplCopyWith<$Res> - implements $PaymentMethodDataCopyWith<$Res> { - factory _$$PaymentMethodDataImplCopyWith(_$PaymentMethodDataImpl value, - $Res Function(_$PaymentMethodDataImpl) then) = - __$$PaymentMethodDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({BillingDetails? billingDetails, ShippingDetails? shippingDetails}); +class __$PaymentMethodDataCopyWithImpl<$Res> + implements _$PaymentMethodDataCopyWith<$Res> { + __$PaymentMethodDataCopyWithImpl(this._self, this._then); - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + final _PaymentMethodData _self; + final $Res Function(_PaymentMethodData) _then; + +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodData( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -/// @nodoc -class __$$PaymentMethodDataImplCopyWithImpl<$Res> - extends _$PaymentMethodDataCopyWithImpl<$Res, _$PaymentMethodDataImpl> - implements _$$PaymentMethodDataImplCopyWith<$Res> { - __$$PaymentMethodDataImplCopyWithImpl(_$PaymentMethodDataImpl _value, - $Res Function(_$PaymentMethodDataImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataImpl( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} } + /// @nodoc +mixin _$PaymentMethodDataCardFromToken { -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataImpl implements _PaymentMethodData { - const _$PaymentMethodDataImpl({this.billingDetails, this.shippingDetails}); +/// Token. + String get token;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromTokenCopyWith get copyWith => _$PaymentMethodDataCardFromTokenCopyWithImpl(this as PaymentMethodDataCardFromToken, _$identity); - factory _$PaymentMethodDataImpl.fromJson(Map json) => - _$$PaymentMethodDataImplFromJson(json); + /// Serializes this PaymentMethodDataCardFromToken to a JSON map. + Map toJson(); - /// Billing information. - @override - final BillingDetails? billingDetails; - /// Shipping details - @override - final ShippingDetails? shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataCardFromToken&&(identical(other.token, token) || other.token == token)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - String toString() { - return 'PaymentMethodData(billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataCardFromToken(token: $token, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataImplCopyWith<_$PaymentMethodDataImpl> get copyWith => - __$$PaymentMethodDataImplCopyWithImpl<_$PaymentMethodDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataImplToJson( - this, - ); - } } -abstract class _PaymentMethodData implements PaymentMethodData { - const factory _PaymentMethodData( - {final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataImpl; +/// @nodoc +abstract mixin class $PaymentMethodDataCardFromTokenCopyWith<$Res> { + factory $PaymentMethodDataCardFromTokenCopyWith(PaymentMethodDataCardFromToken value, $Res Function(PaymentMethodDataCardFromToken) _then) = _$PaymentMethodDataCardFromTokenCopyWithImpl; +@useResult +$Res call({ + String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodData.fromJson(Map json) = - _$PaymentMethodDataImpl.fromJson; - /// Billing information. - @override - BillingDetails? get billingDetails; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +} +/// @nodoc +class _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res> + implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { + _$PaymentMethodDataCardFromTokenCopyWithImpl(this._self, this._then); + + final PaymentMethodDataCardFromToken _self; + final $Res Function(PaymentMethodDataCardFromToken) _then; + +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? token = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataCardFromToken]. +extension PaymentMethodDataCardFromTokenPatterns on PaymentMethodDataCardFromToken { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataCardFromToken value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataCardFromToken value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataCardFromToken value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that.token,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken(): +return $default(_that.token,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that.token,_that.billingDetails,_that.shippingDetails);case _: + return null; - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataImplCopyWith<_$PaymentMethodDataImpl> get copyWith => - throw _privateConstructorUsedError; +} } -PaymentMethodDataCardFromToken _$PaymentMethodDataCardFromTokenFromJson( - Map json) { - return _PaymentMethodDataCardFromToken.fromJson(json); } /// @nodoc -mixin _$PaymentMethodDataCardFromToken { - /// Token. - String get token => throw _privateConstructorUsedError; - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodDataCardFromToken implements PaymentMethodDataCardFromToken { + const _PaymentMethodDataCardFromToken({required this.token, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataCardFromToken.fromJson(Map json) => _$PaymentMethodDataCardFromTokenFromJson(json); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// Token. +@override final String token; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// Serializes this PaymentMethodDataCardFromToken to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataCardFromTokenCopyWith<_PaymentMethodDataCardFromToken> get copyWith => __$PaymentMethodDataCardFromTokenCopyWithImpl<_PaymentMethodDataCardFromToken>(this, _$identity); - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataCardFromTokenCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentMethodDataCardFromTokenToJson(this, ); } -/// @nodoc -abstract class $PaymentMethodDataCardFromTokenCopyWith<$Res> { - factory $PaymentMethodDataCardFromTokenCopyWith( - PaymentMethodDataCardFromToken value, - $Res Function(PaymentMethodDataCardFromToken) then) = - _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res, - PaymentMethodDataCardFromToken>; - @useResult - $Res call( - {String token, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataCardFromToken&&(identical(other.token, token) || other.token == token)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); } -/// @nodoc -class _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res, - $Val extends PaymentMethodDataCardFromToken> - implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { - _$PaymentMethodDataCardFromTokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataCardFromToken(token: $token, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } } /// @nodoc -abstract class _$$PaymentMethodDataCardFromTokenImplCopyWith<$Res> - implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { - factory _$$PaymentMethodDataCardFromTokenImplCopyWith( - _$PaymentMethodDataCardFromTokenImpl value, - $Res Function(_$PaymentMethodDataCardFromTokenImpl) then) = - __$$PaymentMethodDataCardFromTokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String token, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; -} +abstract mixin class _$PaymentMethodDataCardFromTokenCopyWith<$Res> implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { + factory _$PaymentMethodDataCardFromTokenCopyWith(_PaymentMethodDataCardFromToken value, $Res Function(_PaymentMethodDataCardFromToken) _then) = __$PaymentMethodDataCardFromTokenCopyWithImpl; +@override @useResult +$Res call({ + String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); + +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; + +} /// @nodoc -class __$$PaymentMethodDataCardFromTokenImplCopyWithImpl<$Res> - extends _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res, - _$PaymentMethodDataCardFromTokenImpl> - implements _$$PaymentMethodDataCardFromTokenImplCopyWith<$Res> { - __$$PaymentMethodDataCardFromTokenImplCopyWithImpl( - _$PaymentMethodDataCardFromTokenImpl _value, - $Res Function(_$PaymentMethodDataCardFromTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataCardFromTokenImpl( - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); +class __$PaymentMethodDataCardFromTokenCopyWithImpl<$Res> + implements _$PaymentMethodDataCardFromTokenCopyWith<$Res> { + __$PaymentMethodDataCardFromTokenCopyWithImpl(this._self, this._then); + + final _PaymentMethodDataCardFromToken _self; + final $Res Function(_PaymentMethodDataCardFromToken) _then; + +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? token = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataCardFromToken( +token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} + +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} } + /// @nodoc +mixin _$PaymentMethodDataCardFromMethod { -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataCardFromTokenImpl - implements _PaymentMethodDataCardFromToken { - const _$PaymentMethodDataCardFromTokenImpl( - {required this.token, this.billingDetails, this.shippingDetails}); - - factory _$PaymentMethodDataCardFromTokenImpl.fromJson( - Map json) => - _$$PaymentMethodDataCardFromTokenImplFromJson(json); - - /// Token. - @override - final String token; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - @override - String toString() { - return 'PaymentMethodDataCardFromToken(token: $token, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +/// Payment method id. + String get paymentMethodId;/// Cvc of the cart + String? get cvc;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromMethodCopyWith get copyWith => _$PaymentMethodDataCardFromMethodCopyWithImpl(this as PaymentMethodDataCardFromMethod, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataCardFromTokenImpl && - (identical(other.token, token) || other.token == token) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } + /// Serializes this PaymentMethodDataCardFromMethod to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataCardFromMethod&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodId,cvc,billingDetails,shippingDetails); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, token, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataCardFromTokenImplCopyWith< - _$PaymentMethodDataCardFromTokenImpl> - get copyWith => __$$PaymentMethodDataCardFromTokenImplCopyWithImpl< - _$PaymentMethodDataCardFromTokenImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataCardFromTokenImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodDataCardFromMethod(paymentMethodId: $paymentMethodId, cvc: $cvc, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -abstract class _PaymentMethodDataCardFromToken - implements PaymentMethodDataCardFromToken { - const factory _PaymentMethodDataCardFromToken( - {required final String token, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = - _$PaymentMethodDataCardFromTokenImpl; - factory _PaymentMethodDataCardFromToken.fromJson(Map json) = - _$PaymentMethodDataCardFromTokenImpl.fromJson; +} - /// Token. - @override - String get token; +/// @nodoc +abstract mixin class $PaymentMethodDataCardFromMethodCopyWith<$Res> { + factory $PaymentMethodDataCardFromMethodCopyWith(PaymentMethodDataCardFromMethod value, $Res Function(PaymentMethodDataCardFromMethod) _then) = _$PaymentMethodDataCardFromMethodCopyWithImpl; +@useResult +$Res call({ + String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Billing information. - @override - BillingDetails? get billingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataCardFromTokenImplCopyWith< - _$PaymentMethodDataCardFromTokenImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res> + implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { + _$PaymentMethodDataCardFromMethodCopyWithImpl(this._self, this._then); + + final PaymentMethodDataCardFromMethod _self; + final $Res Function(PaymentMethodDataCardFromMethod) _then; + +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethodId = null,Object? cvc = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +paymentMethodId: null == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataCardFromMethod]. +extension PaymentMethodDataCardFromMethodPatterns on PaymentMethodDataCardFromMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataCardFromMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataCardFromMethod value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataCardFromMethod value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that.paymentMethodId,_that.cvc,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod(): +return $default(_that.paymentMethodId,_that.cvc,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that.paymentMethodId,_that.cvc,_that.billingDetails,_that.shippingDetails);case _: + return null; -PaymentMethodDataCardFromMethod _$PaymentMethodDataCardFromMethodFromJson( - Map json) { - return _PaymentMethodDataCardFromMethod.fromJson(json); +} } -/// @nodoc -mixin _$PaymentMethodDataCardFromMethod { - /// Payment method id. - String get paymentMethodId => throw _privateConstructorUsedError; +} - /// Cvc of the cart - String? get cvc => throw _privateConstructorUsedError; +/// @nodoc - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodDataCardFromMethod implements PaymentMethodDataCardFromMethod { + const _PaymentMethodDataCardFromMethod({required this.paymentMethodId, this.cvc, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataCardFromMethod.fromJson(Map json) => _$PaymentMethodDataCardFromMethodFromJson(json); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// Payment method id. +@override final String paymentMethodId; +/// Cvc of the cart +@override final String? cvc; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// Serializes this PaymentMethodDataCardFromMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataCardFromMethodCopyWith<_PaymentMethodDataCardFromMethod> get copyWith => __$PaymentMethodDataCardFromMethodCopyWithImpl<_PaymentMethodDataCardFromMethod>(this, _$identity); - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataCardFromMethodCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentMethodDataCardFromMethodToJson(this, ); } -/// @nodoc -abstract class $PaymentMethodDataCardFromMethodCopyWith<$Res> { - factory $PaymentMethodDataCardFromMethodCopyWith( - PaymentMethodDataCardFromMethod value, - $Res Function(PaymentMethodDataCardFromMethod) then) = - _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res, - PaymentMethodDataCardFromMethod>; - @useResult - $Res call( - {String paymentMethodId, - String? cvc, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataCardFromMethod&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); } -/// @nodoc -class _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res, - $Val extends PaymentMethodDataCardFromMethod> - implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { - _$PaymentMethodDataCardFromMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodId = null, - Object? cvc = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - paymentMethodId: null == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodId,cvc,billingDetails,shippingDetails); - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +@override +String toString() { + return 'PaymentMethodDataCardFromMethod(paymentMethodId: $paymentMethodId, cvc: $cvc, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class _$$PaymentMethodDataCardFromMethodImplCopyWith<$Res> - implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { - factory _$$PaymentMethodDataCardFromMethodImplCopyWith( - _$PaymentMethodDataCardFromMethodImpl value, - $Res Function(_$PaymentMethodDataCardFromMethodImpl) then) = - __$$PaymentMethodDataCardFromMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String paymentMethodId, - String? cvc, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; -} -/// @nodoc -class __$$PaymentMethodDataCardFromMethodImplCopyWithImpl<$Res> - extends _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res, - _$PaymentMethodDataCardFromMethodImpl> - implements _$$PaymentMethodDataCardFromMethodImplCopyWith<$Res> { - __$$PaymentMethodDataCardFromMethodImplCopyWithImpl( - _$PaymentMethodDataCardFromMethodImpl _value, - $Res Function(_$PaymentMethodDataCardFromMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodId = null, - Object? cvc = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataCardFromMethodImpl( - paymentMethodId: null == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc +abstract mixin class _$PaymentMethodDataCardFromMethodCopyWith<$Res> implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { + factory _$PaymentMethodDataCardFromMethodCopyWith(_PaymentMethodDataCardFromMethod value, $Res Function(_PaymentMethodDataCardFromMethod) _then) = __$PaymentMethodDataCardFromMethodCopyWithImpl; +@override @useResult +$Res call({ + String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataCardFromMethodImpl - implements _PaymentMethodDataCardFromMethod { - const _$PaymentMethodDataCardFromMethodImpl( - {required this.paymentMethodId, - this.cvc, - this.billingDetails, - this.shippingDetails}); - - factory _$PaymentMethodDataCardFromMethodImpl.fromJson( - Map json) => - _$$PaymentMethodDataCardFromMethodImplFromJson(json); - - /// Payment method id. - @override - final String paymentMethodId; - - /// Cvc of the cart - @override - final String? cvc; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - @override - String toString() { - return 'PaymentMethodDataCardFromMethod(paymentMethodId: $paymentMethodId, cvc: $cvc, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataCardFromMethodImpl && - (identical(other.paymentMethodId, paymentMethodId) || - other.paymentMethodId == paymentMethodId) && - (identical(other.cvc, cvc) || other.cvc == cvc) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, paymentMethodId, cvc, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataCardFromMethodImplCopyWith< - _$PaymentMethodDataCardFromMethodImpl> - get copyWith => __$$PaymentMethodDataCardFromMethodImplCopyWithImpl< - _$PaymentMethodDataCardFromMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataCardFromMethodImplToJson( - this, - ); - } } +/// @nodoc +class __$PaymentMethodDataCardFromMethodCopyWithImpl<$Res> + implements _$PaymentMethodDataCardFromMethodCopyWith<$Res> { + __$PaymentMethodDataCardFromMethodCopyWithImpl(this._self, this._then); -abstract class _PaymentMethodDataCardFromMethod - implements PaymentMethodDataCardFromMethod { - const factory _PaymentMethodDataCardFromMethod( - {required final String paymentMethodId, - final String? cvc, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = - _$PaymentMethodDataCardFromMethodImpl; - - factory _PaymentMethodDataCardFromMethod.fromJson(Map json) = - _$PaymentMethodDataCardFromMethodImpl.fromJson; - - /// Payment method id. - @override - String get paymentMethodId; + final _PaymentMethodDataCardFromMethod _self; + final $Res Function(_PaymentMethodDataCardFromMethod) _then; - /// Cvc of the cart - @override - String? get cvc; +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethodId = null,Object? cvc = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataCardFromMethod( +paymentMethodId: null == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} - /// Billing information. - @override - BillingDetails? get billingDetails; +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } - /// Shipping details - @override - ShippingDetails? get shippingDetails; + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataCardFromMethodImplCopyWith< - _$PaymentMethodDataCardFromMethodImpl> - get copyWith => throw _privateConstructorUsedError; + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); } - -PaymentMethodDataIdeal _$PaymentMethodDataIdealFromJson( - Map json) { - return _PaymentMethodDataIdeal.fromJson(json); } + /// @nodoc mixin _$PaymentMethodDataIdeal { - /// The name of bank. - String? get bankName => throw _privateConstructorUsedError; - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// The name of bank. + String? get bankName;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataIdealCopyWith get copyWith => _$PaymentMethodDataIdealCopyWithImpl(this as PaymentMethodDataIdeal, _$identity); /// Serializes this PaymentMethodDataIdeal to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataIdealCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataIdeal&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankName,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataIdeal(bankName: $bankName, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataIdealCopyWith<$Res> { - factory $PaymentMethodDataIdealCopyWith(PaymentMethodDataIdeal value, - $Res Function(PaymentMethodDataIdeal) then) = - _$PaymentMethodDataIdealCopyWithImpl<$Res, PaymentMethodDataIdeal>; - @useResult - $Res call( - {String? bankName, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataIdealCopyWithImpl<$Res, - $Val extends PaymentMethodDataIdeal> - implements $PaymentMethodDataIdealCopyWith<$Res> { - _$PaymentMethodDataIdealCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankName = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataIdealCopyWith<$Res> { + factory $PaymentMethodDataIdealCopyWith(PaymentMethodDataIdeal value, $Res Function(PaymentMethodDataIdeal) _then) = _$PaymentMethodDataIdealCopyWithImpl; +@useResult +$Res call({ + String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataIdealImplCopyWith<$Res> +class _$PaymentMethodDataIdealCopyWithImpl<$Res> implements $PaymentMethodDataIdealCopyWith<$Res> { - factory _$$PaymentMethodDataIdealImplCopyWith( - _$PaymentMethodDataIdealImpl value, - $Res Function(_$PaymentMethodDataIdealImpl) then) = - __$$PaymentMethodDataIdealImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? bankName, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + _$PaymentMethodDataIdealCopyWithImpl(this._self, this._then); + + final PaymentMethodDataIdeal _self; + final $Res Function(PaymentMethodDataIdeal) _then; + +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bankName = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataIdeal]. +extension PaymentMethodDataIdealPatterns on PaymentMethodDataIdeal { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataIdeal value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataIdeal value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataIdeal value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that.bankName,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal(): +return $default(_that.bankName,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that.bankName,_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodDataIdealImplCopyWithImpl<$Res> - extends _$PaymentMethodDataIdealCopyWithImpl<$Res, - _$PaymentMethodDataIdealImpl> - implements _$$PaymentMethodDataIdealImplCopyWith<$Res> { - __$$PaymentMethodDataIdealImplCopyWithImpl( - _$PaymentMethodDataIdealImpl _value, - $Res Function(_$PaymentMethodDataIdealImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankName = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataIdealImpl( - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataIdealImpl implements _PaymentMethodDataIdeal { - const _$PaymentMethodDataIdealImpl( - {this.bankName, this.billingDetails, this.shippingDetails}); +class _PaymentMethodDataIdeal implements PaymentMethodDataIdeal { + const _PaymentMethodDataIdeal({this.bankName, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataIdeal.fromJson(Map json) => _$PaymentMethodDataIdealFromJson(json); - factory _$PaymentMethodDataIdealImpl.fromJson(Map json) => - _$$PaymentMethodDataIdealImplFromJson(json); +/// The name of bank. +@override final String? bankName; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// The name of bank. - @override - final String? bankName; +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataIdealCopyWith<_PaymentMethodDataIdeal> get copyWith => __$PaymentMethodDataIdealCopyWithImpl<_PaymentMethodDataIdeal>(this, _$identity); - /// Billing information. - @override - final BillingDetails? billingDetails; +@override +Map toJson() { + return _$PaymentMethodDataIdealToJson(this, ); +} - /// Shipping details - @override - final ShippingDetails? shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataIdeal&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - String toString() { - return 'PaymentMethodDataIdeal(bankName: $bankName, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankName,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataIdeal(bankName: $bankName, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataIdealImpl && - (identical(other.bankName, bankName) || - other.bankName == bankName) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, bankName, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataIdealImplCopyWith<_$PaymentMethodDataIdealImpl> - get copyWith => __$$PaymentMethodDataIdealImplCopyWithImpl< - _$PaymentMethodDataIdealImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataIdealImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataIdeal implements PaymentMethodDataIdeal { - const factory _PaymentMethodDataIdeal( - {final String? bankName, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataIdealImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataIdealCopyWith<$Res> implements $PaymentMethodDataIdealCopyWith<$Res> { + factory _$PaymentMethodDataIdealCopyWith(_PaymentMethodDataIdeal value, $Res Function(_PaymentMethodDataIdeal) _then) = __$PaymentMethodDataIdealCopyWithImpl; +@override @useResult +$Res call({ + String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodDataIdeal.fromJson(Map json) = - _$PaymentMethodDataIdealImpl.fromJson; - /// The name of bank. - @override - String? get bankName; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Billing information. - @override - BillingDetails? get billingDetails; +} +/// @nodoc +class __$PaymentMethodDataIdealCopyWithImpl<$Res> + implements _$PaymentMethodDataIdealCopyWith<$Res> { + __$PaymentMethodDataIdealCopyWithImpl(this._self, this._then); - /// Shipping details - @override - ShippingDetails? get shippingDetails; + final _PaymentMethodDataIdeal _self; + final $Res Function(_PaymentMethodDataIdeal) _then; - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataIdealImplCopyWith<_$PaymentMethodDataIdealImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bankName = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataIdeal( +bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -PaymentMethodDataAubecs _$PaymentMethodDataAubecsFromJson( - Map json) { - return _PaymentMethodDataAubecs.fromJson(json); +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); } +} + /// @nodoc mixin _$PaymentMethodDataAubecs { - /// form input details - dynamic get formDetails => throw _privateConstructorUsedError; - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// form input details + dynamic get formDetails;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataAubecsCopyWith get copyWith => _$PaymentMethodDataAubecsCopyWithImpl(this as PaymentMethodDataAubecs, _$identity); /// Serializes this PaymentMethodDataAubecs to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataAubecsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataAubecs&&const DeepCollectionEquality().equals(other.formDetails, formDetails)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(formDetails),billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataAubecs(formDetails: $formDetails, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataAubecsCopyWith<$Res> { - factory $PaymentMethodDataAubecsCopyWith(PaymentMethodDataAubecs value, - $Res Function(PaymentMethodDataAubecs) then) = - _$PaymentMethodDataAubecsCopyWithImpl<$Res, PaymentMethodDataAubecs>; - @useResult - $Res call( - {dynamic formDetails, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataAubecsCopyWithImpl<$Res, - $Val extends PaymentMethodDataAubecs> - implements $PaymentMethodDataAubecsCopyWith<$Res> { - _$PaymentMethodDataAubecsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? formDetails = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - formDetails: freezed == formDetails - ? _value.formDetails - : formDetails // ignore: cast_nullable_to_non_nullable - as dynamic, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataAubecsCopyWith<$Res> { + factory $PaymentMethodDataAubecsCopyWith(PaymentMethodDataAubecs value, $Res Function(PaymentMethodDataAubecs) _then) = _$PaymentMethodDataAubecsCopyWithImpl; +@useResult +$Res call({ + dynamic formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataAubecsImplCopyWith<$Res> +class _$PaymentMethodDataAubecsCopyWithImpl<$Res> implements $PaymentMethodDataAubecsCopyWith<$Res> { - factory _$$PaymentMethodDataAubecsImplCopyWith( - _$PaymentMethodDataAubecsImpl value, - $Res Function(_$PaymentMethodDataAubecsImpl) then) = - __$$PaymentMethodDataAubecsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {dynamic formDetails, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + _$PaymentMethodDataAubecsCopyWithImpl(this._self, this._then); + + final PaymentMethodDataAubecs _self; + final $Res Function(PaymentMethodDataAubecs) _then; + +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? formDetails = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +formDetails: freezed == formDetails ? _self.formDetails : formDetails // ignore: cast_nullable_to_non_nullable +as dynamic,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataAubecs]. +extension PaymentMethodDataAubecsPatterns on PaymentMethodDataAubecs { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataAubecs value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataAubecs value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataAubecs value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( dynamic formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that.formDetails,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( dynamic formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs(): +return $default(_that.formDetails,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( dynamic formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that.formDetails,_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodDataAubecsImplCopyWithImpl<$Res> - extends _$PaymentMethodDataAubecsCopyWithImpl<$Res, - _$PaymentMethodDataAubecsImpl> - implements _$$PaymentMethodDataAubecsImplCopyWith<$Res> { - __$$PaymentMethodDataAubecsImplCopyWithImpl( - _$PaymentMethodDataAubecsImpl _value, - $Res Function(_$PaymentMethodDataAubecsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? formDetails = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataAubecsImpl( - formDetails: freezed == formDetails - ? _value.formDetails - : formDetails // ignore: cast_nullable_to_non_nullable - as dynamic, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataAubecsImpl implements _PaymentMethodDataAubecs { - const _$PaymentMethodDataAubecsImpl( - {required this.formDetails, this.billingDetails, this.shippingDetails}); +class _PaymentMethodDataAubecs implements PaymentMethodDataAubecs { + const _PaymentMethodDataAubecs({required this.formDetails, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataAubecs.fromJson(Map json) => _$PaymentMethodDataAubecsFromJson(json); - factory _$PaymentMethodDataAubecsImpl.fromJson(Map json) => - _$$PaymentMethodDataAubecsImplFromJson(json); +/// form input details +@override final dynamic formDetails; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// form input details - @override - final dynamic formDetails; +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataAubecsCopyWith<_PaymentMethodDataAubecs> get copyWith => __$PaymentMethodDataAubecsCopyWithImpl<_PaymentMethodDataAubecs>(this, _$identity); - /// Billing information. - @override - final BillingDetails? billingDetails; +@override +Map toJson() { + return _$PaymentMethodDataAubecsToJson(this, ); +} - /// Shipping details - @override - final ShippingDetails? shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataAubecs&&const DeepCollectionEquality().equals(other.formDetails, formDetails)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - String toString() { - return 'PaymentMethodDataAubecs(formDetails: $formDetails, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(formDetails),billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataAubecs(formDetails: $formDetails, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataAubecsImpl && - const DeepCollectionEquality() - .equals(other.formDetails, formDetails) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(formDetails), - billingDetails, - shippingDetails); - - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataAubecsImplCopyWith<_$PaymentMethodDataAubecsImpl> - get copyWith => __$$PaymentMethodDataAubecsImplCopyWithImpl< - _$PaymentMethodDataAubecsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataAubecsImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataAubecs implements PaymentMethodDataAubecs { - const factory _PaymentMethodDataAubecs( - {required final dynamic formDetails, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataAubecsImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataAubecsCopyWith<$Res> implements $PaymentMethodDataAubecsCopyWith<$Res> { + factory _$PaymentMethodDataAubecsCopyWith(_PaymentMethodDataAubecs value, $Res Function(_PaymentMethodDataAubecs) _then) = __$PaymentMethodDataAubecsCopyWithImpl; +@override @useResult +$Res call({ + dynamic formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodDataAubecs.fromJson(Map json) = - _$PaymentMethodDataAubecsImpl.fromJson; - /// form input details - @override - dynamic get formDetails; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Billing information. - @override - BillingDetails? get billingDetails; +} +/// @nodoc +class __$PaymentMethodDataAubecsCopyWithImpl<$Res> + implements _$PaymentMethodDataAubecsCopyWith<$Res> { + __$PaymentMethodDataAubecsCopyWithImpl(this._self, this._then); - /// Shipping details - @override - ShippingDetails? get shippingDetails; + final _PaymentMethodDataAubecs _self; + final $Res Function(_PaymentMethodDataAubecs) _then; - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataAubecsImplCopyWith<_$PaymentMethodDataAubecsImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? formDetails = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataAubecs( +formDetails: freezed == formDetails ? _self.formDetails : formDetails // ignore: cast_nullable_to_non_nullable +as dynamic,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -PaymentMethodDataFpx _$PaymentMethodDataFpxFromJson(Map json) { - return _PaymentMethodDataFpx.fromJson(json); +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); } +} + /// @nodoc mixin _$PaymentMethodDataFpx { - /// When set to true you can test offline payment. - bool get testOfflineBank => throw _privateConstructorUsedError; - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// When set to true you can test offline payment. + bool get testOfflineBank;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataFpxCopyWith get copyWith => _$PaymentMethodDataFpxCopyWithImpl(this as PaymentMethodDataFpx, _$identity); /// Serializes this PaymentMethodDataFpx to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataFpxCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataFpx&&(identical(other.testOfflineBank, testOfflineBank) || other.testOfflineBank == testOfflineBank)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testOfflineBank,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataFpx(testOfflineBank: $testOfflineBank, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataFpxCopyWith<$Res> { - factory $PaymentMethodDataFpxCopyWith(PaymentMethodDataFpx value, - $Res Function(PaymentMethodDataFpx) then) = - _$PaymentMethodDataFpxCopyWithImpl<$Res, PaymentMethodDataFpx>; - @useResult - $Res call( - {bool testOfflineBank, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataFpxCopyWithImpl<$Res, - $Val extends PaymentMethodDataFpx> - implements $PaymentMethodDataFpxCopyWith<$Res> { - _$PaymentMethodDataFpxCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testOfflineBank = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - testOfflineBank: null == testOfflineBank - ? _value.testOfflineBank - : testOfflineBank // ignore: cast_nullable_to_non_nullable - as bool, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataFpxCopyWith<$Res> { + factory $PaymentMethodDataFpxCopyWith(PaymentMethodDataFpx value, $Res Function(PaymentMethodDataFpx) _then) = _$PaymentMethodDataFpxCopyWithImpl; +@useResult +$Res call({ + bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataFpxImplCopyWith<$Res> +class _$PaymentMethodDataFpxCopyWithImpl<$Res> implements $PaymentMethodDataFpxCopyWith<$Res> { - factory _$$PaymentMethodDataFpxImplCopyWith(_$PaymentMethodDataFpxImpl value, - $Res Function(_$PaymentMethodDataFpxImpl) then) = - __$$PaymentMethodDataFpxImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool testOfflineBank, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + _$PaymentMethodDataFpxCopyWithImpl(this._self, this._then); + + final PaymentMethodDataFpx _self; + final $Res Function(PaymentMethodDataFpx) _then; + +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? testOfflineBank = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +testOfflineBank: null == testOfflineBank ? _self.testOfflineBank : testOfflineBank // ignore: cast_nullable_to_non_nullable +as bool,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataFpx]. +extension PaymentMethodDataFpxPatterns on PaymentMethodDataFpx { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataFpx value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataFpx value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataFpx(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataFpx value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that.testOfflineBank,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataFpx(): +return $default(_that.testOfflineBank,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that.testOfflineBank,_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodDataFpxImplCopyWithImpl<$Res> - extends _$PaymentMethodDataFpxCopyWithImpl<$Res, _$PaymentMethodDataFpxImpl> - implements _$$PaymentMethodDataFpxImplCopyWith<$Res> { - __$$PaymentMethodDataFpxImplCopyWithImpl(_$PaymentMethodDataFpxImpl _value, - $Res Function(_$PaymentMethodDataFpxImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testOfflineBank = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataFpxImpl( - testOfflineBank: null == testOfflineBank - ? _value.testOfflineBank - : testOfflineBank // ignore: cast_nullable_to_non_nullable - as bool, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataFpxImpl implements _PaymentMethodDataFpx { - const _$PaymentMethodDataFpxImpl( - {this.testOfflineBank = false, - this.billingDetails, - this.shippingDetails}); - - factory _$PaymentMethodDataFpxImpl.fromJson(Map json) => - _$$PaymentMethodDataFpxImplFromJson(json); - - /// When set to true you can test offline payment. - @override - @JsonKey() - final bool testOfflineBank; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - @override - String toString() { - return 'PaymentMethodDataFpx(testOfflineBank: $testOfflineBank, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +class _PaymentMethodDataFpx implements PaymentMethodDataFpx { + const _PaymentMethodDataFpx({this.testOfflineBank = false, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataFpx.fromJson(Map json) => _$PaymentMethodDataFpxFromJson(json); + +/// When set to true you can test offline payment. +@override@JsonKey() final bool testOfflineBank; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; + +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataFpxCopyWith<_PaymentMethodDataFpx> get copyWith => __$PaymentMethodDataFpxCopyWithImpl<_PaymentMethodDataFpx>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodDataFpxToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataFpx&&(identical(other.testOfflineBank, testOfflineBank) || other.testOfflineBank == testOfflineBank)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testOfflineBank,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataFpx(testOfflineBank: $testOfflineBank, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataFpxImpl && - (identical(other.testOfflineBank, testOfflineBank) || - other.testOfflineBank == testOfflineBank) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, testOfflineBank, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataFpxImplCopyWith<_$PaymentMethodDataFpxImpl> - get copyWith => - __$$PaymentMethodDataFpxImplCopyWithImpl<_$PaymentMethodDataFpxImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataFpxImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataFpx implements PaymentMethodDataFpx { - const factory _PaymentMethodDataFpx( - {final bool testOfflineBank, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataFpxImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataFpxCopyWith<$Res> implements $PaymentMethodDataFpxCopyWith<$Res> { + factory _$PaymentMethodDataFpxCopyWith(_PaymentMethodDataFpx value, $Res Function(_PaymentMethodDataFpx) _then) = __$PaymentMethodDataFpxCopyWithImpl; +@override @useResult +$Res call({ + bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodDataFpx.fromJson(Map json) = - _$PaymentMethodDataFpxImpl.fromJson; - /// When set to true you can test offline payment. - @override - bool get testOfflineBank; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Billing information. - @override - BillingDetails? get billingDetails; +} +/// @nodoc +class __$PaymentMethodDataFpxCopyWithImpl<$Res> + implements _$PaymentMethodDataFpxCopyWith<$Res> { + __$PaymentMethodDataFpxCopyWithImpl(this._self, this._then); - /// Shipping details - @override - ShippingDetails? get shippingDetails; + final _PaymentMethodDataFpx _self; + final $Res Function(_PaymentMethodDataFpx) _then; - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataFpxImplCopyWith<_$PaymentMethodDataFpxImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? testOfflineBank = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataFpx( +testOfflineBank: null == testOfflineBank ? _self.testOfflineBank : testOfflineBank // ignore: cast_nullable_to_non_nullable +as bool,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -PaymentMethodDataSofort _$PaymentMethodDataSofortFromJson( - Map json) { - return _PaymentMethodDataSofort.fromJson(json); +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} } + /// @nodoc mixin _$PaymentMethodDataSofort { - /// Country of the accountholder - String get country => throw _privateConstructorUsedError; - - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// Country of the accountholder + String get country;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataSofortCopyWith get copyWith => _$PaymentMethodDataSofortCopyWithImpl(this as PaymentMethodDataSofort, _$identity); /// Serializes this PaymentMethodDataSofort to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataSofortCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataSofort&&(identical(other.country, country) || other.country == country)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataSofort(country: $country, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataSofortCopyWith<$Res> { - factory $PaymentMethodDataSofortCopyWith(PaymentMethodDataSofort value, - $Res Function(PaymentMethodDataSofort) then) = - _$PaymentMethodDataSofortCopyWithImpl<$Res, PaymentMethodDataSofort>; - @useResult - $Res call( - {String country, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataSofortCopyWithImpl<$Res, - $Val extends PaymentMethodDataSofort> - implements $PaymentMethodDataSofortCopyWith<$Res> { - _$PaymentMethodDataSofortCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataSofortCopyWith<$Res> { + factory $PaymentMethodDataSofortCopyWith(PaymentMethodDataSofort value, $Res Function(PaymentMethodDataSofort) _then) = _$PaymentMethodDataSofortCopyWithImpl; +@useResult +$Res call({ + String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataSofortImplCopyWith<$Res> +class _$PaymentMethodDataSofortCopyWithImpl<$Res> implements $PaymentMethodDataSofortCopyWith<$Res> { - factory _$$PaymentMethodDataSofortImplCopyWith( - _$PaymentMethodDataSofortImpl value, - $Res Function(_$PaymentMethodDataSofortImpl) then) = - __$$PaymentMethodDataSofortImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String country, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + _$PaymentMethodDataSofortCopyWithImpl(this._self, this._then); + + final PaymentMethodDataSofort _self; + final $Res Function(PaymentMethodDataSofort) _then; + +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? country = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataSofort]. +extension PaymentMethodDataSofortPatterns on PaymentMethodDataSofort { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataSofort value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataSofort value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSofort(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataSofort value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that.country,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSofort(): +return $default(_that.country,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that.country,_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodDataSofortImplCopyWithImpl<$Res> - extends _$PaymentMethodDataSofortCopyWithImpl<$Res, - _$PaymentMethodDataSofortImpl> - implements _$$PaymentMethodDataSofortImplCopyWith<$Res> { - __$$PaymentMethodDataSofortImplCopyWithImpl( - _$PaymentMethodDataSofortImpl _value, - $Res Function(_$PaymentMethodDataSofortImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataSofortImpl( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataSofortImpl implements _PaymentMethodDataSofort { - const _$PaymentMethodDataSofortImpl( - {required this.country, this.billingDetails, this.shippingDetails}); +class _PaymentMethodDataSofort implements PaymentMethodDataSofort { + const _PaymentMethodDataSofort({required this.country, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataSofort.fromJson(Map json) => _$PaymentMethodDataSofortFromJson(json); - factory _$PaymentMethodDataSofortImpl.fromJson(Map json) => - _$$PaymentMethodDataSofortImplFromJson(json); +/// Country of the accountholder +@override final String country; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// Country of the accountholder - @override - final String country; +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataSofortCopyWith<_PaymentMethodDataSofort> get copyWith => __$PaymentMethodDataSofortCopyWithImpl<_PaymentMethodDataSofort>(this, _$identity); - /// Billing information. - @override - final BillingDetails? billingDetails; +@override +Map toJson() { + return _$PaymentMethodDataSofortToJson(this, ); +} - /// Shipping details - @override - final ShippingDetails? shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataSofort&&(identical(other.country, country) || other.country == country)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - String toString() { - return 'PaymentMethodDataSofort(country: $country, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataSofort(country: $country, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataSofortImpl && - (identical(other.country, country) || other.country == country) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, country, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataSofortImplCopyWith<_$PaymentMethodDataSofortImpl> - get copyWith => __$$PaymentMethodDataSofortImplCopyWithImpl< - _$PaymentMethodDataSofortImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataSofortImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataSofort implements PaymentMethodDataSofort { - const factory _PaymentMethodDataSofort( - {required final String country, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataSofortImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataSofortCopyWith<$Res> implements $PaymentMethodDataSofortCopyWith<$Res> { + factory _$PaymentMethodDataSofortCopyWith(_PaymentMethodDataSofort value, $Res Function(_PaymentMethodDataSofort) _then) = __$PaymentMethodDataSofortCopyWithImpl; +@override @useResult +$Res call({ + String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodDataSofort.fromJson(Map json) = - _$PaymentMethodDataSofortImpl.fromJson; - /// Country of the accountholder - @override - String get country; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Billing information. - @override - BillingDetails? get billingDetails; +} +/// @nodoc +class __$PaymentMethodDataSofortCopyWithImpl<$Res> + implements _$PaymentMethodDataSofortCopyWith<$Res> { + __$PaymentMethodDataSofortCopyWithImpl(this._self, this._then); - /// Shipping details - @override - ShippingDetails? get shippingDetails; + final _PaymentMethodDataSofort _self; + final $Res Function(_PaymentMethodDataSofort) _then; - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataSofortImplCopyWith<_$PaymentMethodDataSofortImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? country = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataSofort( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -PaymentMethodDataSepa _$PaymentMethodDataSepaFromJson( - Map json) { - return _PaymentMethodDataSepa.fromJson(json); +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} } + /// @nodoc mixin _$PaymentMethodDataSepa { - /// Iban number of the accountholder - String get iban => throw _privateConstructorUsedError; - - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// Iban number of the accountholder + String get iban;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataSepaCopyWith get copyWith => _$PaymentMethodDataSepaCopyWithImpl(this as PaymentMethodDataSepa, _$identity); /// Serializes this PaymentMethodDataSepa to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataSepaCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataSepa&&(identical(other.iban, iban) || other.iban == iban)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,iban,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataSepa(iban: $iban, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataSepaCopyWith<$Res> { - factory $PaymentMethodDataSepaCopyWith(PaymentMethodDataSepa value, - $Res Function(PaymentMethodDataSepa) then) = - _$PaymentMethodDataSepaCopyWithImpl<$Res, PaymentMethodDataSepa>; - @useResult - $Res call( - {String iban, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataSepaCopyWithImpl<$Res, - $Val extends PaymentMethodDataSepa> - implements $PaymentMethodDataSepaCopyWith<$Res> { - _$PaymentMethodDataSepaCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? iban = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - iban: null == iban - ? _value.iban - : iban // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataSepaCopyWith<$Res> { + factory $PaymentMethodDataSepaCopyWith(PaymentMethodDataSepa value, $Res Function(PaymentMethodDataSepa) _then) = _$PaymentMethodDataSepaCopyWithImpl; +@useResult +$Res call({ + String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataSepaImplCopyWith<$Res> +class _$PaymentMethodDataSepaCopyWithImpl<$Res> implements $PaymentMethodDataSepaCopyWith<$Res> { - factory _$$PaymentMethodDataSepaImplCopyWith( - _$PaymentMethodDataSepaImpl value, - $Res Function(_$PaymentMethodDataSepaImpl) then) = - __$$PaymentMethodDataSepaImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String iban, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + _$PaymentMethodDataSepaCopyWithImpl(this._self, this._then); + + final PaymentMethodDataSepa _self; + final $Res Function(PaymentMethodDataSepa) _then; + +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? iban = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +iban: null == iban ? _self.iban : iban // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataSepa]. +extension PaymentMethodDataSepaPatterns on PaymentMethodDataSepa { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataSepa value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataSepa value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSepa(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataSepa value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that.iban,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSepa(): +return $default(_that.iban,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that.iban,_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodDataSepaImplCopyWithImpl<$Res> - extends _$PaymentMethodDataSepaCopyWithImpl<$Res, - _$PaymentMethodDataSepaImpl> - implements _$$PaymentMethodDataSepaImplCopyWith<$Res> { - __$$PaymentMethodDataSepaImplCopyWithImpl(_$PaymentMethodDataSepaImpl _value, - $Res Function(_$PaymentMethodDataSepaImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? iban = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataSepaImpl( - iban: null == iban - ? _value.iban - : iban // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataSepaImpl implements _PaymentMethodDataSepa { - const _$PaymentMethodDataSepaImpl( - {required this.iban, this.billingDetails, this.shippingDetails}); +class _PaymentMethodDataSepa implements PaymentMethodDataSepa { + const _PaymentMethodDataSepa({required this.iban, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataSepa.fromJson(Map json) => _$PaymentMethodDataSepaFromJson(json); - factory _$PaymentMethodDataSepaImpl.fromJson(Map json) => - _$$PaymentMethodDataSepaImplFromJson(json); +/// Iban number of the accountholder +@override final String iban; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - /// Iban number of the accountholder - @override - final String iban; +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataSepaCopyWith<_PaymentMethodDataSepa> get copyWith => __$PaymentMethodDataSepaCopyWithImpl<_PaymentMethodDataSepa>(this, _$identity); - /// Billing information. - @override - final BillingDetails? billingDetails; +@override +Map toJson() { + return _$PaymentMethodDataSepaToJson(this, ); +} - /// Shipping details - @override - final ShippingDetails? shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataSepa&&(identical(other.iban, iban) || other.iban == iban)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - String toString() { - return 'PaymentMethodDataSepa(iban: $iban, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,iban,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataSepa(iban: $iban, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataSepaImpl && - (identical(other.iban, iban) || other.iban == iban) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, iban, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataSepaImplCopyWith<_$PaymentMethodDataSepaImpl> - get copyWith => __$$PaymentMethodDataSepaImplCopyWithImpl< - _$PaymentMethodDataSepaImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataSepaImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataSepa implements PaymentMethodDataSepa { - const factory _PaymentMethodDataSepa( - {required final String iban, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataSepaImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataSepaCopyWith<$Res> implements $PaymentMethodDataSepaCopyWith<$Res> { + factory _$PaymentMethodDataSepaCopyWith(_PaymentMethodDataSepa value, $Res Function(_PaymentMethodDataSepa) _then) = __$PaymentMethodDataSepaCopyWithImpl; +@override @useResult +$Res call({ + String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - factory _PaymentMethodDataSepa.fromJson(Map json) = - _$PaymentMethodDataSepaImpl.fromJson; - /// Iban number of the accountholder - @override - String get iban; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Billing information. - @override - BillingDetails? get billingDetails; +} +/// @nodoc +class __$PaymentMethodDataSepaCopyWithImpl<$Res> + implements _$PaymentMethodDataSepaCopyWith<$Res> { + __$PaymentMethodDataSepaCopyWithImpl(this._self, this._then); - /// Shipping details - @override - ShippingDetails? get shippingDetails; + final _PaymentMethodDataSepa _self; + final $Res Function(_PaymentMethodDataSepa) _then; - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataSepaImplCopyWith<_$PaymentMethodDataSepaImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? iban = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataSepa( +iban: null == iban ? _self.iban : iban // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -PaymentMethodDataAfterPay _$PaymentMethodDataAfterPayFromJson( - Map json) { - return _PaymentMethodDataAfterPay.fromJson(json); +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} } + /// @nodoc mixin _$PaymentMethodDataAfterPay { - /// Billing information. - BillingDetails get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// Billing information. + BillingDetails get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataAfterPayCopyWith get copyWith => _$PaymentMethodDataAfterPayCopyWithImpl(this as PaymentMethodDataAfterPay, _$identity); /// Serializes this PaymentMethodDataAfterPay to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataAfterPayCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataAfterPay&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataAfterPay(billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataAfterPayCopyWith<$Res> { - factory $PaymentMethodDataAfterPayCopyWith(PaymentMethodDataAfterPay value, - $Res Function(PaymentMethodDataAfterPay) then) = - _$PaymentMethodDataAfterPayCopyWithImpl<$Res, PaymentMethodDataAfterPay>; - @useResult - $Res call({BillingDetails billingDetails, ShippingDetails? shippingDetails}); - $BillingDetailsCopyWith<$Res> get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; } /// @nodoc -class _$PaymentMethodDataAfterPayCopyWithImpl<$Res, - $Val extends PaymentMethodDataAfterPay> - implements $PaymentMethodDataAfterPayCopyWith<$Res> { - _$PaymentMethodDataAfterPayCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataAfterPayCopyWith<$Res> { + factory $PaymentMethodDataAfterPayCopyWith(PaymentMethodDataAfterPay value, $Res Function(PaymentMethodDataAfterPay) _then) = _$PaymentMethodDataAfterPayCopyWithImpl; +@useResult +$Res call({ + BillingDetails billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res> get billingDetails { - return $BillingDetailsCopyWith<$Res>(_value.billingDetails, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res> get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataAfterPayImplCopyWith<$Res> +class _$PaymentMethodDataAfterPayCopyWithImpl<$Res> implements $PaymentMethodDataAfterPayCopyWith<$Res> { - factory _$$PaymentMethodDataAfterPayImplCopyWith( - _$PaymentMethodDataAfterPayImpl value, - $Res Function(_$PaymentMethodDataAfterPayImpl) then) = - __$$PaymentMethodDataAfterPayImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({BillingDetails billingDetails, ShippingDetails? shippingDetails}); + _$PaymentMethodDataAfterPayCopyWithImpl(this._self, this._then); + + final PaymentMethodDataAfterPay _self; + final $Res Function(PaymentMethodDataAfterPay) _then; + +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = null,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataAfterPay]. +extension PaymentMethodDataAfterPayPatterns on PaymentMethodDataAfterPay { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataAfterPay value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataAfterPay value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataAfterPay value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BillingDetails billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BillingDetails billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay(): +return $default(_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BillingDetails billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails);case _: + return null; - @override - $BillingDetailsCopyWith<$Res> get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; +} } -/// @nodoc -class __$$PaymentMethodDataAfterPayImplCopyWithImpl<$Res> - extends _$PaymentMethodDataAfterPayCopyWithImpl<$Res, - _$PaymentMethodDataAfterPayImpl> - implements _$$PaymentMethodDataAfterPayImplCopyWith<$Res> { - __$$PaymentMethodDataAfterPayImplCopyWithImpl( - _$PaymentMethodDataAfterPayImpl _value, - $Res Function(_$PaymentMethodDataAfterPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataAfterPayImpl( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataAfterPayImpl implements _PaymentMethodDataAfterPay { - const _$PaymentMethodDataAfterPayImpl( - {required this.billingDetails, this.shippingDetails}); +class _PaymentMethodDataAfterPay implements PaymentMethodDataAfterPay { + const _PaymentMethodDataAfterPay({required this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataAfterPay.fromJson(Map json) => _$PaymentMethodDataAfterPayFromJson(json); + +/// Billing information. +@override final BillingDetails billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - factory _$PaymentMethodDataAfterPayImpl.fromJson(Map json) => - _$$PaymentMethodDataAfterPayImplFromJson(json); +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataAfterPayCopyWith<_PaymentMethodDataAfterPay> get copyWith => __$PaymentMethodDataAfterPayCopyWithImpl<_PaymentMethodDataAfterPay>(this, _$identity); - /// Billing information. - @override - final BillingDetails billingDetails; +@override +Map toJson() { + return _$PaymentMethodDataAfterPayToJson(this, ); +} - /// Shipping details - @override - final ShippingDetails? shippingDetails; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataAfterPay&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - @override - String toString() { - return 'PaymentMethodDataAfterPay(billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails); + +@override +String toString() { + return 'PaymentMethodDataAfterPay(billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataAfterPayImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataAfterPayImplCopyWith<_$PaymentMethodDataAfterPayImpl> - get copyWith => __$$PaymentMethodDataAfterPayImplCopyWithImpl< - _$PaymentMethodDataAfterPayImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataAfterPayImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataAfterPay implements PaymentMethodDataAfterPay { - const factory _PaymentMethodDataAfterPay( - {required final BillingDetails billingDetails, - final ShippingDetails? shippingDetails}) = - _$PaymentMethodDataAfterPayImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataAfterPayCopyWith<$Res> implements $PaymentMethodDataAfterPayCopyWith<$Res> { + factory _$PaymentMethodDataAfterPayCopyWith(_PaymentMethodDataAfterPay value, $Res Function(_PaymentMethodDataAfterPay) _then) = __$PaymentMethodDataAfterPayCopyWithImpl; +@override @useResult +$Res call({ + BillingDetails billingDetails, ShippingDetails? shippingDetails +}); + - factory _PaymentMethodDataAfterPay.fromJson(Map json) = - _$PaymentMethodDataAfterPayImpl.fromJson; +@override $BillingDetailsCopyWith<$Res> get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Billing information. - @override - BillingDetails get billingDetails; +} +/// @nodoc +class __$PaymentMethodDataAfterPayCopyWithImpl<$Res> + implements _$PaymentMethodDataAfterPayCopyWith<$Res> { + __$PaymentMethodDataAfterPayCopyWithImpl(this._self, this._then); - /// Shipping details - @override - ShippingDetails? get shippingDetails; + final _PaymentMethodDataAfterPay _self; + final $Res Function(_PaymentMethodDataAfterPay) _then; - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataAfterPayImplCopyWith<_$PaymentMethodDataAfterPayImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = null,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataAfterPay( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); } -PaymentMethodDataUsBank _$PaymentMethodDataUsBankFromJson( - Map json) { - return _PaymentMethodDataUsBank.fromJson(json); +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} } + /// @nodoc mixin _$PaymentMethodDataUsBank { - /// The account number of the bank account. - String? get accountNumber => throw _privateConstructorUsedError; - - ///The routing number, sort code, or other country-appropriate institution - ///number for the bank account. - String? get routingNumber => throw _privateConstructorUsedError; - /// The bank account type of the holder - UsBankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; +/// The account number of the bank account. + String? get accountNumber;///The routing number, sort code, or other country-appropriate institution +///number for the bank account. + String? get routingNumber;/// The bank account type of the holder + UsBankAccountHolderType? get accountHolderType;/// The account type + UsBankAccountType? get accountType;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataUsBankCopyWith get copyWith => _$PaymentMethodDataUsBankCopyWithImpl(this as PaymentMethodDataUsBank, _$identity); - /// The account type - UsBankAccountType? get accountType => throw _privateConstructorUsedError; + /// Serializes this PaymentMethodDataUsBank to a JSON map. + Map toJson(); - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataUsBank&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - /// Serializes this PaymentMethodDataUsBank to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,accountNumber,routingNumber,accountHolderType,accountType,billingDetails,shippingDetails); - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataUsBankCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataUsBank(accountNumber: $accountNumber, routingNumber: $routingNumber, accountHolderType: $accountHolderType, accountType: $accountType, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; } -/// @nodoc -abstract class $PaymentMethodDataUsBankCopyWith<$Res> { - factory $PaymentMethodDataUsBankCopyWith(PaymentMethodDataUsBank value, - $Res Function(PaymentMethodDataUsBank) then) = - _$PaymentMethodDataUsBankCopyWithImpl<$Res, PaymentMethodDataUsBank>; - @useResult - $Res call( - {String? accountNumber, - String? routingNumber, - UsBankAccountHolderType? accountHolderType, - UsBankAccountType? accountType, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + } /// @nodoc -class _$PaymentMethodDataUsBankCopyWithImpl<$Res, - $Val extends PaymentMethodDataUsBank> - implements $PaymentMethodDataUsBankCopyWith<$Res> { - _$PaymentMethodDataUsBankCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? accountNumber = freezed, - Object? routingNumber = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_value.copyWith( - accountNumber: freezed == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as UsBankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataUsBankCopyWith<$Res> { + factory $PaymentMethodDataUsBankCopyWith(PaymentMethodDataUsBank value, $Res Function(PaymentMethodDataUsBank) _then) = _$PaymentMethodDataUsBankCopyWithImpl; +@useResult +$Res call({ + String? accountNumber, String? routingNumber, UsBankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails; +} /// @nodoc -abstract class _$$PaymentMethodDataUsBankImplCopyWith<$Res> +class _$PaymentMethodDataUsBankCopyWithImpl<$Res> implements $PaymentMethodDataUsBankCopyWith<$Res> { - factory _$$PaymentMethodDataUsBankImplCopyWith( - _$PaymentMethodDataUsBankImpl value, - $Res Function(_$PaymentMethodDataUsBankImpl) then) = - __$$PaymentMethodDataUsBankImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? accountNumber, - String? routingNumber, - UsBankAccountHolderType? accountHolderType, - UsBankAccountType? accountType, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; + _$PaymentMethodDataUsBankCopyWithImpl(this._self, this._then); + + final PaymentMethodDataUsBank _self; + final $Res Function(PaymentMethodDataUsBank) _then; + +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? accountNumber = freezed,Object? routingNumber = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_self.copyWith( +accountNumber: freezed == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as UsBankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataUsBank]. +extension PaymentMethodDataUsBankPatterns on PaymentMethodDataUsBank { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataUsBank value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataUsBank value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataUsBank value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? accountNumber, String? routingNumber, UsBankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that.accountNumber,_that.routingNumber,_that.accountHolderType,_that.accountType,_that.billingDetails,_that.shippingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? accountNumber, String? routingNumber, UsBankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank(): +return $default(_that.accountNumber,_that.routingNumber,_that.accountHolderType,_that.accountType,_that.billingDetails,_that.shippingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? accountNumber, String? routingNumber, UsBankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that.accountNumber,_that.routingNumber,_that.accountHolderType,_that.accountType,_that.billingDetails,_that.shippingDetails);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodDataUsBankImplCopyWithImpl<$Res> - extends _$PaymentMethodDataUsBankCopyWithImpl<$Res, - _$PaymentMethodDataUsBankImpl> - implements _$$PaymentMethodDataUsBankImplCopyWith<$Res> { - __$$PaymentMethodDataUsBankImplCopyWithImpl( - _$PaymentMethodDataUsBankImpl _value, - $Res Function(_$PaymentMethodDataUsBankImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? accountNumber = freezed, - Object? routingNumber = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - }) { - return _then(_$PaymentMethodDataUsBankImpl( - accountNumber: freezed == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as UsBankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataUsBankImpl implements _PaymentMethodDataUsBank { - const _$PaymentMethodDataUsBankImpl( - {this.accountNumber, - this.routingNumber, - this.accountHolderType, - this.accountType, - this.billingDetails, - this.shippingDetails}); - - factory _$PaymentMethodDataUsBankImpl.fromJson(Map json) => - _$$PaymentMethodDataUsBankImplFromJson(json); - - /// The account number of the bank account. - @override - final String? accountNumber; - - ///The routing number, sort code, or other country-appropriate institution - ///number for the bank account. - @override - final String? routingNumber; - - /// The bank account type of the holder - @override - final UsBankAccountHolderType? accountHolderType; - - /// The account type - @override - final UsBankAccountType? accountType; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - @override - String toString() { - return 'PaymentMethodDataUsBank(accountNumber: $accountNumber, routingNumber: $routingNumber, accountHolderType: $accountHolderType, accountType: $accountType, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; - } +class _PaymentMethodDataUsBank implements PaymentMethodDataUsBank { + const _PaymentMethodDataUsBank({this.accountNumber, this.routingNumber, this.accountHolderType, this.accountType, this.billingDetails, this.shippingDetails}); + factory _PaymentMethodDataUsBank.fromJson(Map json) => _$PaymentMethodDataUsBankFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataUsBankImpl && - (identical(other.accountNumber, accountNumber) || - other.accountNumber == accountNumber) && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.accountType, accountType) || - other.accountType == accountType) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails)); - } +/// The account number of the bank account. +@override final String? accountNumber; +///The routing number, sort code, or other country-appropriate institution +///number for the bank account. +@override final String? routingNumber; +/// The bank account type of the holder +@override final UsBankAccountHolderType? accountHolderType; +/// The account type +@override final UsBankAccountType? accountType; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, accountNumber, routingNumber, - accountHolderType, accountType, billingDetails, shippingDetails); - - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataUsBankImplCopyWith<_$PaymentMethodDataUsBankImpl> - get copyWith => __$$PaymentMethodDataUsBankImplCopyWithImpl< - _$PaymentMethodDataUsBankImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataUsBankImplToJson( - this, - ); - } +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataUsBankCopyWith<_PaymentMethodDataUsBank> get copyWith => __$PaymentMethodDataUsBankCopyWithImpl<_PaymentMethodDataUsBank>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodDataUsBankToJson(this, ); } -abstract class _PaymentMethodDataUsBank implements PaymentMethodDataUsBank { - const factory _PaymentMethodDataUsBank( - {final String? accountNumber, - final String? routingNumber, - final UsBankAccountHolderType? accountHolderType, - final UsBankAccountType? accountType, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails}) = _$PaymentMethodDataUsBankImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataUsBank&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)); +} - factory _PaymentMethodDataUsBank.fromJson(Map json) = - _$PaymentMethodDataUsBankImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,accountNumber,routingNumber,accountHolderType,accountType,billingDetails,shippingDetails); - /// The account number of the bank account. - @override - String? get accountNumber; +@override +String toString() { + return 'PaymentMethodDataUsBank(accountNumber: $accountNumber, routingNumber: $routingNumber, accountHolderType: $accountHolderType, accountType: $accountType, billingDetails: $billingDetails, shippingDetails: $shippingDetails)'; +} - ///The routing number, sort code, or other country-appropriate institution - ///number for the bank account. - @override - String? get routingNumber; - /// The bank account type of the holder - @override - UsBankAccountHolderType? get accountHolderType; +} - /// The account type - @override - UsBankAccountType? get accountType; +/// @nodoc +abstract mixin class _$PaymentMethodDataUsBankCopyWith<$Res> implements $PaymentMethodDataUsBankCopyWith<$Res> { + factory _$PaymentMethodDataUsBankCopyWith(_PaymentMethodDataUsBank value, $Res Function(_PaymentMethodDataUsBank) _then) = __$PaymentMethodDataUsBankCopyWithImpl; +@override @useResult +$Res call({ + String? accountNumber, String? routingNumber, UsBankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails +}); - /// Billing information. - @override - BillingDetails? get billingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails; - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataUsBankImplCopyWith<_$PaymentMethodDataUsBankImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$PaymentMethodDataUsBankCopyWithImpl<$Res> + implements _$PaymentMethodDataUsBankCopyWith<$Res> { + __$PaymentMethodDataUsBankCopyWithImpl(this._self, this._then); + + final _PaymentMethodDataUsBank _self; + final $Res Function(_PaymentMethodDataUsBank) _then; + +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? accountNumber = freezed,Object? routingNumber = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,}) { + return _then(_PaymentMethodDataUsBank( +accountNumber: freezed == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as UsBankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?, + )); +} + +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +} +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.g.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.g.dart index d918c2f5e..32488782f 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.g.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_params.g.dart @@ -6,608 +6,535 @@ part of 'payment_method_params.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentMethodParamsCardImpl _$$PaymentMethodParamsCardImplFromJson( - Map json) => - _$PaymentMethodParamsCardImpl( +_PaymentMethodParamsCard _$PaymentMethodParamsCardFromJson(Map json) => + _PaymentMethodParamsCard( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsCardImplToJson( - _$PaymentMethodParamsCardImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsCardWithTokenImpl - _$$PaymentMethodParamsCardWithTokenImplFromJson(Map json) => - _$PaymentMethodParamsCardWithTokenImpl( - paymentMethodData: PaymentMethodDataCardFromToken.fromJson( - Map.from(json['paymentMethodData'] as Map)), - $type: json['paymentMethodType'] as String?, - ); +Map _$PaymentMethodParamsCardToJson( + _PaymentMethodParamsCard instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsCardWithTokenImplToJson( - _$PaymentMethodParamsCardWithTokenImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsCardWithToken _$PaymentMethodParamsCardWithTokenFromJson( + Map json, +) => _PaymentMethodParamsCardWithToken( + paymentMethodData: PaymentMethodDataCardFromToken.fromJson( + Map.from(json['paymentMethodData'] as Map), + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsCardWithTokenToJson( + _PaymentMethodParamsCardWithToken instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsCardWithMethodIdImpl - _$$PaymentMethodParamsCardWithMethodIdImplFromJson(Map json) => - _$PaymentMethodParamsCardWithMethodIdImpl( - paymentMethodData: PaymentMethodDataCardFromMethod.fromJson( - Map.from(json['paymentMethodData'] as Map)), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsCardWithMethodId +_$PaymentMethodParamsCardWithMethodIdFromJson(Map json) => + _PaymentMethodParamsCardWithMethodId( + paymentMethodData: PaymentMethodDataCardFromMethod.fromJson( + Map.from(json['paymentMethodData'] as Map), + ), + $type: json['paymentMethodType'] as String?, + ); -Map _$$PaymentMethodParamsCardWithMethodIdImplToJson( - _$PaymentMethodParamsCardWithMethodIdImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsCardWithMethodIdToJson( + _PaymentMethodParamsCardWithMethodId instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsAlipayImpl _$$PaymentMethodParamsAlipayImplFromJson( - Map json) => - _$PaymentMethodParamsAlipayImpl( +_PaymentMethodParamsAlipay _$PaymentMethodParamsAlipayFromJson(Map json) => + _PaymentMethodParamsAlipay( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsAlipayImplToJson( - _$PaymentMethodParamsAlipayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsAlipayToJson( + _PaymentMethodParamsAlipay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsIdealImpl _$$PaymentMethodParamsIdealImplFromJson( - Map json) => - _$PaymentMethodParamsIdealImpl( +_PaymentMethodParamsIdeal _$PaymentMethodParamsIdealFromJson(Map json) => + _PaymentMethodParamsIdeal( paymentMethodData: PaymentMethodDataIdeal.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsIdealImplToJson( - _$PaymentMethodParamsIdealImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsIdealToJson( + _PaymentMethodParamsIdeal instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsAubecsImpl _$$PaymentMethodParamsAubecsImplFromJson( - Map json) => - _$PaymentMethodParamsAubecsImpl( +_PaymentMethodParamsAubecs _$PaymentMethodParamsAubecsFromJson(Map json) => + _PaymentMethodParamsAubecs( paymentMethodData: PaymentMethodDataAubecs.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsAubecsImplToJson( - _$PaymentMethodParamsAubecsImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsBankContactImpl - _$$PaymentMethodParamsBankContactImplFromJson(Map json) => - _$PaymentMethodParamsBankContactImpl( - paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), - $type: json['paymentMethodType'] as String?, - ); +Map _$PaymentMethodParamsAubecsToJson( + _PaymentMethodParamsAubecs instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsBankContactImplToJson( - _$PaymentMethodParamsBankContactImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsBankContact _$PaymentMethodParamsBankContactFromJson( + Map json, +) => _PaymentMethodParamsBankContact( + paymentMethodData: PaymentMethodData.fromJson( + Map.from(json['paymentMethodData'] as Map), + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsBankContactToJson( + _PaymentMethodParamsBankContact instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsGiroPayImpl _$$PaymentMethodParamsGiroPayImplFromJson( - Map json) => - _$PaymentMethodParamsGiroPayImpl( +_PaymentMethodParamsGiroPay _$PaymentMethodParamsGiroPayFromJson(Map json) => + _PaymentMethodParamsGiroPay( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsGiroPayImplToJson( - _$PaymentMethodParamsGiroPayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsGiroPayToJson( + _PaymentMethodParamsGiroPay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsEpsImpl _$$PaymentMethodParamsEpsImplFromJson(Map json) => - _$PaymentMethodParamsEpsImpl( +_PaymentMethodParamsEps _$PaymentMethodParamsEpsFromJson(Map json) => + _PaymentMethodParamsEps( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsEpsImplToJson( - _$PaymentMethodParamsEpsImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsEpsToJson( + _PaymentMethodParamsEps instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsAffirmImpl _$$PaymentMethodParamsAffirmImplFromJson( - Map json) => - _$PaymentMethodParamsAffirmImpl( +_PaymentMethodParamsAffirm _$PaymentMethodParamsAffirmFromJson(Map json) => + _PaymentMethodParamsAffirm( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsAffirmImplToJson( - _$PaymentMethodParamsAffirmImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsAffirmToJson( + _PaymentMethodParamsAffirm instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsPayImpl _$$PaymentMethodParamsPayImplFromJson(Map json) => - _$PaymentMethodParamsPayImpl( +_PaymentMethodParamsPay _$PaymentMethodParamsPayFromJson(Map json) => + _PaymentMethodParamsPay( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsPayImplToJson( - _$PaymentMethodParamsPayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsPayToJson( + _PaymentMethodParamsPay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsP24Impl _$$PaymentMethodParamsP24ImplFromJson(Map json) => - _$PaymentMethodParamsP24Impl( +_PaymentMethodParamsP24 _$PaymentMethodParamsP24FromJson(Map json) => + _PaymentMethodParamsP24( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsP24ImplToJson( - _$PaymentMethodParamsP24Impl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsP24ToJson( + _PaymentMethodParamsP24 instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsFpxImpl _$$PaymentMethodParamsFpxImplFromJson(Map json) => - _$PaymentMethodParamsFpxImpl( +_PaymentMethodParamsFpx _$PaymentMethodParamsFpxFromJson(Map json) => + _PaymentMethodParamsFpx( paymentMethodData: PaymentMethodDataFpx.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsFpxImplToJson( - _$PaymentMethodParamsFpxImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsSepaDebitImpl _$$PaymentMethodParamsSepaDebitImplFromJson( - Map json) => - _$PaymentMethodParamsSepaDebitImpl( - paymentMethodData: PaymentMethodDataSepa.fromJson( - Map.from(json['paymentMethodData'] as Map)), - $type: json['paymentMethodType'] as String?, - ); +Map _$PaymentMethodParamsFpxToJson( + _PaymentMethodParamsFpx instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsSepaDebitImplToJson( - _$PaymentMethodParamsSepaDebitImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsSepaDebit _$PaymentMethodParamsSepaDebitFromJson( + Map json, +) => _PaymentMethodParamsSepaDebit( + paymentMethodData: PaymentMethodDataSepa.fromJson( + Map.from(json['paymentMethodData'] as Map), + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsSepaDebitToJson( + _PaymentMethodParamsSepaDebit instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsSofortImpl _$$PaymentMethodParamsSofortImplFromJson( - Map json) => - _$PaymentMethodParamsSofortImpl( - paymentMethodData: PaymentMethodDataSofort.fromJson( - Map.from(json['paymentMethodData'] as Map)), +_PaymentMethodParamsAfterpayClearpay +_$PaymentMethodParamsAfterpayClearpayFromJson(Map json) => + _PaymentMethodParamsAfterpayClearpay( + paymentMethodData: PaymentMethodDataAfterPay.fromJson( + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsSofortImplToJson( - _$PaymentMethodParamsSofortImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsAfterpayClearpayImpl - _$$PaymentMethodParamsAfterpayClearpayImplFromJson(Map json) => - _$PaymentMethodParamsAfterpayClearpayImpl( - paymentMethodData: PaymentMethodDataAfterPay.fromJson( - Map.from(json['paymentMethodData'] as Map)), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsAfterpayClearpayImplToJson( - _$PaymentMethodParamsAfterpayClearpayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsAfterpayClearpayToJson( + _PaymentMethodParamsAfterpayClearpay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsOxxoImpl _$$PaymentMethodParamsOxxoImplFromJson( - Map json) => - _$PaymentMethodParamsOxxoImpl( +_PaymentMethodParamsOxxo _$PaymentMethodParamsOxxoFromJson(Map json) => + _PaymentMethodParamsOxxo( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsOxxoImplToJson( - _$PaymentMethodParamsOxxoImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsOxxoToJson( + _PaymentMethodParamsOxxo instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsKlarnaImpl _$$PaymentMethodParamsKlarnaImplFromJson( - Map json) => - _$PaymentMethodParamsKlarnaImpl( +_PaymentMethodParamsKlarna _$PaymentMethodParamsKlarnaFromJson(Map json) => + _PaymentMethodParamsKlarna( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsKlarnaImplToJson( - _$PaymentMethodParamsKlarnaImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsKlarnaToJson( + _PaymentMethodParamsKlarna instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsPayPalImpl _$$PaymentMethodParamsPayPalImplFromJson( - Map json) => - _$PaymentMethodParamsPayPalImpl( +_PaymentMethodParamsPayPal _$PaymentMethodParamsPayPalFromJson(Map json) => + _PaymentMethodParamsPayPal( paymentMethodData: PaymentMethodData.fromJson( - Map.from(json['paymentMethodData'] as Map)), + Map.from(json['paymentMethodData'] as Map), + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsPayPalImplToJson( - _$PaymentMethodParamsPayPalImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsPayPalToJson( + _PaymentMethodParamsPayPal instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsUsBankAccountImpl - _$$PaymentMethodParamsUsBankAccountImplFromJson(Map json) => - _$PaymentMethodParamsUsBankAccountImpl( - paymentMethodData: PaymentMethodDataUsBank.fromJson( - Map.from(json['paymentMethodData'] as Map)), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsUsBankAccount _$PaymentMethodParamsUsBankAccountFromJson( + Map json, +) => _PaymentMethodParamsUsBankAccount( + paymentMethodData: PaymentMethodDataUsBank.fromJson( + Map.from(json['paymentMethodData'] as Map), + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsUsBankAccountToJson( + _PaymentMethodParamsUsBankAccount instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsUsBankAccountImplToJson( - _$PaymentMethodParamsUsBankAccountImpl instance) => +_PaymentMethodData _$PaymentMethodDataFromJson(Map json) => _PaymentMethodData( + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson( + Map.from(json['billingDetails'] as Map), + ), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + Map.from(json['shippingDetails'] as Map), + ), +); + +Map _$PaymentMethodDataToJson(_PaymentMethodData instance) => { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), }; -_$PaymentMethodDataImpl _$$PaymentMethodDataImplFromJson(Map json) => - _$PaymentMethodDataImpl( - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), - ); +_PaymentMethodDataCardFromToken _$PaymentMethodDataCardFromTokenFromJson( + Map json, +) => _PaymentMethodDataCardFromToken( + token: json['token'] as String, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson( + Map.from(json['billingDetails'] as Map), + ), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + Map.from(json['shippingDetails'] as Map), + ), +); + +Map _$PaymentMethodDataCardFromTokenToJson( + _PaymentMethodDataCardFromToken instance, +) => { + 'token': instance.token, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; -Map _$$PaymentMethodDataImplToJson( - _$PaymentMethodDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataCardFromTokenImpl - _$$PaymentMethodDataCardFromTokenImplFromJson(Map json) => - _$PaymentMethodDataCardFromTokenImpl( - token: json['token'] as String, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), - ); - -Map _$$PaymentMethodDataCardFromTokenImplToJson( - _$PaymentMethodDataCardFromTokenImpl instance) { - final val = { - 'token': instance.token, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataCardFromMethodImpl - _$$PaymentMethodDataCardFromMethodImplFromJson(Map json) => - _$PaymentMethodDataCardFromMethodImpl( - paymentMethodId: json['paymentMethodId'] as String, - cvc: json['cvc'] as String?, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), - ); - -Map _$$PaymentMethodDataCardFromMethodImplToJson( - _$PaymentMethodDataCardFromMethodImpl instance) { - final val = { - 'paymentMethodId': instance.paymentMethodId, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('cvc', instance.cvc); - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataIdealImpl _$$PaymentMethodDataIdealImplFromJson(Map json) => - _$PaymentMethodDataIdealImpl( +_PaymentMethodDataCardFromMethod _$PaymentMethodDataCardFromMethodFromJson( + Map json, +) => _PaymentMethodDataCardFromMethod( + paymentMethodId: json['paymentMethodId'] as String, + cvc: json['cvc'] as String?, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson( + Map.from(json['billingDetails'] as Map), + ), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + Map.from(json['shippingDetails'] as Map), + ), +); + +Map _$PaymentMethodDataCardFromMethodToJson( + _PaymentMethodDataCardFromMethod instance, +) => { + 'paymentMethodId': instance.paymentMethodId, + 'cvc': ?instance.cvc, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; + +_PaymentMethodDataIdeal _$PaymentMethodDataIdealFromJson(Map json) => + _PaymentMethodDataIdeal( bankName: json['bankName'] as String?, billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataIdealImplToJson( - _$PaymentMethodDataIdealImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('bankName', instance.bankName); - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataAubecsImpl _$$PaymentMethodDataAubecsImplFromJson( - Map json) => - _$PaymentMethodDataAubecsImpl( +Map _$PaymentMethodDataIdealToJson( + _PaymentMethodDataIdeal instance, +) => { + 'bankName': ?instance.bankName, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; + +_PaymentMethodDataAubecs _$PaymentMethodDataAubecsFromJson(Map json) => + _PaymentMethodDataAubecs( formDetails: json['formDetails'], billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataAubecsImplToJson( - _$PaymentMethodDataAubecsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('formDetails', instance.formDetails); - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} +Map _$PaymentMethodDataAubecsToJson( + _PaymentMethodDataAubecs instance, +) => { + 'formDetails': ?instance.formDetails, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; -_$PaymentMethodDataFpxImpl _$$PaymentMethodDataFpxImplFromJson(Map json) => - _$PaymentMethodDataFpxImpl( +_PaymentMethodDataFpx _$PaymentMethodDataFpxFromJson(Map json) => + _PaymentMethodDataFpx( testOfflineBank: json['testOfflineBank'] as bool? ?? false, billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataFpxImplToJson( - _$PaymentMethodDataFpxImpl instance) { - final val = { - 'testOfflineBank': instance.testOfflineBank, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataSofortImpl _$$PaymentMethodDataSofortImplFromJson( - Map json) => - _$PaymentMethodDataSofortImpl( +Map _$PaymentMethodDataFpxToJson( + _PaymentMethodDataFpx instance, +) => { + 'testOfflineBank': instance.testOfflineBank, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; + +_PaymentMethodDataSofort _$PaymentMethodDataSofortFromJson(Map json) => + _PaymentMethodDataSofort( country: json['country'] as String, billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataSofortImplToJson( - _$PaymentMethodDataSofortImpl instance) { - final val = { - 'country': instance.country, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataSepaImpl _$$PaymentMethodDataSepaImplFromJson(Map json) => - _$PaymentMethodDataSepaImpl( +Map _$PaymentMethodDataSofortToJson( + _PaymentMethodDataSofort instance, +) => { + 'country': instance.country, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; + +_PaymentMethodDataSepa _$PaymentMethodDataSepaFromJson(Map json) => + _PaymentMethodDataSepa( iban: json['iban'] as String, billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataSepaImplToJson( - _$PaymentMethodDataSepaImpl instance) { - final val = { - 'iban': instance.iban, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataAfterPayImpl _$$PaymentMethodDataAfterPayImplFromJson( - Map json) => - _$PaymentMethodDataAfterPayImpl( +Map _$PaymentMethodDataSepaToJson( + _PaymentMethodDataSepa instance, +) => { + 'iban': instance.iban, + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; + +_PaymentMethodDataAfterPay _$PaymentMethodDataAfterPayFromJson(Map json) => + _PaymentMethodDataAfterPay( billingDetails: BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataAfterPayImplToJson( - _$PaymentMethodDataAfterPayImpl instance) { - final val = { - 'billingDetails': instance.billingDetails.toJson(), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} - -_$PaymentMethodDataUsBankImpl _$$PaymentMethodDataUsBankImplFromJson( - Map json) => - _$PaymentMethodDataUsBankImpl( +Map _$PaymentMethodDataAfterPayToJson( + _PaymentMethodDataAfterPay instance, +) => { + 'billingDetails': instance.billingDetails.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; + +_PaymentMethodDataUsBank _$PaymentMethodDataUsBankFromJson(Map json) => + _PaymentMethodDataUsBank( accountNumber: json['accountNumber'] as String?, routingNumber: json['routingNumber'] as String?, accountHolderType: $enumDecodeNullable( - _$UsBankAccountHolderTypeEnumMap, json['accountHolderType']), - accountType: - $enumDecodeNullable(_$UsBankAccountTypeEnumMap, json['accountType']), + _$UsBankAccountHolderTypeEnumMap, + json['accountHolderType'], + ), + accountType: $enumDecodeNullable( + _$UsBankAccountTypeEnumMap, + json['accountType'], + ), billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - Map.from(json['billingDetails'] as Map)), + Map.from(json['billingDetails'] as Map), + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - Map.from(json['shippingDetails'] as Map)), + Map.from(json['shippingDetails'] as Map), + ), ); -Map _$$PaymentMethodDataUsBankImplToJson( - _$PaymentMethodDataUsBankImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('accountNumber', instance.accountNumber); - writeNotNull('routingNumber', instance.routingNumber); - writeNotNull('accountHolderType', - _$UsBankAccountHolderTypeEnumMap[instance.accountHolderType]); - writeNotNull('accountType', _$UsBankAccountTypeEnumMap[instance.accountType]); - writeNotNull('billingDetails', instance.billingDetails?.toJson()); - writeNotNull('shippingDetails', instance.shippingDetails?.toJson()); - return val; -} +Map _$PaymentMethodDataUsBankToJson( + _PaymentMethodDataUsBank instance, +) => { + 'accountNumber': ?instance.accountNumber, + 'routingNumber': ?instance.routingNumber, + 'accountHolderType': + ?_$UsBankAccountHolderTypeEnumMap[instance.accountHolderType], + 'accountType': ?_$UsBankAccountTypeEnumMap[instance.accountType], + 'billingDetails': ?instance.billingDetails?.toJson(), + 'shippingDetails': ?instance.shippingDetails?.toJson(), +}; const _$UsBankAccountHolderTypeEnumMap = { UsBankAccountHolderType.Company: 'Company', diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.dart index dd2e85784..79a9eb211 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.dart @@ -5,7 +5,7 @@ part 'payment_method_response.freezed.dart'; part 'payment_method_response.g.dart'; @freezed -class PaymentMethodResponse with _$PaymentMethodResponse { +abstract class PaymentMethodResponse with _$PaymentMethodResponse { const factory PaymentMethodResponse({ /// If not null, a PaymentMethod was created successfully PaymentMethod? paymentMethod, diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.freezed.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.freezed.dart index 1f3fea3b6..53ba0549b 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.freezed.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,225 +9,324 @@ part of 'payment_method_response.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentMethodResponse _$PaymentMethodResponseFromJson( - Map json) { - return _PaymentMethodResponse.fromJson(json); -} - /// @nodoc mixin _$PaymentMethodResponse { - /// If not null, a PaymentMethod was created successfully - PaymentMethod? get paymentMethod => throw _privateConstructorUsedError; - /// If not null, an error occurred - StripeError? get error => throw _privateConstructorUsedError; +/// If not null, a PaymentMethod was created successfully + PaymentMethod? get paymentMethod;/// If not null, an error occurred + StripeError? get error; +/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodResponseCopyWith get copyWith => _$PaymentMethodResponseCopyWithImpl(this as PaymentMethodResponse, _$identity); /// Serializes this PaymentMethodResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodResponseCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodResponse&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.error, error) || other.error == error)); } -/// @nodoc -abstract class $PaymentMethodResponseCopyWith<$Res> { - factory $PaymentMethodResponseCopyWith(PaymentMethodResponse value, - $Res Function(PaymentMethodResponse) then) = - _$PaymentMethodResponseCopyWithImpl<$Res, PaymentMethodResponse>; - @useResult - $Res call({PaymentMethod? paymentMethod, StripeError? error}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,error); - $PaymentMethodCopyWith<$Res>? get paymentMethod; - $StripeErrorCopyWith<$Res>? get error; +@override +String toString() { + return 'PaymentMethodResponse(paymentMethod: $paymentMethod, error: $error)'; } + +} + +/// @nodoc +abstract mixin class $PaymentMethodResponseCopyWith<$Res> { + factory $PaymentMethodResponseCopyWith(PaymentMethodResponse value, $Res Function(PaymentMethodResponse) _then) = _$PaymentMethodResponseCopyWithImpl; +@useResult +$Res call({ + PaymentMethod? paymentMethod, StripeError? error +}); + + +$PaymentMethodCopyWith<$Res>? get paymentMethod;$StripeErrorCopyWith<$Res>? get error; + +} /// @nodoc -class _$PaymentMethodResponseCopyWithImpl<$Res, - $Val extends PaymentMethodResponse> +class _$PaymentMethodResponseCopyWithImpl<$Res> implements $PaymentMethodResponseCopyWith<$Res> { - _$PaymentMethodResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as PaymentMethod?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - ) as $Val); + _$PaymentMethodResponseCopyWithImpl(this._self, this._then); + + final PaymentMethodResponse _self; + final $Res Function(PaymentMethodResponse) _then; + +/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as PaymentMethod?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} +/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $PaymentMethodCopyWith<$Res>(_value.paymentMethod!, (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); + return $PaymentMethodCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith<$Res>? get error { - if (_value.error == null) { - return null; - } - - return $StripeErrorCopyWith<$Res>(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } -/// @nodoc -abstract class _$$PaymentMethodResponseImplCopyWith<$Res> - implements $PaymentMethodResponseCopyWith<$Res> { - factory _$$PaymentMethodResponseImplCopyWith( - _$PaymentMethodResponseImpl value, - $Res Function(_$PaymentMethodResponseImpl) then) = - __$$PaymentMethodResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({PaymentMethod? paymentMethod, StripeError? error}); - @override - $PaymentMethodCopyWith<$Res>? get paymentMethod; - @override - $StripeErrorCopyWith<$Res>? get error; +/// Adds pattern-matching-related methods to [PaymentMethodResponse]. +extension PaymentMethodResponsePatterns on PaymentMethodResponse { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodResponse() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodResponse value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodResponse(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodResponse value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodResponse() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentMethod? paymentMethod, StripeError? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodResponse() when $default != null: +return $default(_that.paymentMethod,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentMethod? paymentMethod, StripeError? error) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodResponse(): +return $default(_that.paymentMethod,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentMethod? paymentMethod, StripeError? error)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodResponse() when $default != null: +return $default(_that.paymentMethod,_that.error);case _: + return null; + +} } -/// @nodoc -class __$$PaymentMethodResponseImplCopyWithImpl<$Res> - extends _$PaymentMethodResponseCopyWithImpl<$Res, - _$PaymentMethodResponseImpl> - implements _$$PaymentMethodResponseImplCopyWith<$Res> { - __$$PaymentMethodResponseImplCopyWithImpl(_$PaymentMethodResponseImpl _value, - $Res Function(_$PaymentMethodResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? error = freezed, - }) { - return _then(_$PaymentMethodResponseImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as PaymentMethod?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentMethodResponseImpl implements _PaymentMethodResponse { - const _$PaymentMethodResponseImpl({this.paymentMethod, this.error}); - factory _$PaymentMethodResponseImpl.fromJson(Map json) => - _$$PaymentMethodResponseImplFromJson(json); +class _PaymentMethodResponse implements PaymentMethodResponse { + const _PaymentMethodResponse({this.paymentMethod, this.error}); + factory _PaymentMethodResponse.fromJson(Map json) => _$PaymentMethodResponseFromJson(json); - /// If not null, a PaymentMethod was created successfully - @override - final PaymentMethod? paymentMethod; +/// If not null, a PaymentMethod was created successfully +@override final PaymentMethod? paymentMethod; +/// If not null, an error occurred +@override final StripeError? error; - /// If not null, an error occurred - @override - final StripeError? error; +/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodResponseCopyWith<_PaymentMethodResponse> get copyWith => __$PaymentMethodResponseCopyWithImpl<_PaymentMethodResponse>(this, _$identity); - @override - String toString() { - return 'PaymentMethodResponse(paymentMethod: $paymentMethod, error: $error)'; - } +@override +Map toJson() { + return _$PaymentMethodResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodResponse&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.error, error) || other.error == error)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,error); + +@override +String toString() { + return 'PaymentMethodResponse(paymentMethod: $paymentMethod, error: $error)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodResponseImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.error, error) || other.error == error)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod, error); - - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodResponseImplCopyWith<_$PaymentMethodResponseImpl> - get copyWith => __$$PaymentMethodResponseImplCopyWithImpl< - _$PaymentMethodResponseImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodResponseImplToJson( - this, - ); - } } -abstract class _PaymentMethodResponse implements PaymentMethodResponse { - const factory _PaymentMethodResponse( - {final PaymentMethod? paymentMethod, - final StripeError? error}) = _$PaymentMethodResponseImpl; +/// @nodoc +abstract mixin class _$PaymentMethodResponseCopyWith<$Res> implements $PaymentMethodResponseCopyWith<$Res> { + factory _$PaymentMethodResponseCopyWith(_PaymentMethodResponse value, $Res Function(_PaymentMethodResponse) _then) = __$PaymentMethodResponseCopyWithImpl; +@override @useResult +$Res call({ + PaymentMethod? paymentMethod, StripeError? error +}); + + +@override $PaymentMethodCopyWith<$Res>? get paymentMethod;@override $StripeErrorCopyWith<$Res>? get error; - factory _PaymentMethodResponse.fromJson(Map json) = - _$PaymentMethodResponseImpl.fromJson; +} +/// @nodoc +class __$PaymentMethodResponseCopyWithImpl<$Res> + implements _$PaymentMethodResponseCopyWith<$Res> { + __$PaymentMethodResponseCopyWithImpl(this._self, this._then); + + final _PaymentMethodResponse _self; + final $Res Function(_PaymentMethodResponse) _then; + +/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? error = freezed,}) { + return _then(_PaymentMethodResponse( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as PaymentMethod?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} - /// If not null, a PaymentMethod was created successfully - @override - PaymentMethod? get paymentMethod; +/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; + } - /// If not null, an error occurred - @override - StripeError? get error; + return $PaymentMethodCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of PaymentMethodResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } - /// Create a copy of PaymentMethodResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodResponseImplCopyWith<_$PaymentMethodResponseImpl> - get copyWith => throw _privateConstructorUsedError; + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.g.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.g.dart index adf761f52..fc7941ed4 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.g.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_method_response.g.dart @@ -6,29 +6,23 @@ part of 'payment_method_response.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentMethodResponseImpl _$$PaymentMethodResponseImplFromJson(Map json) => - _$PaymentMethodResponseImpl( +_PaymentMethodResponse _$PaymentMethodResponseFromJson(Map json) => + _PaymentMethodResponse( paymentMethod: json['paymentMethod'] == null ? null : PaymentMethod.fromJson( - Map.from(json['paymentMethod'] as Map)), + Map.from(json['paymentMethod'] as Map), + ), error: json['error'] == null ? null : StripeError.fromJson( - Map.from(json['error'] as Map)), + Map.from(json['error'] as Map), + ), ); -Map _$$PaymentMethodResponseImplToJson( - _$PaymentMethodResponseImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('paymentMethod', instance.paymentMethod?.toJson()); - writeNotNull('error', instance.error?.toJson()); - return val; -} +Map _$PaymentMethodResponseToJson( + _PaymentMethodResponse instance, +) => { + 'paymentMethod': ?instance.paymentMethod?.toJson(), + 'error': ?instance.error?.toJson(), +}; diff --git a/packages/stripe_js/lib/src/api/payment_methods/payment_type.dart b/packages/stripe_js/lib/src/api/payment_methods/payment_type.dart index bca99ec48..0c88bf5d4 100644 --- a/packages/stripe_js/lib/src/api/payment_methods/payment_type.dart +++ b/packages/stripe_js/lib/src/api/payment_methods/payment_type.dart @@ -97,9 +97,6 @@ enum PaymentMethodType { @JsonValue("sepa_debit") sepaDebit, - /// Sofort is a bank redirect payment method used in Europe. - sofort, - /// ACH Direct Debit is used to debit US bank accounts through the Automated Clearing House (ACH) payments system. @JsonValue("us_bank_account") usBankAccount, @@ -108,5 +105,5 @@ enum PaymentMethodType { @JsonValue("wechat_pay") wechatPay, - unknown + unknown, } diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.dart index 213d9932b..cab0c782b 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.dart @@ -5,7 +5,7 @@ part 'confirm_card_setup_data.freezed.dart'; part 'confirm_card_setup_data.g.dart'; @freezed -class ConfirmCardSetupData with _$ConfirmCardSetupData { +abstract class ConfirmCardSetupData with _$ConfirmCardSetupData { const factory ConfirmCardSetupData({ /// Either the id of an existing PaymentMethod, or an object containing /// data to create a PaymentMethod with. diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.freezed.dart index d61b21147..4d1c9b91c 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,235 +9,308 @@ part of 'confirm_card_setup_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmCardSetupData _$ConfirmCardSetupDataFromJson(Map json) { - return _ConfirmCardSetupData.fromJson(json); -} - /// @nodoc mixin _$ConfirmCardSetupData { - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @paymentMethodDetailJsonKey - CardPaymentMethodDetails? get paymentMethod => - throw _privateConstructorUsedError; - - /// If you are handling next actions yourself, pass in a return_url. - /// If the subsequent action is redirect_to_url, - /// this URL will be used on the return path for the redirect. - @JsonKey(name: "return_url") - String? get returnUrl => throw _privateConstructorUsedError; + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@paymentMethodDetailJsonKey CardPaymentMethodDetails? get paymentMethod;/// If you are handling next actions yourself, pass in a return_url. +/// If the subsequent action is redirect_to_url, +/// this URL will be used on the return path for the redirect. +@JsonKey(name: "return_url") String? get returnUrl; +/// Create a copy of ConfirmCardSetupData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmCardSetupDataCopyWith get copyWith => _$ConfirmCardSetupDataCopyWithImpl(this as ConfirmCardSetupData, _$identity); /// Serializes this ConfirmCardSetupData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmCardSetupData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmCardSetupDataCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmCardSetupData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)); } -/// @nodoc -abstract class $ConfirmCardSetupDataCopyWith<$Res> { - factory $ConfirmCardSetupDataCopyWith(ConfirmCardSetupData value, - $Res Function(ConfirmCardSetupData) then) = - _$ConfirmCardSetupDataCopyWithImpl<$Res, ConfirmCardSetupData>; - @useResult - $Res call( - {@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl); - $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; +@override +String toString() { + return 'ConfirmCardSetupData(paymentMethod: $paymentMethod, returnUrl: $returnUrl)'; } + +} + +/// @nodoc +abstract mixin class $ConfirmCardSetupDataCopyWith<$Res> { + factory $ConfirmCardSetupDataCopyWith(ConfirmCardSetupData value, $Res Function(ConfirmCardSetupData) _then) = _$ConfirmCardSetupDataCopyWithImpl; +@useResult +$Res call({ +@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod,@JsonKey(name: "return_url") String? returnUrl +}); + + +$CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} /// @nodoc -class _$ConfirmCardSetupDataCopyWithImpl<$Res, - $Val extends ConfirmCardSetupData> +class _$ConfirmCardSetupDataCopyWithImpl<$Res> implements $ConfirmCardSetupDataCopyWith<$Res> { - _$ConfirmCardSetupDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmCardSetupData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as CardPaymentMethodDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + _$ConfirmCardSetupDataCopyWithImpl(this._self, this._then); + + final ConfirmCardSetupData _self; + final $Res Function(ConfirmCardSetupData) _then; + +/// Create a copy of ConfirmCardSetupData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as CardPaymentMethodDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of ConfirmCardSetupData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of ConfirmCardSetupData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $CardPaymentMethodDetailsCopyWith<$Res>(_value.paymentMethod!, - (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); - } + return $CardPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +} } -/// @nodoc -abstract class _$$ConfirmCardSetupDataImplCopyWith<$Res> - implements $ConfirmCardSetupDataCopyWith<$Res> { - factory _$$ConfirmCardSetupDataImplCopyWith(_$ConfirmCardSetupDataImpl value, - $Res Function(_$ConfirmCardSetupDataImpl) then) = - __$$ConfirmCardSetupDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") String? returnUrl}); - @override - $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; +/// Adds pattern-matching-related methods to [ConfirmCardSetupData]. +extension ConfirmCardSetupDataPatterns on ConfirmCardSetupData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmCardSetupData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmCardSetupData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmCardSetupData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl) $default,) {final _that = this; +switch (_that) { +case _ConfirmCardSetupData(): +return $default(_that.paymentMethod,_that.returnUrl);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod, @JsonKey(name: "return_url") String? returnUrl)? $default,) {final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that.paymentMethod,_that.returnUrl);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmCardSetupDataImplCopyWithImpl<$Res> - extends _$ConfirmCardSetupDataCopyWithImpl<$Res, _$ConfirmCardSetupDataImpl> - implements _$$ConfirmCardSetupDataImplCopyWith<$Res> { - __$$ConfirmCardSetupDataImplCopyWithImpl(_$ConfirmCardSetupDataImpl _value, - $Res Function(_$ConfirmCardSetupDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmCardSetupData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - Object? returnUrl = freezed, - }) { - return _then(_$ConfirmCardSetupDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as CardPaymentMethodDetails?, - returnUrl: freezed == returnUrl - ? _value.returnUrl - : returnUrl // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmCardSetupDataImpl implements _ConfirmCardSetupData { - const _$ConfirmCardSetupDataImpl( - {@paymentMethodDetailJsonKey this.paymentMethod, - @JsonKey(name: "return_url") this.returnUrl}); - - factory _$ConfirmCardSetupDataImpl.fromJson(Map json) => - _$$ConfirmCardSetupDataImplFromJson(json); - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - final CardPaymentMethodDetails? paymentMethod; - - /// If you are handling next actions yourself, pass in a return_url. - /// If the subsequent action is redirect_to_url, - /// this URL will be used on the return path for the redirect. - @override - @JsonKey(name: "return_url") - final String? returnUrl; - - @override - String toString() { - return 'ConfirmCardSetupData(paymentMethod: $paymentMethod, returnUrl: $returnUrl)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmCardSetupDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.returnUrl, returnUrl) || - other.returnUrl == returnUrl)); - } +class _ConfirmCardSetupData implements ConfirmCardSetupData { + const _ConfirmCardSetupData({@paymentMethodDetailJsonKey this.paymentMethod, @JsonKey(name: "return_url") this.returnUrl}); + factory _ConfirmCardSetupData.fromJson(Map json) => _$ConfirmCardSetupDataFromJson(json); + +/// Either the id of an existing PaymentMethod, or an object containing +/// data to create a PaymentMethod with. +/// See the use case sections below for details. +@override@paymentMethodDetailJsonKey final CardPaymentMethodDetails? paymentMethod; +/// If you are handling next actions yourself, pass in a return_url. +/// If the subsequent action is redirect_to_url, +/// this URL will be used on the return path for the redirect. +@override@JsonKey(name: "return_url") final String? returnUrl; + +/// Create a copy of ConfirmCardSetupData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmCardSetupDataCopyWith<_ConfirmCardSetupData> get copyWith => __$ConfirmCardSetupDataCopyWithImpl<_ConfirmCardSetupData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmCardSetupDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod, returnUrl); - - /// Create a copy of ConfirmCardSetupData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmCardSetupDataImplCopyWith<_$ConfirmCardSetupDataImpl> - get copyWith => - __$$ConfirmCardSetupDataImplCopyWithImpl<_$ConfirmCardSetupDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ConfirmCardSetupDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmCardSetupData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.returnUrl, returnUrl) || other.returnUrl == returnUrl)); } -abstract class _ConfirmCardSetupData implements ConfirmCardSetupData { - const factory _ConfirmCardSetupData( - {@paymentMethodDetailJsonKey - final CardPaymentMethodDetails? paymentMethod, - @JsonKey(name: "return_url") final String? returnUrl}) = - _$ConfirmCardSetupDataImpl; - - factory _ConfirmCardSetupData.fromJson(Map json) = - _$ConfirmCardSetupDataImpl.fromJson; - - /// Either the id of an existing PaymentMethod, or an object containing - /// data to create a PaymentMethod with. - /// See the use case sections below for details. - @override - @paymentMethodDetailJsonKey - CardPaymentMethodDetails? get paymentMethod; - - /// If you are handling next actions yourself, pass in a return_url. - /// If the subsequent action is redirect_to_url, - /// this URL will be used on the return path for the redirect. - @override - @JsonKey(name: "return_url") - String? get returnUrl; - - /// Create a copy of ConfirmCardSetupData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmCardSetupDataImplCopyWith<_$ConfirmCardSetupDataImpl> - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,returnUrl); + +@override +String toString() { + return 'ConfirmCardSetupData(paymentMethod: $paymentMethod, returnUrl: $returnUrl)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmCardSetupDataCopyWith<$Res> implements $ConfirmCardSetupDataCopyWith<$Res> { + factory _$ConfirmCardSetupDataCopyWith(_ConfirmCardSetupData value, $Res Function(_ConfirmCardSetupData) _then) = __$ConfirmCardSetupDataCopyWithImpl; +@override @useResult +$Res call({ +@paymentMethodDetailJsonKey CardPaymentMethodDetails? paymentMethod,@JsonKey(name: "return_url") String? returnUrl +}); + + +@override $CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod; + +} +/// @nodoc +class __$ConfirmCardSetupDataCopyWithImpl<$Res> + implements _$ConfirmCardSetupDataCopyWith<$Res> { + __$ConfirmCardSetupDataCopyWithImpl(this._self, this._then); + + final _ConfirmCardSetupData _self; + final $Res Function(_ConfirmCardSetupData) _then; + +/// Create a copy of ConfirmCardSetupData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,Object? returnUrl = freezed,}) { + return _then(_ConfirmCardSetupData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as CardPaymentMethodDetails?,returnUrl: freezed == returnUrl ? _self.returnUrl : returnUrl // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of ConfirmCardSetupData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardPaymentMethodDetailsCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; + } + + return $CardPaymentMethodDetailsCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +} +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.g.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.g.dart index 61f46b107..71371122d 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.g.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_data.g.dart @@ -6,27 +6,21 @@ part of 'confirm_card_setup_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmCardSetupDataImpl _$$ConfirmCardSetupDataImplFromJson(Map json) => - _$ConfirmCardSetupDataImpl( +_ConfirmCardSetupData _$ConfirmCardSetupDataFromJson(Map json) => + _ConfirmCardSetupData( paymentMethod: json['payment_method'] == null ? null : CardPaymentMethodDetails.fromJson( - Map.from(json['payment_method'] as Map)), + Map.from(json['payment_method'] as Map), + ), returnUrl: json['return_url'] as String?, ); -Map _$$ConfirmCardSetupDataImplToJson( - _$ConfirmCardSetupDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', - PaymentMethodDetails.toJsonConverter(instance.paymentMethod)); - writeNotNull('return_url', instance.returnUrl); - return val; -} +Map _$ConfirmCardSetupDataToJson( + _ConfirmCardSetupData instance, +) => { + 'payment_method': ?PaymentMethodDetails.toJsonConverter( + instance.paymentMethod, + ), + 'return_url': ?instance.returnUrl, +}; diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.dart index e58ee9542..61eb0fa52 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.dart @@ -4,7 +4,7 @@ part 'confirm_card_setup_options.freezed.dart'; part 'confirm_card_setup_options.g.dart'; @freezed -class ConfirmCardSetupOptions with _$ConfirmCardSetupOptions { +abstract class ConfirmCardSetupOptions with _$ConfirmCardSetupOptions { const factory ConfirmCardSetupOptions({ /// Set this to false if you want to handle next actions yourself, /// or if you want to defer next action handling until later diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.freezed.dart index 55836817b..b780a9f5d 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,174 +9,275 @@ part of 'confirm_card_setup_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmCardSetupOptions _$ConfirmCardSetupOptionsFromJson( - Map json) { - return _ConfirmCardSetupOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmCardSetupOptions { - /// Set this to false if you want to handle next actions yourself, - /// or if you want to defer next action handling until later - /// (e.g. for use in the PaymentRequest API). Default is true. - bool? get handleActions => throw _privateConstructorUsedError; + +/// Set this to false if you want to handle next actions yourself, +/// or if you want to defer next action handling until later +/// (e.g. for use in the PaymentRequest API). Default is true. + bool? get handleActions; +/// Create a copy of ConfirmCardSetupOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmCardSetupOptionsCopyWith get copyWith => _$ConfirmCardSetupOptionsCopyWithImpl(this as ConfirmCardSetupOptions, _$identity); /// Serializes this ConfirmCardSetupOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmCardSetupOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmCardSetupOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmCardSetupOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); } -/// @nodoc -abstract class $ConfirmCardSetupOptionsCopyWith<$Res> { - factory $ConfirmCardSetupOptionsCopyWith(ConfirmCardSetupOptions value, - $Res Function(ConfirmCardSetupOptions) then) = - _$ConfirmCardSetupOptionsCopyWithImpl<$Res, ConfirmCardSetupOptions>; - @useResult - $Res call({bool? handleActions}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmCardSetupOptions(handleActions: $handleActions)'; } -/// @nodoc -class _$ConfirmCardSetupOptionsCopyWithImpl<$Res, - $Val extends ConfirmCardSetupOptions> - implements $ConfirmCardSetupOptionsCopyWith<$Res> { - _$ConfirmCardSetupOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmCardSetupOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_value.copyWith( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmCardSetupOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmCardSetupOptionsCopyWith<$Res> { + factory $ConfirmCardSetupOptionsCopyWith(ConfirmCardSetupOptions value, $Res Function(ConfirmCardSetupOptions) _then) = _$ConfirmCardSetupOptionsCopyWithImpl; +@useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class _$ConfirmCardSetupOptionsCopyWithImpl<$Res> implements $ConfirmCardSetupOptionsCopyWith<$Res> { - factory _$$ConfirmCardSetupOptionsImplCopyWith( - _$ConfirmCardSetupOptionsImpl value, - $Res Function(_$ConfirmCardSetupOptionsImpl) then) = - __$$ConfirmCardSetupOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? handleActions}); + _$ConfirmCardSetupOptionsCopyWithImpl(this._self, this._then); + + final ConfirmCardSetupOptions _self; + final $Res Function(ConfirmCardSetupOptions) _then; + +/// Create a copy of ConfirmCardSetupOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? handleActions = freezed,}) { + return _then(_self.copyWith( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmCardSetupOptions]. +extension ConfirmCardSetupOptionsPatterns on ConfirmCardSetupOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmCardSetupOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmCardSetupOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmCardSetupOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? handleActions)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmCardSetupOptions() when $default != null: +return $default(_that.handleActions);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? handleActions) $default,) {final _that = this; +switch (_that) { +case _ConfirmCardSetupOptions(): +return $default(_that.handleActions);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? handleActions)? $default,) {final _that = this; +switch (_that) { +case _ConfirmCardSetupOptions() when $default != null: +return $default(_that.handleActions);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmCardSetupOptionsImplCopyWithImpl<$Res> - extends _$ConfirmCardSetupOptionsCopyWithImpl<$Res, - _$ConfirmCardSetupOptionsImpl> - implements _$$ConfirmCardSetupOptionsImplCopyWith<$Res> { - __$$ConfirmCardSetupOptionsImplCopyWithImpl( - _$ConfirmCardSetupOptionsImpl _value, - $Res Function(_$ConfirmCardSetupOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmCardSetupOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? handleActions = freezed, - }) { - return _then(_$ConfirmCardSetupOptionsImpl( - handleActions: freezed == handleActions - ? _value.handleActions - : handleActions // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmCardSetupOptionsImpl implements _ConfirmCardSetupOptions { - const _$ConfirmCardSetupOptionsImpl({this.handleActions = true}); - - factory _$ConfirmCardSetupOptionsImpl.fromJson(Map json) => - _$$ConfirmCardSetupOptionsImplFromJson(json); - - /// Set this to false if you want to handle next actions yourself, - /// or if you want to defer next action handling until later - /// (e.g. for use in the PaymentRequest API). Default is true. - @override - @JsonKey() - final bool? handleActions; - - @override - String toString() { - return 'ConfirmCardSetupOptions(handleActions: $handleActions)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmCardSetupOptionsImpl && - (identical(other.handleActions, handleActions) || - other.handleActions == handleActions)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, handleActions); - - /// Create a copy of ConfirmCardSetupOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmCardSetupOptionsImplCopyWith<_$ConfirmCardSetupOptionsImpl> - get copyWith => __$$ConfirmCardSetupOptionsImplCopyWithImpl< - _$ConfirmCardSetupOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmCardSetupOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmCardSetupOptions implements ConfirmCardSetupOptions { - const factory _ConfirmCardSetupOptions({final bool? handleActions}) = - _$ConfirmCardSetupOptionsImpl; - - factory _ConfirmCardSetupOptions.fromJson(Map json) = - _$ConfirmCardSetupOptionsImpl.fromJson; - - /// Set this to false if you want to handle next actions yourself, - /// or if you want to defer next action handling until later - /// (e.g. for use in the PaymentRequest API). Default is true. - @override - bool? get handleActions; - - /// Create a copy of ConfirmCardSetupOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmCardSetupOptionsImplCopyWith<_$ConfirmCardSetupOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _ConfirmCardSetupOptions implements ConfirmCardSetupOptions { + const _ConfirmCardSetupOptions({this.handleActions = true}); + factory _ConfirmCardSetupOptions.fromJson(Map json) => _$ConfirmCardSetupOptionsFromJson(json); + +/// Set this to false if you want to handle next actions yourself, +/// or if you want to defer next action handling until later +/// (e.g. for use in the PaymentRequest API). Default is true. +@override@JsonKey() final bool? handleActions; + +/// Create a copy of ConfirmCardSetupOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmCardSetupOptionsCopyWith<_ConfirmCardSetupOptions> get copyWith => __$ConfirmCardSetupOptionsCopyWithImpl<_ConfirmCardSetupOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmCardSetupOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmCardSetupOptions&&(identical(other.handleActions, handleActions) || other.handleActions == handleActions)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,handleActions); + +@override +String toString() { + return 'ConfirmCardSetupOptions(handleActions: $handleActions)'; } + + +} + +/// @nodoc +abstract mixin class _$ConfirmCardSetupOptionsCopyWith<$Res> implements $ConfirmCardSetupOptionsCopyWith<$Res> { + factory _$ConfirmCardSetupOptionsCopyWith(_ConfirmCardSetupOptions value, $Res Function(_ConfirmCardSetupOptions) _then) = __$ConfirmCardSetupOptionsCopyWithImpl; +@override @useResult +$Res call({ + bool? handleActions +}); + + + + +} +/// @nodoc +class __$ConfirmCardSetupOptionsCopyWithImpl<$Res> + implements _$ConfirmCardSetupOptionsCopyWith<$Res> { + __$ConfirmCardSetupOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmCardSetupOptions _self; + final $Res Function(_ConfirmCardSetupOptions) _then; + +/// Create a copy of ConfirmCardSetupOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? handleActions = freezed,}) { + return _then(_ConfirmCardSetupOptions( +handleActions: freezed == handleActions ? _self.handleActions : handleActions // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.g.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.g.dart index 4076fe8b9..05f71935c 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.g.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_card_setup_options.g.dart @@ -6,22 +6,11 @@ part of 'confirm_card_setup_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmCardSetupOptionsImpl _$$ConfirmCardSetupOptionsImplFromJson( - Map json) => - _$ConfirmCardSetupOptionsImpl( +_ConfirmCardSetupOptions _$ConfirmCardSetupOptionsFromJson(Map json) => + _ConfirmCardSetupOptions( handleActions: json['handleActions'] as bool? ?? true, ); -Map _$$ConfirmCardSetupOptionsImplToJson( - _$ConfirmCardSetupOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('handleActions', instance.handleActions); - return val; -} +Map _$ConfirmCardSetupOptionsToJson( + _ConfirmCardSetupOptions instance, +) => {'handleActions': ?instance.handleActions}; diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.dart index 602ba6e8b..2daf08e2d 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.dart @@ -4,7 +4,7 @@ part 'confirm_sepa_debit_setup_data.freezed.dart'; part 'confirm_sepa_debit_setup_data.g.dart'; @freezed -class ConfirmSepaDebitSetupData with _$ConfirmSepaDebitSetupData { +abstract class ConfirmSepaDebitSetupData with _$ConfirmSepaDebitSetupData { const factory ConfirmSepaDebitSetupData({ /// The id of an existing PaymentMethod or an object of collected data. @JsonKey(name: "payment_method") String? paymentMethod, diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.freezed.dart index 95c4bb6ad..4c8febfe8 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,171 +9,278 @@ part of 'confirm_sepa_debit_setup_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - ConfirmSepaDebitSetupData _$ConfirmSepaDebitSetupDataFromJson( - Map json) { - return _ConfirmCardSetupData.fromJson(json); + Map json +) { + return _ConfirmCardSetupData.fromJson( + json + ); } /// @nodoc mixin _$ConfirmSepaDebitSetupData { - /// The id of an existing PaymentMethod or an object of collected data. - @JsonKey(name: "payment_method") - String? get paymentMethod => throw _privateConstructorUsedError; + +/// The id of an existing PaymentMethod or an object of collected data. +@JsonKey(name: "payment_method") String? get paymentMethod; +/// Create a copy of ConfirmSepaDebitSetupData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmSepaDebitSetupDataCopyWith get copyWith => _$ConfirmSepaDebitSetupDataCopyWithImpl(this as ConfirmSepaDebitSetupData, _$identity); /// Serializes this ConfirmSepaDebitSetupData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmSepaDebitSetupData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmSepaDebitSetupDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmSepaDebitSetupData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)); } -/// @nodoc -abstract class $ConfirmSepaDebitSetupDataCopyWith<$Res> { - factory $ConfirmSepaDebitSetupDataCopyWith(ConfirmSepaDebitSetupData value, - $Res Function(ConfirmSepaDebitSetupData) then) = - _$ConfirmSepaDebitSetupDataCopyWithImpl<$Res, ConfirmSepaDebitSetupData>; - @useResult - $Res call({@JsonKey(name: "payment_method") String? paymentMethod}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod); + +@override +String toString() { + return 'ConfirmSepaDebitSetupData(paymentMethod: $paymentMethod)'; } -/// @nodoc -class _$ConfirmSepaDebitSetupDataCopyWithImpl<$Res, - $Val extends ConfirmSepaDebitSetupData> - implements $ConfirmSepaDebitSetupDataCopyWith<$Res> { - _$ConfirmSepaDebitSetupDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmSepaDebitSetupData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmCardSetupDataImplCopyWith<$Res> +abstract mixin class $ConfirmSepaDebitSetupDataCopyWith<$Res> { + factory $ConfirmSepaDebitSetupDataCopyWith(ConfirmSepaDebitSetupData value, $Res Function(ConfirmSepaDebitSetupData) _then) = _$ConfirmSepaDebitSetupDataCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "payment_method") String? paymentMethod +}); + + + + +} +/// @nodoc +class _$ConfirmSepaDebitSetupDataCopyWithImpl<$Res> implements $ConfirmSepaDebitSetupDataCopyWith<$Res> { - factory _$$ConfirmCardSetupDataImplCopyWith(_$ConfirmCardSetupDataImpl value, - $Res Function(_$ConfirmCardSetupDataImpl) then) = - __$$ConfirmCardSetupDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({@JsonKey(name: "payment_method") String? paymentMethod}); + _$ConfirmSepaDebitSetupDataCopyWithImpl(this._self, this._then); + + final ConfirmSepaDebitSetupData _self; + final $Res Function(ConfirmSepaDebitSetupData) _then; + +/// Create a copy of ConfirmSepaDebitSetupData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = freezed,}) { + return _then(_self.copyWith( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmSepaDebitSetupData]. +extension ConfirmSepaDebitSetupDataPatterns on ConfirmSepaDebitSetupData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmCardSetupData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmCardSetupData value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmCardSetupData value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "payment_method") String? paymentMethod)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that.paymentMethod);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "payment_method") String? paymentMethod) $default,) {final _that = this; +switch (_that) { +case _ConfirmCardSetupData(): +return $default(_that.paymentMethod);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "payment_method") String? paymentMethod)? $default,) {final _that = this; +switch (_that) { +case _ConfirmCardSetupData() when $default != null: +return $default(_that.paymentMethod);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmCardSetupDataImplCopyWithImpl<$Res> - extends _$ConfirmSepaDebitSetupDataCopyWithImpl<$Res, - _$ConfirmCardSetupDataImpl> - implements _$$ConfirmCardSetupDataImplCopyWith<$Res> { - __$$ConfirmCardSetupDataImplCopyWithImpl(_$ConfirmCardSetupDataImpl _value, - $Res Function(_$ConfirmCardSetupDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmSepaDebitSetupData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = freezed, - }) { - return _then(_$ConfirmCardSetupDataImpl( - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmCardSetupDataImpl implements _ConfirmCardSetupData { - const _$ConfirmCardSetupDataImpl( - {@JsonKey(name: "payment_method") this.paymentMethod}); - - factory _$ConfirmCardSetupDataImpl.fromJson(Map json) => - _$$ConfirmCardSetupDataImplFromJson(json); - - /// The id of an existing PaymentMethod or an object of collected data. - @override - @JsonKey(name: "payment_method") - final String? paymentMethod; - - @override - String toString() { - return 'ConfirmSepaDebitSetupData(paymentMethod: $paymentMethod)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmCardSetupDataImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod); - - /// Create a copy of ConfirmSepaDebitSetupData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmCardSetupDataImplCopyWith<_$ConfirmCardSetupDataImpl> - get copyWith => - __$$ConfirmCardSetupDataImplCopyWithImpl<_$ConfirmCardSetupDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ConfirmCardSetupDataImplToJson( - this, - ); - } + +class _ConfirmCardSetupData implements ConfirmSepaDebitSetupData { + const _ConfirmCardSetupData({@JsonKey(name: "payment_method") this.paymentMethod}); + factory _ConfirmCardSetupData.fromJson(Map json) => _$ConfirmCardSetupDataFromJson(json); + +/// The id of an existing PaymentMethod or an object of collected data. +@override@JsonKey(name: "payment_method") final String? paymentMethod; + +/// Create a copy of ConfirmSepaDebitSetupData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmCardSetupDataCopyWith<_ConfirmCardSetupData> get copyWith => __$ConfirmCardSetupDataCopyWithImpl<_ConfirmCardSetupData>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmCardSetupDataToJson(this, ); } -abstract class _ConfirmCardSetupData implements ConfirmSepaDebitSetupData { - const factory _ConfirmCardSetupData( - {@JsonKey(name: "payment_method") final String? paymentMethod}) = - _$ConfirmCardSetupDataImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmCardSetupData&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod); + +@override +String toString() { + return 'ConfirmSepaDebitSetupData(paymentMethod: $paymentMethod)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmCardSetupDataCopyWith<$Res> implements $ConfirmSepaDebitSetupDataCopyWith<$Res> { + factory _$ConfirmCardSetupDataCopyWith(_ConfirmCardSetupData value, $Res Function(_ConfirmCardSetupData) _then) = __$ConfirmCardSetupDataCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "payment_method") String? paymentMethod +}); - factory _ConfirmCardSetupData.fromJson(Map json) = - _$ConfirmCardSetupDataImpl.fromJson; - /// The id of an existing PaymentMethod or an object of collected data. - @override - @JsonKey(name: "payment_method") - String? get paymentMethod; - /// Create a copy of ConfirmSepaDebitSetupData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmCardSetupDataImplCopyWith<_$ConfirmCardSetupDataImpl> - get copyWith => throw _privateConstructorUsedError; + +} +/// @nodoc +class __$ConfirmCardSetupDataCopyWithImpl<$Res> + implements _$ConfirmCardSetupDataCopyWith<$Res> { + __$ConfirmCardSetupDataCopyWithImpl(this._self, this._then); + + final _ConfirmCardSetupData _self; + final $Res Function(_ConfirmCardSetupData) _then; + +/// Create a copy of ConfirmSepaDebitSetupData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = freezed,}) { + return _then(_ConfirmCardSetupData( +paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?, + )); } + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.g.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.g.dart index 686cae410..1ba1e411f 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.g.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_sepa_debit_setup_data.g.dart @@ -6,21 +6,9 @@ part of 'confirm_sepa_debit_setup_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmCardSetupDataImpl _$$ConfirmCardSetupDataImplFromJson(Map json) => - _$ConfirmCardSetupDataImpl( - paymentMethod: json['payment_method'] as String?, - ); +_ConfirmCardSetupData _$ConfirmCardSetupDataFromJson(Map json) => + _ConfirmCardSetupData(paymentMethod: json['payment_method'] as String?); -Map _$$ConfirmCardSetupDataImplToJson( - _$ConfirmCardSetupDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('payment_method', instance.paymentMethod); - return val; -} +Map _$ConfirmCardSetupDataToJson( + _ConfirmCardSetupData instance, +) => {'payment_method': ?instance.paymentMethod}; diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.dart index ee7540451..3def9291d 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.dart @@ -9,7 +9,7 @@ part 'confirm_setup_options.freezed.dart'; part 'confirm_setup_options.g.dart'; @freezed -class ConfirmSetupOptions with _$ConfirmSetupOptions { +abstract class ConfirmSetupOptions with _$ConfirmSetupOptions { const factory ConfirmSetupOptions({ /// Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. @ElementsConverter() required Elements elements, @@ -39,7 +39,7 @@ class ConfirmSetupOptions with _$ConfirmSetupOptions { } @freezed -class ConfirmSetupParams with _$ConfirmSetupParams { +abstract class ConfirmSetupParams with _$ConfirmSetupParams { const factory ConfirmSetupParams({ /// The url your customer will be directed to after they complete authentication. required String return_url, diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.freezed.dart index 946b81e53..da2e28e5a 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,475 +9,594 @@ part of 'confirm_setup_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmSetupOptions _$ConfirmSetupOptionsFromJson(Map json) { - return _ConfirmSetupOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmSetupOptions { - /// Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. - @ElementsConverter() - Elements get elements => throw _privateConstructorUsedError; - - /// Required if you collect payment details before creating an Intent. - /// It's always required if you don't provide an elements instance containing a client secret. - String? get clientSecret => throw _privateConstructorUsedError; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - ConfirmSetupParams get confirmParams => throw _privateConstructorUsedError; - - /// By default, stripe.confirmSetup will always redirect to your return_url - /// after a successful confirmation. If you set redirect: "if_required", - /// then stripe.confirmSetup will only redirect if your user chooses a - /// redirect-based payment method. - /// Note: Setting if_required requires that you handle successful confirmations - /// for redirect-based and non-redirect based payment methods separately. - /// When a non-redirect based payment method is successfully confirmed, - /// stripe.confirmSetup will resolve with a {setupIntent} object. - SetupConfirmationRedirect? get redirect => throw _privateConstructorUsedError; + +/// Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. +@ElementsConverter() Elements get elements;/// Required if you collect payment details before creating an Intent. +/// It's always required if you don't provide an elements instance containing a client secret. + String? get clientSecret;/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. + ConfirmSetupParams get confirmParams;/// By default, stripe.confirmSetup will always redirect to your return_url +/// after a successful confirmation. If you set redirect: "if_required", +/// then stripe.confirmSetup will only redirect if your user chooses a +/// redirect-based payment method. +/// Note: Setting if_required requires that you handle successful confirmations +/// for redirect-based and non-redirect based payment methods separately. +/// When a non-redirect based payment method is successfully confirmed, +/// stripe.confirmSetup will resolve with a {setupIntent} object. + SetupConfirmationRedirect? get redirect; +/// Create a copy of ConfirmSetupOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmSetupOptionsCopyWith get copyWith => _$ConfirmSetupOptionsCopyWithImpl(this as ConfirmSetupOptions, _$identity); /// Serializes this ConfirmSetupOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmSetupOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmSetupOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmSetupOptions&&(identical(other.elements, elements) || other.elements == elements)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); } -/// @nodoc -abstract class $ConfirmSetupOptionsCopyWith<$Res> { - factory $ConfirmSetupOptionsCopyWith( - ConfirmSetupOptions value, $Res Function(ConfirmSetupOptions) then) = - _$ConfirmSetupOptionsCopyWithImpl<$Res, ConfirmSetupOptions>; - @useResult - $Res call( - {@ElementsConverter() Elements elements, - String? clientSecret, - ConfirmSetupParams confirmParams, - SetupConfirmationRedirect? redirect}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elements,clientSecret,confirmParams,redirect); - $ConfirmSetupParamsCopyWith<$Res> get confirmParams; +@override +String toString() { + return 'ConfirmSetupOptions(elements: $elements, clientSecret: $clientSecret, confirmParams: $confirmParams, redirect: $redirect)'; } -/// @nodoc -class _$ConfirmSetupOptionsCopyWithImpl<$Res, $Val extends ConfirmSetupOptions> - implements $ConfirmSetupOptionsCopyWith<$Res> { - _$ConfirmSetupOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmSetupOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elements = null, - Object? clientSecret = freezed, - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_value.copyWith( - elements: null == elements - ? _value.elements - : elements // ignore: cast_nullable_to_non_nullable - as Elements, - clientSecret: freezed == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String?, - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmSetupParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as SetupConfirmationRedirect?, - ) as $Val); - } - - /// Create a copy of ConfirmSetupOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ConfirmSetupParamsCopyWith<$Res> get confirmParams { - return $ConfirmSetupParamsCopyWith<$Res>(_value.confirmParams, (value) { - return _then(_value.copyWith(confirmParams: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$ConfirmSetupOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmSetupOptionsCopyWith<$Res> { + factory $ConfirmSetupOptionsCopyWith(ConfirmSetupOptions value, $Res Function(ConfirmSetupOptions) _then) = _$ConfirmSetupOptionsCopyWithImpl; +@useResult +$Res call({ +@ElementsConverter() Elements elements, String? clientSecret, ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect +}); + + +$ConfirmSetupParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class _$ConfirmSetupOptionsCopyWithImpl<$Res> implements $ConfirmSetupOptionsCopyWith<$Res> { - factory _$$ConfirmSetupOptionsImplCopyWith(_$ConfirmSetupOptionsImpl value, - $Res Function(_$ConfirmSetupOptionsImpl) then) = - __$$ConfirmSetupOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@ElementsConverter() Elements elements, - String? clientSecret, - ConfirmSetupParams confirmParams, - SetupConfirmationRedirect? redirect}); + _$ConfirmSetupOptionsCopyWithImpl(this._self, this._then); + + final ConfirmSetupOptions _self; + final $Res Function(ConfirmSetupOptions) _then; + +/// Create a copy of ConfirmSetupOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? elements = null,Object? clientSecret = freezed,Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_self.copyWith( +elements: null == elements ? _self.elements : elements // ignore: cast_nullable_to_non_nullable +as Elements,clientSecret: freezed == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String?,confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmSetupParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as SetupConfirmationRedirect?, + )); +} +/// Create a copy of ConfirmSetupOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmSetupParamsCopyWith<$Res> get confirmParams { + + return $ConfirmSetupParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ConfirmSetupOptions]. +extension ConfirmSetupOptionsPatterns on ConfirmSetupOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmSetupOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmSetupOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmSetupOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmSetupOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - @override - $ConfirmSetupParamsCopyWith<$Res> get confirmParams; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmSetupOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmSetupOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@ElementsConverter() Elements elements, String? clientSecret, ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmSetupOptions() when $default != null: +return $default(_that.elements,_that.clientSecret,_that.confirmParams,_that.redirect);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@ElementsConverter() Elements elements, String? clientSecret, ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect) $default,) {final _that = this; +switch (_that) { +case _ConfirmSetupOptions(): +return $default(_that.elements,_that.clientSecret,_that.confirmParams,_that.redirect);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@ElementsConverter() Elements elements, String? clientSecret, ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect)? $default,) {final _that = this; +switch (_that) { +case _ConfirmSetupOptions() when $default != null: +return $default(_that.elements,_that.clientSecret,_that.confirmParams,_that.redirect);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmSetupOptionsImplCopyWithImpl<$Res> - extends _$ConfirmSetupOptionsCopyWithImpl<$Res, _$ConfirmSetupOptionsImpl> - implements _$$ConfirmSetupOptionsImplCopyWith<$Res> { - __$$ConfirmSetupOptionsImplCopyWithImpl(_$ConfirmSetupOptionsImpl _value, - $Res Function(_$ConfirmSetupOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmSetupOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? elements = null, - Object? clientSecret = freezed, - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_$ConfirmSetupOptionsImpl( - elements: null == elements - ? _value.elements - : elements // ignore: cast_nullable_to_non_nullable - as Elements, - clientSecret: freezed == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String?, - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmSetupParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as SetupConfirmationRedirect?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmSetupOptionsImpl implements _ConfirmSetupOptions { - const _$ConfirmSetupOptionsImpl( - {@ElementsConverter() required this.elements, - this.clientSecret, - required this.confirmParams, - this.redirect}); - - factory _$ConfirmSetupOptionsImpl.fromJson(Map json) => - _$$ConfirmSetupOptionsImplFromJson(json); - - /// Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. - @override - @ElementsConverter() - final Elements elements; - - /// Required if you collect payment details before creating an Intent. - /// It's always required if you don't provide an elements instance containing a client secret. - @override - final String? clientSecret; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - final ConfirmSetupParams confirmParams; - - /// By default, stripe.confirmSetup will always redirect to your return_url - /// after a successful confirmation. If you set redirect: "if_required", - /// then stripe.confirmSetup will only redirect if your user chooses a - /// redirect-based payment method. - /// Note: Setting if_required requires that you handle successful confirmations - /// for redirect-based and non-redirect based payment methods separately. - /// When a non-redirect based payment method is successfully confirmed, - /// stripe.confirmSetup will resolve with a {setupIntent} object. - @override - final SetupConfirmationRedirect? redirect; - - @override - String toString() { - return 'ConfirmSetupOptions(elements: $elements, clientSecret: $clientSecret, confirmParams: $confirmParams, redirect: $redirect)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmSetupOptionsImpl && - (identical(other.elements, elements) || - other.elements == elements) && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.confirmParams, confirmParams) || - other.confirmParams == confirmParams) && - (identical(other.redirect, redirect) || - other.redirect == redirect)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, elements, clientSecret, confirmParams, redirect); - - /// Create a copy of ConfirmSetupOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmSetupOptionsImplCopyWith<_$ConfirmSetupOptionsImpl> get copyWith => - __$$ConfirmSetupOptionsImplCopyWithImpl<_$ConfirmSetupOptionsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ConfirmSetupOptionsImplToJson( - this, - ); - } -} - -abstract class _ConfirmSetupOptions implements ConfirmSetupOptions { - const factory _ConfirmSetupOptions( - {@ElementsConverter() required final Elements elements, - final String? clientSecret, - required final ConfirmSetupParams confirmParams, - final SetupConfirmationRedirect? redirect}) = _$ConfirmSetupOptionsImpl; - - factory _ConfirmSetupOptions.fromJson(Map json) = - _$ConfirmSetupOptionsImpl.fromJson; - - /// Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. - @override - @ElementsConverter() - Elements get elements; - - /// Required if you collect payment details before creating an Intent. - /// It's always required if you don't provide an elements instance containing a client secret. - @override - String? get clientSecret; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - ConfirmSetupParams get confirmParams; - - /// By default, stripe.confirmSetup will always redirect to your return_url - /// after a successful confirmation. If you set redirect: "if_required", - /// then stripe.confirmSetup will only redirect if your user chooses a - /// redirect-based payment method. - /// Note: Setting if_required requires that you handle successful confirmations - /// for redirect-based and non-redirect based payment methods separately. - /// When a non-redirect based payment method is successfully confirmed, - /// stripe.confirmSetup will resolve with a {setupIntent} object. - @override - SetupConfirmationRedirect? get redirect; - - /// Create a copy of ConfirmSetupOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmSetupOptionsImplCopyWith<_$ConfirmSetupOptionsImpl> get copyWith => - throw _privateConstructorUsedError; -} - -ConfirmSetupParams _$ConfirmSetupParamsFromJson(Map json) { - return _ConfirmSetupParams.fromJson(json); + +class _ConfirmSetupOptions implements ConfirmSetupOptions { + const _ConfirmSetupOptions({@ElementsConverter() required this.elements, this.clientSecret, required this.confirmParams, this.redirect}); + factory _ConfirmSetupOptions.fromJson(Map json) => _$ConfirmSetupOptionsFromJson(json); + +/// Required if you collect payment details before creating an Intent. It's always required if you don't provide a clientSecret. +@override@ElementsConverter() final Elements elements; +/// Required if you collect payment details before creating an Intent. +/// It's always required if you don't provide an elements instance containing a client secret. +@override final String? clientSecret; +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. +@override final ConfirmSetupParams confirmParams; +/// By default, stripe.confirmSetup will always redirect to your return_url +/// after a successful confirmation. If you set redirect: "if_required", +/// then stripe.confirmSetup will only redirect if your user chooses a +/// redirect-based payment method. +/// Note: Setting if_required requires that you handle successful confirmations +/// for redirect-based and non-redirect based payment methods separately. +/// When a non-redirect based payment method is successfully confirmed, +/// stripe.confirmSetup will resolve with a {setupIntent} object. +@override final SetupConfirmationRedirect? redirect; + +/// Create a copy of ConfirmSetupOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmSetupOptionsCopyWith<_ConfirmSetupOptions> get copyWith => __$ConfirmSetupOptionsCopyWithImpl<_ConfirmSetupOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmSetupOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmSetupOptions&&(identical(other.elements, elements) || other.elements == elements)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,elements,clientSecret,confirmParams,redirect); + +@override +String toString() { + return 'ConfirmSetupOptions(elements: $elements, clientSecret: $clientSecret, confirmParams: $confirmParams, redirect: $redirect)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmSetupOptionsCopyWith<$Res> implements $ConfirmSetupOptionsCopyWith<$Res> { + factory _$ConfirmSetupOptionsCopyWith(_ConfirmSetupOptions value, $Res Function(_ConfirmSetupOptions) _then) = __$ConfirmSetupOptionsCopyWithImpl; +@override @useResult +$Res call({ +@ElementsConverter() Elements elements, String? clientSecret, ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect +}); + + +@override $ConfirmSetupParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class __$ConfirmSetupOptionsCopyWithImpl<$Res> + implements _$ConfirmSetupOptionsCopyWith<$Res> { + __$ConfirmSetupOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmSetupOptions _self; + final $Res Function(_ConfirmSetupOptions) _then; + +/// Create a copy of ConfirmSetupOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? elements = null,Object? clientSecret = freezed,Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_ConfirmSetupOptions( +elements: null == elements ? _self.elements : elements // ignore: cast_nullable_to_non_nullable +as Elements,clientSecret: freezed == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String?,confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmSetupParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as SetupConfirmationRedirect?, + )); +} + +/// Create a copy of ConfirmSetupOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmSetupParamsCopyWith<$Res> get confirmParams { + + return $ConfirmSetupParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} } + /// @nodoc mixin _$ConfirmSetupParams { - /// The url your customer will be directed to after they complete authentication. - String get return_url => throw _privateConstructorUsedError; - /// If collected previously, the ID of the ConfirmationToken to use to confirm this SetupIntent. - /// This is mutually exclusive with the elements parameter. - String? get confirmation_token => throw _privateConstructorUsedError; +/// The url your customer will be directed to after they complete authentication. + String get return_url;/// If collected previously, the ID of the ConfirmationToken to use to confirm this SetupIntent. +/// This is mutually exclusive with the elements parameter. + String? get confirmation_token; +/// Create a copy of ConfirmSetupParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmSetupParamsCopyWith get copyWith => _$ConfirmSetupParamsCopyWithImpl(this as ConfirmSetupParams, _$identity); /// Serializes this ConfirmSetupParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ConfirmSetupParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmSetupParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmSetupParams&&(identical(other.return_url, return_url) || other.return_url == return_url)&&(identical(other.confirmation_token, confirmation_token) || other.confirmation_token == confirmation_token)); } -/// @nodoc -abstract class $ConfirmSetupParamsCopyWith<$Res> { - factory $ConfirmSetupParamsCopyWith( - ConfirmSetupParams value, $Res Function(ConfirmSetupParams) then) = - _$ConfirmSetupParamsCopyWithImpl<$Res, ConfirmSetupParams>; - @useResult - $Res call({String return_url, String? confirmation_token}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,return_url,confirmation_token); + +@override +String toString() { + return 'ConfirmSetupParams(return_url: $return_url, confirmation_token: $confirmation_token)'; } -/// @nodoc -class _$ConfirmSetupParamsCopyWithImpl<$Res, $Val extends ConfirmSetupParams> - implements $ConfirmSetupParamsCopyWith<$Res> { - _$ConfirmSetupParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmSetupParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? return_url = null, - Object? confirmation_token = freezed, - }) { - return _then(_value.copyWith( - return_url: null == return_url - ? _value.return_url - : return_url // ignore: cast_nullable_to_non_nullable - as String, - confirmation_token: freezed == confirmation_token - ? _value.confirmation_token - : confirmation_token // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ConfirmSetupParamsImplCopyWith<$Res> +abstract mixin class $ConfirmSetupParamsCopyWith<$Res> { + factory $ConfirmSetupParamsCopyWith(ConfirmSetupParams value, $Res Function(ConfirmSetupParams) _then) = _$ConfirmSetupParamsCopyWithImpl; +@useResult +$Res call({ + String return_url, String? confirmation_token +}); + + + + +} +/// @nodoc +class _$ConfirmSetupParamsCopyWithImpl<$Res> implements $ConfirmSetupParamsCopyWith<$Res> { - factory _$$ConfirmSetupParamsImplCopyWith(_$ConfirmSetupParamsImpl value, - $Res Function(_$ConfirmSetupParamsImpl) then) = - __$$ConfirmSetupParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String return_url, String? confirmation_token}); + _$ConfirmSetupParamsCopyWithImpl(this._self, this._then); + + final ConfirmSetupParams _self; + final $Res Function(ConfirmSetupParams) _then; + +/// Create a copy of ConfirmSetupParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? return_url = null,Object? confirmation_token = freezed,}) { + return _then(_self.copyWith( +return_url: null == return_url ? _self.return_url : return_url // ignore: cast_nullable_to_non_nullable +as String,confirmation_token: freezed == confirmation_token ? _self.confirmation_token : confirmation_token // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ConfirmSetupParams]. +extension ConfirmSetupParamsPatterns on ConfirmSetupParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmSetupParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmSetupParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmSetupParams value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmSetupParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmSetupParams value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmSetupParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String return_url, String? confirmation_token)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmSetupParams() when $default != null: +return $default(_that.return_url,_that.confirmation_token);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String return_url, String? confirmation_token) $default,) {final _that = this; +switch (_that) { +case _ConfirmSetupParams(): +return $default(_that.return_url,_that.confirmation_token);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String return_url, String? confirmation_token)? $default,) {final _that = this; +switch (_that) { +case _ConfirmSetupParams() when $default != null: +return $default(_that.return_url,_that.confirmation_token);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmSetupParamsImplCopyWithImpl<$Res> - extends _$ConfirmSetupParamsCopyWithImpl<$Res, _$ConfirmSetupParamsImpl> - implements _$$ConfirmSetupParamsImplCopyWith<$Res> { - __$$ConfirmSetupParamsImplCopyWithImpl(_$ConfirmSetupParamsImpl _value, - $Res Function(_$ConfirmSetupParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmSetupParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? return_url = null, - Object? confirmation_token = freezed, - }) { - return _then(_$ConfirmSetupParamsImpl( - return_url: null == return_url - ? _value.return_url - : return_url // ignore: cast_nullable_to_non_nullable - as String, - confirmation_token: freezed == confirmation_token - ? _value.confirmation_token - : confirmation_token // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmSetupParamsImpl implements _ConfirmSetupParams { - const _$ConfirmSetupParamsImpl( - {required this.return_url, this.confirmation_token}); - - factory _$ConfirmSetupParamsImpl.fromJson(Map json) => - _$$ConfirmSetupParamsImplFromJson(json); - - /// The url your customer will be directed to after they complete authentication. - @override - final String return_url; - - /// If collected previously, the ID of the ConfirmationToken to use to confirm this SetupIntent. - /// This is mutually exclusive with the elements parameter. - @override - final String? confirmation_token; - - @override - String toString() { - return 'ConfirmSetupParams(return_url: $return_url, confirmation_token: $confirmation_token)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmSetupParamsImpl && - (identical(other.return_url, return_url) || - other.return_url == return_url) && - (identical(other.confirmation_token, confirmation_token) || - other.confirmation_token == confirmation_token)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, return_url, confirmation_token); - - /// Create a copy of ConfirmSetupParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmSetupParamsImplCopyWith<_$ConfirmSetupParamsImpl> get copyWith => - __$$ConfirmSetupParamsImplCopyWithImpl<_$ConfirmSetupParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ConfirmSetupParamsImplToJson( - this, - ); - } -} - -abstract class _ConfirmSetupParams implements ConfirmSetupParams { - const factory _ConfirmSetupParams( - {required final String return_url, - final String? confirmation_token}) = _$ConfirmSetupParamsImpl; - - factory _ConfirmSetupParams.fromJson(Map json) = - _$ConfirmSetupParamsImpl.fromJson; - - /// The url your customer will be directed to after they complete authentication. - @override - String get return_url; - - /// If collected previously, the ID of the ConfirmationToken to use to confirm this SetupIntent. - /// This is mutually exclusive with the elements parameter. - @override - String? get confirmation_token; - - /// Create a copy of ConfirmSetupParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmSetupParamsImplCopyWith<_$ConfirmSetupParamsImpl> get copyWith => - throw _privateConstructorUsedError; + +class _ConfirmSetupParams implements ConfirmSetupParams { + const _ConfirmSetupParams({required this.return_url, this.confirmation_token}); + factory _ConfirmSetupParams.fromJson(Map json) => _$ConfirmSetupParamsFromJson(json); + +/// The url your customer will be directed to after they complete authentication. +@override final String return_url; +/// If collected previously, the ID of the ConfirmationToken to use to confirm this SetupIntent. +/// This is mutually exclusive with the elements parameter. +@override final String? confirmation_token; + +/// Create a copy of ConfirmSetupParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmSetupParamsCopyWith<_ConfirmSetupParams> get copyWith => __$ConfirmSetupParamsCopyWithImpl<_ConfirmSetupParams>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmSetupParamsToJson(this, ); } + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmSetupParams&&(identical(other.return_url, return_url) || other.return_url == return_url)&&(identical(other.confirmation_token, confirmation_token) || other.confirmation_token == confirmation_token)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,return_url,confirmation_token); + +@override +String toString() { + return 'ConfirmSetupParams(return_url: $return_url, confirmation_token: $confirmation_token)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmSetupParamsCopyWith<$Res> implements $ConfirmSetupParamsCopyWith<$Res> { + factory _$ConfirmSetupParamsCopyWith(_ConfirmSetupParams value, $Res Function(_ConfirmSetupParams) _then) = __$ConfirmSetupParamsCopyWithImpl; +@override @useResult +$Res call({ + String return_url, String? confirmation_token +}); + + + + +} +/// @nodoc +class __$ConfirmSetupParamsCopyWithImpl<$Res> + implements _$ConfirmSetupParamsCopyWith<$Res> { + __$ConfirmSetupParamsCopyWithImpl(this._self, this._then); + + final _ConfirmSetupParams _self; + final $Res Function(_ConfirmSetupParams) _then; + +/// Create a copy of ConfirmSetupParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? return_url = null,Object? confirmation_token = freezed,}) { + return _then(_ConfirmSetupParams( +return_url: null == return_url ? _self.return_url : return_url // ignore: cast_nullable_to_non_nullable +as String,confirmation_token: freezed == confirmation_token ? _self.confirmation_token : confirmation_token // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.g.dart b/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.g.dart index fde890904..78eb2a3cc 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.g.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/confirm_setup_options.g.dart @@ -6,57 +6,41 @@ part of 'confirm_setup_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmSetupOptionsImpl _$$ConfirmSetupOptionsImplFromJson(Map json) => - _$ConfirmSetupOptionsImpl( +_ConfirmSetupOptions _$ConfirmSetupOptionsFromJson(Map json) => + _ConfirmSetupOptions( elements: const ElementsConverter().fromJson(json['elements']), clientSecret: json['clientSecret'] as String?, confirmParams: ConfirmSetupParams.fromJson( - Map.from(json['confirmParams'] as Map)), + Map.from(json['confirmParams'] as Map), + ), redirect: $enumDecodeNullable( - _$SetupConfirmationRedirectEnumMap, json['redirect']), + _$SetupConfirmationRedirectEnumMap, + json['redirect'], + ), ); -Map _$$ConfirmSetupOptionsImplToJson( - _$ConfirmSetupOptionsImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('elements', const ElementsConverter().toJson(instance.elements)); - writeNotNull('clientSecret', instance.clientSecret); - val['confirmParams'] = instance.confirmParams.toJson(); - writeNotNull( - 'redirect', _$SetupConfirmationRedirectEnumMap[instance.redirect]); - return val; -} +Map _$ConfirmSetupOptionsToJson( + _ConfirmSetupOptions instance, +) => { + 'elements': ?const ElementsConverter().toJson(instance.elements), + 'clientSecret': ?instance.clientSecret, + 'confirmParams': instance.confirmParams.toJson(), + 'redirect': ?_$SetupConfirmationRedirectEnumMap[instance.redirect], +}; const _$SetupConfirmationRedirectEnumMap = { SetupConfirmationRedirect.always: 'always', SetupConfirmationRedirect.ifRequired: 'if_required', }; -_$ConfirmSetupParamsImpl _$$ConfirmSetupParamsImplFromJson(Map json) => - _$ConfirmSetupParamsImpl( +_ConfirmSetupParams _$ConfirmSetupParamsFromJson(Map json) => + _ConfirmSetupParams( return_url: json['return_url'] as String, confirmation_token: json['confirmation_token'] as String?, ); -Map _$$ConfirmSetupParamsImplToJson( - _$ConfirmSetupParamsImpl instance) { - final val = { - 'return_url': instance.return_url, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('confirmation_token', instance.confirmation_token); - return val; -} +Map _$ConfirmSetupParamsToJson(_ConfirmSetupParams instance) => + { + 'return_url': instance.return_url, + 'confirmation_token': ?instance.confirmation_token, + }; diff --git a/packages/stripe_js/lib/src/api/setup_intents/payment_intent.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/payment_intent.freezed.dart index 6032fc1c2..7abe331a2 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/payment_intent.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/payment_intent.freezed.dart @@ -12,7 +12,8 @@ part of 'payment_intent.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods', +); PaymentIntent _$PaymentIntentFromJson(Map json) { return _PaymentIntent.fromJson(json); @@ -175,8 +176,7 @@ mixin _$PaymentIntent { /// If receipt_email is specified for a payment in live mode, a receipt /// will be sent regardless of your email settings. @JsonKey(name: "receipt_email") - String? get receiptEmail => - throw _privateConstructorUsedError; // ID of the review associated with this PaymentIntent, if any. + String? get receiptEmail => throw _privateConstructorUsedError; // ID of the review associated with this PaymentIntent, if any. String? get review => throw _privateConstructorUsedError; /// Indicates that you intend to make future payments with this @@ -237,55 +237,57 @@ mixin _$PaymentIntent { /// @nodoc abstract class $PaymentIntentCopyWith<$Res> { factory $PaymentIntentCopyWith( - PaymentIntent value, $Res Function(PaymentIntent) then) = - _$PaymentIntentCopyWithImpl<$Res, PaymentIntent>; + PaymentIntent value, + $Res Function(PaymentIntent) then, + ) = _$PaymentIntentCopyWithImpl<$Res, PaymentIntent>; @useResult - $Res call( - {String id, - String object, - int amount, - @JsonKey(name: "amount_capturable") int? amountCapturable, - @JsonKey(name: "amount_received") int? amountReceived, - String? application, - @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") - PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, - @JsonKey(name: "canceled_at") int? canceledAt, - @JsonKey(name: "cancellation_reason") - PaymentIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") String clientSecret, - @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, - @JsonKey(name: "confirmation_method") - PaymentIntentConfirmationMethod confirmationMethod, - int? created, - String currency, - String? customer, - String? description, - String? invoice, - @JsonKey(name: "last_payment_error") Error? lastPaymentError, - @JsonKey(name: "latest_charge") String? latestCharge, - bool livemode, - Map metadata, - @JsonKey(name: "next_action") dynamic nextAction, - @JsonKey(name: "on_behalf_of") String? onBehalfOf, - @JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, - @JsonKey(name: "payment_method_types") List paymentMethodTypes, - dynamic processing, - @JsonKey(name: "receipt_email") String? receiptEmail, - String? review, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage, - ShippingDetails? shipping, - @JsonKey(name: "statement_descriptor") String? statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - String? statementDescriptorSuffix, - PaymentIntentsStatus status, - @JsonKey(name: "transfer_data") dynamic transferData, - @JsonKey(name: "transfer_group") dynamic transferGroup}); + $Res call({ + String id, + String object, + int amount, + @JsonKey(name: "amount_capturable") int? amountCapturable, + @JsonKey(name: "amount_received") int? amountReceived, + String? application, + @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, + @JsonKey(name: "automatic_payment_methods") + PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, + @JsonKey(name: "canceled_at") int? canceledAt, + @JsonKey(name: "cancellation_reason") + PaymentIntentCancellationReason? cancellationReason, + @JsonKey(name: "client_secret") String clientSecret, + @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, + @JsonKey(name: "confirmation_method") + PaymentIntentConfirmationMethod confirmationMethod, + int? created, + String currency, + String? customer, + String? description, + String? invoice, + @JsonKey(name: "last_payment_error") Error? lastPaymentError, + @JsonKey(name: "latest_charge") String? latestCharge, + bool livemode, + Map metadata, + @JsonKey(name: "next_action") dynamic nextAction, + @JsonKey(name: "on_behalf_of") String? onBehalfOf, + @JsonKey(name: "payment_method") String? paymentMethod, + @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, + @JsonKey(name: "payment_method_types") List paymentMethodTypes, + dynamic processing, + @JsonKey(name: "receipt_email") String? receiptEmail, + String? review, + @JsonKey(name: "setup_future_usage") + PaymentIntentSetupFutureUsage? setupFutureUsage, + ShippingDetails? shipping, + @JsonKey(name: "statement_descriptor") String? statementDescriptor, + @JsonKey(name: "statement_descriptor_suffix") + String? statementDescriptorSuffix, + PaymentIntentsStatus status, + @JsonKey(name: "transfer_data") dynamic transferData, + @JsonKey(name: "transfer_group") dynamic transferGroup, + }); $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? - get automaticPaymentMethods; + get automaticPaymentMethods; $ShippingDetailsCopyWith<$Res>? get shipping; } @@ -340,170 +342,175 @@ class _$PaymentIntentCopyWithImpl<$Res, $Val extends PaymentIntent> Object? transferData = null, Object? transferGroup = null, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - amountCapturable: freezed == amountCapturable - ? _value.amountCapturable - : amountCapturable // ignore: cast_nullable_to_non_nullable - as int?, - amountReceived: freezed == amountReceived - ? _value.amountReceived - : amountReceived // ignore: cast_nullable_to_non_nullable - as int?, - application: freezed == application - ? _value.application - : application // ignore: cast_nullable_to_non_nullable - as String?, - applicationFeeAmount: freezed == applicationFeeAmount - ? _value.applicationFeeAmount - : applicationFeeAmount // ignore: cast_nullable_to_non_nullable - as int?, - automaticPaymentMethods: freezed == automaticPaymentMethods - ? _value.automaticPaymentMethods - : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable - as PaymentIntentAutomaticPaymentMethods?, - canceledAt: freezed == canceledAt - ? _value.canceledAt - : canceledAt // ignore: cast_nullable_to_non_nullable - as int?, - cancellationReason: freezed == cancellationReason - ? _value.cancellationReason - : cancellationReason // ignore: cast_nullable_to_non_nullable - as PaymentIntentCancellationReason?, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - captureMethod: null == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentCaptureMethod, - confirmationMethod: null == confirmationMethod - ? _value.confirmationMethod - : confirmationMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentConfirmationMethod, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - invoice: freezed == invoice - ? _value.invoice - : invoice // ignore: cast_nullable_to_non_nullable - as String?, - lastPaymentError: null == lastPaymentError - ? _value.lastPaymentError - : lastPaymentError // ignore: cast_nullable_to_non_nullable - as dynamic, - latestCharge: freezed == latestCharge - ? _value.latestCharge - : latestCharge // ignore: cast_nullable_to_non_nullable - as String?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - nextAction: null == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as dynamic, - onBehalfOf: freezed == onBehalfOf - ? _value.onBehalfOf - : onBehalfOf // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethodOptions: null == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as dynamic, - paymentMethodTypes: null == paymentMethodTypes - ? _value.paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - processing: null == processing - ? _value.processing - : processing // ignore: cast_nullable_to_non_nullable - as dynamic, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - review: freezed == review - ? _value.review - : review // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - statementDescriptor: freezed == statementDescriptor - ? _value.statementDescriptor - : statementDescriptor // ignore: cast_nullable_to_non_nullable - as String?, - statementDescriptorSuffix: freezed == statementDescriptorSuffix - ? _value.statementDescriptorSuffix - : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as PaymentIntentsStatus, - transferData: null == transferData - ? _value.transferData - : transferData // ignore: cast_nullable_to_non_nullable - as dynamic, - transferGroup: null == transferGroup - ? _value.transferGroup - : transferGroup // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + object: null == object + ? _value.object + : object // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + amountCapturable: freezed == amountCapturable + ? _value.amountCapturable + : amountCapturable // ignore: cast_nullable_to_non_nullable + as int?, + amountReceived: freezed == amountReceived + ? _value.amountReceived + : amountReceived // ignore: cast_nullable_to_non_nullable + as int?, + application: freezed == application + ? _value.application + : application // ignore: cast_nullable_to_non_nullable + as String?, + applicationFeeAmount: freezed == applicationFeeAmount + ? _value.applicationFeeAmount + : applicationFeeAmount // ignore: cast_nullable_to_non_nullable + as int?, + automaticPaymentMethods: freezed == automaticPaymentMethods + ? _value.automaticPaymentMethods + : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable + as PaymentIntentAutomaticPaymentMethods?, + canceledAt: freezed == canceledAt + ? _value.canceledAt + : canceledAt // ignore: cast_nullable_to_non_nullable + as int?, + cancellationReason: freezed == cancellationReason + ? _value.cancellationReason + : cancellationReason // ignore: cast_nullable_to_non_nullable + as PaymentIntentCancellationReason?, + clientSecret: null == clientSecret + ? _value.clientSecret + : clientSecret // ignore: cast_nullable_to_non_nullable + as String, + captureMethod: null == captureMethod + ? _value.captureMethod + : captureMethod // ignore: cast_nullable_to_non_nullable + as PaymentIntentCaptureMethod, + confirmationMethod: null == confirmationMethod + ? _value.confirmationMethod + : confirmationMethod // ignore: cast_nullable_to_non_nullable + as PaymentIntentConfirmationMethod, + created: freezed == created + ? _value.created + : created // ignore: cast_nullable_to_non_nullable + as int?, + currency: null == currency + ? _value.currency + : currency // ignore: cast_nullable_to_non_nullable + as String, + customer: freezed == customer + ? _value.customer + : customer // ignore: cast_nullable_to_non_nullable + as String?, + description: freezed == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String?, + invoice: freezed == invoice + ? _value.invoice + : invoice // ignore: cast_nullable_to_non_nullable + as String?, + lastPaymentError: null == lastPaymentError + ? _value.lastPaymentError + : lastPaymentError // ignore: cast_nullable_to_non_nullable + as dynamic, + latestCharge: freezed == latestCharge + ? _value.latestCharge + : latestCharge // ignore: cast_nullable_to_non_nullable + as String?, + livemode: null == livemode + ? _value.livemode + : livemode // ignore: cast_nullable_to_non_nullable + as bool, + metadata: null == metadata + ? _value.metadata + : metadata // ignore: cast_nullable_to_non_nullable + as Map, + nextAction: null == nextAction + ? _value.nextAction + : nextAction // ignore: cast_nullable_to_non_nullable + as dynamic, + onBehalfOf: freezed == onBehalfOf + ? _value.onBehalfOf + : onBehalfOf // ignore: cast_nullable_to_non_nullable + as String?, + paymentMethod: freezed == paymentMethod + ? _value.paymentMethod + : paymentMethod // ignore: cast_nullable_to_non_nullable + as String?, + paymentMethodOptions: null == paymentMethodOptions + ? _value.paymentMethodOptions + : paymentMethodOptions // ignore: cast_nullable_to_non_nullable + as dynamic, + paymentMethodTypes: null == paymentMethodTypes + ? _value.paymentMethodTypes + : paymentMethodTypes // ignore: cast_nullable_to_non_nullable + as List, + processing: null == processing + ? _value.processing + : processing // ignore: cast_nullable_to_non_nullable + as dynamic, + receiptEmail: freezed == receiptEmail + ? _value.receiptEmail + : receiptEmail // ignore: cast_nullable_to_non_nullable + as String?, + review: freezed == review + ? _value.review + : review // ignore: cast_nullable_to_non_nullable + as String?, + setupFutureUsage: freezed == setupFutureUsage + ? _value.setupFutureUsage + : setupFutureUsage // ignore: cast_nullable_to_non_nullable + as PaymentIntentSetupFutureUsage?, + shipping: freezed == shipping + ? _value.shipping + : shipping // ignore: cast_nullable_to_non_nullable + as ShippingDetails?, + statementDescriptor: freezed == statementDescriptor + ? _value.statementDescriptor + : statementDescriptor // ignore: cast_nullable_to_non_nullable + as String?, + statementDescriptorSuffix: freezed == statementDescriptorSuffix + ? _value.statementDescriptorSuffix + : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable + as String?, + status: null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as PaymentIntentsStatus, + transferData: null == transferData + ? _value.transferData + : transferData // ignore: cast_nullable_to_non_nullable + as dynamic, + transferGroup: null == transferGroup + ? _value.transferGroup + : transferGroup // ignore: cast_nullable_to_non_nullable + as dynamic, + ) + as $Val, + ); } @override @pragma('vm:prefer-inline') $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? - get automaticPaymentMethods { + get automaticPaymentMethods { if (_value.automaticPaymentMethods == null) { return null; } return $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>( - _value.automaticPaymentMethods!, (value) { - return _then(_value.copyWith(automaticPaymentMethods: value) as $Val); - }); + _value.automaticPaymentMethods!, + (value) { + return _then(_value.copyWith(automaticPaymentMethods: value) as $Val); + }, + ); } @override @@ -523,57 +530,59 @@ class _$PaymentIntentCopyWithImpl<$Res, $Val extends PaymentIntent> abstract class _$$_PaymentIntentCopyWith<$Res> implements $PaymentIntentCopyWith<$Res> { factory _$$_PaymentIntentCopyWith( - _$_PaymentIntent value, $Res Function(_$_PaymentIntent) then) = - __$$_PaymentIntentCopyWithImpl<$Res>; + _$_PaymentIntent value, + $Res Function(_$_PaymentIntent) then, + ) = __$$_PaymentIntentCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - String object, - int amount, - @JsonKey(name: "amount_capturable") int? amountCapturable, - @JsonKey(name: "amount_received") int? amountReceived, - String? application, - @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") - PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, - @JsonKey(name: "canceled_at") int? canceledAt, - @JsonKey(name: "cancellation_reason") - PaymentIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") String clientSecret, - @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, - @JsonKey(name: "confirmation_method") - PaymentIntentConfirmationMethod confirmationMethod, - int? created, - String currency, - String? customer, - String? description, - String? invoice, - @JsonKey(name: "last_payment_error") Error? lastPaymentError, - @JsonKey(name: "latest_charge") String? latestCharge, - bool livemode, - Map metadata, - @JsonKey(name: "next_action") dynamic nextAction, - @JsonKey(name: "on_behalf_of") String? onBehalfOf, - @JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, - @JsonKey(name: "payment_method_types") List paymentMethodTypes, - dynamic processing, - @JsonKey(name: "receipt_email") String? receiptEmail, - String? review, - @JsonKey(name: "setup_future_usage") - PaymentIntentSetupFutureUsage? setupFutureUsage, - ShippingDetails? shipping, - @JsonKey(name: "statement_descriptor") String? statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - String? statementDescriptorSuffix, - PaymentIntentsStatus status, - @JsonKey(name: "transfer_data") dynamic transferData, - @JsonKey(name: "transfer_group") dynamic transferGroup}); + $Res call({ + String id, + String object, + int amount, + @JsonKey(name: "amount_capturable") int? amountCapturable, + @JsonKey(name: "amount_received") int? amountReceived, + String? application, + @JsonKey(name: "application_fee_amount") int? applicationFeeAmount, + @JsonKey(name: "automatic_payment_methods") + PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, + @JsonKey(name: "canceled_at") int? canceledAt, + @JsonKey(name: "cancellation_reason") + PaymentIntentCancellationReason? cancellationReason, + @JsonKey(name: "client_secret") String clientSecret, + @JsonKey(name: "capture_method") PaymentIntentCaptureMethod captureMethod, + @JsonKey(name: "confirmation_method") + PaymentIntentConfirmationMethod confirmationMethod, + int? created, + String currency, + String? customer, + String? description, + String? invoice, + @JsonKey(name: "last_payment_error") Error? lastPaymentError, + @JsonKey(name: "latest_charge") String? latestCharge, + bool livemode, + Map metadata, + @JsonKey(name: "next_action") dynamic nextAction, + @JsonKey(name: "on_behalf_of") String? onBehalfOf, + @JsonKey(name: "payment_method") String? paymentMethod, + @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, + @JsonKey(name: "payment_method_types") List paymentMethodTypes, + dynamic processing, + @JsonKey(name: "receipt_email") String? receiptEmail, + String? review, + @JsonKey(name: "setup_future_usage") + PaymentIntentSetupFutureUsage? setupFutureUsage, + ShippingDetails? shipping, + @JsonKey(name: "statement_descriptor") String? statementDescriptor, + @JsonKey(name: "statement_descriptor_suffix") + String? statementDescriptorSuffix, + PaymentIntentsStatus status, + @JsonKey(name: "transfer_data") dynamic transferData, + @JsonKey(name: "transfer_group") dynamic transferGroup, + }); @override $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res>? - get automaticPaymentMethods; + get automaticPaymentMethods; @override $ShippingDetailsCopyWith<$Res>? get shipping; } @@ -583,8 +592,9 @@ class __$$_PaymentIntentCopyWithImpl<$Res> extends _$PaymentIntentCopyWithImpl<$Res, _$_PaymentIntent> implements _$$_PaymentIntentCopyWith<$Res> { __$$_PaymentIntentCopyWithImpl( - _$_PaymentIntent _value, $Res Function(_$_PaymentIntent) _then) - : super(_value, _then); + _$_PaymentIntent _value, + $Res Function(_$_PaymentIntent) _then, + ) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -627,206 +637,208 @@ class __$$_PaymentIntentCopyWithImpl<$Res> Object? transferData = null, Object? transferGroup = null, }) { - return _then(_$_PaymentIntent( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - amountCapturable: freezed == amountCapturable - ? _value.amountCapturable - : amountCapturable // ignore: cast_nullable_to_non_nullable - as int?, - amountReceived: freezed == amountReceived - ? _value.amountReceived - : amountReceived // ignore: cast_nullable_to_non_nullable - as int?, - application: freezed == application - ? _value.application - : application // ignore: cast_nullable_to_non_nullable - as String?, - applicationFeeAmount: freezed == applicationFeeAmount - ? _value.applicationFeeAmount - : applicationFeeAmount // ignore: cast_nullable_to_non_nullable - as int?, - automaticPaymentMethods: freezed == automaticPaymentMethods - ? _value.automaticPaymentMethods - : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable - as PaymentIntentAutomaticPaymentMethods?, - canceledAt: freezed == canceledAt - ? _value.canceledAt - : canceledAt // ignore: cast_nullable_to_non_nullable - as int?, - cancellationReason: freezed == cancellationReason - ? _value.cancellationReason - : cancellationReason // ignore: cast_nullable_to_non_nullable - as PaymentIntentCancellationReason?, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - captureMethod: null == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentCaptureMethod, - confirmationMethod: null == confirmationMethod - ? _value.confirmationMethod - : confirmationMethod // ignore: cast_nullable_to_non_nullable - as PaymentIntentConfirmationMethod, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - invoice: freezed == invoice - ? _value.invoice - : invoice // ignore: cast_nullable_to_non_nullable - as String?, - lastPaymentError: null == lastPaymentError - ? _value.lastPaymentError - : lastPaymentError // ignore: cast_nullable_to_non_nullable - as dynamic, - latestCharge: freezed == latestCharge - ? _value.latestCharge - : latestCharge // ignore: cast_nullable_to_non_nullable - as String?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - metadata: null == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - nextAction: null == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as dynamic, - onBehalfOf: freezed == onBehalfOf - ? _value.onBehalfOf - : onBehalfOf // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethodOptions: null == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as dynamic, - paymentMethodTypes: null == paymentMethodTypes - ? _value._paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - processing: null == processing - ? _value.processing - : processing // ignore: cast_nullable_to_non_nullable - as dynamic, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - review: freezed == review - ? _value.review - : review // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentSetupFutureUsage?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - statementDescriptor: freezed == statementDescriptor - ? _value.statementDescriptor - : statementDescriptor // ignore: cast_nullable_to_non_nullable - as String?, - statementDescriptorSuffix: freezed == statementDescriptorSuffix - ? _value.statementDescriptorSuffix - : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as PaymentIntentsStatus, - transferData: null == transferData - ? _value.transferData - : transferData // ignore: cast_nullable_to_non_nullable - as dynamic, - transferGroup: null == transferGroup - ? _value.transferGroup - : transferGroup // ignore: cast_nullable_to_non_nullable - as dynamic, - )); + return _then( + _$_PaymentIntent( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + object: null == object + ? _value.object + : object // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + amountCapturable: freezed == amountCapturable + ? _value.amountCapturable + : amountCapturable // ignore: cast_nullable_to_non_nullable + as int?, + amountReceived: freezed == amountReceived + ? _value.amountReceived + : amountReceived // ignore: cast_nullable_to_non_nullable + as int?, + application: freezed == application + ? _value.application + : application // ignore: cast_nullable_to_non_nullable + as String?, + applicationFeeAmount: freezed == applicationFeeAmount + ? _value.applicationFeeAmount + : applicationFeeAmount // ignore: cast_nullable_to_non_nullable + as int?, + automaticPaymentMethods: freezed == automaticPaymentMethods + ? _value.automaticPaymentMethods + : automaticPaymentMethods // ignore: cast_nullable_to_non_nullable + as PaymentIntentAutomaticPaymentMethods?, + canceledAt: freezed == canceledAt + ? _value.canceledAt + : canceledAt // ignore: cast_nullable_to_non_nullable + as int?, + cancellationReason: freezed == cancellationReason + ? _value.cancellationReason + : cancellationReason // ignore: cast_nullable_to_non_nullable + as PaymentIntentCancellationReason?, + clientSecret: null == clientSecret + ? _value.clientSecret + : clientSecret // ignore: cast_nullable_to_non_nullable + as String, + captureMethod: null == captureMethod + ? _value.captureMethod + : captureMethod // ignore: cast_nullable_to_non_nullable + as PaymentIntentCaptureMethod, + confirmationMethod: null == confirmationMethod + ? _value.confirmationMethod + : confirmationMethod // ignore: cast_nullable_to_non_nullable + as PaymentIntentConfirmationMethod, + created: freezed == created + ? _value.created + : created // ignore: cast_nullable_to_non_nullable + as int?, + currency: null == currency + ? _value.currency + : currency // ignore: cast_nullable_to_non_nullable + as String, + customer: freezed == customer + ? _value.customer + : customer // ignore: cast_nullable_to_non_nullable + as String?, + description: freezed == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String?, + invoice: freezed == invoice + ? _value.invoice + : invoice // ignore: cast_nullable_to_non_nullable + as String?, + lastPaymentError: null == lastPaymentError + ? _value.lastPaymentError + : lastPaymentError // ignore: cast_nullable_to_non_nullable + as dynamic, + latestCharge: freezed == latestCharge + ? _value.latestCharge + : latestCharge // ignore: cast_nullable_to_non_nullable + as String?, + livemode: null == livemode + ? _value.livemode + : livemode // ignore: cast_nullable_to_non_nullable + as bool, + metadata: null == metadata + ? _value._metadata + : metadata // ignore: cast_nullable_to_non_nullable + as Map, + nextAction: null == nextAction + ? _value.nextAction + : nextAction // ignore: cast_nullable_to_non_nullable + as dynamic, + onBehalfOf: freezed == onBehalfOf + ? _value.onBehalfOf + : onBehalfOf // ignore: cast_nullable_to_non_nullable + as String?, + paymentMethod: freezed == paymentMethod + ? _value.paymentMethod + : paymentMethod // ignore: cast_nullable_to_non_nullable + as String?, + paymentMethodOptions: null == paymentMethodOptions + ? _value.paymentMethodOptions + : paymentMethodOptions // ignore: cast_nullable_to_non_nullable + as dynamic, + paymentMethodTypes: null == paymentMethodTypes + ? _value._paymentMethodTypes + : paymentMethodTypes // ignore: cast_nullable_to_non_nullable + as List, + processing: null == processing + ? _value.processing + : processing // ignore: cast_nullable_to_non_nullable + as dynamic, + receiptEmail: freezed == receiptEmail + ? _value.receiptEmail + : receiptEmail // ignore: cast_nullable_to_non_nullable + as String?, + review: freezed == review + ? _value.review + : review // ignore: cast_nullable_to_non_nullable + as String?, + setupFutureUsage: freezed == setupFutureUsage + ? _value.setupFutureUsage + : setupFutureUsage // ignore: cast_nullable_to_non_nullable + as PaymentIntentSetupFutureUsage?, + shipping: freezed == shipping + ? _value.shipping + : shipping // ignore: cast_nullable_to_non_nullable + as ShippingDetails?, + statementDescriptor: freezed == statementDescriptor + ? _value.statementDescriptor + : statementDescriptor // ignore: cast_nullable_to_non_nullable + as String?, + statementDescriptorSuffix: freezed == statementDescriptorSuffix + ? _value.statementDescriptorSuffix + : statementDescriptorSuffix // ignore: cast_nullable_to_non_nullable + as String?, + status: null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as PaymentIntentsStatus, + transferData: null == transferData + ? _value.transferData + : transferData // ignore: cast_nullable_to_non_nullable + as dynamic, + transferGroup: null == transferGroup + ? _value.transferGroup + : transferGroup // ignore: cast_nullable_to_non_nullable + as dynamic, + ), + ); } } /// @nodoc @JsonSerializable() class _$_PaymentIntent implements _PaymentIntent { - const _$_PaymentIntent( - {required this.id, - required this.object, - required this.amount, - @JsonKey(name: "amount_capturable") this.amountCapturable, - @JsonKey(name: "amount_received") this.amountReceived, - this.application, - @JsonKey(name: "application_fee_amount") this.applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") this.automaticPaymentMethods, - @JsonKey(name: "canceled_at") this.canceledAt, - @JsonKey(name: "cancellation_reason") this.cancellationReason, - @JsonKey(name: "client_secret") required this.clientSecret, - @JsonKey(name: "capture_method") - this.captureMethod = PaymentIntentCaptureMethod.automatic, - @JsonKey(name: "confirmation_method") - this.confirmationMethod = PaymentIntentConfirmationMethod.automatic, - this.created, - required this.currency, - this.customer, - this.description, - this.invoice, - @JsonKey(name: "last_payment_error") this.lastPaymentError, - @JsonKey(name: "latest_charge") this.latestCharge, - required this.livemode, - final Map metadata = const {}, - @JsonKey(name: "next_action") this.nextAction, - @JsonKey(name: "on_behalf_of") this.onBehalfOf, - @JsonKey(name: "payment_method") this.paymentMethod, - @JsonKey(name: "payment_method_options") this.paymentMethodOptions, - @JsonKey(name: "payment_method_types") - final List paymentMethodTypes = const [], - this.processing, - @JsonKey(name: "receipt_email") this.receiptEmail, - this.review, - @JsonKey(name: "setup_future_usage") this.setupFutureUsage, - this.shipping, - @JsonKey(name: "statement_descriptor") this.statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - this.statementDescriptorSuffix, - required this.status, - @JsonKey(name: "transfer_data") this.transferData, - @JsonKey(name: "transfer_group") this.transferGroup}) - : _metadata = metadata, - _paymentMethodTypes = paymentMethodTypes; + const _$_PaymentIntent({ + required this.id, + required this.object, + required this.amount, + @JsonKey(name: "amount_capturable") this.amountCapturable, + @JsonKey(name: "amount_received") this.amountReceived, + this.application, + @JsonKey(name: "application_fee_amount") this.applicationFeeAmount, + @JsonKey(name: "automatic_payment_methods") this.automaticPaymentMethods, + @JsonKey(name: "canceled_at") this.canceledAt, + @JsonKey(name: "cancellation_reason") this.cancellationReason, + @JsonKey(name: "client_secret") required this.clientSecret, + @JsonKey(name: "capture_method") + this.captureMethod = PaymentIntentCaptureMethod.automatic, + @JsonKey(name: "confirmation_method") + this.confirmationMethod = PaymentIntentConfirmationMethod.automatic, + this.created, + required this.currency, + this.customer, + this.description, + this.invoice, + @JsonKey(name: "last_payment_error") this.lastPaymentError, + @JsonKey(name: "latest_charge") this.latestCharge, + required this.livemode, + final Map metadata = const {}, + @JsonKey(name: "next_action") this.nextAction, + @JsonKey(name: "on_behalf_of") this.onBehalfOf, + @JsonKey(name: "payment_method") this.paymentMethod, + @JsonKey(name: "payment_method_options") this.paymentMethodOptions, + @JsonKey(name: "payment_method_types") + final List paymentMethodTypes = const [], + this.processing, + @JsonKey(name: "receipt_email") this.receiptEmail, + this.review, + @JsonKey(name: "setup_future_usage") this.setupFutureUsage, + this.shipping, + @JsonKey(name: "statement_descriptor") this.statementDescriptor, + @JsonKey(name: "statement_descriptor_suffix") + this.statementDescriptorSuffix, + required this.status, + @JsonKey(name: "transfer_data") this.transferData, + @JsonKey(name: "transfer_group") this.transferGroup, + }) : _metadata = metadata, + _paymentMethodTypes = paymentMethodTypes; factory _$_PaymentIntent.fromJson(Map json) => _$$_PaymentIntentFromJson(json); @@ -1028,7 +1040,7 @@ class _$_PaymentIntent implements _PaymentIntent { @override @JsonKey(name: "receipt_email") final String? receiptEmail; -// ID of the review associated with this PaymentIntent, if any. + // ID of the review associated with this PaymentIntent, if any. @override final String? review; @@ -1108,7 +1120,10 @@ class _$_PaymentIntent implements _PaymentIntent { other.application == application) && (identical(other.applicationFeeAmount, applicationFeeAmount) || other.applicationFeeAmount == applicationFeeAmount) && - (identical(other.automaticPaymentMethods, automaticPaymentMethods) || + (identical( + other.automaticPaymentMethods, + automaticPaymentMethods, + ) || other.automaticPaymentMethods == automaticPaymentMethods) && (identical(other.canceledAt, canceledAt) || other.canceledAt == canceledAt) && @@ -1128,25 +1143,35 @@ class _$_PaymentIntent implements _PaymentIntent { (identical(other.description, description) || other.description == description) && (identical(other.invoice, invoice) || other.invoice == invoice) && - const DeepCollectionEquality() - .equals(other.lastPaymentError, lastPaymentError) && + const DeepCollectionEquality().equals( + other.lastPaymentError, + lastPaymentError, + ) && (identical(other.latestCharge, latestCharge) || other.latestCharge == latestCharge) && (identical(other.livemode, livemode) || other.livemode == livemode) && const DeepCollectionEquality().equals(other._metadata, _metadata) && - const DeepCollectionEquality() - .equals(other.nextAction, nextAction) && + const DeepCollectionEquality().equals( + other.nextAction, + nextAction, + ) && (identical(other.onBehalfOf, onBehalfOf) || other.onBehalfOf == onBehalfOf) && (identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod) && - const DeepCollectionEquality() - .equals(other.paymentMethodOptions, paymentMethodOptions) && - const DeepCollectionEquality() - .equals(other._paymentMethodTypes, _paymentMethodTypes) && - const DeepCollectionEquality() - .equals(other.processing, processing) && + const DeepCollectionEquality().equals( + other.paymentMethodOptions, + paymentMethodOptions, + ) && + const DeepCollectionEquality().equals( + other._paymentMethodTypes, + _paymentMethodTypes, + ) && + const DeepCollectionEquality().equals( + other.processing, + processing, + ) && (identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail) && (identical(other.review, review) || other.review == review) && @@ -1156,58 +1181,64 @@ class _$_PaymentIntent implements _PaymentIntent { other.shipping == shipping) && (identical(other.statementDescriptor, statementDescriptor) || other.statementDescriptor == statementDescriptor) && - (identical(other.statementDescriptorSuffix, - statementDescriptorSuffix) || + (identical( + other.statementDescriptorSuffix, + statementDescriptorSuffix, + ) || other.statementDescriptorSuffix == statementDescriptorSuffix) && (identical(other.status, status) || other.status == status) && - const DeepCollectionEquality() - .equals(other.transferData, transferData) && - const DeepCollectionEquality() - .equals(other.transferGroup, transferGroup)); + const DeepCollectionEquality().equals( + other.transferData, + transferData, + ) && + const DeepCollectionEquality().equals( + other.transferGroup, + transferGroup, + )); } @JsonKey(ignore: true) @override int get hashCode => Object.hashAll([ - runtimeType, - id, - object, - amount, - amountCapturable, - amountReceived, - application, - applicationFeeAmount, - automaticPaymentMethods, - canceledAt, - cancellationReason, - clientSecret, - captureMethod, - confirmationMethod, - created, - currency, - customer, - description, - invoice, - const DeepCollectionEquality().hash(lastPaymentError), - latestCharge, - livemode, - const DeepCollectionEquality().hash(_metadata), - const DeepCollectionEquality().hash(nextAction), - onBehalfOf, - paymentMethod, - const DeepCollectionEquality().hash(paymentMethodOptions), - const DeepCollectionEquality().hash(_paymentMethodTypes), - const DeepCollectionEquality().hash(processing), - receiptEmail, - review, - setupFutureUsage, - shipping, - statementDescriptor, - statementDescriptorSuffix, - status, - const DeepCollectionEquality().hash(transferData), - const DeepCollectionEquality().hash(transferGroup) - ]); + runtimeType, + id, + object, + amount, + amountCapturable, + amountReceived, + application, + applicationFeeAmount, + automaticPaymentMethods, + canceledAt, + cancellationReason, + clientSecret, + captureMethod, + confirmationMethod, + created, + currency, + customer, + description, + invoice, + const DeepCollectionEquality().hash(lastPaymentError), + latestCharge, + livemode, + const DeepCollectionEquality().hash(_metadata), + const DeepCollectionEquality().hash(nextAction), + onBehalfOf, + paymentMethod, + const DeepCollectionEquality().hash(paymentMethodOptions), + const DeepCollectionEquality().hash(_paymentMethodTypes), + const DeepCollectionEquality().hash(processing), + receiptEmail, + review, + setupFutureUsage, + shipping, + statementDescriptor, + statementDescriptorSuffix, + status, + const DeepCollectionEquality().hash(transferData), + const DeepCollectionEquality().hash(transferGroup), + ]); @JsonKey(ignore: true) @override @@ -1217,76 +1248,70 @@ class _$_PaymentIntent implements _PaymentIntent { @override Map toJson() { - return _$$_PaymentIntentToJson( - this, - ); + return _$$_PaymentIntentToJson(this); } } abstract class _PaymentIntent implements PaymentIntent { - const factory _PaymentIntent( - {required final String id, - required final String object, - required final int amount, - @JsonKey(name: "amount_capturable") final int? amountCapturable, - @JsonKey(name: "amount_received") final int? amountReceived, - final String? application, - @JsonKey(name: "application_fee_amount") final int? applicationFeeAmount, - @JsonKey(name: "automatic_payment_methods") - final PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, - @JsonKey(name: "canceled_at") final int? canceledAt, - @JsonKey(name: "cancellation_reason") - final PaymentIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") required final String clientSecret, - @JsonKey(name: "capture_method") - final PaymentIntentCaptureMethod captureMethod, - @JsonKey(name: "confirmation_method") - final PaymentIntentConfirmationMethod confirmationMethod, - final int? created, - required final String currency, - final String? customer, - final String? description, - final String? invoice, - @JsonKey(name: "last_payment_error") final dynamic lastPaymentError, - @JsonKey(name: "latest_charge") final String? latestCharge, - required final bool livemode, - final Map metadata, - @JsonKey(name: "next_action") final dynamic nextAction, - @JsonKey(name: "on_behalf_of") final String? onBehalfOf, - @JsonKey(name: "payment_method") final String? paymentMethod, - @JsonKey(name: "payment_method_options") - final dynamic paymentMethodOptions, - @JsonKey(name: "payment_method_types") - final List paymentMethodTypes, - final dynamic processing, - @JsonKey(name: "receipt_email") final String? receiptEmail, - final String? review, - @JsonKey(name: "setup_future_usage") - final PaymentIntentSetupFutureUsage? setupFutureUsage, - final ShippingDetails? shipping, - @JsonKey(name: "statement_descriptor") final String? statementDescriptor, - @JsonKey(name: "statement_descriptor_suffix") - final String? statementDescriptorSuffix, - required final PaymentIntentsStatus status, - @JsonKey(name: "transfer_data") final dynamic transferData, - @JsonKey(name: "transfer_group") - final dynamic transferGroup}) = _$_PaymentIntent; + const factory _PaymentIntent({ + required final String id, + required final String object, + required final int amount, + @JsonKey(name: "amount_capturable") final int? amountCapturable, + @JsonKey(name: "amount_received") final int? amountReceived, + final String? application, + @JsonKey(name: "application_fee_amount") final int? applicationFeeAmount, + @JsonKey(name: "automatic_payment_methods") + final PaymentIntentAutomaticPaymentMethods? automaticPaymentMethods, + @JsonKey(name: "canceled_at") final int? canceledAt, + @JsonKey(name: "cancellation_reason") + final PaymentIntentCancellationReason? cancellationReason, + @JsonKey(name: "client_secret") required final String clientSecret, + @JsonKey(name: "capture_method") + final PaymentIntentCaptureMethod captureMethod, + @JsonKey(name: "confirmation_method") + final PaymentIntentConfirmationMethod confirmationMethod, + final int? created, + required final String currency, + final String? customer, + final String? description, + final String? invoice, + @JsonKey(name: "last_payment_error") final dynamic lastPaymentError, + @JsonKey(name: "latest_charge") final String? latestCharge, + required final bool livemode, + final Map metadata, + @JsonKey(name: "next_action") final dynamic nextAction, + @JsonKey(name: "on_behalf_of") final String? onBehalfOf, + @JsonKey(name: "payment_method") final String? paymentMethod, + @JsonKey(name: "payment_method_options") final dynamic paymentMethodOptions, + @JsonKey(name: "payment_method_types") + final List paymentMethodTypes, + final dynamic processing, + @JsonKey(name: "receipt_email") final String? receiptEmail, + final String? review, + @JsonKey(name: "setup_future_usage") + final PaymentIntentSetupFutureUsage? setupFutureUsage, + final ShippingDetails? shipping, + @JsonKey(name: "statement_descriptor") final String? statementDescriptor, + @JsonKey(name: "statement_descriptor_suffix") + final String? statementDescriptorSuffix, + required final PaymentIntentsStatus status, + @JsonKey(name: "transfer_data") final dynamic transferData, + @JsonKey(name: "transfer_group") final dynamic transferGroup, + }) = _$_PaymentIntent; factory _PaymentIntent.fromJson(Map json) = _$_PaymentIntent.fromJson; @override - /// Unique identifier for the object. String get id; @override - /// String representing the object’s type. /// Objects of the same type share the same value. /// Value is "payment_intent". String get object; @override - /// Amount intended to be collected by this PaymentIntent. /// A positive integer representing how much to charge in the /// smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to @@ -1296,22 +1321,18 @@ abstract class _PaymentIntent implements PaymentIntent { /// (e.g., a value of 99999999 for a USD charge of $999,999.99). int get amount; @override - /// The amount that can be captured with from this PaymentIntent (in cents). @JsonKey(name: "amount_capturable") int? get amountCapturable; @override - /// The amount that was collected from this PaymentIntent (in cents). @JsonKey(name: "amount_received") int? get amountReceived; @override - /// CONNECT ONLY /// ID of the Connect application that created the PaymentIntent. String? get application; @override - /// CONNECT ONLY /// The amount of the application fee (if any) that will be requested to /// be applied to the payment and transferred to the application owner’s @@ -1322,19 +1343,16 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "application_fee_amount") int? get applicationFeeAmount; @override - /// Settings to configure compatible payment methods from the /// Stripe Dashboard @JsonKey(name: "automatic_payment_methods") PaymentIntentAutomaticPaymentMethods? get automaticPaymentMethods; @override - /// Populated when status is canceled, this is the time at which the /// PaymentIntent was canceled. Measured in seconds since the Unix epoch. @JsonKey(name: "canceled_at") int? get canceledAt; @override - /// Reason for cancellation of this PaymentIntent, /// either user-provided /// (duplicate, fraudulent, requested_by_customer, or abandoned) or @@ -1343,7 +1361,6 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "cancellation_reason") PaymentIntentCancellationReason? get cancellationReason; @override - /// The client secret of this PaymentIntent. Used for client-side retrieval /// using a publishable key. /// The client secret can be used to complete a payment from your frontend. @@ -1356,7 +1373,6 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "client_secret") String get clientSecret; @override - /// Controls when the funds will be captured from the customer’s account. @JsonKey(name: "capture_method") PaymentIntentCaptureMethod get captureMethod; @@ -1364,17 +1380,14 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "confirmation_method") PaymentIntentConfirmationMethod get confirmationMethod; @override - /// Time at which the object was created. Measured in seconds since the /// Unix epoch. int? get created; @override - /// Three-letter ISO currency code, in lowercase. Must be a supported /// currency. String get currency; @override - /// ID of the Customer this PaymentIntent belongs to, if one exists. /// Payment methods attached to other Customers cannot be used with this /// PaymentIntent. @@ -1385,45 +1398,37 @@ abstract class _PaymentIntent implements PaymentIntent { /// required actions from the user are complete. String? get customer; @override - /// An arbitrary string attached to the object. /// Often useful for displaying to users. String? get description; @override - /// ID of the invoice that created this PaymentIntent, if it exists. String? get invoice; @override - /// The payment error encountered in the previous PaymentIntent confirmation. /// It will be cleared if the PaymentIntent is later updated for any reason. @JsonKey(name: "last_payment_error") dynamic get lastPaymentError; @override - /// The latest charge created by this payment intent. @JsonKey(name: "latest_charge") String? get latestCharge; @override - /// Has the value true if the object exists in live mode or the /// value false if the object exists in test mode. bool get livemode; @override - /// Set of key-value pairs that you can attach to an object. /// This can be useful for storing additional information about the /// object in a structured format. Map get metadata; @override - /// If present, this property tells you what actions you need to /// take in order for your customer to fulfill a payment using the /// provided source. @JsonKey(name: "next_action") dynamic get nextAction; @override - /// CONNECT ONLY /// The account (if any) for which the funds of the PaymentIntent are /// intended. See the PaymentIntents use case for connected accounts @@ -1431,27 +1436,22 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "on_behalf_of") String? get onBehalfOf; @override - /// ID of the payment method used in this PaymentIntent. @JsonKey(name: "payment_method") String? get paymentMethod; @override - /// Payment-method-specific configuration for this PaymentIntent. @JsonKey(name: "payment_method_options") dynamic get paymentMethodOptions; @override - /// The list of payment method types (e.g. card) that this PaymentIntent /// is allowed to use. @JsonKey(name: "payment_method_types") List get paymentMethodTypes; @override - /// If present, this property tells you about the processing state of the payment. dynamic get processing; @override - /// Email address that the receipt for the resulting payment will be sent to. /// If receipt_email is specified for a payment in live mode, a receipt /// will be sent regardless of your email settings. @@ -1460,7 +1460,6 @@ abstract class _PaymentIntent implements PaymentIntent { @override // ID of the review associated with this PaymentIntent, if any. String? get review; @override - /// Indicates that you intend to make future payments with this /// PaymentIntent’s payment method. /// Providing this parameter will attach the payment method to the @@ -1474,18 +1473,15 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "setup_future_usage") PaymentIntentSetupFutureUsage? get setupFutureUsage; @override - /// Shipping information for this PaymentIntent. ShippingDetails? get shipping; @override - /// For non-card charges, you can use this value as the complete /// description that appears on your customers’ statements. /// Must contain at least one letter, maximum 22 characters. @JsonKey(name: "statement_descriptor") String? get statementDescriptor; @override - /// Provides information about a card payment that customers see on /// their statements. /// Concatenated with the prefix (shortened descriptor) or statement @@ -1494,13 +1490,11 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "statement_descriptor_suffix") String? get statementDescriptorSuffix; @override - /// Status of this PaymentIntent, one of requires_payment_method, /// requires_confirmation, requires_action, processing, requires_capture, /// canceled, or succeeded. PaymentIntentsStatus get status; @override - /// CONNECT ONLY /// The data with which to automatically create a Transfer when the payment /// is finalized. See the PaymentIntents use case for connected @@ -1508,7 +1502,6 @@ abstract class _PaymentIntent implements PaymentIntent { @JsonKey(name: "transfer_data") dynamic get transferData; @override - /// CONNECT ONLY /// A string that identifies the resulting payment as part of a group. /// See the PaymentIntents use case for connected accounts for details. @@ -1521,7 +1514,8 @@ abstract class _PaymentIntent implements PaymentIntent { } PaymentIntentAmountDetails _$PaymentIntentAmountDetailsFromJson( - Map json) { + Map json, +) { return _PaymentIntentAmountDetails.fromJson(json); } @@ -1533,15 +1527,19 @@ mixin _$PaymentIntentAmountDetails { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) $PaymentIntentAmountDetailsCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PaymentIntentAmountDetailsCopyWith<$Res> { - factory $PaymentIntentAmountDetailsCopyWith(PaymentIntentAmountDetails value, - $Res Function(PaymentIntentAmountDetails) then) = - _$PaymentIntentAmountDetailsCopyWithImpl<$Res, - PaymentIntentAmountDetails>; + factory $PaymentIntentAmountDetailsCopyWith( + PaymentIntentAmountDetails value, + $Res Function(PaymentIntentAmountDetails) then, + ) = + _$PaymentIntentAmountDetailsCopyWithImpl< + $Res, + PaymentIntentAmountDetails + >; @useResult $Res call({PaymentIntentTip? tip}); @@ -1549,8 +1547,10 @@ abstract class $PaymentIntentAmountDetailsCopyWith<$Res> { } /// @nodoc -class _$PaymentIntentAmountDetailsCopyWithImpl<$Res, - $Val extends PaymentIntentAmountDetails> +class _$PaymentIntentAmountDetailsCopyWithImpl< + $Res, + $Val extends PaymentIntentAmountDetails +> implements $PaymentIntentAmountDetailsCopyWith<$Res> { _$PaymentIntentAmountDetailsCopyWithImpl(this._value, this._then); @@ -1561,15 +1561,16 @@ class _$PaymentIntentAmountDetailsCopyWithImpl<$Res, @pragma('vm:prefer-inline') @override - $Res call({ - Object? tip = freezed, - }) { - return _then(_value.copyWith( - tip: freezed == tip - ? _value.tip - : tip // ignore: cast_nullable_to_non_nullable - as PaymentIntentTip?, - ) as $Val); + $Res call({Object? tip = freezed}) { + return _then( + _value.copyWith( + tip: freezed == tip + ? _value.tip + : tip // ignore: cast_nullable_to_non_nullable + as PaymentIntentTip?, + ) + as $Val, + ); } @override @@ -1589,9 +1590,9 @@ class _$PaymentIntentAmountDetailsCopyWithImpl<$Res, abstract class _$$_PaymentIntentAmountDetailsCopyWith<$Res> implements $PaymentIntentAmountDetailsCopyWith<$Res> { factory _$$_PaymentIntentAmountDetailsCopyWith( - _$_PaymentIntentAmountDetails value, - $Res Function(_$_PaymentIntentAmountDetails) then) = - __$$_PaymentIntentAmountDetailsCopyWithImpl<$Res>; + _$_PaymentIntentAmountDetails value, + $Res Function(_$_PaymentIntentAmountDetails) then, + ) = __$$_PaymentIntentAmountDetailsCopyWithImpl<$Res>; @override @useResult $Res call({PaymentIntentTip? tip}); @@ -1602,25 +1603,28 @@ abstract class _$$_PaymentIntentAmountDetailsCopyWith<$Res> /// @nodoc class __$$_PaymentIntentAmountDetailsCopyWithImpl<$Res> - extends _$PaymentIntentAmountDetailsCopyWithImpl<$Res, - _$_PaymentIntentAmountDetails> + extends + _$PaymentIntentAmountDetailsCopyWithImpl< + $Res, + _$_PaymentIntentAmountDetails + > implements _$$_PaymentIntentAmountDetailsCopyWith<$Res> { __$$_PaymentIntentAmountDetailsCopyWithImpl( - _$_PaymentIntentAmountDetails _value, - $Res Function(_$_PaymentIntentAmountDetails) _then) - : super(_value, _then); + _$_PaymentIntentAmountDetails _value, + $Res Function(_$_PaymentIntentAmountDetails) _then, + ) : super(_value, _then); @pragma('vm:prefer-inline') @override - $Res call({ - Object? tip = freezed, - }) { - return _then(_$_PaymentIntentAmountDetails( - tip: freezed == tip - ? _value.tip - : tip // ignore: cast_nullable_to_non_nullable - as PaymentIntentTip?, - )); + $Res call({Object? tip = freezed}) { + return _then( + _$_PaymentIntentAmountDetails( + tip: freezed == tip + ? _value.tip + : tip // ignore: cast_nullable_to_non_nullable + as PaymentIntentTip?, + ), + ); } } @@ -1657,33 +1661,33 @@ class _$_PaymentIntentAmountDetails implements _PaymentIntentAmountDetails { @override @pragma('vm:prefer-inline') _$$_PaymentIntentAmountDetailsCopyWith<_$_PaymentIntentAmountDetails> - get copyWith => __$$_PaymentIntentAmountDetailsCopyWithImpl< - _$_PaymentIntentAmountDetails>(this, _$identity); + get copyWith => + __$$_PaymentIntentAmountDetailsCopyWithImpl< + _$_PaymentIntentAmountDetails + >(this, _$identity); @override Map toJson() { - return _$$_PaymentIntentAmountDetailsToJson( - this, - ); + return _$$_PaymentIntentAmountDetailsToJson(this); } } abstract class _PaymentIntentAmountDetails implements PaymentIntentAmountDetails { - const factory _PaymentIntentAmountDetails( - {required final PaymentIntentTip? tip}) = _$_PaymentIntentAmountDetails; + const factory _PaymentIntentAmountDetails({ + required final PaymentIntentTip? tip, + }) = _$_PaymentIntentAmountDetails; factory _PaymentIntentAmountDetails.fromJson(Map json) = _$_PaymentIntentAmountDetails.fromJson; @override - /// Details about items included in the amount PaymentIntentTip? get tip; @override @JsonKey(ignore: true) _$$_PaymentIntentAmountDetailsCopyWith<_$_PaymentIntentAmountDetails> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } PaymentIntentTip _$PaymentIntentTipFromJson(Map json) { @@ -1704,8 +1708,9 @@ mixin _$PaymentIntentTip { /// @nodoc abstract class $PaymentIntentTipCopyWith<$Res> { factory $PaymentIntentTipCopyWith( - PaymentIntentTip value, $Res Function(PaymentIntentTip) then) = - _$PaymentIntentTipCopyWithImpl<$Res, PaymentIntentTip>; + PaymentIntentTip value, + $Res Function(PaymentIntentTip) then, + ) = _$PaymentIntentTipCopyWithImpl<$Res, PaymentIntentTip>; @useResult $Res call({int? amount}); } @@ -1722,15 +1727,16 @@ class _$PaymentIntentTipCopyWithImpl<$Res, $Val extends PaymentIntentTip> @pragma('vm:prefer-inline') @override - $Res call({ - Object? amount = freezed, - }) { - return _then(_value.copyWith( - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); + $Res call({Object? amount = freezed}) { + return _then( + _value.copyWith( + amount: freezed == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int?, + ) + as $Val, + ); } } @@ -1738,8 +1744,9 @@ class _$PaymentIntentTipCopyWithImpl<$Res, $Val extends PaymentIntentTip> abstract class _$$_PaymentIntentTipCopyWith<$Res> implements $PaymentIntentTipCopyWith<$Res> { factory _$$_PaymentIntentTipCopyWith( - _$_PaymentIntentTip value, $Res Function(_$_PaymentIntentTip) then) = - __$$_PaymentIntentTipCopyWithImpl<$Res>; + _$_PaymentIntentTip value, + $Res Function(_$_PaymentIntentTip) then, + ) = __$$_PaymentIntentTipCopyWithImpl<$Res>; @override @useResult $Res call({int? amount}); @@ -1750,20 +1757,21 @@ class __$$_PaymentIntentTipCopyWithImpl<$Res> extends _$PaymentIntentTipCopyWithImpl<$Res, _$_PaymentIntentTip> implements _$$_PaymentIntentTipCopyWith<$Res> { __$$_PaymentIntentTipCopyWithImpl( - _$_PaymentIntentTip _value, $Res Function(_$_PaymentIntentTip) _then) - : super(_value, _then); + _$_PaymentIntentTip _value, + $Res Function(_$_PaymentIntentTip) _then, + ) : super(_value, _then); @pragma('vm:prefer-inline') @override - $Res call({ - Object? amount = freezed, - }) { - return _then(_$_PaymentIntentTip( - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int?, - )); + $Res call({Object? amount = freezed}) { + return _then( + _$_PaymentIntentTip( + amount: freezed == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int?, + ), + ); } } @@ -1804,9 +1812,7 @@ class _$_PaymentIntentTip implements _PaymentIntentTip { @override Map toJson() { - return _$$_PaymentIntentTipToJson( - this, - ); + return _$$_PaymentIntentTipToJson(this); } } @@ -1818,7 +1824,6 @@ abstract class _PaymentIntentTip implements PaymentIntentTip { _$_PaymentIntentTip.fromJson; @override - /// Portion of the amount that corresponds to a tip. int? get amount; @override @@ -1828,7 +1833,7 @@ abstract class _PaymentIntentTip implements PaymentIntentTip { } PaymentIntentAutomaticPaymentMethods - _$PaymentIntentAutomaticPaymentMethodsFromJson(Map json) { +_$PaymentIntentAutomaticPaymentMethodsFromJson(Map json) { return _PaymentIntentAutomaticPaymentMethods.fromJson(json); } @@ -1840,24 +1845,30 @@ mixin _$PaymentIntentAutomaticPaymentMethods { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) $PaymentIntentAutomaticPaymentMethodsCopyWith< - PaymentIntentAutomaticPaymentMethods> - get copyWith => throw _privateConstructorUsedError; + PaymentIntentAutomaticPaymentMethods + > + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { factory $PaymentIntentAutomaticPaymentMethodsCopyWith( - PaymentIntentAutomaticPaymentMethods value, - $Res Function(PaymentIntentAutomaticPaymentMethods) then) = - _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, - PaymentIntentAutomaticPaymentMethods>; + PaymentIntentAutomaticPaymentMethods value, + $Res Function(PaymentIntentAutomaticPaymentMethods) then, + ) = + _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl< + $Res, + PaymentIntentAutomaticPaymentMethods + >; @useResult $Res call({bool? enabled}); } /// @nodoc -class _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, - $Val extends PaymentIntentAutomaticPaymentMethods> +class _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl< + $Res, + $Val extends PaymentIntentAutomaticPaymentMethods +> implements $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl(this._value, this._then); @@ -1868,15 +1879,16 @@ class _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, @pragma('vm:prefer-inline') @override - $Res call({ - Object? enabled = freezed, - }) { - return _then(_value.copyWith( - enabled: freezed == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); + $Res call({Object? enabled = freezed}) { + return _then( + _value.copyWith( + enabled: freezed == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool?, + ) + as $Val, + ); } } @@ -1884,9 +1896,9 @@ class _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, abstract class _$$_PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> implements $PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { factory _$$_PaymentIntentAutomaticPaymentMethodsCopyWith( - _$_PaymentIntentAutomaticPaymentMethods value, - $Res Function(_$_PaymentIntentAutomaticPaymentMethods) then) = - __$$_PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res>; + _$_PaymentIntentAutomaticPaymentMethods value, + $Res Function(_$_PaymentIntentAutomaticPaymentMethods) then, + ) = __$$_PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res>; @override @useResult $Res call({bool? enabled}); @@ -1894,25 +1906,28 @@ abstract class _$$_PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> /// @nodoc class __$$_PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res> - extends _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl<$Res, - _$_PaymentIntentAutomaticPaymentMethods> + extends + _$PaymentIntentAutomaticPaymentMethodsCopyWithImpl< + $Res, + _$_PaymentIntentAutomaticPaymentMethods + > implements _$$_PaymentIntentAutomaticPaymentMethodsCopyWith<$Res> { __$$_PaymentIntentAutomaticPaymentMethodsCopyWithImpl( - _$_PaymentIntentAutomaticPaymentMethods _value, - $Res Function(_$_PaymentIntentAutomaticPaymentMethods) _then) - : super(_value, _then); + _$_PaymentIntentAutomaticPaymentMethods _value, + $Res Function(_$_PaymentIntentAutomaticPaymentMethods) _then, + ) : super(_value, _then); @pragma('vm:prefer-inline') @override - $Res call({ - Object? enabled = freezed, - }) { - return _then(_$_PaymentIntentAutomaticPaymentMethods( - enabled: freezed == enabled - ? _value.enabled - : enabled // ignore: cast_nullable_to_non_nullable - as bool?, - )); + $Res call({Object? enabled = freezed}) { + return _then( + _$_PaymentIntentAutomaticPaymentMethods( + enabled: freezed == enabled + ? _value.enabled + : enabled // ignore: cast_nullable_to_non_nullable + as bool?, + ), + ); } } @@ -1923,8 +1938,8 @@ class _$_PaymentIntentAutomaticPaymentMethods const _$_PaymentIntentAutomaticPaymentMethods({required this.enabled}); factory _$_PaymentIntentAutomaticPaymentMethods.fromJson( - Map json) => - _$$_PaymentIntentAutomaticPaymentMethodsFromJson(json); + Map json, + ) => _$$_PaymentIntentAutomaticPaymentMethodsFromJson(json); /// Automatically calculates compatible payment methods @override @@ -1951,34 +1966,36 @@ class _$_PaymentIntentAutomaticPaymentMethods @override @pragma('vm:prefer-inline') _$$_PaymentIntentAutomaticPaymentMethodsCopyWith< - _$_PaymentIntentAutomaticPaymentMethods> - get copyWith => __$$_PaymentIntentAutomaticPaymentMethodsCopyWithImpl< - _$_PaymentIntentAutomaticPaymentMethods>(this, _$identity); + _$_PaymentIntentAutomaticPaymentMethods + > + get copyWith => + __$$_PaymentIntentAutomaticPaymentMethodsCopyWithImpl< + _$_PaymentIntentAutomaticPaymentMethods + >(this, _$identity); @override Map toJson() { - return _$$_PaymentIntentAutomaticPaymentMethodsToJson( - this, - ); + return _$$_PaymentIntentAutomaticPaymentMethodsToJson(this); } } abstract class _PaymentIntentAutomaticPaymentMethods implements PaymentIntentAutomaticPaymentMethods { - const factory _PaymentIntentAutomaticPaymentMethods( - {required final bool? enabled}) = _$_PaymentIntentAutomaticPaymentMethods; + const factory _PaymentIntentAutomaticPaymentMethods({ + required final bool? enabled, + }) = _$_PaymentIntentAutomaticPaymentMethods; factory _PaymentIntentAutomaticPaymentMethods.fromJson( - Map json) = - _$_PaymentIntentAutomaticPaymentMethods.fromJson; + Map json, + ) = _$_PaymentIntentAutomaticPaymentMethods.fromJson; @override - /// Automatically calculates compatible payment methods bool? get enabled; @override @JsonKey(ignore: true) _$$_PaymentIntentAutomaticPaymentMethodsCopyWith< - _$_PaymentIntentAutomaticPaymentMethods> - get copyWith => throw _privateConstructorUsedError; + _$_PaymentIntentAutomaticPaymentMethods + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent.dart index 8190aaa78..7ce9f0d83 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent.dart @@ -9,22 +9,15 @@ part 'setup_intent.g.dart'; /// abandoned) or generated by Stripe internally (failed_invoice, void_invoice, /// or automatic). @JsonEnum(fieldRename: FieldRename.snake) -enum SetupIntentCancellationReason { - duplicate, - - requestedByCustomer, - abandoned, -} +enum SetupIntentCancellationReason { duplicate, requestedByCustomer, abandoned } @JsonEnum(fieldRename: FieldRename.snake) enum SetupIntentUsage { /// Use on_session if you intend to only reuse the payment method /// when the customer is in your checkout flow - onSession, /// Use off_session if your customer may or may not be in your checkout flow. - offSession, } @@ -66,7 +59,7 @@ enum SetupIntentFlowDirections { /// /// https://stripe.com/docs/api/setup_intents @freezed -class SetupIntent with _$SetupIntent { +abstract class SetupIntent with _$SetupIntent { const factory SetupIntent({ /// Unique identifier for the object. required String id, diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent.freezed.dart index 76b5c5a2c..dbd9dcdab 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,973 +9,484 @@ part of 'setup_intent.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -SetupIntent _$SetupIntentFromJson(Map json) { - return _SetupIntent.fromJson(json); -} - /// @nodoc mixin _$SetupIntent { - /// Unique identifier for the object. - String get id => throw _privateConstructorUsedError; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "setup_intent". - String get object => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// ID of the Connect application that created the SetupIntent. - String? get application => throw _privateConstructorUsedError; - - /// If present, the SetupIntent’s payment method will be attached to - /// the in-context Stripe Account. - /// It can only be used for this Stripe Account’s own money movement - /// flows like InboundTransfer and OutboundTransfers. - /// It cannot be set to true when setting up a PaymentMethod for a Customer, - /// and defaults to false when attaching a PaymentMethod to a Customer. - @JsonKey(name: "attach_to_self") - String? get attachToSelf => throw _privateConstructorUsedError; - - /// Reason for cancellation of this SetupIntent, - /// one of abandoned, requested_by_customer, or duplicate. - @JsonKey(name: "cancellation_reason") - SetupIntentCancellationReason? get cancellationReason => - throw _privateConstructorUsedError; - - /// The client secret of this SetupIntent. - /// Used for client-side retrieval using a publishable key. - /// The client secret can be used to complete payment setup from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the - /// customer. Make sure that you have TLS enabled on any page that includes - /// the client secret. - @JsonKey(name: "client_secret") - String get clientSecret => throw _privateConstructorUsedError; - - /// Time at which the object was created. Measured in seconds since the - /// Unix epoch. - int? get created => throw _privateConstructorUsedError; - - /// The ID of the Customer this SetupIntent belongs to. - String? get customer => throw _privateConstructorUsedError; - - /// An arbitrary string attached to the object. - /// Often useful for displaying to users. - String? get description => throw _privateConstructorUsedError; - - /// Indicates the directions of money movement for which this payment - /// method is intended to be used. - /// Include inbound if you intend to use the payment method as - /// the origin to pull funds from. - /// Include outbound if you intend to use the payment method as - /// the destination to send funds to. - /// You can include both if you intend to use the payment - /// method for both purposes - @JsonKey(name: "flow_directions") - List? get flowDirections => - throw _privateConstructorUsedError; - - /// The error encountered in the previous SetupIntent confirmation. - @JsonKey(name: "last_setup_error") - dynamic get lastSetupError => throw _privateConstructorUsedError; - - /// The most recent SetupAttempt for this SetupIntent. - @JsonKey(name: "latest_attempt") - String? get latestAttempt => throw _privateConstructorUsedError; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - bool get livemode => throw _privateConstructorUsedError; - - /// ID of the multi use Mandate generated by the SetupIntent. - String? get mandate => throw _privateConstructorUsedError; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - Map get metadata => throw _privateConstructorUsedError; - - /// If present, this property tells you what actions you need to - /// take in order for your customer to continue payment setup. - @JsonKey(name: "next_action") - dynamic get nextAction => throw _privateConstructorUsedError; - - /// CONNECT ONLY - /// The account (if any) for which the setup is intended. - @JsonKey(name: "on_behalf_of") - String? get onBehalfOf => throw _privateConstructorUsedError; - - /// ID of the payment method used in this SetupIntent. - @JsonKey(name: "payment_method") - String? get paymentMethod => throw _privateConstructorUsedError; - - /// Payment-method-specific configuration for this SetupIntent. - @JsonKey(name: "payment_method_options") - dynamic get paymentMethodOptions => throw _privateConstructorUsedError; - - /// The list of payment method types (e.g. card) that this SetupIntent - /// is allowed to set up. - @JsonKey(name: "payment_method_types") - List get paymentMethodTypes => - throw _privateConstructorUsedError; - - /// ID of the single_use Mandate generated by the SetupIntent. - @JsonKey(name: "single_use_mandate") - String? get singleUseMandate => throw _privateConstructorUsedError; - - /// Status of this SetupIntent, one of requires_payment_method, - /// requires_confirmation, requires_action, processing, canceled, or - /// succeeded. - SetupIntentsStatus get status => throw _privateConstructorUsedError; - - /// Indicates how the payment method is intended to be used in the future. - /// Use on_session if you intend to only reuse the payment method when - /// the customer is in your checkout flow. - /// Use off_session if your customer may or may not be in your checkout flow. - /// If not provided, this value defaults to off_session. - SetupIntentUsage get usage => throw _privateConstructorUsedError; + +/// Unique identifier for the object. + String get id;/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "setup_intent". + String get object;/// CONNECT ONLY +/// ID of the Connect application that created the SetupIntent. + String? get application;/// If present, the SetupIntent’s payment method will be attached to +/// the in-context Stripe Account. +/// It can only be used for this Stripe Account’s own money movement +/// flows like InboundTransfer and OutboundTransfers. +/// It cannot be set to true when setting up a PaymentMethod for a Customer, +/// and defaults to false when attaching a PaymentMethod to a Customer. +@JsonKey(name: "attach_to_self") String? get attachToSelf;/// Reason for cancellation of this SetupIntent, +/// one of abandoned, requested_by_customer, or duplicate. +@JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? get cancellationReason;/// The client secret of this SetupIntent. +/// Used for client-side retrieval using a publishable key. +/// The client secret can be used to complete payment setup from your frontend. +/// It should not be stored, logged, or exposed to anyone other than the +/// customer. Make sure that you have TLS enabled on any page that includes +/// the client secret. +@JsonKey(name: "client_secret") String get clientSecret;/// Time at which the object was created. Measured in seconds since the +/// Unix epoch. + int? get created;/// The ID of the Customer this SetupIntent belongs to. + String? get customer;/// An arbitrary string attached to the object. +/// Often useful for displaying to users. + String? get description;/// Indicates the directions of money movement for which this payment +/// method is intended to be used. +/// Include inbound if you intend to use the payment method as +/// the origin to pull funds from. +/// Include outbound if you intend to use the payment method as +/// the destination to send funds to. +/// You can include both if you intend to use the payment +/// method for both purposes +@JsonKey(name: "flow_directions") List? get flowDirections;/// The error encountered in the previous SetupIntent confirmation. +@JsonKey(name: "last_setup_error") dynamic get lastSetupError;/// The most recent SetupAttempt for this SetupIntent. +@JsonKey(name: "latest_attempt") String? get latestAttempt;/// Has the value true if the object exists in live mode or the +/// value false if the object exists in test mode. + bool get livemode;/// ID of the multi use Mandate generated by the SetupIntent. + String? get mandate;/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the +/// object in a structured format. + Map get metadata;/// If present, this property tells you what actions you need to +/// take in order for your customer to continue payment setup. +@JsonKey(name: "next_action") dynamic get nextAction;/// CONNECT ONLY +/// The account (if any) for which the setup is intended. +@JsonKey(name: "on_behalf_of") String? get onBehalfOf;/// ID of the payment method used in this SetupIntent. +@JsonKey(name: "payment_method") String? get paymentMethod;/// Payment-method-specific configuration for this SetupIntent. +@JsonKey(name: "payment_method_options") dynamic get paymentMethodOptions;/// The list of payment method types (e.g. card) that this SetupIntent +/// is allowed to set up. +@JsonKey(name: "payment_method_types") List get paymentMethodTypes;/// ID of the single_use Mandate generated by the SetupIntent. +@JsonKey(name: "single_use_mandate") String? get singleUseMandate;/// Status of this SetupIntent, one of requires_payment_method, +/// requires_confirmation, requires_action, processing, canceled, or +/// succeeded. + SetupIntentsStatus get status;/// Indicates how the payment method is intended to be used in the future. +/// Use on_session if you intend to only reuse the payment method when +/// the customer is in your checkout flow. +/// Use off_session if your customer may or may not be in your checkout flow. +/// If not provided, this value defaults to off_session. + SetupIntentUsage get usage; +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SetupIntentCopyWith get copyWith => _$SetupIntentCopyWithImpl(this as SetupIntent, _$identity); /// Serializes this SetupIntent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SetupIntentCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SetupIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.application, application) || other.application == application)&&(identical(other.attachToSelf, attachToSelf) || other.attachToSelf == attachToSelf)&&(identical(other.cancellationReason, cancellationReason) || other.cancellationReason == cancellationReason)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.created, created) || other.created == created)&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.description, description) || other.description == description)&&const DeepCollectionEquality().equals(other.flowDirections, flowDirections)&&const DeepCollectionEquality().equals(other.lastSetupError, lastSetupError)&&(identical(other.latestAttempt, latestAttempt) || other.latestAttempt == latestAttempt)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.mandate, mandate) || other.mandate == mandate)&&const DeepCollectionEquality().equals(other.metadata, metadata)&&const DeepCollectionEquality().equals(other.nextAction, nextAction)&&(identical(other.onBehalfOf, onBehalfOf) || other.onBehalfOf == onBehalfOf)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&const DeepCollectionEquality().equals(other.paymentMethodOptions, paymentMethodOptions)&&const DeepCollectionEquality().equals(other.paymentMethodTypes, paymentMethodTypes)&&(identical(other.singleUseMandate, singleUseMandate) || other.singleUseMandate == singleUseMandate)&&(identical(other.status, status) || other.status == status)&&(identical(other.usage, usage) || other.usage == usage)); } -/// @nodoc -abstract class $SetupIntentCopyWith<$Res> { - factory $SetupIntentCopyWith( - SetupIntent value, $Res Function(SetupIntent) then) = - _$SetupIntentCopyWithImpl<$Res, SetupIntent>; - @useResult - $Res call( - {String id, - String object, - String? application, - @JsonKey(name: "attach_to_self") String? attachToSelf, - @JsonKey(name: "cancellation_reason") - SetupIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") String clientSecret, - int? created, - String? customer, - String? description, - @JsonKey(name: "flow_directions") - List? flowDirections, - @JsonKey(name: "last_setup_error") dynamic lastSetupError, - @JsonKey(name: "latest_attempt") String? latestAttempt, - bool livemode, - String? mandate, - Map metadata, - @JsonKey(name: "next_action") dynamic nextAction, - @JsonKey(name: "on_behalf_of") String? onBehalfOf, - @JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, - @JsonKey(name: "payment_method_types") - List paymentMethodTypes, - @JsonKey(name: "single_use_mandate") String? singleUseMandate, - SetupIntentsStatus status, - SetupIntentUsage usage}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,object,application,attachToSelf,cancellationReason,clientSecret,created,customer,description,const DeepCollectionEquality().hash(flowDirections),const DeepCollectionEquality().hash(lastSetupError),latestAttempt,livemode,mandate,const DeepCollectionEquality().hash(metadata),const DeepCollectionEquality().hash(nextAction),onBehalfOf,paymentMethod,const DeepCollectionEquality().hash(paymentMethodOptions),const DeepCollectionEquality().hash(paymentMethodTypes),singleUseMandate,status,usage]); + +@override +String toString() { + return 'SetupIntent(id: $id, object: $object, application: $application, attachToSelf: $attachToSelf, cancellationReason: $cancellationReason, clientSecret: $clientSecret, created: $created, customer: $customer, description: $description, flowDirections: $flowDirections, lastSetupError: $lastSetupError, latestAttempt: $latestAttempt, livemode: $livemode, mandate: $mandate, metadata: $metadata, nextAction: $nextAction, onBehalfOf: $onBehalfOf, paymentMethod: $paymentMethod, paymentMethodOptions: $paymentMethodOptions, paymentMethodTypes: $paymentMethodTypes, singleUseMandate: $singleUseMandate, status: $status, usage: $usage)'; } -/// @nodoc -class _$SetupIntentCopyWithImpl<$Res, $Val extends SetupIntent> - implements $SetupIntentCopyWith<$Res> { - _$SetupIntentCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? application = freezed, - Object? attachToSelf = freezed, - Object? cancellationReason = freezed, - Object? clientSecret = null, - Object? created = freezed, - Object? customer = freezed, - Object? description = freezed, - Object? flowDirections = freezed, - Object? lastSetupError = freezed, - Object? latestAttempt = freezed, - Object? livemode = null, - Object? mandate = freezed, - Object? metadata = null, - Object? nextAction = freezed, - Object? onBehalfOf = freezed, - Object? paymentMethod = freezed, - Object? paymentMethodOptions = freezed, - Object? paymentMethodTypes = null, - Object? singleUseMandate = freezed, - Object? status = null, - Object? usage = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - application: freezed == application - ? _value.application - : application // ignore: cast_nullable_to_non_nullable - as String?, - attachToSelf: freezed == attachToSelf - ? _value.attachToSelf - : attachToSelf // ignore: cast_nullable_to_non_nullable - as String?, - cancellationReason: freezed == cancellationReason - ? _value.cancellationReason - : cancellationReason // ignore: cast_nullable_to_non_nullable - as SetupIntentCancellationReason?, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - flowDirections: freezed == flowDirections - ? _value.flowDirections - : flowDirections // ignore: cast_nullable_to_non_nullable - as List?, - lastSetupError: freezed == lastSetupError - ? _value.lastSetupError - : lastSetupError // ignore: cast_nullable_to_non_nullable - as dynamic, - latestAttempt: freezed == latestAttempt - ? _value.latestAttempt - : latestAttempt // ignore: cast_nullable_to_non_nullable - as String?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - mandate: freezed == mandate - ? _value.mandate - : mandate // ignore: cast_nullable_to_non_nullable - as String?, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as dynamic, - onBehalfOf: freezed == onBehalfOf - ? _value.onBehalfOf - : onBehalfOf // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethodOptions: freezed == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as dynamic, - paymentMethodTypes: null == paymentMethodTypes - ? _value.paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - singleUseMandate: freezed == singleUseMandate - ? _value.singleUseMandate - : singleUseMandate // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as SetupIntentsStatus, - usage: null == usage - ? _value.usage - : usage // ignore: cast_nullable_to_non_nullable - as SetupIntentUsage, - ) as $Val); - } + } /// @nodoc -abstract class _$$SetupIntentImplCopyWith<$Res> +abstract mixin class $SetupIntentCopyWith<$Res> { + factory $SetupIntentCopyWith(SetupIntent value, $Res Function(SetupIntent) _then) = _$SetupIntentCopyWithImpl; +@useResult +$Res call({ + String id, String object, String? application,@JsonKey(name: "attach_to_self") String? attachToSelf,@JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? cancellationReason,@JsonKey(name: "client_secret") String clientSecret, int? created, String? customer, String? description,@JsonKey(name: "flow_directions") List? flowDirections,@JsonKey(name: "last_setup_error") dynamic lastSetupError,@JsonKey(name: "latest_attempt") String? latestAttempt, bool livemode, String? mandate, Map metadata,@JsonKey(name: "next_action") dynamic nextAction,@JsonKey(name: "on_behalf_of") String? onBehalfOf,@JsonKey(name: "payment_method") String? paymentMethod,@JsonKey(name: "payment_method_options") dynamic paymentMethodOptions,@JsonKey(name: "payment_method_types") List paymentMethodTypes,@JsonKey(name: "single_use_mandate") String? singleUseMandate, SetupIntentsStatus status, SetupIntentUsage usage +}); + + + + +} +/// @nodoc +class _$SetupIntentCopyWithImpl<$Res> implements $SetupIntentCopyWith<$Res> { - factory _$$SetupIntentImplCopyWith( - _$SetupIntentImpl value, $Res Function(_$SetupIntentImpl) then) = - __$$SetupIntentImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String object, - String? application, - @JsonKey(name: "attach_to_self") String? attachToSelf, - @JsonKey(name: "cancellation_reason") - SetupIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") String clientSecret, - int? created, - String? customer, - String? description, - @JsonKey(name: "flow_directions") - List? flowDirections, - @JsonKey(name: "last_setup_error") dynamic lastSetupError, - @JsonKey(name: "latest_attempt") String? latestAttempt, - bool livemode, - String? mandate, - Map metadata, - @JsonKey(name: "next_action") dynamic nextAction, - @JsonKey(name: "on_behalf_of") String? onBehalfOf, - @JsonKey(name: "payment_method") String? paymentMethod, - @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, - @JsonKey(name: "payment_method_types") - List paymentMethodTypes, - @JsonKey(name: "single_use_mandate") String? singleUseMandate, - SetupIntentsStatus status, - SetupIntentUsage usage}); + _$SetupIntentCopyWithImpl(this._self, this._then); + + final SetupIntent _self; + final $Res Function(SetupIntent) _then; + +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? object = null,Object? application = freezed,Object? attachToSelf = freezed,Object? cancellationReason = freezed,Object? clientSecret = null,Object? created = freezed,Object? customer = freezed,Object? description = freezed,Object? flowDirections = freezed,Object? lastSetupError = freezed,Object? latestAttempt = freezed,Object? livemode = null,Object? mandate = freezed,Object? metadata = null,Object? nextAction = freezed,Object? onBehalfOf = freezed,Object? paymentMethod = freezed,Object? paymentMethodOptions = freezed,Object? paymentMethodTypes = null,Object? singleUseMandate = freezed,Object? status = null,Object? usage = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,application: freezed == application ? _self.application : application // ignore: cast_nullable_to_non_nullable +as String?,attachToSelf: freezed == attachToSelf ? _self.attachToSelf : attachToSelf // ignore: cast_nullable_to_non_nullable +as String?,cancellationReason: freezed == cancellationReason ? _self.cancellationReason : cancellationReason // ignore: cast_nullable_to_non_nullable +as SetupIntentCancellationReason?,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,flowDirections: freezed == flowDirections ? _self.flowDirections : flowDirections // ignore: cast_nullable_to_non_nullable +as List?,lastSetupError: freezed == lastSetupError ? _self.lastSetupError : lastSetupError // ignore: cast_nullable_to_non_nullable +as dynamic,latestAttempt: freezed == latestAttempt ? _self.latestAttempt : latestAttempt // ignore: cast_nullable_to_non_nullable +as String?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,mandate: freezed == mandate ? _self.mandate : mandate // ignore: cast_nullable_to_non_nullable +as String?,metadata: null == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as dynamic,onBehalfOf: freezed == onBehalfOf ? _self.onBehalfOf : onBehalfOf // ignore: cast_nullable_to_non_nullable +as String?,paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?,paymentMethodOptions: freezed == paymentMethodOptions ? _self.paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as dynamic,paymentMethodTypes: null == paymentMethodTypes ? _self.paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List,singleUseMandate: freezed == singleUseMandate ? _self.singleUseMandate : singleUseMandate // ignore: cast_nullable_to_non_nullable +as String?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as SetupIntentsStatus,usage: null == usage ? _self.usage : usage // ignore: cast_nullable_to_non_nullable +as SetupIntentUsage, + )); +} + +} + + +/// Adds pattern-matching-related methods to [SetupIntent]. +extension SetupIntentPatterns on SetupIntent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SetupIntent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SetupIntent value) $default,){ +final _that = this; +switch (_that) { +case _SetupIntent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SetupIntent value)? $default,){ +final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String object, String? application, @JsonKey(name: "attach_to_self") String? attachToSelf, @JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? cancellationReason, @JsonKey(name: "client_secret") String clientSecret, int? created, String? customer, String? description, @JsonKey(name: "flow_directions") List? flowDirections, @JsonKey(name: "last_setup_error") dynamic lastSetupError, @JsonKey(name: "latest_attempt") String? latestAttempt, bool livemode, String? mandate, Map metadata, @JsonKey(name: "next_action") dynamic nextAction, @JsonKey(name: "on_behalf_of") String? onBehalfOf, @JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, @JsonKey(name: "payment_method_types") List paymentMethodTypes, @JsonKey(name: "single_use_mandate") String? singleUseMandate, SetupIntentsStatus status, SetupIntentUsage usage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that.id,_that.object,_that.application,_that.attachToSelf,_that.cancellationReason,_that.clientSecret,_that.created,_that.customer,_that.description,_that.flowDirections,_that.lastSetupError,_that.latestAttempt,_that.livemode,_that.mandate,_that.metadata,_that.nextAction,_that.onBehalfOf,_that.paymentMethod,_that.paymentMethodOptions,_that.paymentMethodTypes,_that.singleUseMandate,_that.status,_that.usage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String object, String? application, @JsonKey(name: "attach_to_self") String? attachToSelf, @JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? cancellationReason, @JsonKey(name: "client_secret") String clientSecret, int? created, String? customer, String? description, @JsonKey(name: "flow_directions") List? flowDirections, @JsonKey(name: "last_setup_error") dynamic lastSetupError, @JsonKey(name: "latest_attempt") String? latestAttempt, bool livemode, String? mandate, Map metadata, @JsonKey(name: "next_action") dynamic nextAction, @JsonKey(name: "on_behalf_of") String? onBehalfOf, @JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, @JsonKey(name: "payment_method_types") List paymentMethodTypes, @JsonKey(name: "single_use_mandate") String? singleUseMandate, SetupIntentsStatus status, SetupIntentUsage usage) $default,) {final _that = this; +switch (_that) { +case _SetupIntent(): +return $default(_that.id,_that.object,_that.application,_that.attachToSelf,_that.cancellationReason,_that.clientSecret,_that.created,_that.customer,_that.description,_that.flowDirections,_that.lastSetupError,_that.latestAttempt,_that.livemode,_that.mandate,_that.metadata,_that.nextAction,_that.onBehalfOf,_that.paymentMethod,_that.paymentMethodOptions,_that.paymentMethodTypes,_that.singleUseMandate,_that.status,_that.usage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String object, String? application, @JsonKey(name: "attach_to_self") String? attachToSelf, @JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? cancellationReason, @JsonKey(name: "client_secret") String clientSecret, int? created, String? customer, String? description, @JsonKey(name: "flow_directions") List? flowDirections, @JsonKey(name: "last_setup_error") dynamic lastSetupError, @JsonKey(name: "latest_attempt") String? latestAttempt, bool livemode, String? mandate, Map metadata, @JsonKey(name: "next_action") dynamic nextAction, @JsonKey(name: "on_behalf_of") String? onBehalfOf, @JsonKey(name: "payment_method") String? paymentMethod, @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions, @JsonKey(name: "payment_method_types") List paymentMethodTypes, @JsonKey(name: "single_use_mandate") String? singleUseMandate, SetupIntentsStatus status, SetupIntentUsage usage)? $default,) {final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that.id,_that.object,_that.application,_that.attachToSelf,_that.cancellationReason,_that.clientSecret,_that.created,_that.customer,_that.description,_that.flowDirections,_that.lastSetupError,_that.latestAttempt,_that.livemode,_that.mandate,_that.metadata,_that.nextAction,_that.onBehalfOf,_that.paymentMethod,_that.paymentMethodOptions,_that.paymentMethodTypes,_that.singleUseMandate,_that.status,_that.usage);case _: + return null; + +} } -/// @nodoc -class __$$SetupIntentImplCopyWithImpl<$Res> - extends _$SetupIntentCopyWithImpl<$Res, _$SetupIntentImpl> - implements _$$SetupIntentImplCopyWith<$Res> { - __$$SetupIntentImplCopyWithImpl( - _$SetupIntentImpl _value, $Res Function(_$SetupIntentImpl) _then) - : super(_value, _then); - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? application = freezed, - Object? attachToSelf = freezed, - Object? cancellationReason = freezed, - Object? clientSecret = null, - Object? created = freezed, - Object? customer = freezed, - Object? description = freezed, - Object? flowDirections = freezed, - Object? lastSetupError = freezed, - Object? latestAttempt = freezed, - Object? livemode = null, - Object? mandate = freezed, - Object? metadata = null, - Object? nextAction = freezed, - Object? onBehalfOf = freezed, - Object? paymentMethod = freezed, - Object? paymentMethodOptions = freezed, - Object? paymentMethodTypes = null, - Object? singleUseMandate = freezed, - Object? status = null, - Object? usage = null, - }) { - return _then(_$SetupIntentImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - application: freezed == application - ? _value.application - : application // ignore: cast_nullable_to_non_nullable - as String?, - attachToSelf: freezed == attachToSelf - ? _value.attachToSelf - : attachToSelf // ignore: cast_nullable_to_non_nullable - as String?, - cancellationReason: freezed == cancellationReason - ? _value.cancellationReason - : cancellationReason // ignore: cast_nullable_to_non_nullable - as SetupIntentCancellationReason?, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - customer: freezed == customer - ? _value.customer - : customer // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - flowDirections: freezed == flowDirections - ? _value._flowDirections - : flowDirections // ignore: cast_nullable_to_non_nullable - as List?, - lastSetupError: freezed == lastSetupError - ? _value.lastSetupError - : lastSetupError // ignore: cast_nullable_to_non_nullable - as dynamic, - latestAttempt: freezed == latestAttempt - ? _value.latestAttempt - : latestAttempt // ignore: cast_nullable_to_non_nullable - as String?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - mandate: freezed == mandate - ? _value.mandate - : mandate // ignore: cast_nullable_to_non_nullable - as String?, - metadata: null == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as dynamic, - onBehalfOf: freezed == onBehalfOf - ? _value.onBehalfOf - : onBehalfOf // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as String?, - paymentMethodOptions: freezed == paymentMethodOptions - ? _value.paymentMethodOptions - : paymentMethodOptions // ignore: cast_nullable_to_non_nullable - as dynamic, - paymentMethodTypes: null == paymentMethodTypes - ? _value._paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - singleUseMandate: freezed == singleUseMandate - ? _value.singleUseMandate - : singleUseMandate // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as SetupIntentsStatus, - usage: null == usage - ? _value.usage - : usage // ignore: cast_nullable_to_non_nullable - as SetupIntentUsage, - )); - } } /// @nodoc @JsonSerializable() -class _$SetupIntentImpl implements _SetupIntent { - const _$SetupIntentImpl( - {required this.id, - this.object = "setup_intent", - this.application, - @JsonKey(name: "attach_to_self") this.attachToSelf, - @JsonKey(name: "cancellation_reason") this.cancellationReason, - @JsonKey(name: "client_secret") required this.clientSecret, - this.created, - this.customer, - this.description, - @JsonKey(name: "flow_directions") - final List? flowDirections, - @JsonKey(name: "last_setup_error") this.lastSetupError, - @JsonKey(name: "latest_attempt") this.latestAttempt, - this.livemode = true, - this.mandate, - final Map metadata = const {}, - @JsonKey(name: "next_action") this.nextAction, - @JsonKey(name: "on_behalf_of") this.onBehalfOf, - @JsonKey(name: "payment_method") this.paymentMethod, - @JsonKey(name: "payment_method_options") this.paymentMethodOptions, - @JsonKey(name: "payment_method_types") - final List paymentMethodTypes = const [], - @JsonKey(name: "single_use_mandate") this.singleUseMandate, - required this.status, - this.usage = SetupIntentUsage.offSession}) - : _flowDirections = flowDirections, - _metadata = metadata, - _paymentMethodTypes = paymentMethodTypes; - - factory _$SetupIntentImpl.fromJson(Map json) => - _$$SetupIntentImplFromJson(json); - - /// Unique identifier for the object. - @override - final String id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "setup_intent". - @override - @JsonKey() - final String object; - - /// CONNECT ONLY - /// ID of the Connect application that created the SetupIntent. - @override - final String? application; - - /// If present, the SetupIntent’s payment method will be attached to - /// the in-context Stripe Account. - /// It can only be used for this Stripe Account’s own money movement - /// flows like InboundTransfer and OutboundTransfers. - /// It cannot be set to true when setting up a PaymentMethod for a Customer, - /// and defaults to false when attaching a PaymentMethod to a Customer. - @override - @JsonKey(name: "attach_to_self") - final String? attachToSelf; - - /// Reason for cancellation of this SetupIntent, - /// one of abandoned, requested_by_customer, or duplicate. - @override - @JsonKey(name: "cancellation_reason") - final SetupIntentCancellationReason? cancellationReason; - - /// The client secret of this SetupIntent. - /// Used for client-side retrieval using a publishable key. - /// The client secret can be used to complete payment setup from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the - /// customer. Make sure that you have TLS enabled on any page that includes - /// the client secret. - @override - @JsonKey(name: "client_secret") - final String clientSecret; - - /// Time at which the object was created. Measured in seconds since the - /// Unix epoch. - @override - final int? created; - - /// The ID of the Customer this SetupIntent belongs to. - @override - final String? customer; - - /// An arbitrary string attached to the object. - /// Often useful for displaying to users. - @override - final String? description; - - /// Indicates the directions of money movement for which this payment - /// method is intended to be used. - /// Include inbound if you intend to use the payment method as - /// the origin to pull funds from. - /// Include outbound if you intend to use the payment method as - /// the destination to send funds to. - /// You can include both if you intend to use the payment - /// method for both purposes - final List? _flowDirections; - - /// Indicates the directions of money movement for which this payment - /// method is intended to be used. - /// Include inbound if you intend to use the payment method as - /// the origin to pull funds from. - /// Include outbound if you intend to use the payment method as - /// the destination to send funds to. - /// You can include both if you intend to use the payment - /// method for both purposes - @override - @JsonKey(name: "flow_directions") - List? get flowDirections { - final value = _flowDirections; - if (value == null) return null; - if (_flowDirections is EqualUnmodifiableListView) return _flowDirections; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - - /// The error encountered in the previous SetupIntent confirmation. - @override - @JsonKey(name: "last_setup_error") - final dynamic lastSetupError; - - /// The most recent SetupAttempt for this SetupIntent. - @override - @JsonKey(name: "latest_attempt") - final String? latestAttempt; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - @override - @JsonKey() - final bool livemode; - - /// ID of the multi use Mandate generated by the SetupIntent. - @override - final String? mandate; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - final Map _metadata; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - @override - @JsonKey() - Map get metadata { - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_metadata); - } - - /// If present, this property tells you what actions you need to - /// take in order for your customer to continue payment setup. - @override - @JsonKey(name: "next_action") - final dynamic nextAction; - - /// CONNECT ONLY - /// The account (if any) for which the setup is intended. - @override - @JsonKey(name: "on_behalf_of") - final String? onBehalfOf; - - /// ID of the payment method used in this SetupIntent. - @override - @JsonKey(name: "payment_method") - final String? paymentMethod; - - /// Payment-method-specific configuration for this SetupIntent. - @override - @JsonKey(name: "payment_method_options") - final dynamic paymentMethodOptions; - - /// The list of payment method types (e.g. card) that this SetupIntent - /// is allowed to set up. - final List _paymentMethodTypes; - - /// The list of payment method types (e.g. card) that this SetupIntent - /// is allowed to set up. - @override - @JsonKey(name: "payment_method_types") - List get paymentMethodTypes { - if (_paymentMethodTypes is EqualUnmodifiableListView) - return _paymentMethodTypes; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_paymentMethodTypes); - } - - /// ID of the single_use Mandate generated by the SetupIntent. - @override - @JsonKey(name: "single_use_mandate") - final String? singleUseMandate; - - /// Status of this SetupIntent, one of requires_payment_method, - /// requires_confirmation, requires_action, processing, canceled, or - /// succeeded. - @override - final SetupIntentsStatus status; - - /// Indicates how the payment method is intended to be used in the future. - /// Use on_session if you intend to only reuse the payment method when - /// the customer is in your checkout flow. - /// Use off_session if your customer may or may not be in your checkout flow. - /// If not provided, this value defaults to off_session. - @override - @JsonKey() - final SetupIntentUsage usage; - - @override - String toString() { - return 'SetupIntent(id: $id, object: $object, application: $application, attachToSelf: $attachToSelf, cancellationReason: $cancellationReason, clientSecret: $clientSecret, created: $created, customer: $customer, description: $description, flowDirections: $flowDirections, lastSetupError: $lastSetupError, latestAttempt: $latestAttempt, livemode: $livemode, mandate: $mandate, metadata: $metadata, nextAction: $nextAction, onBehalfOf: $onBehalfOf, paymentMethod: $paymentMethod, paymentMethodOptions: $paymentMethodOptions, paymentMethodTypes: $paymentMethodTypes, singleUseMandate: $singleUseMandate, status: $status, usage: $usage)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SetupIntentImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.object, object) || other.object == object) && - (identical(other.application, application) || - other.application == application) && - (identical(other.attachToSelf, attachToSelf) || - other.attachToSelf == attachToSelf) && - (identical(other.cancellationReason, cancellationReason) || - other.cancellationReason == cancellationReason) && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.created, created) || other.created == created) && - (identical(other.customer, customer) || - other.customer == customer) && - (identical(other.description, description) || - other.description == description) && - const DeepCollectionEquality() - .equals(other._flowDirections, _flowDirections) && - const DeepCollectionEquality() - .equals(other.lastSetupError, lastSetupError) && - (identical(other.latestAttempt, latestAttempt) || - other.latestAttempt == latestAttempt) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.mandate, mandate) || other.mandate == mandate) && - const DeepCollectionEquality().equals(other._metadata, _metadata) && - const DeepCollectionEquality() - .equals(other.nextAction, nextAction) && - (identical(other.onBehalfOf, onBehalfOf) || - other.onBehalfOf == onBehalfOf) && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - const DeepCollectionEquality() - .equals(other.paymentMethodOptions, paymentMethodOptions) && - const DeepCollectionEquality() - .equals(other._paymentMethodTypes, _paymentMethodTypes) && - (identical(other.singleUseMandate, singleUseMandate) || - other.singleUseMandate == singleUseMandate) && - (identical(other.status, status) || other.status == status) && - (identical(other.usage, usage) || other.usage == usage)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - id, - object, - application, - attachToSelf, - cancellationReason, - clientSecret, - created, - customer, - description, - const DeepCollectionEquality().hash(_flowDirections), - const DeepCollectionEquality().hash(lastSetupError), - latestAttempt, - livemode, - mandate, - const DeepCollectionEquality().hash(_metadata), - const DeepCollectionEquality().hash(nextAction), - onBehalfOf, - paymentMethod, - const DeepCollectionEquality().hash(paymentMethodOptions), - const DeepCollectionEquality().hash(_paymentMethodTypes), - singleUseMandate, - status, - usage - ]); - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SetupIntentImplCopyWith<_$SetupIntentImpl> get copyWith => - __$$SetupIntentImplCopyWithImpl<_$SetupIntentImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SetupIntentImplToJson( - this, - ); - } + +class _SetupIntent implements SetupIntent { + const _SetupIntent({required this.id, this.object = "setup_intent", this.application, @JsonKey(name: "attach_to_self") this.attachToSelf, @JsonKey(name: "cancellation_reason") this.cancellationReason, @JsonKey(name: "client_secret") required this.clientSecret, this.created, this.customer, this.description, @JsonKey(name: "flow_directions") final List? flowDirections, @JsonKey(name: "last_setup_error") this.lastSetupError, @JsonKey(name: "latest_attempt") this.latestAttempt, this.livemode = true, this.mandate, final Map metadata = const {}, @JsonKey(name: "next_action") this.nextAction, @JsonKey(name: "on_behalf_of") this.onBehalfOf, @JsonKey(name: "payment_method") this.paymentMethod, @JsonKey(name: "payment_method_options") this.paymentMethodOptions, @JsonKey(name: "payment_method_types") final List paymentMethodTypes = const [], @JsonKey(name: "single_use_mandate") this.singleUseMandate, required this.status, this.usage = SetupIntentUsage.offSession}): _flowDirections = flowDirections,_metadata = metadata,_paymentMethodTypes = paymentMethodTypes; + factory _SetupIntent.fromJson(Map json) => _$SetupIntentFromJson(json); + +/// Unique identifier for the object. +@override final String id; +/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "setup_intent". +@override@JsonKey() final String object; +/// CONNECT ONLY +/// ID of the Connect application that created the SetupIntent. +@override final String? application; +/// If present, the SetupIntent’s payment method will be attached to +/// the in-context Stripe Account. +/// It can only be used for this Stripe Account’s own money movement +/// flows like InboundTransfer and OutboundTransfers. +/// It cannot be set to true when setting up a PaymentMethod for a Customer, +/// and defaults to false when attaching a PaymentMethod to a Customer. +@override@JsonKey(name: "attach_to_self") final String? attachToSelf; +/// Reason for cancellation of this SetupIntent, +/// one of abandoned, requested_by_customer, or duplicate. +@override@JsonKey(name: "cancellation_reason") final SetupIntentCancellationReason? cancellationReason; +/// The client secret of this SetupIntent. +/// Used for client-side retrieval using a publishable key. +/// The client secret can be used to complete payment setup from your frontend. +/// It should not be stored, logged, or exposed to anyone other than the +/// customer. Make sure that you have TLS enabled on any page that includes +/// the client secret. +@override@JsonKey(name: "client_secret") final String clientSecret; +/// Time at which the object was created. Measured in seconds since the +/// Unix epoch. +@override final int? created; +/// The ID of the Customer this SetupIntent belongs to. +@override final String? customer; +/// An arbitrary string attached to the object. +/// Often useful for displaying to users. +@override final String? description; +/// Indicates the directions of money movement for which this payment +/// method is intended to be used. +/// Include inbound if you intend to use the payment method as +/// the origin to pull funds from. +/// Include outbound if you intend to use the payment method as +/// the destination to send funds to. +/// You can include both if you intend to use the payment +/// method for both purposes + final List? _flowDirections; +/// Indicates the directions of money movement for which this payment +/// method is intended to be used. +/// Include inbound if you intend to use the payment method as +/// the origin to pull funds from. +/// Include outbound if you intend to use the payment method as +/// the destination to send funds to. +/// You can include both if you intend to use the payment +/// method for both purposes +@override@JsonKey(name: "flow_directions") List? get flowDirections { + final value = _flowDirections; + if (value == null) return null; + if (_flowDirections is EqualUnmodifiableListView) return _flowDirections; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); } -abstract class _SetupIntent implements SetupIntent { - const factory _SetupIntent( - {required final String id, - final String object, - final String? application, - @JsonKey(name: "attach_to_self") final String? attachToSelf, - @JsonKey(name: "cancellation_reason") - final SetupIntentCancellationReason? cancellationReason, - @JsonKey(name: "client_secret") required final String clientSecret, - final int? created, - final String? customer, - final String? description, - @JsonKey(name: "flow_directions") - final List? flowDirections, - @JsonKey(name: "last_setup_error") final dynamic lastSetupError, - @JsonKey(name: "latest_attempt") final String? latestAttempt, - final bool livemode, - final String? mandate, - final Map metadata, - @JsonKey(name: "next_action") final dynamic nextAction, - @JsonKey(name: "on_behalf_of") final String? onBehalfOf, - @JsonKey(name: "payment_method") final String? paymentMethod, - @JsonKey(name: "payment_method_options") - final dynamic paymentMethodOptions, - @JsonKey(name: "payment_method_types") - final List paymentMethodTypes, - @JsonKey(name: "single_use_mandate") final String? singleUseMandate, - required final SetupIntentsStatus status, - final SetupIntentUsage usage}) = _$SetupIntentImpl; - - factory _SetupIntent.fromJson(Map json) = - _$SetupIntentImpl.fromJson; - - /// Unique identifier for the object. - @override - String get id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "setup_intent". - @override - String get object; - - /// CONNECT ONLY - /// ID of the Connect application that created the SetupIntent. - @override - String? get application; - - /// If present, the SetupIntent’s payment method will be attached to - /// the in-context Stripe Account. - /// It can only be used for this Stripe Account’s own money movement - /// flows like InboundTransfer and OutboundTransfers. - /// It cannot be set to true when setting up a PaymentMethod for a Customer, - /// and defaults to false when attaching a PaymentMethod to a Customer. - @override - @JsonKey(name: "attach_to_self") - String? get attachToSelf; - - /// Reason for cancellation of this SetupIntent, - /// one of abandoned, requested_by_customer, or duplicate. - @override - @JsonKey(name: "cancellation_reason") - SetupIntentCancellationReason? get cancellationReason; - - /// The client secret of this SetupIntent. - /// Used for client-side retrieval using a publishable key. - /// The client secret can be used to complete payment setup from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the - /// customer. Make sure that you have TLS enabled on any page that includes - /// the client secret. - @override - @JsonKey(name: "client_secret") - String get clientSecret; - - /// Time at which the object was created. Measured in seconds since the - /// Unix epoch. - @override - int? get created; - - /// The ID of the Customer this SetupIntent belongs to. - @override - String? get customer; - - /// An arbitrary string attached to the object. - /// Often useful for displaying to users. - @override - String? get description; - - /// Indicates the directions of money movement for which this payment - /// method is intended to be used. - /// Include inbound if you intend to use the payment method as - /// the origin to pull funds from. - /// Include outbound if you intend to use the payment method as - /// the destination to send funds to. - /// You can include both if you intend to use the payment - /// method for both purposes - @override - @JsonKey(name: "flow_directions") - List? get flowDirections; - - /// The error encountered in the previous SetupIntent confirmation. - @override - @JsonKey(name: "last_setup_error") - dynamic get lastSetupError; - - /// The most recent SetupAttempt for this SetupIntent. - @override - @JsonKey(name: "latest_attempt") - String? get latestAttempt; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - @override - bool get livemode; - - /// ID of the multi use Mandate generated by the SetupIntent. - @override - String? get mandate; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the - /// object in a structured format. - @override - Map get metadata; - - /// If present, this property tells you what actions you need to - /// take in order for your customer to continue payment setup. - @override - @JsonKey(name: "next_action") - dynamic get nextAction; - - /// CONNECT ONLY - /// The account (if any) for which the setup is intended. - @override - @JsonKey(name: "on_behalf_of") - String? get onBehalfOf; - - /// ID of the payment method used in this SetupIntent. - @override - @JsonKey(name: "payment_method") - String? get paymentMethod; - - /// Payment-method-specific configuration for this SetupIntent. - @override - @JsonKey(name: "payment_method_options") - dynamic get paymentMethodOptions; - - /// The list of payment method types (e.g. card) that this SetupIntent - /// is allowed to set up. - @override - @JsonKey(name: "payment_method_types") - List get paymentMethodTypes; - - /// ID of the single_use Mandate generated by the SetupIntent. - @override - @JsonKey(name: "single_use_mandate") - String? get singleUseMandate; - - /// Status of this SetupIntent, one of requires_payment_method, - /// requires_confirmation, requires_action, processing, canceled, or - /// succeeded. - @override - SetupIntentsStatus get status; - - /// Indicates how the payment method is intended to be used in the future. - /// Use on_session if you intend to only reuse the payment method when - /// the customer is in your checkout flow. - /// Use off_session if your customer may or may not be in your checkout flow. - /// If not provided, this value defaults to off_session. - @override - SetupIntentUsage get usage; - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SetupIntentImplCopyWith<_$SetupIntentImpl> get copyWith => - throw _privateConstructorUsedError; +/// The error encountered in the previous SetupIntent confirmation. +@override@JsonKey(name: "last_setup_error") final dynamic lastSetupError; +/// The most recent SetupAttempt for this SetupIntent. +@override@JsonKey(name: "latest_attempt") final String? latestAttempt; +/// Has the value true if the object exists in live mode or the +/// value false if the object exists in test mode. +@override@JsonKey() final bool livemode; +/// ID of the multi use Mandate generated by the SetupIntent. +@override final String? mandate; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the +/// object in a structured format. + final Map _metadata; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the +/// object in a structured format. +@override@JsonKey() Map get metadata { + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_metadata); +} + +/// If present, this property tells you what actions you need to +/// take in order for your customer to continue payment setup. +@override@JsonKey(name: "next_action") final dynamic nextAction; +/// CONNECT ONLY +/// The account (if any) for which the setup is intended. +@override@JsonKey(name: "on_behalf_of") final String? onBehalfOf; +/// ID of the payment method used in this SetupIntent. +@override@JsonKey(name: "payment_method") final String? paymentMethod; +/// Payment-method-specific configuration for this SetupIntent. +@override@JsonKey(name: "payment_method_options") final dynamic paymentMethodOptions; +/// The list of payment method types (e.g. card) that this SetupIntent +/// is allowed to set up. + final List _paymentMethodTypes; +/// The list of payment method types (e.g. card) that this SetupIntent +/// is allowed to set up. +@override@JsonKey(name: "payment_method_types") List get paymentMethodTypes { + if (_paymentMethodTypes is EqualUnmodifiableListView) return _paymentMethodTypes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_paymentMethodTypes); +} + +/// ID of the single_use Mandate generated by the SetupIntent. +@override@JsonKey(name: "single_use_mandate") final String? singleUseMandate; +/// Status of this SetupIntent, one of requires_payment_method, +/// requires_confirmation, requires_action, processing, canceled, or +/// succeeded. +@override final SetupIntentsStatus status; +/// Indicates how the payment method is intended to be used in the future. +/// Use on_session if you intend to only reuse the payment method when +/// the customer is in your checkout flow. +/// Use off_session if your customer may or may not be in your checkout flow. +/// If not provided, this value defaults to off_session. +@override@JsonKey() final SetupIntentUsage usage; + +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SetupIntentCopyWith<_SetupIntent> get copyWith => __$SetupIntentCopyWithImpl<_SetupIntent>(this, _$identity); + +@override +Map toJson() { + return _$SetupIntentToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SetupIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.application, application) || other.application == application)&&(identical(other.attachToSelf, attachToSelf) || other.attachToSelf == attachToSelf)&&(identical(other.cancellationReason, cancellationReason) || other.cancellationReason == cancellationReason)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.created, created) || other.created == created)&&(identical(other.customer, customer) || other.customer == customer)&&(identical(other.description, description) || other.description == description)&&const DeepCollectionEquality().equals(other._flowDirections, _flowDirections)&&const DeepCollectionEquality().equals(other.lastSetupError, lastSetupError)&&(identical(other.latestAttempt, latestAttempt) || other.latestAttempt == latestAttempt)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.mandate, mandate) || other.mandate == mandate)&&const DeepCollectionEquality().equals(other._metadata, _metadata)&&const DeepCollectionEquality().equals(other.nextAction, nextAction)&&(identical(other.onBehalfOf, onBehalfOf) || other.onBehalfOf == onBehalfOf)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&const DeepCollectionEquality().equals(other.paymentMethodOptions, paymentMethodOptions)&&const DeepCollectionEquality().equals(other._paymentMethodTypes, _paymentMethodTypes)&&(identical(other.singleUseMandate, singleUseMandate) || other.singleUseMandate == singleUseMandate)&&(identical(other.status, status) || other.status == status)&&(identical(other.usage, usage) || other.usage == usage)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,object,application,attachToSelf,cancellationReason,clientSecret,created,customer,description,const DeepCollectionEquality().hash(_flowDirections),const DeepCollectionEquality().hash(lastSetupError),latestAttempt,livemode,mandate,const DeepCollectionEquality().hash(_metadata),const DeepCollectionEquality().hash(nextAction),onBehalfOf,paymentMethod,const DeepCollectionEquality().hash(paymentMethodOptions),const DeepCollectionEquality().hash(_paymentMethodTypes),singleUseMandate,status,usage]); + +@override +String toString() { + return 'SetupIntent(id: $id, object: $object, application: $application, attachToSelf: $attachToSelf, cancellationReason: $cancellationReason, clientSecret: $clientSecret, created: $created, customer: $customer, description: $description, flowDirections: $flowDirections, lastSetupError: $lastSetupError, latestAttempt: $latestAttempt, livemode: $livemode, mandate: $mandate, metadata: $metadata, nextAction: $nextAction, onBehalfOf: $onBehalfOf, paymentMethod: $paymentMethod, paymentMethodOptions: $paymentMethodOptions, paymentMethodTypes: $paymentMethodTypes, singleUseMandate: $singleUseMandate, status: $status, usage: $usage)'; } + + +} + +/// @nodoc +abstract mixin class _$SetupIntentCopyWith<$Res> implements $SetupIntentCopyWith<$Res> { + factory _$SetupIntentCopyWith(_SetupIntent value, $Res Function(_SetupIntent) _then) = __$SetupIntentCopyWithImpl; +@override @useResult +$Res call({ + String id, String object, String? application,@JsonKey(name: "attach_to_self") String? attachToSelf,@JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? cancellationReason,@JsonKey(name: "client_secret") String clientSecret, int? created, String? customer, String? description,@JsonKey(name: "flow_directions") List? flowDirections,@JsonKey(name: "last_setup_error") dynamic lastSetupError,@JsonKey(name: "latest_attempt") String? latestAttempt, bool livemode, String? mandate, Map metadata,@JsonKey(name: "next_action") dynamic nextAction,@JsonKey(name: "on_behalf_of") String? onBehalfOf,@JsonKey(name: "payment_method") String? paymentMethod,@JsonKey(name: "payment_method_options") dynamic paymentMethodOptions,@JsonKey(name: "payment_method_types") List paymentMethodTypes,@JsonKey(name: "single_use_mandate") String? singleUseMandate, SetupIntentsStatus status, SetupIntentUsage usage +}); + + + + +} +/// @nodoc +class __$SetupIntentCopyWithImpl<$Res> + implements _$SetupIntentCopyWith<$Res> { + __$SetupIntentCopyWithImpl(this._self, this._then); + + final _SetupIntent _self; + final $Res Function(_SetupIntent) _then; + +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? object = null,Object? application = freezed,Object? attachToSelf = freezed,Object? cancellationReason = freezed,Object? clientSecret = null,Object? created = freezed,Object? customer = freezed,Object? description = freezed,Object? flowDirections = freezed,Object? lastSetupError = freezed,Object? latestAttempt = freezed,Object? livemode = null,Object? mandate = freezed,Object? metadata = null,Object? nextAction = freezed,Object? onBehalfOf = freezed,Object? paymentMethod = freezed,Object? paymentMethodOptions = freezed,Object? paymentMethodTypes = null,Object? singleUseMandate = freezed,Object? status = null,Object? usage = null,}) { + return _then(_SetupIntent( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,application: freezed == application ? _self.application : application // ignore: cast_nullable_to_non_nullable +as String?,attachToSelf: freezed == attachToSelf ? _self.attachToSelf : attachToSelf // ignore: cast_nullable_to_non_nullable +as String?,cancellationReason: freezed == cancellationReason ? _self.cancellationReason : cancellationReason // ignore: cast_nullable_to_non_nullable +as SetupIntentCancellationReason?,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,customer: freezed == customer ? _self.customer : customer // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,flowDirections: freezed == flowDirections ? _self._flowDirections : flowDirections // ignore: cast_nullable_to_non_nullable +as List?,lastSetupError: freezed == lastSetupError ? _self.lastSetupError : lastSetupError // ignore: cast_nullable_to_non_nullable +as dynamic,latestAttempt: freezed == latestAttempt ? _self.latestAttempt : latestAttempt // ignore: cast_nullable_to_non_nullable +as String?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,mandate: freezed == mandate ? _self.mandate : mandate // ignore: cast_nullable_to_non_nullable +as String?,metadata: null == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as dynamic,onBehalfOf: freezed == onBehalfOf ? _self.onBehalfOf : onBehalfOf // ignore: cast_nullable_to_non_nullable +as String?,paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as String?,paymentMethodOptions: freezed == paymentMethodOptions ? _self.paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as dynamic,paymentMethodTypes: null == paymentMethodTypes ? _self._paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List,singleUseMandate: freezed == singleUseMandate ? _self.singleUseMandate : singleUseMandate // ignore: cast_nullable_to_non_nullable +as String?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as SetupIntentsStatus,usage: null == usage ? _self.usage : usage // ignore: cast_nullable_to_non_nullable +as SetupIntentUsage, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent.g.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent.g.dart index 35a5752cd..f616fd156 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent.g.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent.g.dart @@ -6,84 +6,76 @@ part of 'setup_intent.dart'; // JsonSerializableGenerator // ************************************************************************** -_$SetupIntentImpl _$$SetupIntentImplFromJson(Map json) => _$SetupIntentImpl( - id: json['id'] as String, - object: json['object'] as String? ?? "setup_intent", - application: json['application'] as String?, - attachToSelf: json['attach_to_self'] as String?, - cancellationReason: $enumDecodeNullable( - _$SetupIntentCancellationReasonEnumMap, json['cancellation_reason']), - clientSecret: json['client_secret'] as String, - created: (json['created'] as num?)?.toInt(), - customer: json['customer'] as String?, - description: json['description'] as String?, - flowDirections: (json['flow_directions'] as List?) - ?.map((e) => $enumDecode(_$SetupIntentFlowDirectionsEnumMap, e)) - .toList(), - lastSetupError: json['last_setup_error'], - latestAttempt: json['latest_attempt'] as String?, - livemode: json['livemode'] as bool? ?? true, - mandate: json['mandate'] as String?, - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k as String, e), - ) ?? - const {}, - nextAction: json['next_action'], - onBehalfOf: json['on_behalf_of'] as String?, - paymentMethod: json['payment_method'] as String?, - paymentMethodOptions: json['payment_method_options'], - paymentMethodTypes: (json['payment_method_types'] as List?) - ?.map((e) => $enumDecode(_$PaymentMethodTypeEnumMap, e)) - .toList() ?? - const [], - singleUseMandate: json['single_use_mandate'] as String?, - status: $enumDecode(_$SetupIntentsStatusEnumMap, json['status']), - usage: $enumDecodeNullable(_$SetupIntentUsageEnumMap, json['usage']) ?? - SetupIntentUsage.offSession, - ); - -Map _$$SetupIntentImplToJson(_$SetupIntentImpl instance) { - final val = { - 'id': instance.id, - 'object': instance.object, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } +_SetupIntent _$SetupIntentFromJson(Map json) => _SetupIntent( + id: json['id'] as String, + object: json['object'] as String? ?? "setup_intent", + application: json['application'] as String?, + attachToSelf: json['attach_to_self'] as String?, + cancellationReason: $enumDecodeNullable( + _$SetupIntentCancellationReasonEnumMap, + json['cancellation_reason'], + ), + clientSecret: json['client_secret'] as String, + created: (json['created'] as num?)?.toInt(), + customer: json['customer'] as String?, + description: json['description'] as String?, + flowDirections: (json['flow_directions'] as List?) + ?.map((e) => $enumDecode(_$SetupIntentFlowDirectionsEnumMap, e)) + .toList(), + lastSetupError: json['last_setup_error'], + latestAttempt: json['latest_attempt'] as String?, + livemode: json['livemode'] as bool? ?? true, + mandate: json['mandate'] as String?, + metadata: + (json['metadata'] as Map?)?.map((k, e) => MapEntry(k as String, e)) ?? + const {}, + nextAction: json['next_action'], + onBehalfOf: json['on_behalf_of'] as String?, + paymentMethod: json['payment_method'] as String?, + paymentMethodOptions: json['payment_method_options'], + paymentMethodTypes: + (json['payment_method_types'] as List?) + ?.map((e) => $enumDecode(_$PaymentMethodTypeEnumMap, e)) + .toList() ?? + const [], + singleUseMandate: json['single_use_mandate'] as String?, + status: $enumDecode(_$SetupIntentsStatusEnumMap, json['status']), + usage: + $enumDecodeNullable(_$SetupIntentUsageEnumMap, json['usage']) ?? + SetupIntentUsage.offSession, +); - writeNotNull('application', instance.application); - writeNotNull('attach_to_self', instance.attachToSelf); - writeNotNull('cancellation_reason', - _$SetupIntentCancellationReasonEnumMap[instance.cancellationReason]); - val['client_secret'] = instance.clientSecret; - writeNotNull('created', instance.created); - writeNotNull('customer', instance.customer); - writeNotNull('description', instance.description); - writeNotNull( - 'flow_directions', - instance.flowDirections +Map _$SetupIntentToJson(_SetupIntent instance) => + { + 'id': instance.id, + 'object': instance.object, + 'application': ?instance.application, + 'attach_to_self': ?instance.attachToSelf, + 'cancellation_reason': + ?_$SetupIntentCancellationReasonEnumMap[instance.cancellationReason], + 'client_secret': instance.clientSecret, + 'created': ?instance.created, + 'customer': ?instance.customer, + 'description': ?instance.description, + 'flow_directions': ?instance.flowDirections ?.map((e) => _$SetupIntentFlowDirectionsEnumMap[e]!) - .toList()); - writeNotNull('last_setup_error', instance.lastSetupError); - writeNotNull('latest_attempt', instance.latestAttempt); - val['livemode'] = instance.livemode; - writeNotNull('mandate', instance.mandate); - val['metadata'] = instance.metadata; - writeNotNull('next_action', instance.nextAction); - writeNotNull('on_behalf_of', instance.onBehalfOf); - writeNotNull('payment_method', instance.paymentMethod); - writeNotNull('payment_method_options', instance.paymentMethodOptions); - val['payment_method_types'] = instance.paymentMethodTypes - .map((e) => _$PaymentMethodTypeEnumMap[e]!) - .toList(); - writeNotNull('single_use_mandate', instance.singleUseMandate); - val['status'] = _$SetupIntentsStatusEnumMap[instance.status]!; - val['usage'] = _$SetupIntentUsageEnumMap[instance.usage]!; - return val; -} + .toList(), + 'last_setup_error': ?instance.lastSetupError, + 'latest_attempt': ?instance.latestAttempt, + 'livemode': instance.livemode, + 'mandate': ?instance.mandate, + 'metadata': instance.metadata, + 'next_action': ?instance.nextAction, + 'on_behalf_of': ?instance.onBehalfOf, + 'payment_method': ?instance.paymentMethod, + 'payment_method_options': ?instance.paymentMethodOptions, + 'payment_method_types': instance.paymentMethodTypes + .map((e) => _$PaymentMethodTypeEnumMap[e]!) + .toList(), + 'single_use_mandate': ?instance.singleUseMandate, + 'status': _$SetupIntentsStatusEnumMap[instance.status]!, + 'usage': _$SetupIntentUsageEnumMap[instance.usage]!, + }; const _$SetupIntentCancellationReasonEnumMap = { SetupIntentCancellationReason.duplicate: 'duplicate', @@ -125,7 +117,6 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.pix: 'pix', PaymentMethodType.promptpay: 'promptpay', PaymentMethodType.sepaDebit: 'sepa_debit', - PaymentMethodType.sofort: 'sofort', PaymentMethodType.usBankAccount: 'us_bank_account', PaymentMethodType.wechatPay: 'wechat_pay', PaymentMethodType.unknown: 'unknown', diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.dart index 72af47a1b..bac846202 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.dart @@ -1,11 +1,11 @@ -import 'package:stripe_js/stripe_api.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:stripe_js/stripe_api.dart'; part 'setup_intent_response.freezed.dart'; part 'setup_intent_response.g.dart'; @freezed -class SetupIntentResponse with _$SetupIntentResponse { +abstract class SetupIntentResponse with _$SetupIntentResponse { const factory SetupIntentResponse({ /// If not null, a SetupIntent was retrieved successfully SetupIntent? setupIntent, diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.freezed.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.freezed.dart index 90a843f06..5cefa6494 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.freezed.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,221 +9,324 @@ part of 'setup_intent_response.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -SetupIntentResponse _$SetupIntentResponseFromJson(Map json) { - return _SetupIntentResponse.fromJson(json); -} - /// @nodoc mixin _$SetupIntentResponse { - /// If not null, a SetupIntent was retrieved successfully - SetupIntent? get setupIntent => throw _privateConstructorUsedError; - /// If not null, an error occurred - StripeError? get error => throw _privateConstructorUsedError; +/// If not null, a SetupIntent was retrieved successfully + SetupIntent? get setupIntent;/// If not null, an error occurred + StripeError? get error; +/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SetupIntentResponseCopyWith get copyWith => _$SetupIntentResponseCopyWithImpl(this as SetupIntentResponse, _$identity); /// Serializes this SetupIntentResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SetupIntentResponseCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SetupIntentResponse&&(identical(other.setupIntent, setupIntent) || other.setupIntent == setupIntent)&&(identical(other.error, error) || other.error == error)); } -/// @nodoc -abstract class $SetupIntentResponseCopyWith<$Res> { - factory $SetupIntentResponseCopyWith( - SetupIntentResponse value, $Res Function(SetupIntentResponse) then) = - _$SetupIntentResponseCopyWithImpl<$Res, SetupIntentResponse>; - @useResult - $Res call({SetupIntent? setupIntent, StripeError? error}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,setupIntent,error); - $SetupIntentCopyWith<$Res>? get setupIntent; - $StripeErrorCopyWith<$Res>? get error; +@override +String toString() { + return 'SetupIntentResponse(setupIntent: $setupIntent, error: $error)'; } + +} + +/// @nodoc +abstract mixin class $SetupIntentResponseCopyWith<$Res> { + factory $SetupIntentResponseCopyWith(SetupIntentResponse value, $Res Function(SetupIntentResponse) _then) = _$SetupIntentResponseCopyWithImpl; +@useResult +$Res call({ + SetupIntent? setupIntent, StripeError? error +}); + + +$SetupIntentCopyWith<$Res>? get setupIntent;$StripeErrorCopyWith<$Res>? get error; + +} /// @nodoc -class _$SetupIntentResponseCopyWithImpl<$Res, $Val extends SetupIntentResponse> +class _$SetupIntentResponseCopyWithImpl<$Res> implements $SetupIntentResponseCopyWith<$Res> { - _$SetupIntentResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? setupIntent = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - setupIntent: freezed == setupIntent - ? _value.setupIntent - : setupIntent // ignore: cast_nullable_to_non_nullable - as SetupIntent?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - ) as $Val); + _$SetupIntentResponseCopyWithImpl(this._self, this._then); + + final SetupIntentResponse _self; + final $Res Function(SetupIntentResponse) _then; + +/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? setupIntent = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +setupIntent: freezed == setupIntent ? _self.setupIntent : setupIntent // ignore: cast_nullable_to_non_nullable +as SetupIntent?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} +/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SetupIntentCopyWith<$Res>? get setupIntent { + if (_self.setupIntent == null) { + return null; } - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SetupIntentCopyWith<$Res>? get setupIntent { - if (_value.setupIntent == null) { - return null; - } - - return $SetupIntentCopyWith<$Res>(_value.setupIntent!, (value) { - return _then(_value.copyWith(setupIntent: value) as $Val); - }); + return $SetupIntentCopyWith<$Res>(_self.setupIntent!, (value) { + return _then(_self.copyWith(setupIntent: value)); + }); +}/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith<$Res>? get error { - if (_value.error == null) { - return null; - } - - return $StripeErrorCopyWith<$Res>(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } -/// @nodoc -abstract class _$$SetupIntentResponseImplCopyWith<$Res> - implements $SetupIntentResponseCopyWith<$Res> { - factory _$$SetupIntentResponseImplCopyWith(_$SetupIntentResponseImpl value, - $Res Function(_$SetupIntentResponseImpl) then) = - __$$SetupIntentResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({SetupIntent? setupIntent, StripeError? error}); - @override - $SetupIntentCopyWith<$Res>? get setupIntent; - @override - $StripeErrorCopyWith<$Res>? get error; +/// Adds pattern-matching-related methods to [SetupIntentResponse]. +extension SetupIntentResponsePatterns on SetupIntentResponse { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SetupIntentResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SetupIntentResponse() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SetupIntentResponse value) $default,){ +final _that = this; +switch (_that) { +case _SetupIntentResponse(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SetupIntentResponse value)? $default,){ +final _that = this; +switch (_that) { +case _SetupIntentResponse() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( SetupIntent? setupIntent, StripeError? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SetupIntentResponse() when $default != null: +return $default(_that.setupIntent,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( SetupIntent? setupIntent, StripeError? error) $default,) {final _that = this; +switch (_that) { +case _SetupIntentResponse(): +return $default(_that.setupIntent,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( SetupIntent? setupIntent, StripeError? error)? $default,) {final _that = this; +switch (_that) { +case _SetupIntentResponse() when $default != null: +return $default(_that.setupIntent,_that.error);case _: + return null; + +} } -/// @nodoc -class __$$SetupIntentResponseImplCopyWithImpl<$Res> - extends _$SetupIntentResponseCopyWithImpl<$Res, _$SetupIntentResponseImpl> - implements _$$SetupIntentResponseImplCopyWith<$Res> { - __$$SetupIntentResponseImplCopyWithImpl(_$SetupIntentResponseImpl _value, - $Res Function(_$SetupIntentResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? setupIntent = freezed, - Object? error = freezed, - }) { - return _then(_$SetupIntentResponseImpl( - setupIntent: freezed == setupIntent - ? _value.setupIntent - : setupIntent // ignore: cast_nullable_to_non_nullable - as SetupIntent?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - )); - } } /// @nodoc @JsonSerializable() -class _$SetupIntentResponseImpl implements _SetupIntentResponse { - const _$SetupIntentResponseImpl({this.setupIntent, this.error}); - factory _$SetupIntentResponseImpl.fromJson(Map json) => - _$$SetupIntentResponseImplFromJson(json); +class _SetupIntentResponse implements SetupIntentResponse { + const _SetupIntentResponse({this.setupIntent, this.error}); + factory _SetupIntentResponse.fromJson(Map json) => _$SetupIntentResponseFromJson(json); - /// If not null, a SetupIntent was retrieved successfully - @override - final SetupIntent? setupIntent; +/// If not null, a SetupIntent was retrieved successfully +@override final SetupIntent? setupIntent; +/// If not null, an error occurred +@override final StripeError? error; - /// If not null, an error occurred - @override - final StripeError? error; +/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SetupIntentResponseCopyWith<_SetupIntentResponse> get copyWith => __$SetupIntentResponseCopyWithImpl<_SetupIntentResponse>(this, _$identity); - @override - String toString() { - return 'SetupIntentResponse(setupIntent: $setupIntent, error: $error)'; - } +@override +Map toJson() { + return _$SetupIntentResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SetupIntentResponse&&(identical(other.setupIntent, setupIntent) || other.setupIntent == setupIntent)&&(identical(other.error, error) || other.error == error)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,setupIntent,error); + +@override +String toString() { + return 'SetupIntentResponse(setupIntent: $setupIntent, error: $error)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SetupIntentResponseImpl && - (identical(other.setupIntent, setupIntent) || - other.setupIntent == setupIntent) && - (identical(other.error, error) || other.error == error)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, setupIntent, error); - - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SetupIntentResponseImplCopyWith<_$SetupIntentResponseImpl> get copyWith => - __$$SetupIntentResponseImplCopyWithImpl<_$SetupIntentResponseImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$SetupIntentResponseImplToJson( - this, - ); - } } -abstract class _SetupIntentResponse implements SetupIntentResponse { - const factory _SetupIntentResponse( - {final SetupIntent? setupIntent, - final StripeError? error}) = _$SetupIntentResponseImpl; +/// @nodoc +abstract mixin class _$SetupIntentResponseCopyWith<$Res> implements $SetupIntentResponseCopyWith<$Res> { + factory _$SetupIntentResponseCopyWith(_SetupIntentResponse value, $Res Function(_SetupIntentResponse) _then) = __$SetupIntentResponseCopyWithImpl; +@override @useResult +$Res call({ + SetupIntent? setupIntent, StripeError? error +}); + + +@override $SetupIntentCopyWith<$Res>? get setupIntent;@override $StripeErrorCopyWith<$Res>? get error; - factory _SetupIntentResponse.fromJson(Map json) = - _$SetupIntentResponseImpl.fromJson; +} +/// @nodoc +class __$SetupIntentResponseCopyWithImpl<$Res> + implements _$SetupIntentResponseCopyWith<$Res> { + __$SetupIntentResponseCopyWithImpl(this._self, this._then); + + final _SetupIntentResponse _self; + final $Res Function(_SetupIntentResponse) _then; + +/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? setupIntent = freezed,Object? error = freezed,}) { + return _then(_SetupIntentResponse( +setupIntent: freezed == setupIntent ? _self.setupIntent : setupIntent // ignore: cast_nullable_to_non_nullable +as SetupIntent?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} - /// If not null, a SetupIntent was retrieved successfully - @override - SetupIntent? get setupIntent; +/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SetupIntentCopyWith<$Res>? get setupIntent { + if (_self.setupIntent == null) { + return null; + } - /// If not null, an error occurred - @override - StripeError? get error; + return $SetupIntentCopyWith<$Res>(_self.setupIntent!, (value) { + return _then(_self.copyWith(setupIntent: value)); + }); +}/// Create a copy of SetupIntentResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } - /// Create a copy of SetupIntentResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SetupIntentResponseImplCopyWith<_$SetupIntentResponseImpl> get copyWith => - throw _privateConstructorUsedError; + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.g.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.g.dart index 9fcf6dc87..115884d6a 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.g.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_response.g.dart @@ -6,29 +6,23 @@ part of 'setup_intent_response.dart'; // JsonSerializableGenerator // ************************************************************************** -_$SetupIntentResponseImpl _$$SetupIntentResponseImplFromJson(Map json) => - _$SetupIntentResponseImpl( +_SetupIntentResponse _$SetupIntentResponseFromJson(Map json) => + _SetupIntentResponse( setupIntent: json['setupIntent'] == null ? null : SetupIntent.fromJson( - Map.from(json['setupIntent'] as Map)), + Map.from(json['setupIntent'] as Map), + ), error: json['error'] == null ? null : StripeError.fromJson( - Map.from(json['error'] as Map)), + Map.from(json['error'] as Map), + ), ); -Map _$$SetupIntentResponseImplToJson( - _$SetupIntentResponseImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('setupIntent', instance.setupIntent?.toJson()); - writeNotNull('error', instance.error?.toJson()); - return val; -} +Map _$SetupIntentResponseToJson( + _SetupIntentResponse instance, +) => { + 'setupIntent': ?instance.setupIntent?.toJson(), + 'error': ?instance.error?.toJson(), +}; diff --git a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_status.dart b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_status.dart index 0c70a475a..0e9bb4795 100644 --- a/packages/stripe_js/lib/src/api/setup_intents/setup_intent_status.dart +++ b/packages/stripe_js/lib/src/api/setup_intents/setup_intent_status.dart @@ -7,7 +7,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; enum SetupIntentsStatus { /// When the SetupIntent is created, it has a status of /// requires_payment_method until a payment method is attached. - requiresPaymentMethod, /// Optional @@ -16,12 +15,10 @@ enum SetupIntentsStatus { /// In most integrations, this state is skipped because payment method /// information is submitted at the same time that the SetupIntent is /// confirmed. - requiresConfirmation, /// If the payment requires additional actions, such as authenticating /// with 3D Secure, the SetupIntent has a status of requires_action. - requiresAction, /// After required actions are handled, the SetupIntent moves to processing. diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.dart b/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.dart index 00b01cd14..c8a38a639 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.dart @@ -5,7 +5,7 @@ part 'create_token_bank_account_data.freezed.dart'; part 'create_token_bank_account_data.g.dart'; @freezed -class CreateTokenBankAccountData with _$CreateTokenBankAccountData { +abstract class CreateTokenBankAccountData with _$CreateTokenBankAccountData { const factory CreateTokenBankAccountData({ required String country, diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.freezed.dart b/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.freezed.dart index 60227ee5e..5cc5dd5d0 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,322 +9,289 @@ part of 'create_token_bank_account_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CreateTokenBankAccountData _$CreateTokenBankAccountDataFromJson( - Map json) { - return _CreateTokenBankAccountData.fromJson(json); -} - /// @nodoc mixin _$CreateTokenBankAccountData { - String get country => throw _privateConstructorUsedError; - - /// Three character currency code (e.g., usd). - String get currency => throw _privateConstructorUsedError; - @JsonKey(name: "routing_number") - String? get routingNumber => throw _privateConstructorUsedError; - @JsonKey(name: "account_number") - String get accountNumber => throw _privateConstructorUsedError; - @JsonKey(name: "account_holder_name") - String? get accountHolderName => throw _privateConstructorUsedError; - @JsonKey(name: "account_holder_type") - BankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; - @JsonKey(name: "account_type") - String? get accountType => throw _privateConstructorUsedError; + + String get country;/// Three character currency code (e.g., usd). + String get currency;@JsonKey(name: "routing_number") String? get routingNumber;@JsonKey(name: "account_number") String get accountNumber;@JsonKey(name: "account_holder_name") String? get accountHolderName;@JsonKey(name: "account_holder_type") BankAccountHolderType? get accountHolderType;@JsonKey(name: "account_type") String? get accountType; +/// Create a copy of CreateTokenBankAccountData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CreateTokenBankAccountDataCopyWith get copyWith => _$CreateTokenBankAccountDataCopyWithImpl(this as CreateTokenBankAccountData, _$identity); /// Serializes this CreateTokenBankAccountData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CreateTokenBankAccountData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CreateTokenBankAccountDataCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateTokenBankAccountData&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)); } -/// @nodoc -abstract class $CreateTokenBankAccountDataCopyWith<$Res> { - factory $CreateTokenBankAccountDataCopyWith(CreateTokenBankAccountData value, - $Res Function(CreateTokenBankAccountData) then) = - _$CreateTokenBankAccountDataCopyWithImpl<$Res, - CreateTokenBankAccountData>; - @useResult - $Res call( - {String country, - String currency, - @JsonKey(name: "routing_number") String? routingNumber, - @JsonKey(name: "account_number") String accountNumber, - @JsonKey(name: "account_holder_name") String? accountHolderName, - @JsonKey(name: "account_holder_type") - BankAccountHolderType? accountHolderType, - @JsonKey(name: "account_type") String? accountType}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,currency,routingNumber,accountNumber,accountHolderName,accountHolderType,accountType); + +@override +String toString() { + return 'CreateTokenBankAccountData(country: $country, currency: $currency, routingNumber: $routingNumber, accountNumber: $accountNumber, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, accountType: $accountType)'; } -/// @nodoc -class _$CreateTokenBankAccountDataCopyWithImpl<$Res, - $Val extends CreateTokenBankAccountData> - implements $CreateTokenBankAccountDataCopyWith<$Res> { - _$CreateTokenBankAccountDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CreateTokenBankAccountData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? currency = null, - Object? routingNumber = freezed, - Object? accountNumber = null, - Object? accountHolderName = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - }) { - return _then(_value.copyWith( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - accountNumber: null == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CreateTokenBankAccountDataImplCopyWith<$Res> +abstract mixin class $CreateTokenBankAccountDataCopyWith<$Res> { + factory $CreateTokenBankAccountDataCopyWith(CreateTokenBankAccountData value, $Res Function(CreateTokenBankAccountData) _then) = _$CreateTokenBankAccountDataCopyWithImpl; +@useResult +$Res call({ + String country, String currency,@JsonKey(name: "routing_number") String? routingNumber,@JsonKey(name: "account_number") String accountNumber,@JsonKey(name: "account_holder_name") String? accountHolderName,@JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType,@JsonKey(name: "account_type") String? accountType +}); + + + + +} +/// @nodoc +class _$CreateTokenBankAccountDataCopyWithImpl<$Res> implements $CreateTokenBankAccountDataCopyWith<$Res> { - factory _$$CreateTokenBankAccountDataImplCopyWith( - _$CreateTokenBankAccountDataImpl value, - $Res Function(_$CreateTokenBankAccountDataImpl) then) = - __$$CreateTokenBankAccountDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String country, - String currency, - @JsonKey(name: "routing_number") String? routingNumber, - @JsonKey(name: "account_number") String accountNumber, - @JsonKey(name: "account_holder_name") String? accountHolderName, - @JsonKey(name: "account_holder_type") - BankAccountHolderType? accountHolderType, - @JsonKey(name: "account_type") String? accountType}); + _$CreateTokenBankAccountDataCopyWithImpl(this._self, this._then); + + final CreateTokenBankAccountData _self; + final $Res Function(CreateTokenBankAccountData) _then; + +/// Create a copy of CreateTokenBankAccountData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? country = null,Object? currency = null,Object? routingNumber = freezed,Object? accountNumber = null,Object? accountHolderName = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,}) { + return _then(_self.copyWith( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,accountNumber: null == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CreateTokenBankAccountData]. +extension CreateTokenBankAccountDataPatterns on CreateTokenBankAccountData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreateTokenBankAccountData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreateTokenBankAccountData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreateTokenBankAccountData value) $default,){ +final _that = this; +switch (_that) { +case _CreateTokenBankAccountData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreateTokenBankAccountData value)? $default,){ +final _that = this; +switch (_that) { +case _CreateTokenBankAccountData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String country, String currency, @JsonKey(name: "routing_number") String? routingNumber, @JsonKey(name: "account_number") String accountNumber, @JsonKey(name: "account_holder_name") String? accountHolderName, @JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType, @JsonKey(name: "account_type") String? accountType)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreateTokenBankAccountData() when $default != null: +return $default(_that.country,_that.currency,_that.routingNumber,_that.accountNumber,_that.accountHolderName,_that.accountHolderType,_that.accountType);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String country, String currency, @JsonKey(name: "routing_number") String? routingNumber, @JsonKey(name: "account_number") String accountNumber, @JsonKey(name: "account_holder_name") String? accountHolderName, @JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType, @JsonKey(name: "account_type") String? accountType) $default,) {final _that = this; +switch (_that) { +case _CreateTokenBankAccountData(): +return $default(_that.country,_that.currency,_that.routingNumber,_that.accountNumber,_that.accountHolderName,_that.accountHolderType,_that.accountType);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String country, String currency, @JsonKey(name: "routing_number") String? routingNumber, @JsonKey(name: "account_number") String accountNumber, @JsonKey(name: "account_holder_name") String? accountHolderName, @JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType, @JsonKey(name: "account_type") String? accountType)? $default,) {final _that = this; +switch (_that) { +case _CreateTokenBankAccountData() when $default != null: +return $default(_that.country,_that.currency,_that.routingNumber,_that.accountNumber,_that.accountHolderName,_that.accountHolderType,_that.accountType);case _: + return null; + +} } -/// @nodoc -class __$$CreateTokenBankAccountDataImplCopyWithImpl<$Res> - extends _$CreateTokenBankAccountDataCopyWithImpl<$Res, - _$CreateTokenBankAccountDataImpl> - implements _$$CreateTokenBankAccountDataImplCopyWith<$Res> { - __$$CreateTokenBankAccountDataImplCopyWithImpl( - _$CreateTokenBankAccountDataImpl _value, - $Res Function(_$CreateTokenBankAccountDataImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenBankAccountData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? currency = null, - Object? routingNumber = freezed, - Object? accountNumber = null, - Object? accountHolderName = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - }) { - return _then(_$CreateTokenBankAccountDataImpl( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - accountNumber: null == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$CreateTokenBankAccountDataImpl implements _CreateTokenBankAccountData { - const _$CreateTokenBankAccountDataImpl( - {required this.country, - required this.currency, - @JsonKey(name: "routing_number") this.routingNumber, - @JsonKey(name: "account_number") required this.accountNumber, - @JsonKey(name: "account_holder_name") this.accountHolderName, - @JsonKey(name: "account_holder_type") this.accountHolderType, - @JsonKey(name: "account_type") this.accountType}); - - factory _$CreateTokenBankAccountDataImpl.fromJson( - Map json) => - _$$CreateTokenBankAccountDataImplFromJson(json); - - @override - final String country; - - /// Three character currency code (e.g., usd). - @override - final String currency; - @override - @JsonKey(name: "routing_number") - final String? routingNumber; - @override - @JsonKey(name: "account_number") - final String accountNumber; - @override - @JsonKey(name: "account_holder_name") - final String? accountHolderName; - @override - @JsonKey(name: "account_holder_type") - final BankAccountHolderType? accountHolderType; - @override - @JsonKey(name: "account_type") - final String? accountType; - - @override - String toString() { - return 'CreateTokenBankAccountData(country: $country, currency: $currency, routingNumber: $routingNumber, accountNumber: $accountNumber, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, accountType: $accountType)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenBankAccountDataImpl && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.accountNumber, accountNumber) || - other.accountNumber == accountNumber) && - (identical(other.accountHolderName, accountHolderName) || - other.accountHolderName == accountHolderName) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.accountType, accountType) || - other.accountType == accountType)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, country, currency, routingNumber, - accountNumber, accountHolderName, accountHolderType, accountType); - - /// Create a copy of CreateTokenBankAccountData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenBankAccountDataImplCopyWith<_$CreateTokenBankAccountDataImpl> - get copyWith => __$$CreateTokenBankAccountDataImplCopyWithImpl< - _$CreateTokenBankAccountDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CreateTokenBankAccountDataImplToJson( - this, - ); - } + +class _CreateTokenBankAccountData implements CreateTokenBankAccountData { + const _CreateTokenBankAccountData({required this.country, required this.currency, @JsonKey(name: "routing_number") this.routingNumber, @JsonKey(name: "account_number") required this.accountNumber, @JsonKey(name: "account_holder_name") this.accountHolderName, @JsonKey(name: "account_holder_type") this.accountHolderType, @JsonKey(name: "account_type") this.accountType}); + factory _CreateTokenBankAccountData.fromJson(Map json) => _$CreateTokenBankAccountDataFromJson(json); + +@override final String country; +/// Three character currency code (e.g., usd). +@override final String currency; +@override@JsonKey(name: "routing_number") final String? routingNumber; +@override@JsonKey(name: "account_number") final String accountNumber; +@override@JsonKey(name: "account_holder_name") final String? accountHolderName; +@override@JsonKey(name: "account_holder_type") final BankAccountHolderType? accountHolderType; +@override@JsonKey(name: "account_type") final String? accountType; + +/// Create a copy of CreateTokenBankAccountData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenBankAccountDataCopyWith<_CreateTokenBankAccountData> get copyWith => __$CreateTokenBankAccountDataCopyWithImpl<_CreateTokenBankAccountData>(this, _$identity); + +@override +Map toJson() { + return _$CreateTokenBankAccountDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenBankAccountData&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)); } -abstract class _CreateTokenBankAccountData - implements CreateTokenBankAccountData { - const factory _CreateTokenBankAccountData( - {required final String country, - required final String currency, - @JsonKey(name: "routing_number") final String? routingNumber, - @JsonKey(name: "account_number") required final String accountNumber, - @JsonKey(name: "account_holder_name") final String? accountHolderName, - @JsonKey(name: "account_holder_type") - final BankAccountHolderType? accountHolderType, - @JsonKey(name: "account_type") final String? accountType}) = - _$CreateTokenBankAccountDataImpl; - - factory _CreateTokenBankAccountData.fromJson(Map json) = - _$CreateTokenBankAccountDataImpl.fromJson; - - @override - String get country; - - /// Three character currency code (e.g., usd). - @override - String get currency; - @override - @JsonKey(name: "routing_number") - String? get routingNumber; - @override - @JsonKey(name: "account_number") - String get accountNumber; - @override - @JsonKey(name: "account_holder_name") - String? get accountHolderName; - @override - @JsonKey(name: "account_holder_type") - BankAccountHolderType? get accountHolderType; - @override - @JsonKey(name: "account_type") - String? get accountType; - - /// Create a copy of CreateTokenBankAccountData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenBankAccountDataImplCopyWith<_$CreateTokenBankAccountDataImpl> - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,currency,routingNumber,accountNumber,accountHolderName,accountHolderType,accountType); + +@override +String toString() { + return 'CreateTokenBankAccountData(country: $country, currency: $currency, routingNumber: $routingNumber, accountNumber: $accountNumber, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, accountType: $accountType)'; } + + +} + +/// @nodoc +abstract mixin class _$CreateTokenBankAccountDataCopyWith<$Res> implements $CreateTokenBankAccountDataCopyWith<$Res> { + factory _$CreateTokenBankAccountDataCopyWith(_CreateTokenBankAccountData value, $Res Function(_CreateTokenBankAccountData) _then) = __$CreateTokenBankAccountDataCopyWithImpl; +@override @useResult +$Res call({ + String country, String currency,@JsonKey(name: "routing_number") String? routingNumber,@JsonKey(name: "account_number") String accountNumber,@JsonKey(name: "account_holder_name") String? accountHolderName,@JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType,@JsonKey(name: "account_type") String? accountType +}); + + + + +} +/// @nodoc +class __$CreateTokenBankAccountDataCopyWithImpl<$Res> + implements _$CreateTokenBankAccountDataCopyWith<$Res> { + __$CreateTokenBankAccountDataCopyWithImpl(this._self, this._then); + + final _CreateTokenBankAccountData _self; + final $Res Function(_CreateTokenBankAccountData) _then; + +/// Create a copy of CreateTokenBankAccountData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? country = null,Object? currency = null,Object? routingNumber = freezed,Object? accountNumber = null,Object? accountHolderName = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,}) { + return _then(_CreateTokenBankAccountData( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,accountNumber: null == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.g.dart b/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.g.dart index 0f7c1281a..2ac76cbb8 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.g.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_bank_account_data.g.dart @@ -6,40 +6,32 @@ part of 'create_token_bank_account_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CreateTokenBankAccountDataImpl _$$CreateTokenBankAccountDataImplFromJson( - Map json) => - _$CreateTokenBankAccountDataImpl( +_CreateTokenBankAccountData _$CreateTokenBankAccountDataFromJson(Map json) => + _CreateTokenBankAccountData( country: json['country'] as String, currency: json['currency'] as String, routingNumber: json['routing_number'] as String?, accountNumber: json['account_number'] as String, accountHolderName: json['account_holder_name'] as String?, accountHolderType: $enumDecodeNullable( - _$BankAccountHolderTypeEnumMap, json['account_holder_type']), + _$BankAccountHolderTypeEnumMap, + json['account_holder_type'], + ), accountType: json['account_type'] as String?, ); -Map _$$CreateTokenBankAccountDataImplToJson( - _$CreateTokenBankAccountDataImpl instance) { - final val = { - 'country': instance.country, - 'currency': instance.currency, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('routing_number', instance.routingNumber); - val['account_number'] = instance.accountNumber; - writeNotNull('account_holder_name', instance.accountHolderName); - writeNotNull('account_holder_type', - _$BankAccountHolderTypeEnumMap[instance.accountHolderType]); - writeNotNull('account_type', instance.accountType); - return val; -} +Map _$CreateTokenBankAccountDataToJson( + _CreateTokenBankAccountData instance, +) => { + 'country': instance.country, + 'currency': instance.currency, + 'routing_number': ?instance.routingNumber, + 'account_number': instance.accountNumber, + 'account_holder_name': ?instance.accountHolderName, + 'account_holder_type': + ?_$BankAccountHolderTypeEnumMap[instance.accountHolderType], + 'account_type': ?instance.accountType, +}; const _$BankAccountHolderTypeEnumMap = { BankAccountHolderType.company: 'company', diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_card_data.dart b/packages/stripe_js/lib/src/api/tokens/create_token_card_data.dart index a8cbc9eec..55ccbada0 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_card_data.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_card_data.dart @@ -4,7 +4,7 @@ part 'create_token_card_data.freezed.dart'; part 'create_token_card_data.g.dart'; @freezed -class CreateTokenCardData with _$CreateTokenCardData { +abstract class CreateTokenCardData with _$CreateTokenCardData { const factory CreateTokenCardData({ /// RECOMMENDED /// Cardholder name. diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_card_data.freezed.dart b/packages/stripe_js/lib/src/api/tokens/create_token_card_data.freezed.dart index 236a93803..c4899160f 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_card_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_card_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,388 +9,314 @@ part of 'create_token_card_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$CreateTokenCardData { + +/// RECOMMENDED +/// Cardholder name. + String? get name;/// Address line 1 (Street address/PO Box/Company name). +@JsonKey(name: "address_line1") String? get addressLine1;/// Address line 2 (Apartment/Suite/Unit/Building). +@JsonKey(name: "address_line2") String? get addressLine2;/// City/District/Suburb/Town/Village. +@JsonKey(name: "address_city") String? get addressCity;/// State/County/Province/Region. +@JsonKey(name: "address_state") String? get addressState;/// ZIP or postal code. +@JsonKey(name: "address_zip") String? get addressZip;/// RECOMMENDED. +/// A two character country code (for example, US). +/// Billing address country +@JsonKey(name: "address_country") String? get addressCountry;/// Required in order to add the card to a Connect account +///(in all other cases, this parameter is not used). +@JsonKey(name: "currency") String? get currency; +/// Create a copy of CreateTokenCardData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CreateTokenCardDataCopyWith get copyWith => _$CreateTokenCardDataCopyWithImpl(this as CreateTokenCardData, _$identity); + + /// Serializes this CreateTokenCardData to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateTokenCardData&&(identical(other.name, name) || other.name == name)&&(identical(other.addressLine1, addressLine1) || other.addressLine1 == addressLine1)&&(identical(other.addressLine2, addressLine2) || other.addressLine2 == addressLine2)&&(identical(other.addressCity, addressCity) || other.addressCity == addressCity)&&(identical(other.addressState, addressState) || other.addressState == addressState)&&(identical(other.addressZip, addressZip) || other.addressZip == addressZip)&&(identical(other.addressCountry, addressCountry) || other.addressCountry == addressCountry)&&(identical(other.currency, currency) || other.currency == currency)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,addressLine1,addressLine2,addressCity,addressState,addressZip,addressCountry,currency); + +@override +String toString() { + return 'CreateTokenCardData(name: $name, addressLine1: $addressLine1, addressLine2: $addressLine2, addressCity: $addressCity, addressState: $addressState, addressZip: $addressZip, addressCountry: $addressCountry, currency: $currency)'; +} + -CreateTokenCardData _$CreateTokenCardDataFromJson(Map json) { - return _CreateTokenCardData.fromJson(json); } /// @nodoc -mixin _$CreateTokenCardData { - /// RECOMMENDED - /// Cardholder name. - String? get name => throw _privateConstructorUsedError; +abstract mixin class $CreateTokenCardDataCopyWith<$Res> { + factory $CreateTokenCardDataCopyWith(CreateTokenCardData value, $Res Function(CreateTokenCardData) _then) = _$CreateTokenCardDataCopyWithImpl; +@useResult +$Res call({ + String? name,@JsonKey(name: "address_line1") String? addressLine1,@JsonKey(name: "address_line2") String? addressLine2,@JsonKey(name: "address_city") String? addressCity,@JsonKey(name: "address_state") String? addressState,@JsonKey(name: "address_zip") String? addressZip,@JsonKey(name: "address_country") String? addressCountry,@JsonKey(name: "currency") String? currency +}); - /// Address line 1 (Street address/PO Box/Company name). - @JsonKey(name: "address_line1") - String? get addressLine1 => throw _privateConstructorUsedError; - /// Address line 2 (Apartment/Suite/Unit/Building). - @JsonKey(name: "address_line2") - String? get addressLine2 => throw _privateConstructorUsedError; - /// City/District/Suburb/Town/Village. - @JsonKey(name: "address_city") - String? get addressCity => throw _privateConstructorUsedError; - /// State/County/Province/Region. - @JsonKey(name: "address_state") - String? get addressState => throw _privateConstructorUsedError; +} +/// @nodoc +class _$CreateTokenCardDataCopyWithImpl<$Res> + implements $CreateTokenCardDataCopyWith<$Res> { + _$CreateTokenCardDataCopyWithImpl(this._self, this._then); + + final CreateTokenCardData _self; + final $Res Function(CreateTokenCardData) _then; + +/// Create a copy of CreateTokenCardData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? addressLine1 = freezed,Object? addressLine2 = freezed,Object? addressCity = freezed,Object? addressState = freezed,Object? addressZip = freezed,Object? addressCountry = freezed,Object? currency = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,addressLine1: freezed == addressLine1 ? _self.addressLine1 : addressLine1 // ignore: cast_nullable_to_non_nullable +as String?,addressLine2: freezed == addressLine2 ? _self.addressLine2 : addressLine2 // ignore: cast_nullable_to_non_nullable +as String?,addressCity: freezed == addressCity ? _self.addressCity : addressCity // ignore: cast_nullable_to_non_nullable +as String?,addressState: freezed == addressState ? _self.addressState : addressState // ignore: cast_nullable_to_non_nullable +as String?,addressZip: freezed == addressZip ? _self.addressZip : addressZip // ignore: cast_nullable_to_non_nullable +as String?,addressCountry: freezed == addressCountry ? _self.addressCountry : addressCountry // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// ZIP or postal code. - @JsonKey(name: "address_zip") - String? get addressZip => throw _privateConstructorUsedError; +} - /// RECOMMENDED. - /// A two character country code (for example, US). - /// Billing address country - @JsonKey(name: "address_country") - String? get addressCountry => throw _privateConstructorUsedError; - /// Required in order to add the card to a Connect account - ///(in all other cases, this parameter is not used). - @JsonKey(name: "currency") - String? get currency => throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [CreateTokenCardData]. +extension CreateTokenCardDataPatterns on CreateTokenCardData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreateTokenCardData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreateTokenCardData() when $default != null: +return $default(_that);case _: + return orElse(); - /// Serializes this CreateTokenCardData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreateTokenCardData value) $default,){ +final _that = this; +switch (_that) { +case _CreateTokenCardData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// Create a copy of CreateTokenCardData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CreateTokenCardDataCopyWith get copyWith => - throw _privateConstructorUsedError; } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreateTokenCardData value)? $default,){ +final _that = this; +switch (_that) { +case _CreateTokenCardData() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc -abstract class $CreateTokenCardDataCopyWith<$Res> { - factory $CreateTokenCardDataCopyWith( - CreateTokenCardData value, $Res Function(CreateTokenCardData) then) = - _$CreateTokenCardDataCopyWithImpl<$Res, CreateTokenCardData>; - @useResult - $Res call( - {String? name, - @JsonKey(name: "address_line1") String? addressLine1, - @JsonKey(name: "address_line2") String? addressLine2, - @JsonKey(name: "address_city") String? addressCity, - @JsonKey(name: "address_state") String? addressState, - @JsonKey(name: "address_zip") String? addressZip, - @JsonKey(name: "address_country") String? addressCountry, - @JsonKey(name: "currency") String? currency}); } +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name, @JsonKey(name: "address_line1") String? addressLine1, @JsonKey(name: "address_line2") String? addressLine2, @JsonKey(name: "address_city") String? addressCity, @JsonKey(name: "address_state") String? addressState, @JsonKey(name: "address_zip") String? addressZip, @JsonKey(name: "address_country") String? addressCountry, @JsonKey(name: "currency") String? currency)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreateTokenCardData() when $default != null: +return $default(_that.name,_that.addressLine1,_that.addressLine2,_that.addressCity,_that.addressState,_that.addressZip,_that.addressCountry,_that.currency);case _: + return orElse(); -/// @nodoc -class _$CreateTokenCardDataCopyWithImpl<$Res, $Val extends CreateTokenCardData> - implements $CreateTokenCardDataCopyWith<$Res> { - _$CreateTokenCardDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CreateTokenCardData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? addressLine1 = freezed, - Object? addressLine2 = freezed, - Object? addressCity = freezed, - Object? addressState = freezed, - Object? addressZip = freezed, - Object? addressCountry = freezed, - Object? currency = freezed, - }) { - return _then(_value.copyWith( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - addressLine1: freezed == addressLine1 - ? _value.addressLine1 - : addressLine1 // ignore: cast_nullable_to_non_nullable - as String?, - addressLine2: freezed == addressLine2 - ? _value.addressLine2 - : addressLine2 // ignore: cast_nullable_to_non_nullable - as String?, - addressCity: freezed == addressCity - ? _value.addressCity - : addressCity // ignore: cast_nullable_to_non_nullable - as String?, - addressState: freezed == addressState - ? _value.addressState - : addressState // ignore: cast_nullable_to_non_nullable - as String?, - addressZip: freezed == addressZip - ? _value.addressZip - : addressZip // ignore: cast_nullable_to_non_nullable - as String?, - addressCountry: freezed == addressCountry - ? _value.addressCountry - : addressCountry // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } } +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name, @JsonKey(name: "address_line1") String? addressLine1, @JsonKey(name: "address_line2") String? addressLine2, @JsonKey(name: "address_city") String? addressCity, @JsonKey(name: "address_state") String? addressState, @JsonKey(name: "address_zip") String? addressZip, @JsonKey(name: "address_country") String? addressCountry, @JsonKey(name: "currency") String? currency) $default,) {final _that = this; +switch (_that) { +case _CreateTokenCardData(): +return $default(_that.name,_that.addressLine1,_that.addressLine2,_that.addressCity,_that.addressState,_that.addressZip,_that.addressCountry,_that.currency);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class _$$CreateTokenCardDataImplCopyWith<$Res> - implements $CreateTokenCardDataCopyWith<$Res> { - factory _$$CreateTokenCardDataImplCopyWith(_$CreateTokenCardDataImpl value, - $Res Function(_$CreateTokenCardDataImpl) then) = - __$$CreateTokenCardDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? name, - @JsonKey(name: "address_line1") String? addressLine1, - @JsonKey(name: "address_line2") String? addressLine2, - @JsonKey(name: "address_city") String? addressCity, - @JsonKey(name: "address_state") String? addressState, - @JsonKey(name: "address_zip") String? addressZip, - @JsonKey(name: "address_country") String? addressCountry, - @JsonKey(name: "currency") String? currency}); +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name, @JsonKey(name: "address_line1") String? addressLine1, @JsonKey(name: "address_line2") String? addressLine2, @JsonKey(name: "address_city") String? addressCity, @JsonKey(name: "address_state") String? addressState, @JsonKey(name: "address_zip") String? addressZip, @JsonKey(name: "address_country") String? addressCountry, @JsonKey(name: "currency") String? currency)? $default,) {final _that = this; +switch (_that) { +case _CreateTokenCardData() when $default != null: +return $default(_that.name,_that.addressLine1,_that.addressLine2,_that.addressCity,_that.addressState,_that.addressZip,_that.addressCountry,_that.currency);case _: + return null; + +} } -/// @nodoc -class __$$CreateTokenCardDataImplCopyWithImpl<$Res> - extends _$CreateTokenCardDataCopyWithImpl<$Res, _$CreateTokenCardDataImpl> - implements _$$CreateTokenCardDataImplCopyWith<$Res> { - __$$CreateTokenCardDataImplCopyWithImpl(_$CreateTokenCardDataImpl _value, - $Res Function(_$CreateTokenCardDataImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenCardData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? addressLine1 = freezed, - Object? addressLine2 = freezed, - Object? addressCity = freezed, - Object? addressState = freezed, - Object? addressZip = freezed, - Object? addressCountry = freezed, - Object? currency = freezed, - }) { - return _then(_$CreateTokenCardDataImpl( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - addressLine1: freezed == addressLine1 - ? _value.addressLine1 - : addressLine1 // ignore: cast_nullable_to_non_nullable - as String?, - addressLine2: freezed == addressLine2 - ? _value.addressLine2 - : addressLine2 // ignore: cast_nullable_to_non_nullable - as String?, - addressCity: freezed == addressCity - ? _value.addressCity - : addressCity // ignore: cast_nullable_to_non_nullable - as String?, - addressState: freezed == addressState - ? _value.addressState - : addressState // ignore: cast_nullable_to_non_nullable - as String?, - addressZip: freezed == addressZip - ? _value.addressZip - : addressZip // ignore: cast_nullable_to_non_nullable - as String?, - addressCountry: freezed == addressCountry - ? _value.addressCountry - : addressCountry // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$CreateTokenCardDataImpl implements _CreateTokenCardData { - const _$CreateTokenCardDataImpl( - {this.name, - @JsonKey(name: "address_line1") this.addressLine1, - @JsonKey(name: "address_line2") this.addressLine2, - @JsonKey(name: "address_city") this.addressCity, - @JsonKey(name: "address_state") this.addressState, - @JsonKey(name: "address_zip") this.addressZip, - @JsonKey(name: "address_country") this.addressCountry, - @JsonKey(name: "currency") this.currency}); - - factory _$CreateTokenCardDataImpl.fromJson(Map json) => - _$$CreateTokenCardDataImplFromJson(json); - - /// RECOMMENDED - /// Cardholder name. - @override - final String? name; - - /// Address line 1 (Street address/PO Box/Company name). - @override - @JsonKey(name: "address_line1") - final String? addressLine1; - - /// Address line 2 (Apartment/Suite/Unit/Building). - @override - @JsonKey(name: "address_line2") - final String? addressLine2; - - /// City/District/Suburb/Town/Village. - @override - @JsonKey(name: "address_city") - final String? addressCity; - - /// State/County/Province/Region. - @override - @JsonKey(name: "address_state") - final String? addressState; - - /// ZIP or postal code. - @override - @JsonKey(name: "address_zip") - final String? addressZip; - - /// RECOMMENDED. - /// A two character country code (for example, US). - /// Billing address country - @override - @JsonKey(name: "address_country") - final String? addressCountry; - - /// Required in order to add the card to a Connect account - ///(in all other cases, this parameter is not used). - @override - @JsonKey(name: "currency") - final String? currency; - - @override - String toString() { - return 'CreateTokenCardData(name: $name, addressLine1: $addressLine1, addressLine2: $addressLine2, addressCity: $addressCity, addressState: $addressState, addressZip: $addressZip, addressCountry: $addressCountry, currency: $currency)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenCardDataImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.addressLine1, addressLine1) || - other.addressLine1 == addressLine1) && - (identical(other.addressLine2, addressLine2) || - other.addressLine2 == addressLine2) && - (identical(other.addressCity, addressCity) || - other.addressCity == addressCity) && - (identical(other.addressState, addressState) || - other.addressState == addressState) && - (identical(other.addressZip, addressZip) || - other.addressZip == addressZip) && - (identical(other.addressCountry, addressCountry) || - other.addressCountry == addressCountry) && - (identical(other.currency, currency) || - other.currency == currency)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, addressLine1, addressLine2, - addressCity, addressState, addressZip, addressCountry, currency); - - /// Create a copy of CreateTokenCardData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenCardDataImplCopyWith<_$CreateTokenCardDataImpl> get copyWith => - __$$CreateTokenCardDataImplCopyWithImpl<_$CreateTokenCardDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CreateTokenCardDataImplToJson( - this, - ); - } + +class _CreateTokenCardData implements CreateTokenCardData { + const _CreateTokenCardData({this.name, @JsonKey(name: "address_line1") this.addressLine1, @JsonKey(name: "address_line2") this.addressLine2, @JsonKey(name: "address_city") this.addressCity, @JsonKey(name: "address_state") this.addressState, @JsonKey(name: "address_zip") this.addressZip, @JsonKey(name: "address_country") this.addressCountry, @JsonKey(name: "currency") this.currency}); + factory _CreateTokenCardData.fromJson(Map json) => _$CreateTokenCardDataFromJson(json); + +/// RECOMMENDED +/// Cardholder name. +@override final String? name; +/// Address line 1 (Street address/PO Box/Company name). +@override@JsonKey(name: "address_line1") final String? addressLine1; +/// Address line 2 (Apartment/Suite/Unit/Building). +@override@JsonKey(name: "address_line2") final String? addressLine2; +/// City/District/Suburb/Town/Village. +@override@JsonKey(name: "address_city") final String? addressCity; +/// State/County/Province/Region. +@override@JsonKey(name: "address_state") final String? addressState; +/// ZIP or postal code. +@override@JsonKey(name: "address_zip") final String? addressZip; +/// RECOMMENDED. +/// A two character country code (for example, US). +/// Billing address country +@override@JsonKey(name: "address_country") final String? addressCountry; +/// Required in order to add the card to a Connect account +///(in all other cases, this parameter is not used). +@override@JsonKey(name: "currency") final String? currency; + +/// Create a copy of CreateTokenCardData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenCardDataCopyWith<_CreateTokenCardData> get copyWith => __$CreateTokenCardDataCopyWithImpl<_CreateTokenCardData>(this, _$identity); + +@override +Map toJson() { + return _$CreateTokenCardDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenCardData&&(identical(other.name, name) || other.name == name)&&(identical(other.addressLine1, addressLine1) || other.addressLine1 == addressLine1)&&(identical(other.addressLine2, addressLine2) || other.addressLine2 == addressLine2)&&(identical(other.addressCity, addressCity) || other.addressCity == addressCity)&&(identical(other.addressState, addressState) || other.addressState == addressState)&&(identical(other.addressZip, addressZip) || other.addressZip == addressZip)&&(identical(other.addressCountry, addressCountry) || other.addressCountry == addressCountry)&&(identical(other.currency, currency) || other.currency == currency)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,addressLine1,addressLine2,addressCity,addressState,addressZip,addressCountry,currency); + +@override +String toString() { + return 'CreateTokenCardData(name: $name, addressLine1: $addressLine1, addressLine2: $addressLine2, addressCity: $addressCity, addressState: $addressState, addressZip: $addressZip, addressCountry: $addressCountry, currency: $currency)'; } -abstract class _CreateTokenCardData implements CreateTokenCardData { - const factory _CreateTokenCardData( - {final String? name, - @JsonKey(name: "address_line1") final String? addressLine1, - @JsonKey(name: "address_line2") final String? addressLine2, - @JsonKey(name: "address_city") final String? addressCity, - @JsonKey(name: "address_state") final String? addressState, - @JsonKey(name: "address_zip") final String? addressZip, - @JsonKey(name: "address_country") final String? addressCountry, - @JsonKey(name: "currency") final String? currency}) = - _$CreateTokenCardDataImpl; - - factory _CreateTokenCardData.fromJson(Map json) = - _$CreateTokenCardDataImpl.fromJson; - - /// RECOMMENDED - /// Cardholder name. - @override - String? get name; - - /// Address line 1 (Street address/PO Box/Company name). - @override - @JsonKey(name: "address_line1") - String? get addressLine1; - - /// Address line 2 (Apartment/Suite/Unit/Building). - @override - @JsonKey(name: "address_line2") - String? get addressLine2; - - /// City/District/Suburb/Town/Village. - @override - @JsonKey(name: "address_city") - String? get addressCity; - - /// State/County/Province/Region. - @override - @JsonKey(name: "address_state") - String? get addressState; - - /// ZIP or postal code. - @override - @JsonKey(name: "address_zip") - String? get addressZip; - - /// RECOMMENDED. - /// A two character country code (for example, US). - /// Billing address country - @override - @JsonKey(name: "address_country") - String? get addressCountry; - - /// Required in order to add the card to a Connect account - ///(in all other cases, this parameter is not used). - @override - @JsonKey(name: "currency") - String? get currency; - - /// Create a copy of CreateTokenCardData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenCardDataImplCopyWith<_$CreateTokenCardDataImpl> get copyWith => - throw _privateConstructorUsedError; + +} + +/// @nodoc +abstract mixin class _$CreateTokenCardDataCopyWith<$Res> implements $CreateTokenCardDataCopyWith<$Res> { + factory _$CreateTokenCardDataCopyWith(_CreateTokenCardData value, $Res Function(_CreateTokenCardData) _then) = __$CreateTokenCardDataCopyWithImpl; +@override @useResult +$Res call({ + String? name,@JsonKey(name: "address_line1") String? addressLine1,@JsonKey(name: "address_line2") String? addressLine2,@JsonKey(name: "address_city") String? addressCity,@JsonKey(name: "address_state") String? addressState,@JsonKey(name: "address_zip") String? addressZip,@JsonKey(name: "address_country") String? addressCountry,@JsonKey(name: "currency") String? currency +}); + + + + +} +/// @nodoc +class __$CreateTokenCardDataCopyWithImpl<$Res> + implements _$CreateTokenCardDataCopyWith<$Res> { + __$CreateTokenCardDataCopyWithImpl(this._self, this._then); + + final _CreateTokenCardData _self; + final $Res Function(_CreateTokenCardData) _then; + +/// Create a copy of CreateTokenCardData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? addressLine1 = freezed,Object? addressLine2 = freezed,Object? addressCity = freezed,Object? addressState = freezed,Object? addressZip = freezed,Object? addressCountry = freezed,Object? currency = freezed,}) { + return _then(_CreateTokenCardData( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,addressLine1: freezed == addressLine1 ? _self.addressLine1 : addressLine1 // ignore: cast_nullable_to_non_nullable +as String?,addressLine2: freezed == addressLine2 ? _self.addressLine2 : addressLine2 // ignore: cast_nullable_to_non_nullable +as String?,addressCity: freezed == addressCity ? _self.addressCity : addressCity // ignore: cast_nullable_to_non_nullable +as String?,addressState: freezed == addressState ? _self.addressState : addressState // ignore: cast_nullable_to_non_nullable +as String?,addressZip: freezed == addressZip ? _self.addressZip : addressZip // ignore: cast_nullable_to_non_nullable +as String?,addressCountry: freezed == addressCountry ? _self.addressCountry : addressCountry // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?, + )); } + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_card_data.g.dart b/packages/stripe_js/lib/src/api/tokens/create_token_card_data.g.dart index 288b981f0..52684cc46 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_card_data.g.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_card_data.g.dart @@ -6,8 +6,8 @@ part of 'create_token_card_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CreateTokenCardDataImpl _$$CreateTokenCardDataImplFromJson(Map json) => - _$CreateTokenCardDataImpl( +_CreateTokenCardData _$CreateTokenCardDataFromJson(Map json) => + _CreateTokenCardData( name: json['name'] as String?, addressLine1: json['address_line1'] as String?, addressLine2: json['address_line2'] as String?, @@ -18,23 +18,15 @@ _$CreateTokenCardDataImpl _$$CreateTokenCardDataImplFromJson(Map json) => currency: json['currency'] as String?, ); -Map _$$CreateTokenCardDataImplToJson( - _$CreateTokenCardDataImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('name', instance.name); - writeNotNull('address_line1', instance.addressLine1); - writeNotNull('address_line2', instance.addressLine2); - writeNotNull('address_city', instance.addressCity); - writeNotNull('address_state', instance.addressState); - writeNotNull('address_zip', instance.addressZip); - writeNotNull('address_country', instance.addressCountry); - writeNotNull('currency', instance.currency); - return val; -} +Map _$CreateTokenCardDataToJson( + _CreateTokenCardData instance, +) => { + 'name': ?instance.name, + 'address_line1': ?instance.addressLine1, + 'address_line2': ?instance.addressLine2, + 'address_city': ?instance.addressCity, + 'address_state': ?instance.addressState, + 'address_zip': ?instance.addressZip, + 'address_country': ?instance.addressCountry, + 'currency': ?instance.currency, +}; diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.dart b/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.dart index aaba957af..accbd4c3c 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.dart @@ -4,7 +4,7 @@ part 'create_token_pii_data.freezed.dart'; part 'create_token_pii_data.g.dart'; @freezed -class CreateTokenPIIData with _$CreateTokenPIIData { +abstract class CreateTokenPIIData with _$CreateTokenPIIData { const factory CreateTokenPIIData({ @JsonKey(name: "personal_id_number") required String personalIdNumber, }) = _CreateTokenPIIData; diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.freezed.dart b/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.freezed.dart index 3e7dd1045..891f989fe 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.freezed.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,164 +9,269 @@ part of 'create_token_pii_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CreateTokenPIIData _$CreateTokenPIIDataFromJson(Map json) { - return _CreateTokenPIIData.fromJson(json); -} - /// @nodoc mixin _$CreateTokenPIIData { - @JsonKey(name: "personal_id_number") - String get personalIdNumber => throw _privateConstructorUsedError; + +@JsonKey(name: "personal_id_number") String get personalIdNumber; +/// Create a copy of CreateTokenPIIData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CreateTokenPIIDataCopyWith get copyWith => _$CreateTokenPIIDataCopyWithImpl(this as CreateTokenPIIData, _$identity); /// Serializes this CreateTokenPIIData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CreateTokenPIIData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CreateTokenPIIDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateTokenPIIData&&(identical(other.personalIdNumber, personalIdNumber) || other.personalIdNumber == personalIdNumber)); } -/// @nodoc -abstract class $CreateTokenPIIDataCopyWith<$Res> { - factory $CreateTokenPIIDataCopyWith( - CreateTokenPIIData value, $Res Function(CreateTokenPIIData) then) = - _$CreateTokenPIIDataCopyWithImpl<$Res, CreateTokenPIIData>; - @useResult - $Res call({@JsonKey(name: "personal_id_number") String personalIdNumber}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,personalIdNumber); + +@override +String toString() { + return 'CreateTokenPIIData(personalIdNumber: $personalIdNumber)'; } -/// @nodoc -class _$CreateTokenPIIDataCopyWithImpl<$Res, $Val extends CreateTokenPIIData> - implements $CreateTokenPIIDataCopyWith<$Res> { - _$CreateTokenPIIDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CreateTokenPIIData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? personalIdNumber = null, - }) { - return _then(_value.copyWith( - personalIdNumber: null == personalIdNumber - ? _value.personalIdNumber - : personalIdNumber // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$CreateTokenPIIDataImplCopyWith<$Res> +abstract mixin class $CreateTokenPIIDataCopyWith<$Res> { + factory $CreateTokenPIIDataCopyWith(CreateTokenPIIData value, $Res Function(CreateTokenPIIData) _then) = _$CreateTokenPIIDataCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: "personal_id_number") String personalIdNumber +}); + + + + +} +/// @nodoc +class _$CreateTokenPIIDataCopyWithImpl<$Res> implements $CreateTokenPIIDataCopyWith<$Res> { - factory _$$CreateTokenPIIDataImplCopyWith(_$CreateTokenPIIDataImpl value, - $Res Function(_$CreateTokenPIIDataImpl) then) = - __$$CreateTokenPIIDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({@JsonKey(name: "personal_id_number") String personalIdNumber}); + _$CreateTokenPIIDataCopyWithImpl(this._self, this._then); + + final CreateTokenPIIData _self; + final $Res Function(CreateTokenPIIData) _then; + +/// Create a copy of CreateTokenPIIData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? personalIdNumber = null,}) { + return _then(_self.copyWith( +personalIdNumber: null == personalIdNumber ? _self.personalIdNumber : personalIdNumber // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CreateTokenPIIData]. +extension CreateTokenPIIDataPatterns on CreateTokenPIIData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreateTokenPIIData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreateTokenPIIData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreateTokenPIIData value) $default,){ +final _that = this; +switch (_that) { +case _CreateTokenPIIData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreateTokenPIIData value)? $default,){ +final _that = this; +switch (_that) { +case _CreateTokenPIIData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: "personal_id_number") String personalIdNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreateTokenPIIData() when $default != null: +return $default(_that.personalIdNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: "personal_id_number") String personalIdNumber) $default,) {final _that = this; +switch (_that) { +case _CreateTokenPIIData(): +return $default(_that.personalIdNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: "personal_id_number") String personalIdNumber)? $default,) {final _that = this; +switch (_that) { +case _CreateTokenPIIData() when $default != null: +return $default(_that.personalIdNumber);case _: + return null; + +} } -/// @nodoc -class __$$CreateTokenPIIDataImplCopyWithImpl<$Res> - extends _$CreateTokenPIIDataCopyWithImpl<$Res, _$CreateTokenPIIDataImpl> - implements _$$CreateTokenPIIDataImplCopyWith<$Res> { - __$$CreateTokenPIIDataImplCopyWithImpl(_$CreateTokenPIIDataImpl _value, - $Res Function(_$CreateTokenPIIDataImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenPIIData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? personalIdNumber = null, - }) { - return _then(_$CreateTokenPIIDataImpl( - personalIdNumber: null == personalIdNumber - ? _value.personalIdNumber - : personalIdNumber // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$CreateTokenPIIDataImpl implements _CreateTokenPIIData { - const _$CreateTokenPIIDataImpl( - {@JsonKey(name: "personal_id_number") required this.personalIdNumber}); - - factory _$CreateTokenPIIDataImpl.fromJson(Map json) => - _$$CreateTokenPIIDataImplFromJson(json); - - @override - @JsonKey(name: "personal_id_number") - final String personalIdNumber; - - @override - String toString() { - return 'CreateTokenPIIData(personalIdNumber: $personalIdNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenPIIDataImpl && - (identical(other.personalIdNumber, personalIdNumber) || - other.personalIdNumber == personalIdNumber)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, personalIdNumber); - - /// Create a copy of CreateTokenPIIData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenPIIDataImplCopyWith<_$CreateTokenPIIDataImpl> get copyWith => - __$$CreateTokenPIIDataImplCopyWithImpl<_$CreateTokenPIIDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CreateTokenPIIDataImplToJson( - this, - ); - } -} - -abstract class _CreateTokenPIIData implements CreateTokenPIIData { - const factory _CreateTokenPIIData( - {@JsonKey(name: "personal_id_number") - required final String personalIdNumber}) = _$CreateTokenPIIDataImpl; - - factory _CreateTokenPIIData.fromJson(Map json) = - _$CreateTokenPIIDataImpl.fromJson; - - @override - @JsonKey(name: "personal_id_number") - String get personalIdNumber; - - /// Create a copy of CreateTokenPIIData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenPIIDataImplCopyWith<_$CreateTokenPIIDataImpl> get copyWith => - throw _privateConstructorUsedError; + +class _CreateTokenPIIData implements CreateTokenPIIData { + const _CreateTokenPIIData({@JsonKey(name: "personal_id_number") required this.personalIdNumber}); + factory _CreateTokenPIIData.fromJson(Map json) => _$CreateTokenPIIDataFromJson(json); + +@override@JsonKey(name: "personal_id_number") final String personalIdNumber; + +/// Create a copy of CreateTokenPIIData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenPIIDataCopyWith<_CreateTokenPIIData> get copyWith => __$CreateTokenPIIDataCopyWithImpl<_CreateTokenPIIData>(this, _$identity); + +@override +Map toJson() { + return _$CreateTokenPIIDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenPIIData&&(identical(other.personalIdNumber, personalIdNumber) || other.personalIdNumber == personalIdNumber)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,personalIdNumber); + +@override +String toString() { + return 'CreateTokenPIIData(personalIdNumber: $personalIdNumber)'; } + + +} + +/// @nodoc +abstract mixin class _$CreateTokenPIIDataCopyWith<$Res> implements $CreateTokenPIIDataCopyWith<$Res> { + factory _$CreateTokenPIIDataCopyWith(_CreateTokenPIIData value, $Res Function(_CreateTokenPIIData) _then) = __$CreateTokenPIIDataCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: "personal_id_number") String personalIdNumber +}); + + + + +} +/// @nodoc +class __$CreateTokenPIIDataCopyWithImpl<$Res> + implements _$CreateTokenPIIDataCopyWith<$Res> { + __$CreateTokenPIIDataCopyWithImpl(this._self, this._then); + + final _CreateTokenPIIData _self; + final $Res Function(_CreateTokenPIIData) _then; + +/// Create a copy of CreateTokenPIIData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? personalIdNumber = null,}) { + return _then(_CreateTokenPIIData( +personalIdNumber: null == personalIdNumber ? _self.personalIdNumber : personalIdNumber // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.g.dart b/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.g.dart index b8780bd5d..480eeb060 100644 --- a/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.g.dart +++ b/packages/stripe_js/lib/src/api/tokens/create_token_pii_data.g.dart @@ -6,13 +6,8 @@ part of 'create_token_pii_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CreateTokenPIIDataImpl _$$CreateTokenPIIDataImplFromJson(Map json) => - _$CreateTokenPIIDataImpl( - personalIdNumber: json['personal_id_number'] as String, - ); +_CreateTokenPIIData _$CreateTokenPIIDataFromJson(Map json) => + _CreateTokenPIIData(personalIdNumber: json['personal_id_number'] as String); -Map _$$CreateTokenPIIDataImplToJson( - _$CreateTokenPIIDataImpl instance) => - { - 'personal_id_number': instance.personalIdNumber, - }; +Map _$CreateTokenPIIDataToJson(_CreateTokenPIIData instance) => + {'personal_id_number': instance.personalIdNumber}; diff --git a/packages/stripe_js/lib/src/api/tokens/token.dart b/packages/stripe_js/lib/src/api/tokens/token.dart index 1efef4668..39fb73605 100644 --- a/packages/stripe_js/lib/src/api/tokens/token.dart +++ b/packages/stripe_js/lib/src/api/tokens/token.dart @@ -29,7 +29,7 @@ part 'token.g.dart'; /// /// https://stripe.com/docs/api/tokens @freezed -class Token with _$Token { +abstract class Token with _$Token { const factory Token({ /// Unique identifier for the object. required String id, @@ -67,7 +67,7 @@ class Token with _$Token { } @freezed -class BankAccountToken with _$BankAccountToken { +abstract class BankAccountToken with _$BankAccountToken { const factory BankAccountToken({ /// Unique identifier for the object. required String id, @@ -139,7 +139,7 @@ class BankAccountToken with _$BankAccountToken { } @freezed -class CardToken with _$CardToken { +abstract class CardToken with _$CardToken { const factory CardToken({ /// Unique identifier for the object. required String id, @@ -244,18 +244,10 @@ class CardToken with _$CardToken { _$CardTokenFromJson(json); } -enum BankAccountHolderType { - company, - individual, -} +enum BankAccountHolderType { company, individual } @JsonEnum(fieldRename: FieldRename.snake) -enum TokenType { - account, - bankAccount, - card, - pii, -} +enum TokenType { account, bankAccount, card, pii } @JsonEnum(fieldRename: FieldRename.snake) enum BankAccountStatus { @@ -267,27 +259,12 @@ enum BankAccountStatus { errored, } -enum VerificationCheck { - pass, - fail, - unavailable, - unchecked, -} +enum VerificationCheck { pass, fail, unavailable, unchecked } -enum CardFundingType { - credit, - debit, - prepaid, - unkwown, -} +enum CardFundingType { credit, debit, prepaid, unkwown } @JsonEnum(fieldRename: FieldRename.snake) -enum CardTokenizationMethod { - androidPay, - applePay, - masterpass, - visaCheckout, -} +enum CardTokenizationMethod { androidPay, applePay, masterpass, visaCheckout } enum CardTokenBrand { @JsonValue('American Express') diff --git a/packages/stripe_js/lib/src/api/tokens/token.freezed.dart b/packages/stripe_js/lib/src/api/tokens/token.freezed.dart index be39c62bd..5f0d9aa2e 100644 --- a/packages/stripe_js/lib/src/api/tokens/token.freezed.dart +++ b/packages/stripe_js/lib/src/api/tokens/token.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1903 +9,1181 @@ part of 'token.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -Token _$TokenFromJson(Map json) { - return _Token.fromJson(json); -} - /// @nodoc mixin _$Token { - /// Unique identifier for the object. - String get id => throw _privateConstructorUsedError; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "token". - String get object => throw _privateConstructorUsedError; - /// Hash describing the bank account. - @JsonKey(name: "bank_account") - BankAccountToken? get bankAccount => throw _privateConstructorUsedError; +/// Unique identifier for the object. + String get id;/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "token". + String get object;/// Hash describing the bank account. +@JsonKey(name: "bank_account") BankAccountToken? get bankAccount;/// Hash describing the card used to make the charge. + CardToken? get card;/// IP address of the client that generated the token. +@JsonKey(name: "client_ip") String? get clientIP;/// Time at which the object was created. Measured in seconds since the Unix epoch. + int? get created;/// Type of the token: account, bank_account, card, or pii. + bool get livemode;/// Has the value true if the object exists in live mode or the +/// value false if the object exists in test mode. + TokenType get type;/// Whether this token has already been used +/// (tokens can be used only once). + bool get used; +/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$TokenCopyWith get copyWith => _$TokenCopyWithImpl(this as Token, _$identity); - /// Hash describing the card used to make the charge. - CardToken? get card => throw _privateConstructorUsedError; - - /// IP address of the client that generated the token. - @JsonKey(name: "client_ip") - String? get clientIP => throw _privateConstructorUsedError; + /// Serializes this Token to a JSON map. + Map toJson(); - /// Time at which the object was created. Measured in seconds since the Unix epoch. - int? get created => throw _privateConstructorUsedError; - /// Type of the token: account, bank_account, card, or pii. - bool get livemode => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Token&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.bankAccount, bankAccount) || other.bankAccount == bankAccount)&&(identical(other.card, card) || other.card == card)&&(identical(other.clientIP, clientIP) || other.clientIP == clientIP)&&(identical(other.created, created) || other.created == created)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.type, type) || other.type == type)&&(identical(other.used, used) || other.used == used)); +} - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - TokenType get type => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,object,bankAccount,card,clientIP,created,livemode,type,used); - /// Whether this token has already been used - /// (tokens can be used only once). - bool get used => throw _privateConstructorUsedError; +@override +String toString() { + return 'Token(id: $id, object: $object, bankAccount: $bankAccount, card: $card, clientIP: $clientIP, created: $created, livemode: $livemode, type: $type, used: $used)'; +} - /// Serializes this Token to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $TokenCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $TokenCopyWith<$Res> { - factory $TokenCopyWith(Token value, $Res Function(Token) then) = - _$TokenCopyWithImpl<$Res, Token>; - @useResult - $Res call( - {String id, - String object, - @JsonKey(name: "bank_account") BankAccountToken? bankAccount, - CardToken? card, - @JsonKey(name: "client_ip") String? clientIP, - int? created, - bool livemode, - TokenType type, - bool used}); - - $BankAccountTokenCopyWith<$Res>? get bankAccount; - $CardTokenCopyWith<$Res>? get card; -} +abstract mixin class $TokenCopyWith<$Res> { + factory $TokenCopyWith(Token value, $Res Function(Token) _then) = _$TokenCopyWithImpl; +@useResult +$Res call({ + String id, String object,@JsonKey(name: "bank_account") BankAccountToken? bankAccount, CardToken? card,@JsonKey(name: "client_ip") String? clientIP, int? created, bool livemode, TokenType type, bool used +}); + + +$BankAccountTokenCopyWith<$Res>? get bankAccount;$CardTokenCopyWith<$Res>? get card; +} /// @nodoc -class _$TokenCopyWithImpl<$Res, $Val extends Token> +class _$TokenCopyWithImpl<$Res> implements $TokenCopyWith<$Res> { - _$TokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? bankAccount = freezed, - Object? card = freezed, - Object? clientIP = freezed, - Object? created = freezed, - Object? livemode = null, - Object? type = null, - Object? used = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - bankAccount: freezed == bankAccount - ? _value.bankAccount - : bankAccount // ignore: cast_nullable_to_non_nullable - as BankAccountToken?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardToken?, - clientIP: freezed == clientIP - ? _value.clientIP - : clientIP // ignore: cast_nullable_to_non_nullable - as String?, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - used: null == used - ? _value.used - : used // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + _$TokenCopyWithImpl(this._self, this._then); + + final Token _self; + final $Res Function(Token) _then; + +/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? object = null,Object? bankAccount = freezed,Object? card = freezed,Object? clientIP = freezed,Object? created = freezed,Object? livemode = null,Object? type = null,Object? used = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,bankAccount: freezed == bankAccount ? _self.bankAccount : bankAccount // ignore: cast_nullable_to_non_nullable +as BankAccountToken?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardToken?,clientIP: freezed == clientIP ? _self.clientIP : clientIP // ignore: cast_nullable_to_non_nullable +as String?,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,used: null == used ? _self.used : used // ignore: cast_nullable_to_non_nullable +as bool, + )); +} +/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountTokenCopyWith<$Res>? get bankAccount { + if (_self.bankAccount == null) { + return null; } - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BankAccountTokenCopyWith<$Res>? get bankAccount { - if (_value.bankAccount == null) { - return null; - } - - return $BankAccountTokenCopyWith<$Res>(_value.bankAccount!, (value) { - return _then(_value.copyWith(bankAccount: value) as $Val); - }); + return $BankAccountTokenCopyWith<$Res>(_self.bankAccount!, (value) { + return _then(_self.copyWith(bankAccount: value)); + }); +}/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardTokenCopyWith<$Res>? get card { + if (_self.card == null) { + return null; } - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardTokenCopyWith<$Res>? get card { - if (_value.card == null) { - return null; - } - - return $CardTokenCopyWith<$Res>(_value.card!, (value) { - return _then(_value.copyWith(card: value) as $Val); - }); - } + return $CardTokenCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); +} } -/// @nodoc -abstract class _$$TokenImplCopyWith<$Res> implements $TokenCopyWith<$Res> { - factory _$$TokenImplCopyWith( - _$TokenImpl value, $Res Function(_$TokenImpl) then) = - __$$TokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String object, - @JsonKey(name: "bank_account") BankAccountToken? bankAccount, - CardToken? card, - @JsonKey(name: "client_ip") String? clientIP, - int? created, - bool livemode, - TokenType type, - bool used}); - - @override - $BankAccountTokenCopyWith<$Res>? get bankAccount; - @override - $CardTokenCopyWith<$Res>? get card; + +/// Adds pattern-matching-related methods to [Token]. +extension TokenPatterns on Token { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Token value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Token() when $default != null: +return $default(_that);case _: + return orElse(); + +} } +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Token value) $default,){ +final _that = this; +switch (_that) { +case _Token(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -class __$$TokenImplCopyWithImpl<$Res> - extends _$TokenCopyWithImpl<$Res, _$TokenImpl> - implements _$$TokenImplCopyWith<$Res> { - __$$TokenImplCopyWithImpl( - _$TokenImpl _value, $Res Function(_$TokenImpl) _then) - : super(_value, _then); - - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? bankAccount = freezed, - Object? card = freezed, - Object? clientIP = freezed, - Object? created = freezed, - Object? livemode = null, - Object? type = null, - Object? used = null, - }) { - return _then(_$TokenImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - bankAccount: freezed == bankAccount - ? _value.bankAccount - : bankAccount // ignore: cast_nullable_to_non_nullable - as BankAccountToken?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardToken?, - clientIP: freezed == clientIP - ? _value.clientIP - : clientIP // ignore: cast_nullable_to_non_nullable - as String?, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - used: null == used - ? _value.used - : used // ignore: cast_nullable_to_non_nullable - as bool, - )); - } } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Token value)? $default,){ +final _that = this; +switch (_that) { +case _Token() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc -@JsonSerializable() -class _$TokenImpl implements _Token { - const _$TokenImpl( - {required this.id, - this.object = "token", - @JsonKey(name: "bank_account") this.bankAccount, - this.card, - @JsonKey(name: "client_ip") this.clientIP, - this.created, - this.livemode = true, - required this.type, - this.used = false}); - - factory _$TokenImpl.fromJson(Map json) => - _$$TokenImplFromJson(json); - - /// Unique identifier for the object. - @override - final String id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "token". - @override - @JsonKey() - final String object; - - /// Hash describing the bank account. - @override - @JsonKey(name: "bank_account") - final BankAccountToken? bankAccount; - - /// Hash describing the card used to make the charge. - @override - final CardToken? card; - - /// IP address of the client that generated the token. - @override - @JsonKey(name: "client_ip") - final String? clientIP; - - /// Time at which the object was created. Measured in seconds since the Unix epoch. - @override - final int? created; - - /// Type of the token: account, bank_account, card, or pii. - @override - @JsonKey() - final bool livemode; - - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - @override - final TokenType type; - - /// Whether this token has already been used - /// (tokens can be used only once). - @override - @JsonKey() - final bool used; - - @override - String toString() { - return 'Token(id: $id, object: $object, bankAccount: $bankAccount, card: $card, clientIP: $clientIP, created: $created, livemode: $livemode, type: $type, used: $used)'; - } +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String object, @JsonKey(name: "bank_account") BankAccountToken? bankAccount, CardToken? card, @JsonKey(name: "client_ip") String? clientIP, int? created, bool livemode, TokenType type, bool used)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Token() when $default != null: +return $default(_that.id,_that.object,_that.bankAccount,_that.card,_that.clientIP,_that.created,_that.livemode,_that.type,_that.used);case _: + return orElse(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$TokenImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.object, object) || other.object == object) && - (identical(other.bankAccount, bankAccount) || - other.bankAccount == bankAccount) && - (identical(other.card, card) || other.card == card) && - (identical(other.clientIP, clientIP) || - other.clientIP == clientIP) && - (identical(other.created, created) || other.created == created) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.type, type) || other.type == type) && - (identical(other.used, used) || other.used == used)); - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String object, @JsonKey(name: "bank_account") BankAccountToken? bankAccount, CardToken? card, @JsonKey(name: "client_ip") String? clientIP, int? created, bool livemode, TokenType type, bool used) $default,) {final _that = this; +switch (_that) { +case _Token(): +return $default(_that.id,_that.object,_that.bankAccount,_that.card,_that.clientIP,_that.created,_that.livemode,_that.type,_that.used);case _: + throw StateError('Unexpected subclass'); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id, object, bankAccount, card, - clientIP, created, livemode, type, used); - - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$TokenImplCopyWith<_$TokenImpl> get copyWith => - __$$TokenImplCopyWithImpl<_$TokenImpl>(this, _$identity); - - @override - Map toJson() { - return _$$TokenImplToJson( - this, - ); - } +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String object, @JsonKey(name: "bank_account") BankAccountToken? bankAccount, CardToken? card, @JsonKey(name: "client_ip") String? clientIP, int? created, bool livemode, TokenType type, bool used)? $default,) {final _that = this; +switch (_that) { +case _Token() when $default != null: +return $default(_that.id,_that.object,_that.bankAccount,_that.card,_that.clientIP,_that.created,_that.livemode,_that.type,_that.used);case _: + return null; + +} } -abstract class _Token implements Token { - const factory _Token( - {required final String id, - final String object, - @JsonKey(name: "bank_account") final BankAccountToken? bankAccount, - final CardToken? card, - @JsonKey(name: "client_ip") final String? clientIP, - final int? created, - final bool livemode, - required final TokenType type, - final bool used}) = _$TokenImpl; +} - factory _Token.fromJson(Map json) = _$TokenImpl.fromJson; +/// @nodoc +@JsonSerializable() - /// Unique identifier for the object. - @override - String get id; +class _Token implements Token { + const _Token({required this.id, this.object = "token", @JsonKey(name: "bank_account") this.bankAccount, this.card, @JsonKey(name: "client_ip") this.clientIP, this.created, this.livemode = true, required this.type, this.used = false}); + factory _Token.fromJson(Map json) => _$TokenFromJson(json); + +/// Unique identifier for the object. +@override final String id; +/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "token". +@override@JsonKey() final String object; +/// Hash describing the bank account. +@override@JsonKey(name: "bank_account") final BankAccountToken? bankAccount; +/// Hash describing the card used to make the charge. +@override final CardToken? card; +/// IP address of the client that generated the token. +@override@JsonKey(name: "client_ip") final String? clientIP; +/// Time at which the object was created. Measured in seconds since the Unix epoch. +@override final int? created; +/// Type of the token: account, bank_account, card, or pii. +@override@JsonKey() final bool livemode; +/// Has the value true if the object exists in live mode or the +/// value false if the object exists in test mode. +@override final TokenType type; +/// Whether this token has already been used +/// (tokens can be used only once). +@override@JsonKey() final bool used; + +/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$TokenCopyWith<_Token> get copyWith => __$TokenCopyWithImpl<_Token>(this, _$identity); + +@override +Map toJson() { + return _$TokenToJson(this, ); +} - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "token". - @override - String get object; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Token&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.bankAccount, bankAccount) || other.bankAccount == bankAccount)&&(identical(other.card, card) || other.card == card)&&(identical(other.clientIP, clientIP) || other.clientIP == clientIP)&&(identical(other.created, created) || other.created == created)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.type, type) || other.type == type)&&(identical(other.used, used) || other.used == used)); +} - /// Hash describing the bank account. - @override - @JsonKey(name: "bank_account") - BankAccountToken? get bankAccount; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,object,bankAccount,card,clientIP,created,livemode,type,used); - /// Hash describing the card used to make the charge. - @override - CardToken? get card; +@override +String toString() { + return 'Token(id: $id, object: $object, bankAccount: $bankAccount, card: $card, clientIP: $clientIP, created: $created, livemode: $livemode, type: $type, used: $used)'; +} - /// IP address of the client that generated the token. - @override - @JsonKey(name: "client_ip") - String? get clientIP; - /// Time at which the object was created. Measured in seconds since the Unix epoch. - @override - int? get created; +} - /// Type of the token: account, bank_account, card, or pii. - @override - bool get livemode; +/// @nodoc +abstract mixin class _$TokenCopyWith<$Res> implements $TokenCopyWith<$Res> { + factory _$TokenCopyWith(_Token value, $Res Function(_Token) _then) = __$TokenCopyWithImpl; +@override @useResult +$Res call({ + String id, String object,@JsonKey(name: "bank_account") BankAccountToken? bankAccount, CardToken? card,@JsonKey(name: "client_ip") String? clientIP, int? created, bool livemode, TokenType type, bool used +}); - /// Has the value true if the object exists in live mode or the - /// value false if the object exists in test mode. - @override - TokenType get type; - /// Whether this token has already been used - /// (tokens can be used only once). - @override - bool get used; +@override $BankAccountTokenCopyWith<$Res>? get bankAccount;@override $CardTokenCopyWith<$Res>? get card; - /// Create a copy of Token - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$TokenImplCopyWith<_$TokenImpl> get copyWith => - throw _privateConstructorUsedError; +} +/// @nodoc +class __$TokenCopyWithImpl<$Res> + implements _$TokenCopyWith<$Res> { + __$TokenCopyWithImpl(this._self, this._then); + + final _Token _self; + final $Res Function(_Token) _then; + +/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? object = null,Object? bankAccount = freezed,Object? card = freezed,Object? clientIP = freezed,Object? created = freezed,Object? livemode = null,Object? type = null,Object? used = null,}) { + return _then(_Token( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,bankAccount: freezed == bankAccount ? _self.bankAccount : bankAccount // ignore: cast_nullable_to_non_nullable +as BankAccountToken?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardToken?,clientIP: freezed == clientIP ? _self.clientIP : clientIP // ignore: cast_nullable_to_non_nullable +as String?,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,used: null == used ? _self.used : used // ignore: cast_nullable_to_non_nullable +as bool, + )); } -BankAccountToken _$BankAccountTokenFromJson(Map json) { - return _BankAccountToken.fromJson(json); +/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountTokenCopyWith<$Res>? get bankAccount { + if (_self.bankAccount == null) { + return null; + } + + return $BankAccountTokenCopyWith<$Res>(_self.bankAccount!, (value) { + return _then(_self.copyWith(bankAccount: value)); + }); +}/// Create a copy of Token +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardTokenCopyWith<$Res>? get card { + if (_self.card == null) { + return null; + } + + return $CardTokenCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); } +} + /// @nodoc mixin _$BankAccountToken { - /// Unique identifier for the object. - String get id => throw _privateConstructorUsedError; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "bank_account". - String get object => throw _privateConstructorUsedError; - - /// The name of the person or business that owns the bank account. - @JsonKey(name: "account_holder_name") - String? get accountHolderName => throw _privateConstructorUsedError; - - /// The type of entity that holds the account. - /// This can be either individual or company. - @JsonKey(name: "account_holder_type") - BankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; - - /// The bank account type. - /// This can only be checking or savings in most countries. - /// In Japan, this can only be futsu or toza. - @JsonKey(name: "account_type") - String? get accountType => throw _privateConstructorUsedError; - - /// Name of the bank associated with the routing number (e.g., WELLS FARGO). - @JsonKey(name: "bank_name") - String? get bankName => throw _privateConstructorUsedError; - - /// Two-letter ISO code representing the country the bank account is - /// located in. - String? get country => throw _privateConstructorUsedError; - - /// Three-letter ISO code for the currency paid out to the bank account. - String? get currency => throw _privateConstructorUsedError; - - /// Uniquely identifies this particular bank account. - /// You can use this attribute to check whether two bank accounts are - /// the same. - String? get fingerprint => throw _privateConstructorUsedError; - - /// The last four digits of the bank account number. - String? get last4 => throw _privateConstructorUsedError; - - /// The routing transit number for the bank account. - @JsonKey(name: "routing_number") - String? get routingNumber => throw _privateConstructorUsedError; - - /// For bank accounts, possible values are new, validated, verified, - /// verification_failed, or errored. - /// A bank account that hasn’t had any activity or validation performed - /// is new. - /// If Stripe can determine that the bank account exists, - /// its status will be validated. - /// Note that there often isn’t enough information to know - /// (e.g., for smaller credit unions), and the validation is not always run. - /// If customer bank account verification has succeeded, the bank account - /// status will be verified. If the verification failed for any reason, - /// such as microdeposit failure, the status will be verification_failed. - /// If a transfer sent to this bank account fails, we’ll set the status to - /// errored and will not continue to send transfers until the bank details - /// are updated. - /// - /// For external accounts, possible values are new and errored. - /// Validations aren’t run against external accounts because they’re - /// only used for payouts. This means the other statuses don’t apply. - /// If a transfer fails, the status is set to errored and transfers are - /// stopped until account details are updated. - BankAccountStatus? get status => throw _privateConstructorUsedError; + +/// Unique identifier for the object. + String get id;/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "bank_account". + String get object;/// The name of the person or business that owns the bank account. +@JsonKey(name: "account_holder_name") String? get accountHolderName;/// The type of entity that holds the account. +/// This can be either individual or company. +@JsonKey(name: "account_holder_type") BankAccountHolderType? get accountHolderType;/// The bank account type. +/// This can only be checking or savings in most countries. +/// In Japan, this can only be futsu or toza. +@JsonKey(name: "account_type") String? get accountType;/// Name of the bank associated with the routing number (e.g., WELLS FARGO). +@JsonKey(name: "bank_name") String? get bankName;/// Two-letter ISO code representing the country the bank account is +/// located in. + String? get country;/// Three-letter ISO code for the currency paid out to the bank account. + String? get currency;/// Uniquely identifies this particular bank account. +/// You can use this attribute to check whether two bank accounts are +/// the same. + String? get fingerprint;/// The last four digits of the bank account number. + String? get last4;/// The routing transit number for the bank account. +@JsonKey(name: "routing_number") String? get routingNumber;/// For bank accounts, possible values are new, validated, verified, +/// verification_failed, or errored. +/// A bank account that hasn’t had any activity or validation performed +/// is new. +/// If Stripe can determine that the bank account exists, +/// its status will be validated. +/// Note that there often isn’t enough information to know +/// (e.g., for smaller credit unions), and the validation is not always run. +/// If customer bank account verification has succeeded, the bank account +/// status will be verified. If the verification failed for any reason, +/// such as microdeposit failure, the status will be verification_failed. +/// If a transfer sent to this bank account fails, we’ll set the status to +/// errored and will not continue to send transfers until the bank details +/// are updated. +/// +/// For external accounts, possible values are new and errored. +/// Validations aren’t run against external accounts because they’re +/// only used for payouts. This means the other statuses don’t apply. +/// If a transfer fails, the status is set to errored and transfers are +/// stopped until account details are updated. + BankAccountStatus? get status; +/// Create a copy of BankAccountToken +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BankAccountTokenCopyWith get copyWith => _$BankAccountTokenCopyWithImpl(this as BankAccountToken, _$identity); /// Serializes this BankAccountToken to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of BankAccountToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BankAccountTokenCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BankAccountToken&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.status, status) || other.status == status)); } -/// @nodoc -abstract class $BankAccountTokenCopyWith<$Res> { - factory $BankAccountTokenCopyWith( - BankAccountToken value, $Res Function(BankAccountToken) then) = - _$BankAccountTokenCopyWithImpl<$Res, BankAccountToken>; - @useResult - $Res call( - {String id, - String object, - @JsonKey(name: "account_holder_name") String? accountHolderName, - @JsonKey(name: "account_holder_type") - BankAccountHolderType? accountHolderType, - @JsonKey(name: "account_type") String? accountType, - @JsonKey(name: "bank_name") String? bankName, - String? country, - String? currency, - String? fingerprint, - String? last4, - @JsonKey(name: "routing_number") String? routingNumber, - BankAccountStatus? status}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,object,accountHolderName,accountHolderType,accountType,bankName,country,currency,fingerprint,last4,routingNumber,status); + +@override +String toString() { + return 'BankAccountToken(id: $id, object: $object, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, country: $country, currency: $currency, fingerprint: $fingerprint, last4: $last4, routingNumber: $routingNumber, status: $status)'; } -/// @nodoc -class _$BankAccountTokenCopyWithImpl<$Res, $Val extends BankAccountToken> - implements $BankAccountTokenCopyWith<$Res> { - _$BankAccountTokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BankAccountToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? accountHolderName = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? bankName = freezed, - Object? country = freezed, - Object? currency = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - Object? routingNumber = freezed, - Object? status = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as String?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as BankAccountStatus?, - ) as $Val); - } + } /// @nodoc -abstract class _$$BankAccountTokenImplCopyWith<$Res> +abstract mixin class $BankAccountTokenCopyWith<$Res> { + factory $BankAccountTokenCopyWith(BankAccountToken value, $Res Function(BankAccountToken) _then) = _$BankAccountTokenCopyWithImpl; +@useResult +$Res call({ + String id, String object,@JsonKey(name: "account_holder_name") String? accountHolderName,@JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType,@JsonKey(name: "account_type") String? accountType,@JsonKey(name: "bank_name") String? bankName, String? country, String? currency, String? fingerprint, String? last4,@JsonKey(name: "routing_number") String? routingNumber, BankAccountStatus? status +}); + + + + +} +/// @nodoc +class _$BankAccountTokenCopyWithImpl<$Res> implements $BankAccountTokenCopyWith<$Res> { - factory _$$BankAccountTokenImplCopyWith(_$BankAccountTokenImpl value, - $Res Function(_$BankAccountTokenImpl) then) = - __$$BankAccountTokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String object, - @JsonKey(name: "account_holder_name") String? accountHolderName, - @JsonKey(name: "account_holder_type") - BankAccountHolderType? accountHolderType, - @JsonKey(name: "account_type") String? accountType, - @JsonKey(name: "bank_name") String? bankName, - String? country, - String? currency, - String? fingerprint, - String? last4, - @JsonKey(name: "routing_number") String? routingNumber, - BankAccountStatus? status}); + _$BankAccountTokenCopyWithImpl(this._self, this._then); + + final BankAccountToken _self; + final $Res Function(BankAccountToken) _then; + +/// Create a copy of BankAccountToken +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? object = null,Object? accountHolderName = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,Object? bankName = freezed,Object? country = freezed,Object? currency = freezed,Object? fingerprint = freezed,Object? last4 = freezed,Object? routingNumber = freezed,Object? status = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as String?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as BankAccountStatus?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BankAccountToken]. +extension BankAccountTokenPatterns on BankAccountToken { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BankAccountToken value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BankAccountToken() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BankAccountToken value) $default,){ +final _that = this; +switch (_that) { +case _BankAccountToken(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BankAccountToken value)? $default,){ +final _that = this; +switch (_that) { +case _BankAccountToken() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String object, @JsonKey(name: "account_holder_name") String? accountHolderName, @JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType, @JsonKey(name: "account_type") String? accountType, @JsonKey(name: "bank_name") String? bankName, String? country, String? currency, String? fingerprint, String? last4, @JsonKey(name: "routing_number") String? routingNumber, BankAccountStatus? status)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BankAccountToken() when $default != null: +return $default(_that.id,_that.object,_that.accountHolderName,_that.accountHolderType,_that.accountType,_that.bankName,_that.country,_that.currency,_that.fingerprint,_that.last4,_that.routingNumber,_that.status);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String object, @JsonKey(name: "account_holder_name") String? accountHolderName, @JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType, @JsonKey(name: "account_type") String? accountType, @JsonKey(name: "bank_name") String? bankName, String? country, String? currency, String? fingerprint, String? last4, @JsonKey(name: "routing_number") String? routingNumber, BankAccountStatus? status) $default,) {final _that = this; +switch (_that) { +case _BankAccountToken(): +return $default(_that.id,_that.object,_that.accountHolderName,_that.accountHolderType,_that.accountType,_that.bankName,_that.country,_that.currency,_that.fingerprint,_that.last4,_that.routingNumber,_that.status);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String object, @JsonKey(name: "account_holder_name") String? accountHolderName, @JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType, @JsonKey(name: "account_type") String? accountType, @JsonKey(name: "bank_name") String? bankName, String? country, String? currency, String? fingerprint, String? last4, @JsonKey(name: "routing_number") String? routingNumber, BankAccountStatus? status)? $default,) {final _that = this; +switch (_that) { +case _BankAccountToken() when $default != null: +return $default(_that.id,_that.object,_that.accountHolderName,_that.accountHolderType,_that.accountType,_that.bankName,_that.country,_that.currency,_that.fingerprint,_that.last4,_that.routingNumber,_that.status);case _: + return null; + +} } -/// @nodoc -class __$$BankAccountTokenImplCopyWithImpl<$Res> - extends _$BankAccountTokenCopyWithImpl<$Res, _$BankAccountTokenImpl> - implements _$$BankAccountTokenImplCopyWith<$Res> { - __$$BankAccountTokenImplCopyWithImpl(_$BankAccountTokenImpl _value, - $Res Function(_$BankAccountTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of BankAccountToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? accountHolderName = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? bankName = freezed, - Object? country = freezed, - Object? currency = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - Object? routingNumber = freezed, - Object? status = freezed, - }) { - return _then(_$BankAccountTokenImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as String?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as BankAccountStatus?, - )); - } } /// @nodoc @JsonSerializable() -class _$BankAccountTokenImpl implements _BankAccountToken { - const _$BankAccountTokenImpl( - {required this.id, - this.object = "bank_account", - @JsonKey(name: "account_holder_name") this.accountHolderName, - @JsonKey(name: "account_holder_type") this.accountHolderType, - @JsonKey(name: "account_type") this.accountType, - @JsonKey(name: "bank_name") this.bankName, - this.country, - this.currency, - this.fingerprint, - this.last4, - @JsonKey(name: "routing_number") this.routingNumber, - this.status}); - - factory _$BankAccountTokenImpl.fromJson(Map json) => - _$$BankAccountTokenImplFromJson(json); - - /// Unique identifier for the object. - @override - final String id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "bank_account". - @override - @JsonKey() - final String object; - - /// The name of the person or business that owns the bank account. - @override - @JsonKey(name: "account_holder_name") - final String? accountHolderName; - - /// The type of entity that holds the account. - /// This can be either individual or company. - @override - @JsonKey(name: "account_holder_type") - final BankAccountHolderType? accountHolderType; - - /// The bank account type. - /// This can only be checking or savings in most countries. - /// In Japan, this can only be futsu or toza. - @override - @JsonKey(name: "account_type") - final String? accountType; - - /// Name of the bank associated with the routing number (e.g., WELLS FARGO). - @override - @JsonKey(name: "bank_name") - final String? bankName; - - /// Two-letter ISO code representing the country the bank account is - /// located in. - @override - final String? country; - - /// Three-letter ISO code for the currency paid out to the bank account. - @override - final String? currency; - - /// Uniquely identifies this particular bank account. - /// You can use this attribute to check whether two bank accounts are - /// the same. - @override - final String? fingerprint; - - /// The last four digits of the bank account number. - @override - final String? last4; - - /// The routing transit number for the bank account. - @override - @JsonKey(name: "routing_number") - final String? routingNumber; - - /// For bank accounts, possible values are new, validated, verified, - /// verification_failed, or errored. - /// A bank account that hasn’t had any activity or validation performed - /// is new. - /// If Stripe can determine that the bank account exists, - /// its status will be validated. - /// Note that there often isn’t enough information to know - /// (e.g., for smaller credit unions), and the validation is not always run. - /// If customer bank account verification has succeeded, the bank account - /// status will be verified. If the verification failed for any reason, - /// such as microdeposit failure, the status will be verification_failed. - /// If a transfer sent to this bank account fails, we’ll set the status to - /// errored and will not continue to send transfers until the bank details - /// are updated. - /// - /// For external accounts, possible values are new and errored. - /// Validations aren’t run against external accounts because they’re - /// only used for payouts. This means the other statuses don’t apply. - /// If a transfer fails, the status is set to errored and transfers are - /// stopped until account details are updated. - @override - final BankAccountStatus? status; - - @override - String toString() { - return 'BankAccountToken(id: $id, object: $object, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, country: $country, currency: $currency, fingerprint: $fingerprint, last4: $last4, routingNumber: $routingNumber, status: $status)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BankAccountTokenImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.object, object) || other.object == object) && - (identical(other.accountHolderName, accountHolderName) || - other.accountHolderName == accountHolderName) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.accountType, accountType) || - other.accountType == accountType) && - (identical(other.bankName, bankName) || - other.bankName == bankName) && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.status, status) || other.status == status)); - } +class _BankAccountToken implements BankAccountToken { + const _BankAccountToken({required this.id, this.object = "bank_account", @JsonKey(name: "account_holder_name") this.accountHolderName, @JsonKey(name: "account_holder_type") this.accountHolderType, @JsonKey(name: "account_type") this.accountType, @JsonKey(name: "bank_name") this.bankName, this.country, this.currency, this.fingerprint, this.last4, @JsonKey(name: "routing_number") this.routingNumber, this.status}); + factory _BankAccountToken.fromJson(Map json) => _$BankAccountTokenFromJson(json); + +/// Unique identifier for the object. +@override final String id; +/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "bank_account". +@override@JsonKey() final String object; +/// The name of the person or business that owns the bank account. +@override@JsonKey(name: "account_holder_name") final String? accountHolderName; +/// The type of entity that holds the account. +/// This can be either individual or company. +@override@JsonKey(name: "account_holder_type") final BankAccountHolderType? accountHolderType; +/// The bank account type. +/// This can only be checking or savings in most countries. +/// In Japan, this can only be futsu or toza. +@override@JsonKey(name: "account_type") final String? accountType; +/// Name of the bank associated with the routing number (e.g., WELLS FARGO). +@override@JsonKey(name: "bank_name") final String? bankName; +/// Two-letter ISO code representing the country the bank account is +/// located in. +@override final String? country; +/// Three-letter ISO code for the currency paid out to the bank account. +@override final String? currency; +/// Uniquely identifies this particular bank account. +/// You can use this attribute to check whether two bank accounts are +/// the same. +@override final String? fingerprint; +/// The last four digits of the bank account number. +@override final String? last4; +/// The routing transit number for the bank account. +@override@JsonKey(name: "routing_number") final String? routingNumber; +/// For bank accounts, possible values are new, validated, verified, +/// verification_failed, or errored. +/// A bank account that hasn’t had any activity or validation performed +/// is new. +/// If Stripe can determine that the bank account exists, +/// its status will be validated. +/// Note that there often isn’t enough information to know +/// (e.g., for smaller credit unions), and the validation is not always run. +/// If customer bank account verification has succeeded, the bank account +/// status will be verified. If the verification failed for any reason, +/// such as microdeposit failure, the status will be verification_failed. +/// If a transfer sent to this bank account fails, we’ll set the status to +/// errored and will not continue to send transfers until the bank details +/// are updated. +/// +/// For external accounts, possible values are new and errored. +/// Validations aren’t run against external accounts because they’re +/// only used for payouts. This means the other statuses don’t apply. +/// If a transfer fails, the status is set to errored and transfers are +/// stopped until account details are updated. +@override final BankAccountStatus? status; + +/// Create a copy of BankAccountToken +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BankAccountTokenCopyWith<_BankAccountToken> get copyWith => __$BankAccountTokenCopyWithImpl<_BankAccountToken>(this, _$identity); + +@override +Map toJson() { + return _$BankAccountTokenToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - object, - accountHolderName, - accountHolderType, - accountType, - bankName, - country, - currency, - fingerprint, - last4, - routingNumber, - status); - - /// Create a copy of BankAccountToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BankAccountTokenImplCopyWith<_$BankAccountTokenImpl> get copyWith => - __$$BankAccountTokenImplCopyWithImpl<_$BankAccountTokenImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$BankAccountTokenImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BankAccountToken&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.status, status) || other.status == status)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,object,accountHolderName,accountHolderType,accountType,bankName,country,currency,fingerprint,last4,routingNumber,status); + +@override +String toString() { + return 'BankAccountToken(id: $id, object: $object, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, country: $country, currency: $currency, fingerprint: $fingerprint, last4: $last4, routingNumber: $routingNumber, status: $status)'; } -abstract class _BankAccountToken implements BankAccountToken { - const factory _BankAccountToken( - {required final String id, - final String object, - @JsonKey(name: "account_holder_name") final String? accountHolderName, - @JsonKey(name: "account_holder_type") - final BankAccountHolderType? accountHolderType, - @JsonKey(name: "account_type") final String? accountType, - @JsonKey(name: "bank_name") final String? bankName, - final String? country, - final String? currency, - final String? fingerprint, - final String? last4, - @JsonKey(name: "routing_number") final String? routingNumber, - final BankAccountStatus? status}) = _$BankAccountTokenImpl; - - factory _BankAccountToken.fromJson(Map json) = - _$BankAccountTokenImpl.fromJson; - - /// Unique identifier for the object. - @override - String get id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "bank_account". - @override - String get object; - - /// The name of the person or business that owns the bank account. - @override - @JsonKey(name: "account_holder_name") - String? get accountHolderName; - - /// The type of entity that holds the account. - /// This can be either individual or company. - @override - @JsonKey(name: "account_holder_type") - BankAccountHolderType? get accountHolderType; - - /// The bank account type. - /// This can only be checking or savings in most countries. - /// In Japan, this can only be futsu or toza. - @override - @JsonKey(name: "account_type") - String? get accountType; - - /// Name of the bank associated with the routing number (e.g., WELLS FARGO). - @override - @JsonKey(name: "bank_name") - String? get bankName; - - /// Two-letter ISO code representing the country the bank account is - /// located in. - @override - String? get country; - - /// Three-letter ISO code for the currency paid out to the bank account. - @override - String? get currency; - - /// Uniquely identifies this particular bank account. - /// You can use this attribute to check whether two bank accounts are - /// the same. - @override - String? get fingerprint; - - /// The last four digits of the bank account number. - @override - String? get last4; - - /// The routing transit number for the bank account. - @override - @JsonKey(name: "routing_number") - String? get routingNumber; - - /// For bank accounts, possible values are new, validated, verified, - /// verification_failed, or errored. - /// A bank account that hasn’t had any activity or validation performed - /// is new. - /// If Stripe can determine that the bank account exists, - /// its status will be validated. - /// Note that there often isn’t enough information to know - /// (e.g., for smaller credit unions), and the validation is not always run. - /// If customer bank account verification has succeeded, the bank account - /// status will be verified. If the verification failed for any reason, - /// such as microdeposit failure, the status will be verification_failed. - /// If a transfer sent to this bank account fails, we’ll set the status to - /// errored and will not continue to send transfers until the bank details - /// are updated. - /// - /// For external accounts, possible values are new and errored. - /// Validations aren’t run against external accounts because they’re - /// only used for payouts. This means the other statuses don’t apply. - /// If a transfer fails, the status is set to errored and transfers are - /// stopped until account details are updated. - @override - BankAccountStatus? get status; - - /// Create a copy of BankAccountToken - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BankAccountTokenImplCopyWith<_$BankAccountTokenImpl> get copyWith => - throw _privateConstructorUsedError; -} - -CardToken _$CardTokenFromJson(Map json) { - return _CardToken.fromJson(json); + } +/// @nodoc +abstract mixin class _$BankAccountTokenCopyWith<$Res> implements $BankAccountTokenCopyWith<$Res> { + factory _$BankAccountTokenCopyWith(_BankAccountToken value, $Res Function(_BankAccountToken) _then) = __$BankAccountTokenCopyWithImpl; +@override @useResult +$Res call({ + String id, String object,@JsonKey(name: "account_holder_name") String? accountHolderName,@JsonKey(name: "account_holder_type") BankAccountHolderType? accountHolderType,@JsonKey(name: "account_type") String? accountType,@JsonKey(name: "bank_name") String? bankName, String? country, String? currency, String? fingerprint, String? last4,@JsonKey(name: "routing_number") String? routingNumber, BankAccountStatus? status +}); + + + + +} +/// @nodoc +class __$BankAccountTokenCopyWithImpl<$Res> + implements _$BankAccountTokenCopyWith<$Res> { + __$BankAccountTokenCopyWithImpl(this._self, this._then); + + final _BankAccountToken _self; + final $Res Function(_BankAccountToken) _then; + +/// Create a copy of BankAccountToken +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? object = null,Object? accountHolderName = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,Object? bankName = freezed,Object? country = freezed,Object? currency = freezed,Object? fingerprint = freezed,Object? last4 = freezed,Object? routingNumber = freezed,Object? status = freezed,}) { + return _then(_BankAccountToken( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as String?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as BankAccountStatus?, + )); +} + + +} + + /// @nodoc mixin _$CardToken { - /// Unique identifier for the object. - String get id => throw _privateConstructorUsedError; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "card". - String get object => throw _privateConstructorUsedError; - - /// City/District/Suburb/Town/Village. - @JsonKey(name: "address_city") - String? get addressCity => throw _privateConstructorUsedError; - - /// Billing address country, if provided when creating card. - @JsonKey(name: "address_country") - String? get addressCountry => throw _privateConstructorUsedError; - - /// Address line 1 (Street address/PO Box/Company name). - @JsonKey(name: "address_line1") - String? get addressLine1 => throw _privateConstructorUsedError; - - /// If address_line1 was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @JsonKey(name: "address_line1_check") - VerificationCheck? get addressLine1Check => - throw _privateConstructorUsedError; - - /// Address line 2 (Apartment/Suite/Unit/Building). - @JsonKey(name: "address_line2") - String? get addressLine2 => throw _privateConstructorUsedError; - - /// State/County/Province/Region. - @JsonKey(name: "address_state") - String? get addressState => throw _privateConstructorUsedError; - - /// ZIP or postal code. - @JsonKey(name: "address_zip") - String? get addressZip => throw _privateConstructorUsedError; - - /// If address_zip was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @JsonKey(name: "address_zip_check") - VerificationCheck? get addressZipCheck => throw _privateConstructorUsedError; - - /// If address_zip was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - CardTokenBrand? get brand => throw _privateConstructorUsedError; - - /// Two-letter ISO code representing the country of the card. - /// You could use this attribute to get a sense of the - /// international breakdown of cards you’ve collected. - String? get country => throw _privateConstructorUsedError; - - /// Three-letter ISO currency code, in lowercase. - /// Must be a supported currency. - String? get currency => throw _privateConstructorUsedError; - - /// If a CVC was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - /// A result of unchecked indicates that CVC was provided but hasn’t - /// been checked yet. - /// Checks are typically performed when attaching a card to a Customer - /// object, or when creating a charge. For more details, see - /// Check if a card is valid without a charge. - /// https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge - @JsonKey(name: "cvc_check") - VerificationCheck? get cvcCheck => throw _privateConstructorUsedError; - - /// (For tokenized numbers only.) - /// The last four digits of the device account number. - @JsonKey(name: "dynamic_last4") - String? get dynamicLast4 => throw _privateConstructorUsedError; - - /// Two-digit number representing the card’s expiration month. - @JsonKey(name: "exp_month") - int? get expMonth => throw _privateConstructorUsedError; - - /// Four-digit number representing the card’s expiration year. - @JsonKey(name: "exp_year") - int? get expYear => throw _privateConstructorUsedError; - - /// Uniquely identifies this particular card number. - /// You can use this attribute to check whether two customers who’ve - /// signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information - /// (Apple Pay, Google Pay), the tokenized number might be provided - /// instead of the underlying card number. - /// Starting May 1, 2021, card fingerprint in India for Connect will - /// change to allow two fingerprints for the same card — one for India and - /// one for the rest of the world. - String? get fingerprint => throw _privateConstructorUsedError; - - /// Card funding type. Can be credit, debit, prepaid, or unknown. - CardFundingType? get funding => throw _privateConstructorUsedError; - - /// The last four digits of the card. - String? get last4 => throw _privateConstructorUsedError; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured forma - Map get metadata => throw _privateConstructorUsedError; - - /// Cardholder name. - String? get name => throw _privateConstructorUsedError; - - /// If the card number is tokenized, this is the method that was used. - /// Can be android_pay (includes Google Pay), apple_pay, masterpass, - /// visa_checkout, or null. - @JsonKey(name: "tokenization_method") - CardTokenizationMethod? get tokenizationMethod => - throw _privateConstructorUsedError; + +/// Unique identifier for the object. + String get id;/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "card". + String get object;/// City/District/Suburb/Town/Village. +@JsonKey(name: "address_city") String? get addressCity;/// Billing address country, if provided when creating card. +@JsonKey(name: "address_country") String? get addressCountry;/// Address line 1 (Street address/PO Box/Company name). +@JsonKey(name: "address_line1") String? get addressLine1;/// If address_line1 was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +@JsonKey(name: "address_line1_check") VerificationCheck? get addressLine1Check;/// Address line 2 (Apartment/Suite/Unit/Building). +@JsonKey(name: "address_line2") String? get addressLine2;/// State/County/Province/Region. +@JsonKey(name: "address_state") String? get addressState;/// ZIP or postal code. +@JsonKey(name: "address_zip") String? get addressZip;/// If address_zip was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +@JsonKey(name: "address_zip_check") VerificationCheck? get addressZipCheck;/// If address_zip was provided, results of the check: +/// pass, fail, unavailable, or unchecked. + CardTokenBrand? get brand;/// Two-letter ISO code representing the country of the card. +/// You could use this attribute to get a sense of the +/// international breakdown of cards you’ve collected. + String? get country;/// Three-letter ISO currency code, in lowercase. +/// Must be a supported currency. + String? get currency;/// If a CVC was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +/// A result of unchecked indicates that CVC was provided but hasn’t +/// been checked yet. +/// Checks are typically performed when attaching a card to a Customer +/// object, or when creating a charge. For more details, see +/// Check if a card is valid without a charge. +/// https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge +@JsonKey(name: "cvc_check") VerificationCheck? get cvcCheck;/// (For tokenized numbers only.) +/// The last four digits of the device account number. +@JsonKey(name: "dynamic_last4") String? get dynamicLast4;/// Two-digit number representing the card’s expiration month. +@JsonKey(name: "exp_month") int? get expMonth;/// Four-digit number representing the card’s expiration year. +@JsonKey(name: "exp_year") int? get expYear;/// Uniquely identifies this particular card number. +/// You can use this attribute to check whether two customers who’ve +/// signed up with you are using the same card number, for example. +/// For payment methods that tokenize card information +/// (Apple Pay, Google Pay), the tokenized number might be provided +/// instead of the underlying card number. +/// Starting May 1, 2021, card fingerprint in India for Connect will +/// change to allow two fingerprints for the same card — one for India and +/// one for the rest of the world. + String? get fingerprint;/// Card funding type. Can be credit, debit, prepaid, or unknown. + CardFundingType? get funding;/// The last four digits of the card. + String? get last4;/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the object +/// in a structured forma + Map get metadata;/// Cardholder name. + String? get name;/// If the card number is tokenized, this is the method that was used. +/// Can be android_pay (includes Google Pay), apple_pay, masterpass, +/// visa_checkout, or null. +@JsonKey(name: "tokenization_method") CardTokenizationMethod? get tokenizationMethod; +/// Create a copy of CardToken +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardTokenCopyWith get copyWith => _$CardTokenCopyWithImpl(this as CardToken, _$identity); /// Serializes this CardToken to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CardToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardTokenCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardToken&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.addressCity, addressCity) || other.addressCity == addressCity)&&(identical(other.addressCountry, addressCountry) || other.addressCountry == addressCountry)&&(identical(other.addressLine1, addressLine1) || other.addressLine1 == addressLine1)&&(identical(other.addressLine1Check, addressLine1Check) || other.addressLine1Check == addressLine1Check)&&(identical(other.addressLine2, addressLine2) || other.addressLine2 == addressLine2)&&(identical(other.addressState, addressState) || other.addressState == addressState)&&(identical(other.addressZip, addressZip) || other.addressZip == addressZip)&&(identical(other.addressZipCheck, addressZipCheck) || other.addressZipCheck == addressZipCheck)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.cvcCheck, cvcCheck) || other.cvcCheck == cvcCheck)&&(identical(other.dynamicLast4, dynamicLast4) || other.dynamicLast4 == dynamicLast4)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&const DeepCollectionEquality().equals(other.metadata, metadata)&&(identical(other.name, name) || other.name == name)&&(identical(other.tokenizationMethod, tokenizationMethod) || other.tokenizationMethod == tokenizationMethod)); } -/// @nodoc -abstract class $CardTokenCopyWith<$Res> { - factory $CardTokenCopyWith(CardToken value, $Res Function(CardToken) then) = - _$CardTokenCopyWithImpl<$Res, CardToken>; - @useResult - $Res call( - {String id, - String object, - @JsonKey(name: "address_city") String? addressCity, - @JsonKey(name: "address_country") String? addressCountry, - @JsonKey(name: "address_line1") String? addressLine1, - @JsonKey(name: "address_line1_check") - VerificationCheck? addressLine1Check, - @JsonKey(name: "address_line2") String? addressLine2, - @JsonKey(name: "address_state") String? addressState, - @JsonKey(name: "address_zip") String? addressZip, - @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, - CardTokenBrand? brand, - String? country, - String? currency, - @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck, - @JsonKey(name: "dynamic_last4") String? dynamicLast4, - @JsonKey(name: "exp_month") int? expMonth, - @JsonKey(name: "exp_year") int? expYear, - String? fingerprint, - CardFundingType? funding, - String? last4, - Map metadata, - String? name, - @JsonKey(name: "tokenization_method") - CardTokenizationMethod? tokenizationMethod}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,object,addressCity,addressCountry,addressLine1,addressLine1Check,addressLine2,addressState,addressZip,addressZipCheck,brand,country,currency,cvcCheck,dynamicLast4,expMonth,expYear,fingerprint,funding,last4,const DeepCollectionEquality().hash(metadata),name,tokenizationMethod]); + +@override +String toString() { + return 'CardToken(id: $id, object: $object, addressCity: $addressCity, addressCountry: $addressCountry, addressLine1: $addressLine1, addressLine1Check: $addressLine1Check, addressLine2: $addressLine2, addressState: $addressState, addressZip: $addressZip, addressZipCheck: $addressZipCheck, brand: $brand, country: $country, currency: $currency, cvcCheck: $cvcCheck, dynamicLast4: $dynamicLast4, expMonth: $expMonth, expYear: $expYear, fingerprint: $fingerprint, funding: $funding, last4: $last4, metadata: $metadata, name: $name, tokenizationMethod: $tokenizationMethod)'; } -/// @nodoc -class _$CardTokenCopyWithImpl<$Res, $Val extends CardToken> - implements $CardTokenCopyWith<$Res> { - _$CardTokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? addressCity = freezed, - Object? addressCountry = freezed, - Object? addressLine1 = freezed, - Object? addressLine1Check = freezed, - Object? addressLine2 = freezed, - Object? addressState = freezed, - Object? addressZip = freezed, - Object? addressZipCheck = freezed, - Object? brand = freezed, - Object? country = freezed, - Object? currency = freezed, - Object? cvcCheck = freezed, - Object? dynamicLast4 = freezed, - Object? expMonth = freezed, - Object? expYear = freezed, - Object? fingerprint = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? metadata = null, - Object? name = freezed, - Object? tokenizationMethod = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - addressCity: freezed == addressCity - ? _value.addressCity - : addressCity // ignore: cast_nullable_to_non_nullable - as String?, - addressCountry: freezed == addressCountry - ? _value.addressCountry - : addressCountry // ignore: cast_nullable_to_non_nullable - as String?, - addressLine1: freezed == addressLine1 - ? _value.addressLine1 - : addressLine1 // ignore: cast_nullable_to_non_nullable - as String?, - addressLine1Check: freezed == addressLine1Check - ? _value.addressLine1Check - : addressLine1Check // ignore: cast_nullable_to_non_nullable - as VerificationCheck?, - addressLine2: freezed == addressLine2 - ? _value.addressLine2 - : addressLine2 // ignore: cast_nullable_to_non_nullable - as String?, - addressState: freezed == addressState - ? _value.addressState - : addressState // ignore: cast_nullable_to_non_nullable - as String?, - addressZip: freezed == addressZip - ? _value.addressZip - : addressZip // ignore: cast_nullable_to_non_nullable - as String?, - addressZipCheck: freezed == addressZipCheck - ? _value.addressZipCheck - : addressZipCheck // ignore: cast_nullable_to_non_nullable - as VerificationCheck?, - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as CardTokenBrand?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - cvcCheck: freezed == cvcCheck - ? _value.cvcCheck - : cvcCheck // ignore: cast_nullable_to_non_nullable - as VerificationCheck?, - dynamicLast4: freezed == dynamicLast4 - ? _value.dynamicLast4 - : dynamicLast4 // ignore: cast_nullable_to_non_nullable - as String?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as CardFundingType?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - tokenizationMethod: freezed == tokenizationMethod - ? _value.tokenizationMethod - : tokenizationMethod // ignore: cast_nullable_to_non_nullable - as CardTokenizationMethod?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardTokenImplCopyWith<$Res> +abstract mixin class $CardTokenCopyWith<$Res> { + factory $CardTokenCopyWith(CardToken value, $Res Function(CardToken) _then) = _$CardTokenCopyWithImpl; +@useResult +$Res call({ + String id, String object,@JsonKey(name: "address_city") String? addressCity,@JsonKey(name: "address_country") String? addressCountry,@JsonKey(name: "address_line1") String? addressLine1,@JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check,@JsonKey(name: "address_line2") String? addressLine2,@JsonKey(name: "address_state") String? addressState,@JsonKey(name: "address_zip") String? addressZip,@JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, CardTokenBrand? brand, String? country, String? currency,@JsonKey(name: "cvc_check") VerificationCheck? cvcCheck,@JsonKey(name: "dynamic_last4") String? dynamicLast4,@JsonKey(name: "exp_month") int? expMonth,@JsonKey(name: "exp_year") int? expYear, String? fingerprint, CardFundingType? funding, String? last4, Map metadata, String? name,@JsonKey(name: "tokenization_method") CardTokenizationMethod? tokenizationMethod +}); + + + + +} +/// @nodoc +class _$CardTokenCopyWithImpl<$Res> implements $CardTokenCopyWith<$Res> { - factory _$$CardTokenImplCopyWith( - _$CardTokenImpl value, $Res Function(_$CardTokenImpl) then) = - __$$CardTokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String object, - @JsonKey(name: "address_city") String? addressCity, - @JsonKey(name: "address_country") String? addressCountry, - @JsonKey(name: "address_line1") String? addressLine1, - @JsonKey(name: "address_line1_check") - VerificationCheck? addressLine1Check, - @JsonKey(name: "address_line2") String? addressLine2, - @JsonKey(name: "address_state") String? addressState, - @JsonKey(name: "address_zip") String? addressZip, - @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, - CardTokenBrand? brand, - String? country, - String? currency, - @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck, - @JsonKey(name: "dynamic_last4") String? dynamicLast4, - @JsonKey(name: "exp_month") int? expMonth, - @JsonKey(name: "exp_year") int? expYear, - String? fingerprint, - CardFundingType? funding, - String? last4, - Map metadata, - String? name, - @JsonKey(name: "tokenization_method") - CardTokenizationMethod? tokenizationMethod}); + _$CardTokenCopyWithImpl(this._self, this._then); + + final CardToken _self; + final $Res Function(CardToken) _then; + +/// Create a copy of CardToken +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? object = null,Object? addressCity = freezed,Object? addressCountry = freezed,Object? addressLine1 = freezed,Object? addressLine1Check = freezed,Object? addressLine2 = freezed,Object? addressState = freezed,Object? addressZip = freezed,Object? addressZipCheck = freezed,Object? brand = freezed,Object? country = freezed,Object? currency = freezed,Object? cvcCheck = freezed,Object? dynamicLast4 = freezed,Object? expMonth = freezed,Object? expYear = freezed,Object? fingerprint = freezed,Object? funding = freezed,Object? last4 = freezed,Object? metadata = null,Object? name = freezed,Object? tokenizationMethod = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,addressCity: freezed == addressCity ? _self.addressCity : addressCity // ignore: cast_nullable_to_non_nullable +as String?,addressCountry: freezed == addressCountry ? _self.addressCountry : addressCountry // ignore: cast_nullable_to_non_nullable +as String?,addressLine1: freezed == addressLine1 ? _self.addressLine1 : addressLine1 // ignore: cast_nullable_to_non_nullable +as String?,addressLine1Check: freezed == addressLine1Check ? _self.addressLine1Check : addressLine1Check // ignore: cast_nullable_to_non_nullable +as VerificationCheck?,addressLine2: freezed == addressLine2 ? _self.addressLine2 : addressLine2 // ignore: cast_nullable_to_non_nullable +as String?,addressState: freezed == addressState ? _self.addressState : addressState // ignore: cast_nullable_to_non_nullable +as String?,addressZip: freezed == addressZip ? _self.addressZip : addressZip // ignore: cast_nullable_to_non_nullable +as String?,addressZipCheck: freezed == addressZipCheck ? _self.addressZipCheck : addressZipCheck // ignore: cast_nullable_to_non_nullable +as VerificationCheck?,brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as CardTokenBrand?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,cvcCheck: freezed == cvcCheck ? _self.cvcCheck : cvcCheck // ignore: cast_nullable_to_non_nullable +as VerificationCheck?,dynamicLast4: freezed == dynamicLast4 ? _self.dynamicLast4 : dynamicLast4 // ignore: cast_nullable_to_non_nullable +as String?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as CardFundingType?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,metadata: null == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,tokenizationMethod: freezed == tokenizationMethod ? _self.tokenizationMethod : tokenizationMethod // ignore: cast_nullable_to_non_nullable +as CardTokenizationMethod?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardToken]. +extension CardTokenPatterns on CardToken { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardToken value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardToken() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardToken value) $default,){ +final _that = this; +switch (_that) { +case _CardToken(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardToken value)? $default,){ +final _that = this; +switch (_that) { +case _CardToken() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String object, @JsonKey(name: "address_city") String? addressCity, @JsonKey(name: "address_country") String? addressCountry, @JsonKey(name: "address_line1") String? addressLine1, @JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check, @JsonKey(name: "address_line2") String? addressLine2, @JsonKey(name: "address_state") String? addressState, @JsonKey(name: "address_zip") String? addressZip, @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, CardTokenBrand? brand, String? country, String? currency, @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck, @JsonKey(name: "dynamic_last4") String? dynamicLast4, @JsonKey(name: "exp_month") int? expMonth, @JsonKey(name: "exp_year") int? expYear, String? fingerprint, CardFundingType? funding, String? last4, Map metadata, String? name, @JsonKey(name: "tokenization_method") CardTokenizationMethod? tokenizationMethod)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardToken() when $default != null: +return $default(_that.id,_that.object,_that.addressCity,_that.addressCountry,_that.addressLine1,_that.addressLine1Check,_that.addressLine2,_that.addressState,_that.addressZip,_that.addressZipCheck,_that.brand,_that.country,_that.currency,_that.cvcCheck,_that.dynamicLast4,_that.expMonth,_that.expYear,_that.fingerprint,_that.funding,_that.last4,_that.metadata,_that.name,_that.tokenizationMethod);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String object, @JsonKey(name: "address_city") String? addressCity, @JsonKey(name: "address_country") String? addressCountry, @JsonKey(name: "address_line1") String? addressLine1, @JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check, @JsonKey(name: "address_line2") String? addressLine2, @JsonKey(name: "address_state") String? addressState, @JsonKey(name: "address_zip") String? addressZip, @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, CardTokenBrand? brand, String? country, String? currency, @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck, @JsonKey(name: "dynamic_last4") String? dynamicLast4, @JsonKey(name: "exp_month") int? expMonth, @JsonKey(name: "exp_year") int? expYear, String? fingerprint, CardFundingType? funding, String? last4, Map metadata, String? name, @JsonKey(name: "tokenization_method") CardTokenizationMethod? tokenizationMethod) $default,) {final _that = this; +switch (_that) { +case _CardToken(): +return $default(_that.id,_that.object,_that.addressCity,_that.addressCountry,_that.addressLine1,_that.addressLine1Check,_that.addressLine2,_that.addressState,_that.addressZip,_that.addressZipCheck,_that.brand,_that.country,_that.currency,_that.cvcCheck,_that.dynamicLast4,_that.expMonth,_that.expYear,_that.fingerprint,_that.funding,_that.last4,_that.metadata,_that.name,_that.tokenizationMethod);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String object, @JsonKey(name: "address_city") String? addressCity, @JsonKey(name: "address_country") String? addressCountry, @JsonKey(name: "address_line1") String? addressLine1, @JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check, @JsonKey(name: "address_line2") String? addressLine2, @JsonKey(name: "address_state") String? addressState, @JsonKey(name: "address_zip") String? addressZip, @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, CardTokenBrand? brand, String? country, String? currency, @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck, @JsonKey(name: "dynamic_last4") String? dynamicLast4, @JsonKey(name: "exp_month") int? expMonth, @JsonKey(name: "exp_year") int? expYear, String? fingerprint, CardFundingType? funding, String? last4, Map metadata, String? name, @JsonKey(name: "tokenization_method") CardTokenizationMethod? tokenizationMethod)? $default,) {final _that = this; +switch (_that) { +case _CardToken() when $default != null: +return $default(_that.id,_that.object,_that.addressCity,_that.addressCountry,_that.addressLine1,_that.addressLine1Check,_that.addressLine2,_that.addressState,_that.addressZip,_that.addressZipCheck,_that.brand,_that.country,_that.currency,_that.cvcCheck,_that.dynamicLast4,_that.expMonth,_that.expYear,_that.fingerprint,_that.funding,_that.last4,_that.metadata,_that.name,_that.tokenizationMethod);case _: + return null; + +} } -/// @nodoc -class __$$CardTokenImplCopyWithImpl<$Res> - extends _$CardTokenCopyWithImpl<$Res, _$CardTokenImpl> - implements _$$CardTokenImplCopyWith<$Res> { - __$$CardTokenImplCopyWithImpl( - _$CardTokenImpl _value, $Res Function(_$CardTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of CardToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? object = null, - Object? addressCity = freezed, - Object? addressCountry = freezed, - Object? addressLine1 = freezed, - Object? addressLine1Check = freezed, - Object? addressLine2 = freezed, - Object? addressState = freezed, - Object? addressZip = freezed, - Object? addressZipCheck = freezed, - Object? brand = freezed, - Object? country = freezed, - Object? currency = freezed, - Object? cvcCheck = freezed, - Object? dynamicLast4 = freezed, - Object? expMonth = freezed, - Object? expYear = freezed, - Object? fingerprint = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? metadata = null, - Object? name = freezed, - Object? tokenizationMethod = freezed, - }) { - return _then(_$CardTokenImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - object: null == object - ? _value.object - : object // ignore: cast_nullable_to_non_nullable - as String, - addressCity: freezed == addressCity - ? _value.addressCity - : addressCity // ignore: cast_nullable_to_non_nullable - as String?, - addressCountry: freezed == addressCountry - ? _value.addressCountry - : addressCountry // ignore: cast_nullable_to_non_nullable - as String?, - addressLine1: freezed == addressLine1 - ? _value.addressLine1 - : addressLine1 // ignore: cast_nullable_to_non_nullable - as String?, - addressLine1Check: freezed == addressLine1Check - ? _value.addressLine1Check - : addressLine1Check // ignore: cast_nullable_to_non_nullable - as VerificationCheck?, - addressLine2: freezed == addressLine2 - ? _value.addressLine2 - : addressLine2 // ignore: cast_nullable_to_non_nullable - as String?, - addressState: freezed == addressState - ? _value.addressState - : addressState // ignore: cast_nullable_to_non_nullable - as String?, - addressZip: freezed == addressZip - ? _value.addressZip - : addressZip // ignore: cast_nullable_to_non_nullable - as String?, - addressZipCheck: freezed == addressZipCheck - ? _value.addressZipCheck - : addressZipCheck // ignore: cast_nullable_to_non_nullable - as VerificationCheck?, - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as CardTokenBrand?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - cvcCheck: freezed == cvcCheck - ? _value.cvcCheck - : cvcCheck // ignore: cast_nullable_to_non_nullable - as VerificationCheck?, - dynamicLast4: freezed == dynamicLast4 - ? _value.dynamicLast4 - : dynamicLast4 // ignore: cast_nullable_to_non_nullable - as String?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as CardFundingType?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - metadata: null == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - tokenizationMethod: freezed == tokenizationMethod - ? _value.tokenizationMethod - : tokenizationMethod // ignore: cast_nullable_to_non_nullable - as CardTokenizationMethod?, - )); - } } /// @nodoc @JsonSerializable() -class _$CardTokenImpl implements _CardToken { - const _$CardTokenImpl( - {required this.id, - this.object = "card", - @JsonKey(name: "address_city") this.addressCity, - @JsonKey(name: "address_country") this.addressCountry, - @JsonKey(name: "address_line1") this.addressLine1, - @JsonKey(name: "address_line1_check") this.addressLine1Check, - @JsonKey(name: "address_line2") this.addressLine2, - @JsonKey(name: "address_state") this.addressState, - @JsonKey(name: "address_zip") this.addressZip, - @JsonKey(name: "address_zip_check") this.addressZipCheck, - this.brand = CardTokenBrand.unknown, - this.country, - this.currency, - @JsonKey(name: "cvc_check") this.cvcCheck, - @JsonKey(name: "dynamic_last4") this.dynamicLast4, - @JsonKey(name: "exp_month") this.expMonth, - @JsonKey(name: "exp_year") this.expYear, - this.fingerprint, - this.funding, - this.last4, - final Map metadata = const {}, - this.name, - @JsonKey(name: "tokenization_method") this.tokenizationMethod}) - : _metadata = metadata; - - factory _$CardTokenImpl.fromJson(Map json) => - _$$CardTokenImplFromJson(json); - - /// Unique identifier for the object. - @override - final String id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "card". - @override - @JsonKey() - final String object; - - /// City/District/Suburb/Town/Village. - @override - @JsonKey(name: "address_city") - final String? addressCity; - - /// Billing address country, if provided when creating card. - @override - @JsonKey(name: "address_country") - final String? addressCountry; - - /// Address line 1 (Street address/PO Box/Company name). - @override - @JsonKey(name: "address_line1") - final String? addressLine1; - - /// If address_line1 was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @override - @JsonKey(name: "address_line1_check") - final VerificationCheck? addressLine1Check; - - /// Address line 2 (Apartment/Suite/Unit/Building). - @override - @JsonKey(name: "address_line2") - final String? addressLine2; - - /// State/County/Province/Region. - @override - @JsonKey(name: "address_state") - final String? addressState; - - /// ZIP or postal code. - @override - @JsonKey(name: "address_zip") - final String? addressZip; - - /// If address_zip was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @override - @JsonKey(name: "address_zip_check") - final VerificationCheck? addressZipCheck; - - /// If address_zip was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @override - @JsonKey() - final CardTokenBrand? brand; - - /// Two-letter ISO code representing the country of the card. - /// You could use this attribute to get a sense of the - /// international breakdown of cards you’ve collected. - @override - final String? country; - - /// Three-letter ISO currency code, in lowercase. - /// Must be a supported currency. - @override - final String? currency; - - /// If a CVC was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - /// A result of unchecked indicates that CVC was provided but hasn’t - /// been checked yet. - /// Checks are typically performed when attaching a card to a Customer - /// object, or when creating a charge. For more details, see - /// Check if a card is valid without a charge. - /// https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge - @override - @JsonKey(name: "cvc_check") - final VerificationCheck? cvcCheck; - - /// (For tokenized numbers only.) - /// The last four digits of the device account number. - @override - @JsonKey(name: "dynamic_last4") - final String? dynamicLast4; - - /// Two-digit number representing the card’s expiration month. - @override - @JsonKey(name: "exp_month") - final int? expMonth; - - /// Four-digit number representing the card’s expiration year. - @override - @JsonKey(name: "exp_year") - final int? expYear; - - /// Uniquely identifies this particular card number. - /// You can use this attribute to check whether two customers who’ve - /// signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information - /// (Apple Pay, Google Pay), the tokenized number might be provided - /// instead of the underlying card number. - /// Starting May 1, 2021, card fingerprint in India for Connect will - /// change to allow two fingerprints for the same card — one for India and - /// one for the rest of the world. - @override - final String? fingerprint; - - /// Card funding type. Can be credit, debit, prepaid, or unknown. - @override - final CardFundingType? funding; - - /// The last four digits of the card. - @override - final String? last4; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured forma - final Map _metadata; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured forma - @override - @JsonKey() - Map get metadata { - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_metadata); - } - /// Cardholder name. - @override - final String? name; +class _CardToken implements CardToken { + const _CardToken({required this.id, this.object = "card", @JsonKey(name: "address_city") this.addressCity, @JsonKey(name: "address_country") this.addressCountry, @JsonKey(name: "address_line1") this.addressLine1, @JsonKey(name: "address_line1_check") this.addressLine1Check, @JsonKey(name: "address_line2") this.addressLine2, @JsonKey(name: "address_state") this.addressState, @JsonKey(name: "address_zip") this.addressZip, @JsonKey(name: "address_zip_check") this.addressZipCheck, this.brand = CardTokenBrand.unknown, this.country, this.currency, @JsonKey(name: "cvc_check") this.cvcCheck, @JsonKey(name: "dynamic_last4") this.dynamicLast4, @JsonKey(name: "exp_month") this.expMonth, @JsonKey(name: "exp_year") this.expYear, this.fingerprint, this.funding, this.last4, final Map metadata = const {}, this.name, @JsonKey(name: "tokenization_method") this.tokenizationMethod}): _metadata = metadata; + factory _CardToken.fromJson(Map json) => _$CardTokenFromJson(json); + +/// Unique identifier for the object. +@override final String id; +/// String representing the object’s type. +/// Objects of the same type share the same value. +/// Value is "card". +@override@JsonKey() final String object; +/// City/District/Suburb/Town/Village. +@override@JsonKey(name: "address_city") final String? addressCity; +/// Billing address country, if provided when creating card. +@override@JsonKey(name: "address_country") final String? addressCountry; +/// Address line 1 (Street address/PO Box/Company name). +@override@JsonKey(name: "address_line1") final String? addressLine1; +/// If address_line1 was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +@override@JsonKey(name: "address_line1_check") final VerificationCheck? addressLine1Check; +/// Address line 2 (Apartment/Suite/Unit/Building). +@override@JsonKey(name: "address_line2") final String? addressLine2; +/// State/County/Province/Region. +@override@JsonKey(name: "address_state") final String? addressState; +/// ZIP or postal code. +@override@JsonKey(name: "address_zip") final String? addressZip; +/// If address_zip was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +@override@JsonKey(name: "address_zip_check") final VerificationCheck? addressZipCheck; +/// If address_zip was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +@override@JsonKey() final CardTokenBrand? brand; +/// Two-letter ISO code representing the country of the card. +/// You could use this attribute to get a sense of the +/// international breakdown of cards you’ve collected. +@override final String? country; +/// Three-letter ISO currency code, in lowercase. +/// Must be a supported currency. +@override final String? currency; +/// If a CVC was provided, results of the check: +/// pass, fail, unavailable, or unchecked. +/// A result of unchecked indicates that CVC was provided but hasn’t +/// been checked yet. +/// Checks are typically performed when attaching a card to a Customer +/// object, or when creating a charge. For more details, see +/// Check if a card is valid without a charge. +/// https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge +@override@JsonKey(name: "cvc_check") final VerificationCheck? cvcCheck; +/// (For tokenized numbers only.) +/// The last four digits of the device account number. +@override@JsonKey(name: "dynamic_last4") final String? dynamicLast4; +/// Two-digit number representing the card’s expiration month. +@override@JsonKey(name: "exp_month") final int? expMonth; +/// Four-digit number representing the card’s expiration year. +@override@JsonKey(name: "exp_year") final int? expYear; +/// Uniquely identifies this particular card number. +/// You can use this attribute to check whether two customers who’ve +/// signed up with you are using the same card number, for example. +/// For payment methods that tokenize card information +/// (Apple Pay, Google Pay), the tokenized number might be provided +/// instead of the underlying card number. +/// Starting May 1, 2021, card fingerprint in India for Connect will +/// change to allow two fingerprints for the same card — one for India and +/// one for the rest of the world. +@override final String? fingerprint; +/// Card funding type. Can be credit, debit, prepaid, or unknown. +@override final CardFundingType? funding; +/// The last four digits of the card. +@override final String? last4; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the object +/// in a structured forma + final Map _metadata; +/// Set of key-value pairs that you can attach to an object. +/// This can be useful for storing additional information about the object +/// in a structured forma +@override@JsonKey() Map get metadata { + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_metadata); +} - /// If the card number is tokenized, this is the method that was used. - /// Can be android_pay (includes Google Pay), apple_pay, masterpass, - /// visa_checkout, or null. - @override - @JsonKey(name: "tokenization_method") - final CardTokenizationMethod? tokenizationMethod; +/// Cardholder name. +@override final String? name; +/// If the card number is tokenized, this is the method that was used. +/// Can be android_pay (includes Google Pay), apple_pay, masterpass, +/// visa_checkout, or null. +@override@JsonKey(name: "tokenization_method") final CardTokenizationMethod? tokenizationMethod; + +/// Create a copy of CardToken +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardTokenCopyWith<_CardToken> get copyWith => __$CardTokenCopyWithImpl<_CardToken>(this, _$identity); + +@override +Map toJson() { + return _$CardTokenToJson(this, ); +} - @override - String toString() { - return 'CardToken(id: $id, object: $object, addressCity: $addressCity, addressCountry: $addressCountry, addressLine1: $addressLine1, addressLine1Check: $addressLine1Check, addressLine2: $addressLine2, addressState: $addressState, addressZip: $addressZip, addressZipCheck: $addressZipCheck, brand: $brand, country: $country, currency: $currency, cvcCheck: $cvcCheck, dynamicLast4: $dynamicLast4, expMonth: $expMonth, expYear: $expYear, fingerprint: $fingerprint, funding: $funding, last4: $last4, metadata: $metadata, name: $name, tokenizationMethod: $tokenizationMethod)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardToken&&(identical(other.id, id) || other.id == id)&&(identical(other.object, object) || other.object == object)&&(identical(other.addressCity, addressCity) || other.addressCity == addressCity)&&(identical(other.addressCountry, addressCountry) || other.addressCountry == addressCountry)&&(identical(other.addressLine1, addressLine1) || other.addressLine1 == addressLine1)&&(identical(other.addressLine1Check, addressLine1Check) || other.addressLine1Check == addressLine1Check)&&(identical(other.addressLine2, addressLine2) || other.addressLine2 == addressLine2)&&(identical(other.addressState, addressState) || other.addressState == addressState)&&(identical(other.addressZip, addressZip) || other.addressZip == addressZip)&&(identical(other.addressZipCheck, addressZipCheck) || other.addressZipCheck == addressZipCheck)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.cvcCheck, cvcCheck) || other.cvcCheck == cvcCheck)&&(identical(other.dynamicLast4, dynamicLast4) || other.dynamicLast4 == dynamicLast4)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&const DeepCollectionEquality().equals(other._metadata, _metadata)&&(identical(other.name, name) || other.name == name)&&(identical(other.tokenizationMethod, tokenizationMethod) || other.tokenizationMethod == tokenizationMethod)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardTokenImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.object, object) || other.object == object) && - (identical(other.addressCity, addressCity) || - other.addressCity == addressCity) && - (identical(other.addressCountry, addressCountry) || - other.addressCountry == addressCountry) && - (identical(other.addressLine1, addressLine1) || - other.addressLine1 == addressLine1) && - (identical(other.addressLine1Check, addressLine1Check) || - other.addressLine1Check == addressLine1Check) && - (identical(other.addressLine2, addressLine2) || - other.addressLine2 == addressLine2) && - (identical(other.addressState, addressState) || - other.addressState == addressState) && - (identical(other.addressZip, addressZip) || - other.addressZip == addressZip) && - (identical(other.addressZipCheck, addressZipCheck) || - other.addressZipCheck == addressZipCheck) && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.cvcCheck, cvcCheck) || - other.cvcCheck == cvcCheck) && - (identical(other.dynamicLast4, dynamicLast4) || - other.dynamicLast4 == dynamicLast4) && - (identical(other.expMonth, expMonth) || - other.expMonth == expMonth) && - (identical(other.expYear, expYear) || other.expYear == expYear) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.funding, funding) || other.funding == funding) && - (identical(other.last4, last4) || other.last4 == last4) && - const DeepCollectionEquality().equals(other._metadata, _metadata) && - (identical(other.name, name) || other.name == name) && - (identical(other.tokenizationMethod, tokenizationMethod) || - other.tokenizationMethod == tokenizationMethod)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,object,addressCity,addressCountry,addressLine1,addressLine1Check,addressLine2,addressState,addressZip,addressZipCheck,brand,country,currency,cvcCheck,dynamicLast4,expMonth,expYear,fingerprint,funding,last4,const DeepCollectionEquality().hash(_metadata),name,tokenizationMethod]); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - id, - object, - addressCity, - addressCountry, - addressLine1, - addressLine1Check, - addressLine2, - addressState, - addressZip, - addressZipCheck, - brand, - country, - currency, - cvcCheck, - dynamicLast4, - expMonth, - expYear, - fingerprint, - funding, - last4, - const DeepCollectionEquality().hash(_metadata), - name, - tokenizationMethod - ]); - - /// Create a copy of CardToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardTokenImplCopyWith<_$CardTokenImpl> get copyWith => - __$$CardTokenImplCopyWithImpl<_$CardTokenImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardTokenImplToJson( - this, - ); - } +@override +String toString() { + return 'CardToken(id: $id, object: $object, addressCity: $addressCity, addressCountry: $addressCountry, addressLine1: $addressLine1, addressLine1Check: $addressLine1Check, addressLine2: $addressLine2, addressState: $addressState, addressZip: $addressZip, addressZipCheck: $addressZipCheck, brand: $brand, country: $country, currency: $currency, cvcCheck: $cvcCheck, dynamicLast4: $dynamicLast4, expMonth: $expMonth, expYear: $expYear, fingerprint: $fingerprint, funding: $funding, last4: $last4, metadata: $metadata, name: $name, tokenizationMethod: $tokenizationMethod)'; } -abstract class _CardToken implements CardToken { - const factory _CardToken( - {required final String id, - final String object, - @JsonKey(name: "address_city") final String? addressCity, - @JsonKey(name: "address_country") final String? addressCountry, - @JsonKey(name: "address_line1") final String? addressLine1, - @JsonKey(name: "address_line1_check") - final VerificationCheck? addressLine1Check, - @JsonKey(name: "address_line2") final String? addressLine2, - @JsonKey(name: "address_state") final String? addressState, - @JsonKey(name: "address_zip") final String? addressZip, - @JsonKey(name: "address_zip_check") - final VerificationCheck? addressZipCheck, - final CardTokenBrand? brand, - final String? country, - final String? currency, - @JsonKey(name: "cvc_check") final VerificationCheck? cvcCheck, - @JsonKey(name: "dynamic_last4") final String? dynamicLast4, - @JsonKey(name: "exp_month") final int? expMonth, - @JsonKey(name: "exp_year") final int? expYear, - final String? fingerprint, - final CardFundingType? funding, - final String? last4, - final Map metadata, - final String? name, - @JsonKey(name: "tokenization_method") - final CardTokenizationMethod? tokenizationMethod}) = _$CardTokenImpl; - - factory _CardToken.fromJson(Map json) = - _$CardTokenImpl.fromJson; - - /// Unique identifier for the object. - @override - String get id; - - /// String representing the object’s type. - /// Objects of the same type share the same value. - /// Value is "card". - @override - String get object; - - /// City/District/Suburb/Town/Village. - @override - @JsonKey(name: "address_city") - String? get addressCity; - - /// Billing address country, if provided when creating card. - @override - @JsonKey(name: "address_country") - String? get addressCountry; - - /// Address line 1 (Street address/PO Box/Company name). - @override - @JsonKey(name: "address_line1") - String? get addressLine1; - - /// If address_line1 was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @override - @JsonKey(name: "address_line1_check") - VerificationCheck? get addressLine1Check; - - /// Address line 2 (Apartment/Suite/Unit/Building). - @override - @JsonKey(name: "address_line2") - String? get addressLine2; - - /// State/County/Province/Region. - @override - @JsonKey(name: "address_state") - String? get addressState; - - /// ZIP or postal code. - @override - @JsonKey(name: "address_zip") - String? get addressZip; - - /// If address_zip was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @override - @JsonKey(name: "address_zip_check") - VerificationCheck? get addressZipCheck; - - /// If address_zip was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - @override - CardTokenBrand? get brand; - - /// Two-letter ISO code representing the country of the card. - /// You could use this attribute to get a sense of the - /// international breakdown of cards you’ve collected. - @override - String? get country; - - /// Three-letter ISO currency code, in lowercase. - /// Must be a supported currency. - @override - String? get currency; - - /// If a CVC was provided, results of the check: - /// pass, fail, unavailable, or unchecked. - /// A result of unchecked indicates that CVC was provided but hasn’t - /// been checked yet. - /// Checks are typically performed when attaching a card to a Customer - /// object, or when creating a charge. For more details, see - /// Check if a card is valid without a charge. - /// https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge - @override - @JsonKey(name: "cvc_check") - VerificationCheck? get cvcCheck; - - /// (For tokenized numbers only.) - /// The last four digits of the device account number. - @override - @JsonKey(name: "dynamic_last4") - String? get dynamicLast4; - - /// Two-digit number representing the card’s expiration month. - @override - @JsonKey(name: "exp_month") - int? get expMonth; - - /// Four-digit number representing the card’s expiration year. - @override - @JsonKey(name: "exp_year") - int? get expYear; - - /// Uniquely identifies this particular card number. - /// You can use this attribute to check whether two customers who’ve - /// signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information - /// (Apple Pay, Google Pay), the tokenized number might be provided - /// instead of the underlying card number. - /// Starting May 1, 2021, card fingerprint in India for Connect will - /// change to allow two fingerprints for the same card — one for India and - /// one for the rest of the world. - @override - String? get fingerprint; - - /// Card funding type. Can be credit, debit, prepaid, or unknown. - @override - CardFundingType? get funding; - - /// The last four digits of the card. - @override - String? get last4; - - /// Set of key-value pairs that you can attach to an object. - /// This can be useful for storing additional information about the object - /// in a structured forma - @override - Map get metadata; - - /// Cardholder name. - @override - String? get name; - - /// If the card number is tokenized, this is the method that was used. - /// Can be android_pay (includes Google Pay), apple_pay, masterpass, - /// visa_checkout, or null. - @override - @JsonKey(name: "tokenization_method") - CardTokenizationMethod? get tokenizationMethod; - - /// Create a copy of CardToken - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardTokenImplCopyWith<_$CardTokenImpl> get copyWith => - throw _privateConstructorUsedError; + } + +/// @nodoc +abstract mixin class _$CardTokenCopyWith<$Res> implements $CardTokenCopyWith<$Res> { + factory _$CardTokenCopyWith(_CardToken value, $Res Function(_CardToken) _then) = __$CardTokenCopyWithImpl; +@override @useResult +$Res call({ + String id, String object,@JsonKey(name: "address_city") String? addressCity,@JsonKey(name: "address_country") String? addressCountry,@JsonKey(name: "address_line1") String? addressLine1,@JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check,@JsonKey(name: "address_line2") String? addressLine2,@JsonKey(name: "address_state") String? addressState,@JsonKey(name: "address_zip") String? addressZip,@JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck, CardTokenBrand? brand, String? country, String? currency,@JsonKey(name: "cvc_check") VerificationCheck? cvcCheck,@JsonKey(name: "dynamic_last4") String? dynamicLast4,@JsonKey(name: "exp_month") int? expMonth,@JsonKey(name: "exp_year") int? expYear, String? fingerprint, CardFundingType? funding, String? last4, Map metadata, String? name,@JsonKey(name: "tokenization_method") CardTokenizationMethod? tokenizationMethod +}); + + + + +} +/// @nodoc +class __$CardTokenCopyWithImpl<$Res> + implements _$CardTokenCopyWith<$Res> { + __$CardTokenCopyWithImpl(this._self, this._then); + + final _CardToken _self; + final $Res Function(_CardToken) _then; + +/// Create a copy of CardToken +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? object = null,Object? addressCity = freezed,Object? addressCountry = freezed,Object? addressLine1 = freezed,Object? addressLine1Check = freezed,Object? addressLine2 = freezed,Object? addressState = freezed,Object? addressZip = freezed,Object? addressZipCheck = freezed,Object? brand = freezed,Object? country = freezed,Object? currency = freezed,Object? cvcCheck = freezed,Object? dynamicLast4 = freezed,Object? expMonth = freezed,Object? expYear = freezed,Object? fingerprint = freezed,Object? funding = freezed,Object? last4 = freezed,Object? metadata = null,Object? name = freezed,Object? tokenizationMethod = freezed,}) { + return _then(_CardToken( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,object: null == object ? _self.object : object // ignore: cast_nullable_to_non_nullable +as String,addressCity: freezed == addressCity ? _self.addressCity : addressCity // ignore: cast_nullable_to_non_nullable +as String?,addressCountry: freezed == addressCountry ? _self.addressCountry : addressCountry // ignore: cast_nullable_to_non_nullable +as String?,addressLine1: freezed == addressLine1 ? _self.addressLine1 : addressLine1 // ignore: cast_nullable_to_non_nullable +as String?,addressLine1Check: freezed == addressLine1Check ? _self.addressLine1Check : addressLine1Check // ignore: cast_nullable_to_non_nullable +as VerificationCheck?,addressLine2: freezed == addressLine2 ? _self.addressLine2 : addressLine2 // ignore: cast_nullable_to_non_nullable +as String?,addressState: freezed == addressState ? _self.addressState : addressState // ignore: cast_nullable_to_non_nullable +as String?,addressZip: freezed == addressZip ? _self.addressZip : addressZip // ignore: cast_nullable_to_non_nullable +as String?,addressZipCheck: freezed == addressZipCheck ? _self.addressZipCheck : addressZipCheck // ignore: cast_nullable_to_non_nullable +as VerificationCheck?,brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as CardTokenBrand?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,cvcCheck: freezed == cvcCheck ? _self.cvcCheck : cvcCheck // ignore: cast_nullable_to_non_nullable +as VerificationCheck?,dynamicLast4: freezed == dynamicLast4 ? _self.dynamicLast4 : dynamicLast4 // ignore: cast_nullable_to_non_nullable +as String?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as CardFundingType?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,metadata: null == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,tokenizationMethod: freezed == tokenizationMethod ? _self.tokenizationMethod : tokenizationMethod // ignore: cast_nullable_to_non_nullable +as CardTokenizationMethod?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_js/lib/src/api/tokens/token.g.dart b/packages/stripe_js/lib/src/api/tokens/token.g.dart index 696e6d82c..545ae1d9c 100644 --- a/packages/stripe_js/lib/src/api/tokens/token.g.dart +++ b/packages/stripe_js/lib/src/api/tokens/token.g.dart @@ -6,44 +6,35 @@ part of 'token.dart'; // JsonSerializableGenerator // ************************************************************************** -_$TokenImpl _$$TokenImplFromJson(Map json) => _$TokenImpl( - id: json['id'] as String, - object: json['object'] as String? ?? "token", - bankAccount: json['bank_account'] == null - ? null - : BankAccountToken.fromJson( - Map.from(json['bank_account'] as Map)), - card: json['card'] == null - ? null - : CardToken.fromJson(Map.from(json['card'] as Map)), - clientIP: json['client_ip'] as String?, - created: (json['created'] as num?)?.toInt(), - livemode: json['livemode'] as bool? ?? true, - type: $enumDecode(_$TokenTypeEnumMap, json['type']), - used: json['used'] as bool? ?? false, - ); - -Map _$$TokenImplToJson(_$TokenImpl instance) { - final val = { - 'id': instance.id, - 'object': instance.object, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('bank_account', instance.bankAccount?.toJson()); - writeNotNull('card', instance.card?.toJson()); - writeNotNull('client_ip', instance.clientIP); - writeNotNull('created', instance.created); - val['livemode'] = instance.livemode; - val['type'] = _$TokenTypeEnumMap[instance.type]!; - val['used'] = instance.used; - return val; -} +_Token _$TokenFromJson(Map json) => _Token( + id: json['id'] as String, + object: json['object'] as String? ?? "token", + bankAccount: json['bank_account'] == null + ? null + : BankAccountToken.fromJson( + Map.from(json['bank_account'] as Map), + ), + card: json['card'] == null + ? null + : CardToken.fromJson(Map.from(json['card'] as Map)), + clientIP: json['client_ip'] as String?, + created: (json['created'] as num?)?.toInt(), + livemode: json['livemode'] as bool? ?? true, + type: $enumDecode(_$TokenTypeEnumMap, json['type']), + used: json['used'] as bool? ?? false, +); + +Map _$TokenToJson(_Token instance) => { + 'id': instance.id, + 'object': instance.object, + 'bank_account': ?instance.bankAccount?.toJson(), + 'card': ?instance.card?.toJson(), + 'client_ip': ?instance.clientIP, + 'created': ?instance.created, + 'livemode': instance.livemode, + 'type': _$TokenTypeEnumMap[instance.type]!, + 'used': instance.used, +}; const _$TokenTypeEnumMap = { TokenType.account: 'account', @@ -52,49 +43,40 @@ const _$TokenTypeEnumMap = { TokenType.pii: 'pii', }; -_$BankAccountTokenImpl _$$BankAccountTokenImplFromJson(Map json) => - _$BankAccountTokenImpl( - id: json['id'] as String, - object: json['object'] as String? ?? "bank_account", - accountHolderName: json['account_holder_name'] as String?, - accountHolderType: $enumDecodeNullable( - _$BankAccountHolderTypeEnumMap, json['account_holder_type']), - accountType: json['account_type'] as String?, - bankName: json['bank_name'] as String?, - country: json['country'] as String?, - currency: json['currency'] as String?, - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - routingNumber: json['routing_number'] as String?, - status: $enumDecodeNullable(_$BankAccountStatusEnumMap, json['status']), - ); - -Map _$$BankAccountTokenImplToJson( - _$BankAccountTokenImpl instance) { - final val = { - 'id': instance.id, - 'object': instance.object, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('account_holder_name', instance.accountHolderName); - writeNotNull('account_holder_type', - _$BankAccountHolderTypeEnumMap[instance.accountHolderType]); - writeNotNull('account_type', instance.accountType); - writeNotNull('bank_name', instance.bankName); - writeNotNull('country', instance.country); - writeNotNull('currency', instance.currency); - writeNotNull('fingerprint', instance.fingerprint); - writeNotNull('last4', instance.last4); - writeNotNull('routing_number', instance.routingNumber); - writeNotNull('status', _$BankAccountStatusEnumMap[instance.status]); - return val; -} +_BankAccountToken _$BankAccountTokenFromJson(Map json) => _BankAccountToken( + id: json['id'] as String, + object: json['object'] as String? ?? "bank_account", + accountHolderName: json['account_holder_name'] as String?, + accountHolderType: $enumDecodeNullable( + _$BankAccountHolderTypeEnumMap, + json['account_holder_type'], + ), + accountType: json['account_type'] as String?, + bankName: json['bank_name'] as String?, + country: json['country'] as String?, + currency: json['currency'] as String?, + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, + routingNumber: json['routing_number'] as String?, + status: $enumDecodeNullable(_$BankAccountStatusEnumMap, json['status']), +); + +Map _$BankAccountTokenToJson(_BankAccountToken instance) => + { + 'id': instance.id, + 'object': instance.object, + 'account_holder_name': ?instance.accountHolderName, + 'account_holder_type': + ?_$BankAccountHolderTypeEnumMap[instance.accountHolderType], + 'account_type': ?instance.accountType, + 'bank_name': ?instance.bankName, + 'country': ?instance.country, + 'currency': ?instance.currency, + 'fingerprint': ?instance.fingerprint, + 'last4': ?instance.last4, + 'routing_number': ?instance.routingNumber, + 'status': ?_$BankAccountStatusEnumMap[instance.status], + }; const _$BankAccountHolderTypeEnumMap = { BankAccountHolderType.company: 'company', @@ -109,78 +91,74 @@ const _$BankAccountStatusEnumMap = { BankAccountStatus.errored: 'errored', }; -_$CardTokenImpl _$$CardTokenImplFromJson(Map json) => _$CardTokenImpl( - id: json['id'] as String, - object: json['object'] as String? ?? "card", - addressCity: json['address_city'] as String?, - addressCountry: json['address_country'] as String?, - addressLine1: json['address_line1'] as String?, - addressLine1Check: $enumDecodeNullable( - _$VerificationCheckEnumMap, json['address_line1_check']), - addressLine2: json['address_line2'] as String?, - addressState: json['address_state'] as String?, - addressZip: json['address_zip'] as String?, - addressZipCheck: $enumDecodeNullable( - _$VerificationCheckEnumMap, json['address_zip_check']), - brand: $enumDecodeNullable(_$CardTokenBrandEnumMap, json['brand']) ?? - CardTokenBrand.unknown, - country: json['country'] as String?, - currency: json['currency'] as String?, - cvcCheck: - $enumDecodeNullable(_$VerificationCheckEnumMap, json['cvc_check']), - dynamicLast4: json['dynamic_last4'] as String?, - expMonth: (json['exp_month'] as num?)?.toInt(), - expYear: (json['exp_year'] as num?)?.toInt(), - fingerprint: json['fingerprint'] as String?, - funding: $enumDecodeNullable(_$CardFundingTypeEnumMap, json['funding']), - last4: json['last4'] as String?, - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k as String, e), - ) ?? - const {}, - name: json['name'] as String?, - tokenizationMethod: $enumDecodeNullable( - _$CardTokenizationMethodEnumMap, json['tokenization_method']), - ); - -Map _$$CardTokenImplToJson(_$CardTokenImpl instance) { - final val = { - 'id': instance.id, - 'object': instance.object, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('address_city', instance.addressCity); - writeNotNull('address_country', instance.addressCountry); - writeNotNull('address_line1', instance.addressLine1); - writeNotNull('address_line1_check', - _$VerificationCheckEnumMap[instance.addressLine1Check]); - writeNotNull('address_line2', instance.addressLine2); - writeNotNull('address_state', instance.addressState); - writeNotNull('address_zip', instance.addressZip); - writeNotNull('address_zip_check', - _$VerificationCheckEnumMap[instance.addressZipCheck]); - writeNotNull('brand', _$CardTokenBrandEnumMap[instance.brand]); - writeNotNull('country', instance.country); - writeNotNull('currency', instance.currency); - writeNotNull('cvc_check', _$VerificationCheckEnumMap[instance.cvcCheck]); - writeNotNull('dynamic_last4', instance.dynamicLast4); - writeNotNull('exp_month', instance.expMonth); - writeNotNull('exp_year', instance.expYear); - writeNotNull('fingerprint', instance.fingerprint); - writeNotNull('funding', _$CardFundingTypeEnumMap[instance.funding]); - writeNotNull('last4', instance.last4); - val['metadata'] = instance.metadata; - writeNotNull('name', instance.name); - writeNotNull('tokenization_method', - _$CardTokenizationMethodEnumMap[instance.tokenizationMethod]); - return val; -} +_CardToken _$CardTokenFromJson(Map json) => _CardToken( + id: json['id'] as String, + object: json['object'] as String? ?? "card", + addressCity: json['address_city'] as String?, + addressCountry: json['address_country'] as String?, + addressLine1: json['address_line1'] as String?, + addressLine1Check: $enumDecodeNullable( + _$VerificationCheckEnumMap, + json['address_line1_check'], + ), + addressLine2: json['address_line2'] as String?, + addressState: json['address_state'] as String?, + addressZip: json['address_zip'] as String?, + addressZipCheck: $enumDecodeNullable( + _$VerificationCheckEnumMap, + json['address_zip_check'], + ), + brand: + $enumDecodeNullable(_$CardTokenBrandEnumMap, json['brand']) ?? + CardTokenBrand.unknown, + country: json['country'] as String?, + currency: json['currency'] as String?, + cvcCheck: $enumDecodeNullable(_$VerificationCheckEnumMap, json['cvc_check']), + dynamicLast4: json['dynamic_last4'] as String?, + expMonth: (json['exp_month'] as num?)?.toInt(), + expYear: (json['exp_year'] as num?)?.toInt(), + fingerprint: json['fingerprint'] as String?, + funding: $enumDecodeNullable(_$CardFundingTypeEnumMap, json['funding']), + last4: json['last4'] as String?, + metadata: + (json['metadata'] as Map?)?.map((k, e) => MapEntry(k as String, e)) ?? + const {}, + name: json['name'] as String?, + tokenizationMethod: $enumDecodeNullable( + _$CardTokenizationMethodEnumMap, + json['tokenization_method'], + ), +); + +Map _$CardTokenToJson( + _CardToken instance, +) => { + 'id': instance.id, + 'object': instance.object, + 'address_city': ?instance.addressCity, + 'address_country': ?instance.addressCountry, + 'address_line1': ?instance.addressLine1, + 'address_line1_check': + ?_$VerificationCheckEnumMap[instance.addressLine1Check], + 'address_line2': ?instance.addressLine2, + 'address_state': ?instance.addressState, + 'address_zip': ?instance.addressZip, + 'address_zip_check': ?_$VerificationCheckEnumMap[instance.addressZipCheck], + 'brand': ?_$CardTokenBrandEnumMap[instance.brand], + 'country': ?instance.country, + 'currency': ?instance.currency, + 'cvc_check': ?_$VerificationCheckEnumMap[instance.cvcCheck], + 'dynamic_last4': ?instance.dynamicLast4, + 'exp_month': ?instance.expMonth, + 'exp_year': ?instance.expYear, + 'fingerprint': ?instance.fingerprint, + 'funding': ?_$CardFundingTypeEnumMap[instance.funding], + 'last4': ?instance.last4, + 'metadata': instance.metadata, + 'name': ?instance.name, + 'tokenization_method': + ?_$CardTokenizationMethodEnumMap[instance.tokenizationMethod], +}; const _$VerificationCheckEnumMap = { VerificationCheck.pass: 'pass', diff --git a/packages/stripe_js/lib/src/api/tokens/token_response.dart b/packages/stripe_js/lib/src/api/tokens/token_response.dart index 191325360..7e97d9677 100644 --- a/packages/stripe_js/lib/src/api/tokens/token_response.dart +++ b/packages/stripe_js/lib/src/api/tokens/token_response.dart @@ -5,7 +5,7 @@ part 'token_response.freezed.dart'; part 'token_response.g.dart'; @freezed -class TokenResponse with _$TokenResponse { +abstract class TokenResponse with _$TokenResponse { const factory TokenResponse({ /// If not null, a Token was created successfully. Token? token, diff --git a/packages/stripe_js/lib/src/api/tokens/token_response.freezed.dart b/packages/stripe_js/lib/src/api/tokens/token_response.freezed.dart index 480ba7620..9fc767aaa 100644 --- a/packages/stripe_js/lib/src/api/tokens/token_response.freezed.dart +++ b/packages/stripe_js/lib/src/api/tokens/token_response.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,221 +9,326 @@ part of 'token_response.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -TokenResponse _$TokenResponseFromJson(Map json) { - return _TokenResponse.fromJson(json); -} - /// @nodoc mixin _$TokenResponse { - /// If not null, a Token was created successfully. - Token? get token => throw _privateConstructorUsedError; - /// If not null, an error occurred. - /// This includes client-side validation errors - StripeError? get error => throw _privateConstructorUsedError; +/// If not null, a Token was created successfully. + Token? get token;/// If not null, an error occurred. +/// This includes client-side validation errors + StripeError? get error; +/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$TokenResponseCopyWith get copyWith => _$TokenResponseCopyWithImpl(this as TokenResponse, _$identity); /// Serializes this TokenResponse to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $TokenResponseCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is TokenResponse&&(identical(other.token, token) || other.token == token)&&(identical(other.error, error) || other.error == error)); } -/// @nodoc -abstract class $TokenResponseCopyWith<$Res> { - factory $TokenResponseCopyWith( - TokenResponse value, $Res Function(TokenResponse) then) = - _$TokenResponseCopyWithImpl<$Res, TokenResponse>; - @useResult - $Res call({Token? token, StripeError? error}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,error); - $TokenCopyWith<$Res>? get token; - $StripeErrorCopyWith<$Res>? get error; +@override +String toString() { + return 'TokenResponse(token: $token, error: $error)'; } + +} + +/// @nodoc +abstract mixin class $TokenResponseCopyWith<$Res> { + factory $TokenResponseCopyWith(TokenResponse value, $Res Function(TokenResponse) _then) = _$TokenResponseCopyWithImpl; +@useResult +$Res call({ + Token? token, StripeError? error +}); + + +$TokenCopyWith<$Res>? get token;$StripeErrorCopyWith<$Res>? get error; + +} /// @nodoc -class _$TokenResponseCopyWithImpl<$Res, $Val extends TokenResponse> +class _$TokenResponseCopyWithImpl<$Res> implements $TokenResponseCopyWith<$Res> { - _$TokenResponseCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as Token?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - ) as $Val); + _$TokenResponseCopyWithImpl(this._self, this._then); + + final TokenResponse _self; + final $Res Function(TokenResponse) _then; + +/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? token = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as Token?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} +/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$TokenCopyWith<$Res>? get token { + if (_self.token == null) { + return null; } - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $TokenCopyWith<$Res>? get token { - if (_value.token == null) { - return null; - } - - return $TokenCopyWith<$Res>(_value.token!, (value) { - return _then(_value.copyWith(token: value) as $Val); - }); + return $TokenCopyWith<$Res>(_self.token!, (value) { + return _then(_self.copyWith(token: value)); + }); +}/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith<$Res>? get error { - if (_value.error == null) { - return null; - } - - return $StripeErrorCopyWith<$Res>(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } -/// @nodoc -abstract class _$$TokenResponseImplCopyWith<$Res> - implements $TokenResponseCopyWith<$Res> { - factory _$$TokenResponseImplCopyWith( - _$TokenResponseImpl value, $Res Function(_$TokenResponseImpl) then) = - __$$TokenResponseImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({Token? token, StripeError? error}); - @override - $TokenCopyWith<$Res>? get token; - @override - $StripeErrorCopyWith<$Res>? get error; +/// Adds pattern-matching-related methods to [TokenResponse]. +extension TokenResponsePatterns on TokenResponse { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _TokenResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _TokenResponse() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _TokenResponse value) $default,){ +final _that = this; +switch (_that) { +case _TokenResponse(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _TokenResponse value)? $default,){ +final _that = this; +switch (_that) { +case _TokenResponse() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Token? token, StripeError? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _TokenResponse() when $default != null: +return $default(_that.token,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Token? token, StripeError? error) $default,) {final _that = this; +switch (_that) { +case _TokenResponse(): +return $default(_that.token,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Token? token, StripeError? error)? $default,) {final _that = this; +switch (_that) { +case _TokenResponse() when $default != null: +return $default(_that.token,_that.error);case _: + return null; + +} } -/// @nodoc -class __$$TokenResponseImplCopyWithImpl<$Res> - extends _$TokenResponseCopyWithImpl<$Res, _$TokenResponseImpl> - implements _$$TokenResponseImplCopyWith<$Res> { - __$$TokenResponseImplCopyWithImpl( - _$TokenResponseImpl _value, $Res Function(_$TokenResponseImpl) _then) - : super(_value, _then); - - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = freezed, - Object? error = freezed, - }) { - return _then(_$TokenResponseImpl( - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as Token?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - )); - } } /// @nodoc @JsonSerializable() -class _$TokenResponseImpl implements _TokenResponse { - const _$TokenResponseImpl({this.token, this.error}); - factory _$TokenResponseImpl.fromJson(Map json) => - _$$TokenResponseImplFromJson(json); +class _TokenResponse implements TokenResponse { + const _TokenResponse({this.token, this.error}); + factory _TokenResponse.fromJson(Map json) => _$TokenResponseFromJson(json); + +/// If not null, a Token was created successfully. +@override final Token? token; +/// If not null, an error occurred. +/// This includes client-side validation errors +@override final StripeError? error; + +/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$TokenResponseCopyWith<_TokenResponse> get copyWith => __$TokenResponseCopyWithImpl<_TokenResponse>(this, _$identity); + +@override +Map toJson() { + return _$TokenResponseToJson(this, ); +} - /// If not null, a Token was created successfully. - @override - final Token? token; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _TokenResponse&&(identical(other.token, token) || other.token == token)&&(identical(other.error, error) || other.error == error)); +} - /// If not null, an error occurred. - /// This includes client-side validation errors - @override - final StripeError? error; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,error); - @override - String toString() { - return 'TokenResponse(token: $token, error: $error)'; - } +@override +String toString() { + return 'TokenResponse(token: $token, error: $error)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$TokenResponseImpl && - (identical(other.token, token) || other.token == token) && - (identical(other.error, error) || other.error == error)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, token, error); - - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$TokenResponseImplCopyWith<_$TokenResponseImpl> get copyWith => - __$$TokenResponseImplCopyWithImpl<_$TokenResponseImpl>(this, _$identity); - - @override - Map toJson() { - return _$$TokenResponseImplToJson( - this, - ); - } } -abstract class _TokenResponse implements TokenResponse { - const factory _TokenResponse({final Token? token, final StripeError? error}) = - _$TokenResponseImpl; +/// @nodoc +abstract mixin class _$TokenResponseCopyWith<$Res> implements $TokenResponseCopyWith<$Res> { + factory _$TokenResponseCopyWith(_TokenResponse value, $Res Function(_TokenResponse) _then) = __$TokenResponseCopyWithImpl; +@override @useResult +$Res call({ + Token? token, StripeError? error +}); - factory _TokenResponse.fromJson(Map json) = - _$TokenResponseImpl.fromJson; - /// If not null, a Token was created successfully. - @override - Token? get token; +@override $TokenCopyWith<$Res>? get token;@override $StripeErrorCopyWith<$Res>? get error; - /// If not null, an error occurred. - /// This includes client-side validation errors - @override - StripeError? get error; +} +/// @nodoc +class __$TokenResponseCopyWithImpl<$Res> + implements _$TokenResponseCopyWith<$Res> { + __$TokenResponseCopyWithImpl(this._self, this._then); + + final _TokenResponse _self; + final $Res Function(_TokenResponse) _then; + +/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? token = freezed,Object? error = freezed,}) { + return _then(_TokenResponse( +token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as Token?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} - /// Create a copy of TokenResponse - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$TokenResponseImplCopyWith<_$TokenResponseImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$TokenCopyWith<$Res>? get token { + if (_self.token == null) { + return null; + } + + return $TokenCopyWith<$Res>(_self.token!, (value) { + return _then(_self.copyWith(token: value)); + }); +}/// Create a copy of TokenResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } + + return $StripeErrorCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } + +// dart format on diff --git a/packages/stripe_js/lib/src/api/tokens/token_response.g.dart b/packages/stripe_js/lib/src/api/tokens/token_response.g.dart index 2fb8c2234..4547e552a 100644 --- a/packages/stripe_js/lib/src/api/tokens/token_response.g.dart +++ b/packages/stripe_js/lib/src/api/tokens/token_response.g.dart @@ -6,27 +6,17 @@ part of 'token_response.dart'; // JsonSerializableGenerator // ************************************************************************** -_$TokenResponseImpl _$$TokenResponseImplFromJson(Map json) => - _$TokenResponseImpl( - token: json['token'] == null - ? null - : Token.fromJson(Map.from(json['token'] as Map)), - error: json['error'] == null - ? null - : StripeError.fromJson( - Map.from(json['error'] as Map)), - ); +_TokenResponse _$TokenResponseFromJson(Map json) => _TokenResponse( + token: json['token'] == null + ? null + : Token.fromJson(Map.from(json['token'] as Map)), + error: json['error'] == null + ? null + : StripeError.fromJson(Map.from(json['error'] as Map)), +); -Map _$$TokenResponseImplToJson(_$TokenResponseImpl instance) { - final val = {}; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('token', instance.token?.toJson()); - writeNotNull('error', instance.error?.toJson()); - return val; -} +Map _$TokenResponseToJson(_TokenResponse instance) => + { + 'token': ?instance.token?.toJson(), + 'error': ?instance.error?.toJson(), + }; diff --git a/packages/stripe_js/lib/src/js/elements/element_express_checkout/element_express_checkout.dart b/packages/stripe_js/lib/src/js/elements/element_express_checkout/element_express_checkout.dart index 60acf19d5..954801a46 100644 --- a/packages/stripe_js/lib/src/js/elements/element_express_checkout/element_express_checkout.dart +++ b/packages/stripe_js/lib/src/js/elements/element_express_checkout/element_express_checkout.dart @@ -6,14 +6,16 @@ import 'package:stripe_js/stripe_js.dart'; extension ExpressCheckoutPaymentExtension on StripeElements { /// This method creates an instance of the Payment Element. /// [options] : Options for creating the Payment Element. - ExpressCheckoutElement createExpressCheckout( - [ExpressCheckoutOptions? options]) { + ExpressCheckoutElement createExpressCheckout([ + ExpressCheckoutOptions? options, + ]) { return create('expressCheckout', (options?.toJson() ?? {}).jsify()) as ExpressCheckoutElement; } - ExpressCheckoutElement? getExpressCheckout( - [ExpressCheckoutOptions? options]) { + ExpressCheckoutElement? getExpressCheckout([ + ExpressCheckoutOptions? options, + ]) { return getElement('expressCheckout') as ExpressCheckoutElement; } } diff --git a/packages/stripe_js/lib/src/js/elements/element_payment_request_button.dart b/packages/stripe_js/lib/src/js/elements/element_payment_request_button.dart index dd36697e9..eec75a458 100644 --- a/packages/stripe_js/lib/src/js/elements/element_payment_request_button.dart +++ b/packages/stripe_js/lib/src/js/elements/element_payment_request_button.dart @@ -25,7 +25,8 @@ extension type PaymentRequestButtonElement(StripeElement o) extension ElementsPaymentRequestExtension on StripeElements { PaymentRequestButtonElement createPaymentRequestButton( - JsPaymentRequestButtonElementCreateOptions options) { + JsPaymentRequestButtonElementCreateOptions options, + ) { return create('paymentRequestButton', options.jsify()) as PaymentRequestButtonElement; } diff --git a/packages/stripe_js/lib/src/js/elements/elements_base.dart b/packages/stripe_js/lib/src/js/elements/elements_base.dart index 256502ea8..bdbd0553d 100644 --- a/packages/stripe_js/lib/src/js/elements/elements_base.dart +++ b/packages/stripe_js/lib/src/js/elements/elements_base.dart @@ -43,5 +43,5 @@ enum ElementsType { postalCode, paymentRequestButton, iban, - idealBank + idealBank, } diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_acss_debit_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_acss_debit_payment.dart index eddc6a0c9..939e667e2 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_acss_debit_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_acss_debit_payment.dart @@ -33,9 +33,11 @@ extension ExtensionAcssDebitPayment on Stripe { }) async { final jsData = (data?.toJson() ?? {}).jsify(); final jsOptions = (options?.toJson() ?? {}).jsify(); - return _confirmAcssDebitPayment(clientSecret, jsData, jsOptions) - .toDart - .then((response) => response.toDart); + return _confirmAcssDebitPayment( + clientSecret, + jsData, + jsOptions, + ).toDart.then((response) => response.toDart); } @JS('confirmAcssDebitPayment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_alipay_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_alipay_payment.dart index 48318c878..f199ba34d 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_alipay_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_alipay_payment.dart @@ -31,9 +31,11 @@ extension ExtensionAlipayPayment on Stripe { }) { final jsData = (data?.toJson() ?? {}).jsify(); final jsOptions = (options?.toJson() ?? {}).jsify(); - return _confirmAlipayPayment(clientSecret, jsData, jsOptions) - .toDart - .then((response) => response.toDart); + return _confirmAlipayPayment( + clientSecret, + jsData, + jsOptions, + ).toDart.then((response) => response.toDart); } @JS('confirmAlipayPayment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_card_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_card_payment.dart index 051adceb5..94bcabac1 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_card_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_card_payment.dart @@ -28,9 +28,11 @@ extension ExtensionCardPayment on Stripe { }) { final jsData = (data?.toJson() ?? {}).jsify(); final jsOptions = (options?.toJson() ?? {}).jsify(); - return _confirmCardPayment(clientSecret, jsData, jsOptions) - .toDart - .then((response) => response.toDart); + return _confirmCardPayment( + clientSecret, + jsData, + jsOptions, + ).toDart.then((response) => response.toDart); } @JS('confirmCardPayment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_ideal_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_ideal_payment.dart index 2290dfe1e..2fef5be96 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_ideal_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_ideal_payment.dart @@ -31,9 +31,11 @@ extension ExtensionIdealPayment on Stripe { }) { final jsData = (data?.toJson() ?? {}).jsify(); final jsOptions = (options?.toJson() ?? {}).jsify(); - return _confirmIdealPayment(clientSecret, jsData, jsOptions) - .toDart - .then((response) => response.toDart); + return _confirmIdealPayment( + clientSecret, + jsData, + jsOptions, + ).toDart.then((response) => response.toDart); } @JS('confirmIdealPayment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_p24_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_p24_payment.dart index dc9137d37..86a664f14 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_p24_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_p24_payment.dart @@ -31,9 +31,11 @@ extension ExtensionP24Payment on Stripe { }) { final jsData = (data?.toJson() ?? {}).jsify(); final jsOptions = (options?.toJson() ?? {}).jsify(); - return _confirmP24Payment(clientSecret, jsData, jsOptions) - .toDart - .then((response) => response.toDart); + return _confirmP24Payment( + clientSecret, + jsData, + jsOptions, + ).toDart.then((response) => response.toDart); } @JS('confirmP24Payment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_payment.dart index f0af62c12..628a15367 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_payment.dart @@ -38,12 +38,10 @@ extension ExtensionConfirmPayment on Stripe { /// and hide the waiting indicator. /// /// https://stripe.com/docs/js/payment_intents/confirm_payment - Future confirmPayment( - ConfirmPaymentOptions options, - ) { - return _confirmPayment(options.toJson().jsify()) - .toDart - .then((response) => response.toDart); + Future confirmPayment(ConfirmPaymentOptions options) { + return _confirmPayment( + options.toJson().jsify(), + ).toDart.then((response) => response.toDart); } @JS('confirmPayment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/confirm_sepa_debit_payment.dart b/packages/stripe_js/lib/src/js/payment_intents/confirm_sepa_debit_payment.dart index 720a70c5c..8882279ee 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/confirm_sepa_debit_payment.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/confirm_sepa_debit_payment.dart @@ -30,9 +30,10 @@ extension ExtensionSepaDebitPayment on Stripe { ConfirmSepaDebitPaymentData? data, }) { final jsData = (data?.toJson() ?? {}).jsify(); - return _confirmSepaDebitPayment(clientSecret, jsData) - .toDart - .then((response) => response.toDart); + return _confirmSepaDebitPayment( + clientSecret, + jsData, + ).toDart.then((response) => response.toDart); } @JS('confirmSepaDebitPayment') diff --git a/packages/stripe_js/lib/src/js/payment_intents/handle_card_action.dart b/packages/stripe_js/lib/src/js/payment_intents/handle_card_action.dart index 68ce5dd92..cadc2c8c6 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/handle_card_action.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/handle_card_action.dart @@ -22,9 +22,9 @@ extension ExtensionHandleCardAction on Stripe { /// Ensure that your form is accessible by ensuring that success or /// error messages are clearly read out. Future handleCardAction(String clientSecret) { - return _handleCardAction(clientSecret) - .toDart - .then((response) => response.toDart); + return _handleCardAction( + clientSecret, + ).toDart.then((response) => response.toDart); } @JS('handleCardAction') diff --git a/packages/stripe_js/lib/src/js/payment_intents/retrieve_payment_intent.dart b/packages/stripe_js/lib/src/js/payment_intents/retrieve_payment_intent.dart index 0d6f0712c..991d187ce 100644 --- a/packages/stripe_js/lib/src/js/payment_intents/retrieve_payment_intent.dart +++ b/packages/stripe_js/lib/src/js/payment_intents/retrieve_payment_intent.dart @@ -7,12 +7,13 @@ extension ExtensionRetrievePaymentIntent on Stripe { /// Retrieve a PaymentIntent using its client secret. /// https://stripe.com/docs/js/payment_intents/retrieve_payment_intent Future retrievePaymentIntent(String clientSecret) { - return _retrievePaymentIntent(clientSecret) - .toDart - .then((response) => response.toDart); + return _retrievePaymentIntent( + clientSecret, + ).toDart.then((response) => response.toDart); } @JS('retrievePaymentIntent') external JSPromise _retrievePaymentIntent( - String clientSecret); + String clientSecret, + ); } diff --git a/packages/stripe_js/lib/src/js/payment_methods/create_payment_method.dart b/packages/stripe_js/lib/src/js/payment_methods/create_payment_method.dart index 9ca8e1dcd..e2ad10bf5 100644 --- a/packages/stripe_js/lib/src/js/payment_methods/create_payment_method.dart +++ b/packages/stripe_js/lib/src/js/payment_methods/create_payment_method.dart @@ -14,11 +14,12 @@ extension ExtensionCreatePaymentMethod on Stripe { /// /// https://stripe.com/docs/js/payment_methods/create_payment_method Future createPaymentMethod( - CreatePaymentMethodData data) { + CreatePaymentMethodData data, + ) { final jsData = data.toJson().jsify(); - return _createPaymentMethod(jsData) - .toDart - .then((response) => response.toDart); + return _createPaymentMethod( + jsData, + ).toDart.then((response) => response.toDart); } @JS('createPaymentMethod') diff --git a/packages/stripe_js/lib/src/js/payment_requests/payment_request.dart b/packages/stripe_js/lib/src/js/payment_requests/payment_request.dart index 28c30a79f..17703123e 100644 --- a/packages/stripe_js/lib/src/js/payment_requests/payment_request.dart +++ b/packages/stripe_js/lib/src/js/payment_requests/payment_request.dart @@ -7,9 +7,7 @@ import 'package:stripe_js/stripe_js.dart'; extension PaymentRequestExtension on Stripe { _JS get _js => this as _JS; - PaymentRequest paymentRequest( - PaymentRequestCreateOptions options, - ) { + PaymentRequest paymentRequest(PaymentRequestCreateOptions options) { return PaymentRequest.of(_js.paymentRequest(options)); } } @@ -52,9 +50,7 @@ class PaymentResponse { } extension type _JS._(JSObject o) { - external JsPaymentRequest paymentRequest( - PaymentRequestCreateOptions options, - ); + external JsPaymentRequest paymentRequest(PaymentRequestCreateOptions options); } extension type JsPaymentResponse._(JSObject o) { diff --git a/packages/stripe_js/lib/src/js/setup_intents/confirm_card_setup.dart b/packages/stripe_js/lib/src/js/setup_intents/confirm_card_setup.dart index 2b68035c4..b806937e8 100644 --- a/packages/stripe_js/lib/src/js/setup_intents/confirm_card_setup.dart +++ b/packages/stripe_js/lib/src/js/setup_intents/confirm_card_setup.dart @@ -25,9 +25,11 @@ extension ExtensionConfirmCardSetup on Stripe { }) { final jsData = (data?.toJson() ?? {}).jsify(); final jsOptions = (options?.toJson() ?? {}).jsify(); - return _confirmCardSetup(clientSecret, jsData, jsOptions) - .toDart - .then((response) => response.toDart); + return _confirmCardSetup( + clientSecret, + jsData, + jsOptions, + ).toDart.then((response) => response.toDart); } @JS('confirmCardSetup') diff --git a/packages/stripe_js/lib/src/js/setup_intents/confirm_sepa_debit_setup.dart b/packages/stripe_js/lib/src/js/setup_intents/confirm_sepa_debit_setup.dart index 6cf26712f..77ee884de 100644 --- a/packages/stripe_js/lib/src/js/setup_intents/confirm_sepa_debit_setup.dart +++ b/packages/stripe_js/lib/src/js/setup_intents/confirm_sepa_debit_setup.dart @@ -18,9 +18,10 @@ extension ExtensionConfirmSepaDebitSetup on Stripe { ConfirmSepaDebitSetupData? data, }) { final jsData = (data?.toJson() ?? {}).jsify(); - return _confirmSepaDebitSetup(clientSecret, jsData) - .toDart - .then((response) => response.toDart); + return _confirmSepaDebitSetup( + clientSecret, + jsData, + ).toDart.then((response) => response.toDart); } @JS('confirmSepaDebitSetup') diff --git a/packages/stripe_js/lib/src/js/setup_intents/confirm_setup.dart b/packages/stripe_js/lib/src/js/setup_intents/confirm_setup.dart index c66ec511c..31fd540a2 100644 --- a/packages/stripe_js/lib/src/js/setup_intents/confirm_setup.dart +++ b/packages/stripe_js/lib/src/js/setup_intents/confirm_setup.dart @@ -17,12 +17,10 @@ extension ExtensionConfirmSetup on Stripe { /// your user will be redirected to the return_url you provide /// before the Future ever resolves. /// see: https://docs.stripe.com/js/setup_intents/confirm_setup - Future confirmSetup( - ConfirmSetupOptions options, - ) async { - return _confirmSetup(options.toJson().jsify()) - .toDart - .then((response) => response.toDart); + Future confirmSetup(ConfirmSetupOptions options) async { + return _confirmSetup( + options.toJson().jsify(), + ).toDart.then((response) => response.toDart); } @JS('confirmSetup') diff --git a/packages/stripe_js/lib/src/js/setup_intents/retrieve_setup_intent.dart b/packages/stripe_js/lib/src/js/setup_intents/retrieve_setup_intent.dart index 1427c45ba..153e41481 100644 --- a/packages/stripe_js/lib/src/js/setup_intents/retrieve_setup_intent.dart +++ b/packages/stripe_js/lib/src/js/setup_intents/retrieve_setup_intent.dart @@ -7,12 +7,13 @@ extension ExtensionRetrieveSetupIntent on Stripe { /// Retrieve a SetupIntent using its client secret. /// https://stripe.com/docs/js/setup_intents/retrieve_setup_intent Future retrieveSetupIntent(String clientSecret) { - return _retrieveSetupIntent(clientSecret) - .toDart - .then((response) => response.toDart); + return _retrieveSetupIntent( + clientSecret, + ).toDart.then((response) => response.toDart); } @JS('retrieveSetupIntent') external JSPromise _retrieveSetupIntent( - String clientSecret); + String clientSecret, + ); } diff --git a/packages/stripe_js/lib/src/js/stripe.dart b/packages/stripe_js/lib/src/js/stripe.dart index d8c026ca6..61443e349 100644 --- a/packages/stripe_js/lib/src/js/stripe.dart +++ b/packages/stripe_js/lib/src/js/stripe.dart @@ -23,8 +23,11 @@ extension type Stripe.__(JSObject o) { } extension type StripeOptions._(JSObject o) implements JSObject { - external StripeOptions( - {String? stripeAccount, String? apiVersion, String locale}); + external StripeOptions({ + String? stripeAccount, + String? apiVersion, + String locale, + }); external String? stripeAccount; external String? apiVersion; diff --git a/packages/stripe_js/lib/src/js/tokens/create_token.dart b/packages/stripe_js/lib/src/js/tokens/create_token.dart index 190369b05..abedecc4c 100644 --- a/packages/stripe_js/lib/src/js/tokens/create_token.dart +++ b/packages/stripe_js/lib/src/js/tokens/create_token.dart @@ -27,30 +27,32 @@ extension ExtensionCreateTokenMethod on Stripe { CreateTokenCardData? data, ]) { final jsData = data?.toJson().jsify(); - return _createToken(element, jsData) - .toDart - .then((response) => response.toDart); + return _createToken( + element, + jsData, + ).toDart.then((response) => response.toDart); } /// Use createBankAccountToken to convert bank account information into a /// single-use token that you safely pass to your server to use in an API call. Future createBankAccountToken( - CreateTokenBankAccountData data) { + CreateTokenBankAccountData data, + ) { final jsData = data.toJson().jsify(); - return _createToken('bank_account'.toJS, jsData) - .toDart - .then((response) => response.toDart); + return _createToken( + 'bank_account'.toJS, + jsData, + ).toDart.then((response) => response.toDart); } /// Use createPIIToken to convert personally identifiable information (PII) /// into a single-use token for account identity verification. - Future createPIIToken( - CreateTokenPIIData data, - ) { + Future createPIIToken(CreateTokenPIIData data) { final jsData = data.toJson().jsify(); - return _createToken('pii'.toJS, jsData) - .toDart - .then((response) => response.toDart); + return _createToken( + 'pii'.toJS, + jsData, + ).toDart.then((response) => response.toDart); } @JS('createToken') diff --git a/packages/stripe_js/lib/src/loader/stripe_loader.dart b/packages/stripe_js/lib/src/loader/stripe_loader.dart index ba471e296..863ecaca4 100644 --- a/packages/stripe_js/lib/src/loader/stripe_loader.dart +++ b/packages/stripe_js/lib/src/loader/stripe_loader.dart @@ -11,7 +11,8 @@ Future _injectSrcScript(String src, String windowVar) async { HTMLScriptElement script = HTMLScriptElement(); script.type = 'text/javascript'; script.crossOrigin = 'anonymous'; - script.text = ''' + script.text = + ''' window.ff_trigger_$windowVar = async (callback) => { callback(await import("$src")); }; @@ -42,8 +43,5 @@ Future loadStripe() async { return; } - return _injectSrcScript( - 'https://js.stripe.com/v3/', - 'stripe_$_version', - ); + return _injectSrcScript('https://js.stripe.com/v3/', 'stripe_$_version'); } diff --git a/packages/stripe_js/pubspec.yaml b/packages/stripe_js/pubspec.yaml index 57de8b0eb..6ff000429 100644 --- a/packages/stripe_js/pubspec.yaml +++ b/packages/stripe_js/pubspec.yaml @@ -4,17 +4,17 @@ version: 6.4.0 homepage: https://github.com/flutter-stripe/flutter_stripe environment: - sdk: ">=3.3.0 <4.0.0" + sdk: ">=3.8.1 <4.0.0" dependencies: - freezed_annotation: ^2.2.0 - json_annotation: ^4.8.1 + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 meta: ^1.0.0 web: ^1.0.0 dev_dependencies: build_runner: ^2.3.2 - freezed: ^2.3.5 + freezed: ^3.2.0 json_serializable: ^6.5.4 test: ^1.22.0 diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_data_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_data_test.dart index 2facbefe2..532a9c037 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_data_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_data_test.dart @@ -4,21 +4,13 @@ import 'package:test/test.dart'; void main() { group('ConfirmAcssDebitPaymentData', () { test('expected default value', () { - expect( - ConfirmAcssDebitPaymentData().toJson(), - {}, - ); + expect(ConfirmAcssDebitPaymentData().toJson(), {}); }); test('parses correctly', () { - expect( - ConfirmAcssDebitPaymentData( - paymentMethod: 'id', - ).toJson(), - { - "payment_method": "id", - }, - ); + expect(ConfirmAcssDebitPaymentData(paymentMethod: 'id').toJson(), { + "payment_method": "id", + }); }); }); } diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_options_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_options_test.dart index 7c19046b4..72f4274d8 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_options_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_acss_debit_payment_options_test.dart @@ -4,23 +4,13 @@ import 'package:test/test.dart'; void main() { group('ConfirmAcssDebitPaymentOptions', () { test(' skipMandate is false by default', () { - expect( - ConfirmAcssDebitPaymentOptions().toJson(), - { - "skipMandate": false, - }, - ); + expect(ConfirmAcssDebitPaymentOptions().toJson(), {"skipMandate": false}); }); test('skipMandate can be set to true', () { - expect( - ConfirmAcssDebitPaymentOptions( - skipMandate: true, - ).toJson(), - { - "skipMandate": true, - }, - ); + expect(ConfirmAcssDebitPaymentOptions(skipMandate: true).toJson(), { + "skipMandate": true, + }); }); }); } diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_data_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_data_test.dart index f4b7f955a..32efec86e 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_data_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_data_test.dart @@ -4,10 +4,7 @@ import 'package:test/test.dart'; void main() { group('ConfirmAlipayPaymentData', () { test('expected default value', () { - expect( - ConfirmAlipayPaymentData().toJson(), - {}, - ); + expect(ConfirmAlipayPaymentData().toJson(), {}); }); test('parses correctly', () { @@ -16,10 +13,7 @@ void main() { paymentMethod: 'id', returnUrl: 'returnUrl', ).toJson(), - { - "payment_method": "id", - "return_url": "returnUrl", - }, + {"payment_method": "id", "return_url": "returnUrl"}, ); }); }); diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_options_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_options_test.dart index 604e08d17..16c5feee4 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_options_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_alipay_payment_options_test.dart @@ -4,23 +4,13 @@ import 'package:test/test.dart'; void main() { group('ConfirmAlipayPaymentOptions', () { test('handleActions is true by default', () { - expect( - ConfirmAlipayPaymentOptions().toJson(), - { - "handleActions": true, - }, - ); + expect(ConfirmAlipayPaymentOptions().toJson(), {"handleActions": true}); }); test('handleActions can be set to false', () { - expect( - ConfirmAlipayPaymentOptions( - handleActions: false, - ).toJson(), - { - "handleActions": false, - }, - ); + expect(ConfirmAlipayPaymentOptions(handleActions: false).toJson(), { + "handleActions": false, + }); }); }); } diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_data_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_data_test.dart index 466039dc5..4ceb16da3 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_data_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_data_test.dart @@ -20,10 +20,8 @@ void main() { "payment_method": { "card": fakeElement, "type": "card", - "billing_details": { - "name": "Jenny Rosen", - }, - } + "billing_details": {"name": "Jenny Rosen"}, + }, }, ); }); @@ -49,10 +47,8 @@ void main() { "payment_method": { "card": {"token": "tokenValue"}, "type": "card", - "billing_details": { - "name": "Jenny Rosen", - }, - } + "billing_details": {"name": "Jenny Rosen"}, + }, }, ); }); diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_options_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_options_test.dart index dc315bd6a..ea9d328db 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_options_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_card_payment_options_test.dart @@ -4,23 +4,13 @@ import 'package:test/test.dart'; void main() { group('ConfirmCardPaymentOptions', () { test('handleActions is true by default', () { - expect( - ConfirmCardPaymentOptions().toJson(), - { - "handleActions": true, - }, - ); + expect(ConfirmCardPaymentOptions().toJson(), {"handleActions": true}); }); test('handleActions can be set to false', () { - expect( - ConfirmCardPaymentOptions( - handleActions: false, - ).toJson(), - { - "handleActions": false, - }, - ); + expect(ConfirmCardPaymentOptions(handleActions: false).toJson(), { + "handleActions": false, + }); }); }); } diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_data_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_data_test.dart index 7030eaaed..52c711269 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_data_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_data_test.dart @@ -20,10 +20,8 @@ void main() { "payment_method": { "ideal": fakeElement, "type": "ideal", - "billing_details": { - "name": "Jenny Rosen", - }, - } + "billing_details": {"name": "Jenny Rosen"}, + }, }, ); }); @@ -49,10 +47,8 @@ void main() { "payment_method": { "ideal": {"bank": "abn_amro"}, "type": "ideal", - "billing_details": { - "name": "Jenny Rosen", - }, - } + "billing_details": {"name": "Jenny Rosen"}, + }, }, ); }); @@ -69,10 +65,8 @@ void main() { "payment_method": { "ideal": {}, "type": "ideal", - "billing_details": { - "name": "Jenny Rosen", - }, - } + "billing_details": {"name": "Jenny Rosen"}, + }, }, ); }); @@ -89,10 +83,8 @@ void main() { "payment_method": { "ideal": {}, "type": "ideal", - "billing_details": { - "name": "Jenny Rosen", - }, - } + "billing_details": {"name": "Jenny Rosen"}, + }, }, ); }); @@ -100,13 +92,10 @@ void main() { test('extra params parse correctly', () { expect( ConfirmIdealPaymentData( - returnUrl: 'url', - setupFutureUsage: PaymentIntentSetupFutureUsage.offSession) - .toJson(), - { - "return_url": "url", - "setup_future_usage": "off_session", - }, + returnUrl: 'url', + setupFutureUsage: PaymentIntentSetupFutureUsage.offSession, + ).toJson(), + {"return_url": "url", "setup_future_usage": "off_session"}, ); }); }); diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_options_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_options_test.dart index 960afc1e5..116727caa 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_options_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_ideal_payment_options_test.dart @@ -4,23 +4,13 @@ import 'package:test/test.dart'; void main() { group('ConfirmIdealPaymentOptions', () { test('handleActions is true by default', () { - expect( - ConfirmIdealPaymentOptions().toJson(), - { - "handleActions": true, - }, - ); + expect(ConfirmIdealPaymentOptions().toJson(), {"handleActions": true}); }); test('handleActions can be set to false', () { - expect( - ConfirmIdealPaymentOptions( - handleActions: false, - ).toJson(), - { - "handleActions": false, - }, - ); + expect(ConfirmIdealPaymentOptions(handleActions: false).toJson(), { + "handleActions": false, + }); }); }); } diff --git a/packages/stripe_js/test/src/api/payment_intents/confirm_sepa_debit_payment_data_test.dart b/packages/stripe_js/test/src/api/payment_intents/confirm_sepa_debit_payment_data_test.dart index 9e19ff5cd..db65f83c9 100644 --- a/packages/stripe_js/test/src/api/payment_intents/confirm_sepa_debit_payment_data_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/confirm_sepa_debit_payment_data_test.dart @@ -14,7 +14,9 @@ void main() { paymentMethod: SepaDebitPaymentMethodDetails( sepaDebit: fakeElement, billingDetails: SepaBillingDetails( - name: 'Jenny Rosen', email: 'jenny@example.com'), + name: 'Jenny Rosen', + email: 'jenny@example.com', + ), ), ).toJson(), { @@ -25,7 +27,7 @@ void main() { "name": "Jenny Rosen", "email": 'jenny@example.com', }, - } + }, }, ); }); @@ -58,15 +60,12 @@ void main() { "name": "Jenny Rosen", "email": 'jenny@example.com', }, - } + }, }, ); }); test('extra params parse correctly', () { - expect( - ConfirmSepaDebitPaymentData().toJson(), - {}, - ); + expect(ConfirmSepaDebitPaymentData().toJson(), {}); }); }); } diff --git a/packages/stripe_js/test/src/api/payment_intents/payment_intent_test.dart b/packages/stripe_js/test/src/api/payment_intents/payment_intent_test.dart index b249da0af..051acd894 100644 --- a/packages/stripe_js/test/src/api/payment_intents/payment_intent_test.dart +++ b/packages/stripe_js/test/src/api/payment_intents/payment_intent_test.dart @@ -29,23 +29,17 @@ void main() { id: "pi_1Dsr1T2eZvKYlo2C7KHhBRmV", amount: 100, amountCapturable: 0, - amountDetails: PaymentIntentAmountDetails( - tip: PaymentIntentTip(), - ), + amountDetails: PaymentIntentAmountDetails(tip: PaymentIntentTip()), amountReceived: 0, clientSecret: "pi_1Dsr1T2eZvKYlo2C7KHhBRmV_secret_qH4mhHMXKbJjDgyVuBao7MkBq", currency: "usd", created: 1547555283, livemode: false, - paymentMethodTypes: [ - PaymentMethodType.card, - ], + paymentMethodTypes: [PaymentMethodType.card], status: PaymentIntentsStatus.requiresPaymentMethod, ).toJson(), - equals( - expected, - ), + equals(expected), ); }); @@ -90,7 +84,7 @@ void main() { "statement_descriptor_suffix": null, "status": "requires_payment_method", "transfer_data": null, - "transfer_group": null + "transfer_group": null, }; expect( PaymentIntent.fromJson(full), @@ -99,18 +93,14 @@ void main() { id: "pi_1Dsr1T2eZvKYlo2C7KHhBRmV", amount: 100, amountCapturable: 0, - amountDetails: PaymentIntentAmountDetails( - tip: PaymentIntentTip(), - ), + amountDetails: PaymentIntentAmountDetails(tip: PaymentIntentTip()), amountReceived: 0, clientSecret: "pi_1Dsr1T2eZvKYlo2C7KHhBRmV_secret_qH4mhHMXKbJjDgyVuBao7MkBq", currency: "usd", created: 1547555283, livemode: false, - paymentMethodTypes: [ - PaymentMethodType.card, - ], + paymentMethodTypes: [PaymentMethodType.card], status: PaymentIntentsStatus.requiresPaymentMethod, ), ), @@ -118,50 +108,62 @@ void main() { }); test('parses intent with canceled status', () { - expect(PaymentIntent.fromJson(_paymentIntentWithStatusJson('canceled')), - _expectedPaymentIntentWithStatus(PaymentIntentsStatus.canceled)); + expect( + PaymentIntent.fromJson(_paymentIntentWithStatusJson('canceled')), + _expectedPaymentIntentWithStatus(PaymentIntentsStatus.canceled), + ); }); test('parses intent with processing status', () { - expect(PaymentIntent.fromJson(_paymentIntentWithStatusJson('processing')), - _expectedPaymentIntentWithStatus(PaymentIntentsStatus.processing)); + expect( + PaymentIntent.fromJson(_paymentIntentWithStatusJson('processing')), + _expectedPaymentIntentWithStatus(PaymentIntentsStatus.processing), + ); }); test('parses intent with requires_action status', () { expect( - PaymentIntent.fromJson( - _paymentIntentWithStatusJson('requires_action')), - _expectedPaymentIntentWithStatus( - PaymentIntentsStatus.requiresAction)); + PaymentIntent.fromJson(_paymentIntentWithStatusJson('requires_action')), + _expectedPaymentIntentWithStatus(PaymentIntentsStatus.requiresAction), + ); }); test('parses intent with requires_capture status', () { expect( - PaymentIntent.fromJson( - _paymentIntentWithStatusJson('requires_capture')), - _expectedPaymentIntentWithStatus( - PaymentIntentsStatus.requiresCapture)); + PaymentIntent.fromJson( + _paymentIntentWithStatusJson('requires_capture'), + ), + _expectedPaymentIntentWithStatus(PaymentIntentsStatus.requiresCapture), + ); }); test('parses intent with requires_confirmation status', () { expect( - PaymentIntent.fromJson( - _paymentIntentWithStatusJson('requires_confirmation')), - _expectedPaymentIntentWithStatus( - PaymentIntentsStatus.requiresConfirmation)); + PaymentIntent.fromJson( + _paymentIntentWithStatusJson('requires_confirmation'), + ), + _expectedPaymentIntentWithStatus( + PaymentIntentsStatus.requiresConfirmation, + ), + ); }); test('parses intent with requires_payment_method status', () { expect( - PaymentIntent.fromJson( - _paymentIntentWithStatusJson('requires_payment_method')), - _expectedPaymentIntentWithStatus( - PaymentIntentsStatus.requiresPaymentMethod)); + PaymentIntent.fromJson( + _paymentIntentWithStatusJson('requires_payment_method'), + ), + _expectedPaymentIntentWithStatus( + PaymentIntentsStatus.requiresPaymentMethod, + ), + ); }); test('parses intent with succeeded status', () { - expect(PaymentIntent.fromJson(_paymentIntentWithStatusJson('succeeded')), - _expectedPaymentIntentWithStatus(PaymentIntentsStatus.succeeded)); + expect( + PaymentIntent.fromJson(_paymentIntentWithStatusJson('succeeded')), + _expectedPaymentIntentWithStatus(PaymentIntentsStatus.succeeded), + ); }); }); } @@ -207,26 +209,23 @@ Map _paymentIntentWithStatusJson(String status) { "statement_descriptor_suffix": null, "status": status, "transfer_data": null, - "transfer_group": null + "transfer_group": null, }; } PaymentIntent _expectedPaymentIntentWithStatus(PaymentIntentsStatus status) { return PaymentIntent( - id: "pi_1Dsr1T2eZvKYlo2C7KHhBRmV", - amount: 100, - amountCapturable: 0, - amountDetails: PaymentIntentAmountDetails( - tip: PaymentIntentTip(), - ), - amountReceived: 0, - clientSecret: - "pi_1Dsr1T2eZvKYlo2C7KHhBRmV_secret_qH4mhHMXKbJjDgyVuBao7MkBq", - currency: "usd", - created: 1547555283, - livemode: false, - paymentMethodTypes: [ - PaymentMethodType.card, - ], - status: status); + id: "pi_1Dsr1T2eZvKYlo2C7KHhBRmV", + amount: 100, + amountCapturable: 0, + amountDetails: PaymentIntentAmountDetails(tip: PaymentIntentTip()), + amountReceived: 0, + clientSecret: + "pi_1Dsr1T2eZvKYlo2C7KHhBRmV_secret_qH4mhHMXKbJjDgyVuBao7MkBq", + currency: "usd", + created: 1547555283, + livemode: false, + paymentMethodTypes: [PaymentMethodType.card], + status: status, + ); } diff --git a/packages/stripe_js/test/src/api/setup_intents/setup_intent_test.dart b/packages/stripe_js/test/src/api/setup_intents/setup_intent_test.dart index c77ffcac7..37f5de365 100644 --- a/packages/stripe_js/test/src/api/setup_intents/setup_intent_test.dart +++ b/packages/stripe_js/test/src/api/setup_intents/setup_intent_test.dart @@ -15,27 +15,28 @@ void main() { "livemode": false, "metadata": {}, "payment_method_options": { - "card": {"request_three_d_secure": "automatic"} + "card": {"request_three_d_secure": "automatic"}, }, "payment_method_types": ["card"], "status": "requires_payment_method", - "usage": "off_session" + "usage": "off_session", }; expect( - SetupIntent( - id: "seti_1EuLZI2eZvKYlo2ClGUjTBUi", - clientSecret: - "seti_1EuLZI2eZvKYlo2ClGUjTBUi_secret_FP9teCGsMtJlhYfuW1z9U0Aa9JKyTIK", - status: SetupIntentsStatus.requiresPaymentMethod, - livemode: false, - created: 1562687364, - paymentMethodTypes: [PaymentMethodType.card], - paymentMethodOptions: { - "card": {"request_three_d_secure": "automatic"} - }, - ).toJson(), - equals(value)); + SetupIntent( + id: "seti_1EuLZI2eZvKYlo2ClGUjTBUi", + clientSecret: + "seti_1EuLZI2eZvKYlo2ClGUjTBUi_secret_FP9teCGsMtJlhYfuW1z9U0Aa9JKyTIK", + status: SetupIntentsStatus.requiresPaymentMethod, + livemode: false, + created: 1562687364, + paymentMethodTypes: [PaymentMethodType.card], + paymentMethodOptions: { + "card": {"request_three_d_secure": "automatic"}, + }, + ).toJson(), + equals(value), + ); }); test('reverse parsing correctly', () { final value = { @@ -61,14 +62,14 @@ void main() { "card": { "mandate_options": null, "network": null, - "request_three_d_secure": "automatic" - } + "request_three_d_secure": "automatic", + }, }, "payment_method_types": ["card"], "redaction": null, "single_use_mandate": null, "status": "requires_payment_method", - "usage": "off_session" + "usage": "off_session", }; expect( @@ -86,8 +87,8 @@ void main() { "card": { "mandate_options": null, "network": null, - "request_three_d_secure": "automatic" - } + "request_three_d_secure": "automatic", + }, }, ), ), diff --git a/packages/stripe_js/test/src/api/tokens/create_token_bank_account_data_test.dart b/packages/stripe_js/test/src/api/tokens/create_token_bank_account_data_test.dart index 69644b3ea..32ec107cb 100644 --- a/packages/stripe_js/test/src/api/tokens/create_token_bank_account_data_test.dart +++ b/packages/stripe_js/test/src/api/tokens/create_token_bank_account_data_test.dart @@ -10,11 +10,7 @@ void main() { currency: 'USD', accountNumber: '000123456789', ).toJson(), - { - "country": "US", - "currency": "USD", - "account_number": "000123456789", - }, + {"country": "US", "currency": "USD", "account_number": "000123456789"}, ); }); diff --git a/packages/stripe_js/test/src/api/tokens/create_token_card_data_test.dart b/packages/stripe_js/test/src/api/tokens/create_token_card_data_test.dart index fc8f12c92..622ddfedf 100644 --- a/packages/stripe_js/test/src/api/tokens/create_token_card_data_test.dart +++ b/packages/stripe_js/test/src/api/tokens/create_token_card_data_test.dart @@ -4,10 +4,7 @@ import 'package:test/test.dart'; void main() { group('CreateTokenCardData', () { test('expected default value', () { - expect( - CreateTokenCardData().toJson(), - {}, - ); + expect(CreateTokenCardData().toJson(), {}); }); test('parses correctly', () { diff --git a/packages/stripe_js/test/src/api/tokens/create_token_pii_data_test.dart b/packages/stripe_js/test/src/api/tokens/create_token_pii_data_test.dart index b3a2709d2..78c966471 100644 --- a/packages/stripe_js/test/src/api/tokens/create_token_pii_data_test.dart +++ b/packages/stripe_js/test/src/api/tokens/create_token_pii_data_test.dart @@ -4,12 +4,9 @@ import 'package:test/test.dart'; void main() { group('CreateTokenCardData', () { test('expected default value', () { - expect( - CreateTokenPIIData(personalIdNumber: '123131185').toJson(), - { - 'personal_id_number': '123131185', - }, - ); + expect(CreateTokenPIIData(personalIdNumber: '123131185').toJson(), { + 'personal_id_number': '123131185', + }); }); }); } diff --git a/packages/stripe_js/test/src/api/tokens/token_test.dart b/packages/stripe_js/test/src/api/tokens/token_test.dart index 95b4c10ff..184ef1d90 100644 --- a/packages/stripe_js/test/src/api/tokens/token_test.dart +++ b/packages/stripe_js/test/src/api/tokens/token_test.dart @@ -4,19 +4,13 @@ import 'package:test/test.dart'; void main() { group('Token', () { test('expected default value', () { - expect( - Token( - id: 'token_id', - type: TokenType.card, - ).toJson(), - { - 'id': 'token_id', - 'object': 'token', - 'livemode': true, - 'type': 'card', - 'used': false - }, - ); + expect(Token(id: 'token_id', type: TokenType.card).toJson(), { + 'id': 'token_id', + 'object': 'token', + 'livemode': true, + 'type': 'card', + 'used': false, + }); }); test('parses correctly', () { @@ -62,50 +56,48 @@ void main() { "created": 1673088120, "livemode": false, "type": "card", - "used": false + "used": false, }, ); }); test('creates object correctly', () { expect( - Token.fromJson( - { - "id": "tok_1MNZqe2eZvKYlo2CE2MWUijg", - "object": "token", - "card": { - "id": "card_1MNZqe2eZvKYlo2Cr6CbnUVe", - "object": "card", - "address_city": null, - "address_country": null, - "address_line1": null, - "address_line1_check": null, - "address_line2": null, - "address_state": null, - "address_zip": null, - "address_zip_check": null, - "brand": "Visa", - "country": "US", - "cvc_check": "pass", - "dynamic_last4": null, - "exp_month": 8, - "exp_year": 2024, - "fingerprint": "Xt5EWLLDS7FJjR1c", - "funding": "credit", - "last4": "4242", - "metadata": {}, - "name": null, - "redaction": null, - "tokenization_method": null - }, - "client_ip": null, - "created": 1673088120, - "livemode": false, + Token.fromJson({ + "id": "tok_1MNZqe2eZvKYlo2CE2MWUijg", + "object": "token", + "card": { + "id": "card_1MNZqe2eZvKYlo2Cr6CbnUVe", + "object": "card", + "address_city": null, + "address_country": null, + "address_line1": null, + "address_line1_check": null, + "address_line2": null, + "address_state": null, + "address_zip": null, + "address_zip_check": null, + "brand": "Visa", + "country": "US", + "cvc_check": "pass", + "dynamic_last4": null, + "exp_month": 8, + "exp_year": 2024, + "fingerprint": "Xt5EWLLDS7FJjR1c", + "funding": "credit", + "last4": "4242", + "metadata": {}, + "name": null, "redaction": null, - "type": "card", - "used": false + "tokenization_method": null, }, - ), + "client_ip": null, + "created": 1673088120, + "livemode": false, + "redaction": null, + "type": "card", + "used": false, + }), equals( Token( id: "tok_1MNZqe2eZvKYlo2CE2MWUijg", diff --git a/packages/stripe_js/test/src/js/elements/element_card_test.dart b/packages/stripe_js/test/src/js/elements/element_card_test.dart index 3e2abb85d..9f0f650b9 100644 --- a/packages/stripe_js/test/src/js/elements/element_card_test.dart +++ b/packages/stripe_js/test/src/js/elements/element_card_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'dart:async'; import 'package:stripe_js/stripe_api.dart'; @@ -53,11 +52,9 @@ void main() { final card = elements.createCard(); card.mount(child); final completer = Completer(); - card.onReady( - (event) { - completer.complete(); - }, - ); + card.onReady((event) { + completer.complete(); + }); expect(completer.future, completes); }); @@ -68,11 +65,9 @@ void main() { card.mount(child); final onFocusCompleter = Completer(); - card.onFocus( - (event) { - onFocusCompleter.complete(); - }, - ); + card.onFocus((event) { + onFocusCompleter.complete(); + }); await card.waitForReady(); card.focus(); expect(onFocusCompleter.future, completes); @@ -84,11 +79,9 @@ void main() { card.mount(child); final onBlurCompleter = Completer(); - card.onFocus( - (event) { - onBlurCompleter.complete(); - }, - ); + card.onFocus((event) { + onBlurCompleter.complete(); + }); await card.waitForReady(); card.focus(); card.blur(); diff --git a/packages/stripe_js/test/src/js/elements/element_payment_test.dart b/packages/stripe_js/test/src/js/elements/element_payment_test.dart index 2a4de9938..848a3d281 100644 --- a/packages/stripe_js/test/src/js/elements/element_payment_test.dart +++ b/packages/stripe_js/test/src/js/elements/element_payment_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'dart:async'; import 'package:stripe_js/stripe_api.dart'; @@ -21,9 +20,7 @@ void main() { final stripe = Stripe(stripePublishableKey); elements = stripe.elements( - JsElementsCreateOptions( - clientSecret: setupInputClientSecret, - ), + JsElementsCreateOptions(clientSecret: setupInputClientSecret), ); }); @@ -59,11 +56,9 @@ void main() { final card = elements.createPayment(); card.mount(child); final completer = Completer(); - card.onReady( - (event) { - completer.complete(); - }, - ); + card.onReady((event) { + completer.complete(); + }); expect(completer.future, completes); }); @@ -74,11 +69,9 @@ void main() { card.mount(child); final onFocusCompleter = Completer(); - card.onFocus( - (event) { - onFocusCompleter.complete(); - }, - ); + card.onFocus((event) { + onFocusCompleter.complete(); + }); await card.waitForReady(); card.focus(); expect(onFocusCompleter.future, completes); @@ -90,11 +83,9 @@ void main() { card.mount(child); final onBlurCompleter = Completer(); - card.onFocus( - (event) { - onBlurCompleter.complete(); - }, - ); + card.onFocus((event) { + onBlurCompleter.complete(); + }); await card.waitForReady(); card.focus(); card.blur(); diff --git a/packages/stripe_js/test/src/js/elements/elements_base_test.dart b/packages/stripe_js/test/src/js/elements/elements_base_test.dart index cd8b725ef..9920eaa58 100644 --- a/packages/stripe_js/test/src/js/elements/elements_base_test.dart +++ b/packages/stripe_js/test/src/js/elements/elements_base_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; diff --git a/packages/stripe_js/test/src/js/helpers/stripe_element_helper.dart b/packages/stripe_js/test/src/js/helpers/stripe_element_helper.dart index 7ab3e4821..a6efe3380 100644 --- a/packages/stripe_js/test/src/js/helpers/stripe_element_helper.dart +++ b/packages/stripe_js/test/src/js/helpers/stripe_element_helper.dart @@ -11,11 +11,9 @@ extension type JSIFrameElement(JSObject element) { extension WaitStripeElement on StripeElement { Future waitForReady() { final completer = Completer(); - onReady( - (event) { - completer.complete(); - }, - ); + onReady((event) { + completer.complete(); + }); return completer.future; } } @@ -34,24 +32,28 @@ extension ElementWaitFor on web.Element { // ignore: prefer_typing_uninitialized_variables late final mutationObserver; mutationObserver = web.MutationObserver( - (JSArray entries, web.MutationObserver observer) { - web.console.log("$innerHTML".toJS); - final element = querySelector(selectors); - if (element != null) { - web.console.log("found".toJS); - mutationObserver.disconnect(); - completer.complete(element); - } - }.toJS); + (JSArray entries, web.MutationObserver observer) { + web.console.log("$innerHTML".toJS); + final element = querySelector(selectors); + if (element != null) { + web.console.log("found".toJS); + mutationObserver.disconnect(); + completer.complete(element); + } + }.toJS, + ); web.console.log("searching".toJS); mutationObserver.observe(this, childList: true, subtree: true); append(web.HTMLDivElement()); await Future.delayed(Duration(seconds: 2)); append(web.HTMLDivElement()); - return completer.future.timeout(timeout, onTimeout: () { - mutationObserver.disconnect(); - throw TimeoutException('Could not find element $selectors'); - }); + return completer.future.timeout( + timeout, + onTimeout: () { + mutationObserver.disconnect(); + throw TimeoutException('Could not find element $selectors'); + }, + ); } } diff --git a/packages/stripe_js/test/src/js/payment_intents/retrieve_payment_intent_test.dart b/packages/stripe_js/test/src/js/payment_intents/retrieve_payment_intent_test.dart index 4eb08f6f0..356d40cc0 100644 --- a/packages/stripe_js/test/src/js/payment_intents/retrieve_payment_intent_test.dart +++ b/packages/stripe_js/test/src/js/payment_intents/retrieve_payment_intent_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'package:stripe_js/stripe_api.dart'; import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; @@ -24,8 +23,9 @@ void main() { }); test('retrieved setup intent is valid', () async { - final value = - await stripe.retrievePaymentIntent(paymentIntentClientSecret); + final value = await stripe.retrievePaymentIntent( + paymentIntentClientSecret, + ); expect(value.error, isNull); expect( value.paymentIntent?.toJson(), @@ -53,15 +53,12 @@ void main() { expect(value.error, isNotNull); expect( value.error?.toJson(), - equals( - { - 'type': 'invalid_request_error', - 'code': 'resource_missing', - 'param': 'intent', - 'message': - 'No such payment_intent: \'pi_3M8VVPLLSCwoVL5p1ZZjwhPT\'', - }, - ), + equals({ + 'type': 'invalid_request_error', + 'code': 'resource_missing', + 'param': 'intent', + 'message': 'No such payment_intent: \'pi_3M8VVPLLSCwoVL5p1ZZjwhPT\'', + }), ); }); }); diff --git a/packages/stripe_js/test/src/js/payment_methods/create_payment_method_test.dart b/packages/stripe_js/test/src/js/payment_methods/create_payment_method_test.dart index 929ef8a86..917919043 100644 --- a/packages/stripe_js/test/src/js/payment_methods/create_payment_method_test.dart +++ b/packages/stripe_js/test/src/js/payment_methods/create_payment_method_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'package:stripe_js/stripe_api.dart'; import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; @@ -48,7 +47,7 @@ void main() { equals({ 'type': 'validation_error', 'code': 'incomplete_number', - 'message': 'Your card number is incomplete.' + 'message': 'Your card number is incomplete.', }), ); }); diff --git a/packages/stripe_js/test/src/js/setup_intents/retrieve_setup_intent_test.dart b/packages/stripe_js/test/src/js/setup_intents/retrieve_setup_intent_test.dart index 2338f47d3..b2aa713fc 100644 --- a/packages/stripe_js/test/src/js/setup_intents/retrieve_setup_intent_test.dart +++ b/packages/stripe_js/test/src/js/setup_intents/retrieve_setup_intent_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'package:stripe_js/stripe_api.dart'; import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; @@ -17,10 +16,7 @@ void main() { stripe = Stripe(stripePublishableKey); }); test('can be retrieve Setup Intent', () { - expect( - stripe.retrieveSetupIntent(setupInputClientSecret), - completes, - ); + expect(stripe.retrieveSetupIntent(setupInputClientSecret), completes); }); test('retrieved setup intent is valid', () async { @@ -49,14 +45,12 @@ void main() { expect(value.error, isNotNull); expect( value.error?.toJson(), - equals( - { - 'type': 'invalid_request_error', - 'message': - 'The client_secret provided does not match the client_secret associated with the SetupIntent.', - 'param': 'client_secret' - }, - ), + equals({ + 'type': 'invalid_request_error', + 'message': + 'The client_secret provided does not match the client_secret associated with the SetupIntent.', + 'param': 'client_secret', + }), ); }); }); diff --git a/packages/stripe_js/test/src/js/stripe_test.dart b/packages/stripe_js/test/src/js/stripe_test.dart index 9fcb82ba5..e68b873d2 100644 --- a/packages/stripe_js/test/src/js/stripe_test.dart +++ b/packages/stripe_js/test/src/js/stripe_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; diff --git a/packages/stripe_js/test/src/js/tokens/create_token_test.dart b/packages/stripe_js/test/src/js/tokens/create_token_test.dart index d862bf1da..49c7f1c67 100644 --- a/packages/stripe_js/test/src/js/tokens/create_token_test.dart +++ b/packages/stripe_js/test/src/js/tokens/create_token_test.dart @@ -2,7 +2,6 @@ @TestOn('browser') @Tags(["browser"]) - import 'package:stripe_js/stripe_api.dart'; import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; @@ -69,7 +68,7 @@ void main() { equals({ 'type': 'validation_error', 'code': 'incomplete_number', - 'message': 'Your card number is incomplete.' + 'message': 'Your card number is incomplete.', }), ); }); @@ -78,22 +77,25 @@ void main() { group('createBankAccountToken', () { test('can be called', () async { expect( - stripe.createBankAccountToken(CreateTokenBankAccountData( - country: 'US', - currency: 'USD', - accountNumber: '22', - )), + stripe.createBankAccountToken( + CreateTokenBankAccountData( + country: 'US', + currency: 'USD', + accountNumber: '22', + ), + ), completes, ); }); test('returns when invalid data', () async { - final response = - await stripe.createBankAccountToken(CreateTokenBankAccountData( - country: 'invalid', - currency: 'USD', - accountNumber: '22', - )); + final response = await stripe.createBankAccountToken( + CreateTokenBankAccountData( + country: 'invalid', + currency: 'USD', + accountNumber: '22', + ), + ); expect( response.error?.toJson(), equals({ @@ -101,7 +103,7 @@ void main() { 'code': 'bank_account_unusable', 'param': 'bank_account[country]', 'message': - 'Country INVALID not supported (you should use the 2-letter country code, e.g. US).' + 'Country INVALID not supported (you should use the 2-letter country code, e.g. US).', }), ); }); @@ -119,10 +121,7 @@ void main() { final response = await stripe.createPIIToken( CreateTokenPIIData(personalIdNumber: 'a'), ); - expect( - response.token?.id, - startsWith('pii_'), - ); + expect(response.token?.id, startsWith('pii_')); }); }); }); diff --git a/packages/stripe_js/test/src/loader/initial_state_test.dart b/packages/stripe_js/test/src/loader/initial_state_test.dart index 91d98abb7..c21827b45 100644 --- a/packages/stripe_js/test/src/loader/initial_state_test.dart +++ b/packages/stripe_js/test/src/loader/initial_state_test.dart @@ -7,12 +7,9 @@ import 'dart:js'; import 'package:test/test.dart'; void main() { - group( - 'StripeLoader', - () { - test('Stripe is not loaded by default', () { - expect(context['Stripe'], isNull); - }); - }, - ); + group('StripeLoader', () { + test('Stripe is not loaded by default', () { + expect(context['Stripe'], isNull); + }); + }); } diff --git a/packages/stripe_js/test/src/loader/stripe_loader_test.dart b/packages/stripe_js/test/src/loader/stripe_loader_test.dart index 71573938a..474372817 100644 --- a/packages/stripe_js/test/src/loader/stripe_loader_test.dart +++ b/packages/stripe_js/test/src/loader/stripe_loader_test.dart @@ -8,18 +8,15 @@ import 'package:stripe_js/stripe_js.dart'; import 'package:test/test.dart'; void main() { - group( - 'StripeLoader', - () { - test('loads Stripe library', () async { - await loadStripe(); - expect(context['Stripe'], isNotNull); - }); + group('StripeLoader', () { + test('loads Stripe library', () async { + await loadStripe(); + expect(context['Stripe'], isNotNull); + }); - test('Stripe can be initialized', () async { - await loadStripe(); - expect(Stripe('publicKey'), isNotNull); - }); - }, - ); + test('Stripe can be initialized', () async { + await loadStripe(); + expect(Stripe('publicKey'), isNotNull); + }); + }); } diff --git a/packages/stripe_platform_interface/lib/src/card_edit_controller.dart b/packages/stripe_platform_interface/lib/src/card_edit_controller.dart index 4cbaf90b2..52ff06360 100644 --- a/packages/stripe_platform_interface/lib/src/card_edit_controller.dart +++ b/packages/stripe_platform_interface/lib/src/card_edit_controller.dart @@ -29,16 +29,17 @@ mixin CardFieldContext { } void updateCardDetails( - CardFieldInputDetails value, CardEditController controller) { + CardFieldInputDetails value, + CardEditController controller, + ) { controller._updateDetails(value); } } class CardEditController extends ChangeNotifier { CardEditController({CardFieldInputDetails? initialDetails}) - : initalDetails = initialDetails, - _details = - initialDetails ?? const CardFieldInputDetails(complete: false); + : initalDetails = initialDetails, + _details = initialDetails ?? const CardFieldInputDetails(complete: false); final CardFieldInputDetails? initalDetails; CardFieldInputDetails _details; @@ -76,7 +77,9 @@ class CardEditController extends ChangeNotifier { CardFieldContext? _context; CardFieldContext get context { assert( - _context != null, 'CardEditController is not attached to any CardView'); + _context != null, + 'CardEditController is not attached to any CardView', + ); return _context!; } } diff --git a/packages/stripe_platform_interface/lib/src/method_channel_stripe.dart b/packages/stripe_platform_interface/lib/src/method_channel_stripe.dart index 8278f9597..777506f3c 100644 --- a/packages/stripe_platform_interface/lib/src/method_channel_stripe.dart +++ b/packages/stripe_platform_interface/lib/src/method_channel_stripe.dart @@ -23,9 +23,10 @@ import 'models/three_d_secure.dart'; import 'stripe_platform_interface.dart'; const _appInfo = AppInfo( - name: 'flutter_stripe', - version: '0.0.0', - url: 'https://github.com/fluttercommunity/flutter_stripe/'); + name: 'flutter_stripe', + version: '0.0.0', + url: 'https://github.com/fluttercommunity/flutter_stripe/', +); /// An implementation of [StripePlatform] that uses method channels. class MethodChannelStripe extends StripePlatform { @@ -33,14 +34,15 @@ class MethodChannelStripe extends StripePlatform { required MethodChannel methodChannel, required bool platformIsIos, required bool platformIsAndroid, - }) : _methodChannel = methodChannel, - _platformIsAndroid = platformIsAndroid, - _platformIsIos = platformIsIos; + }) : _methodChannel = methodChannel, + _platformIsAndroid = platformIsAndroid, + _platformIsIos = platformIsIos; final MethodChannel _methodChannel; final bool _platformIsIos; final bool _platformIsAndroid; ConfirmHandler? _confirmHandler; + ConfirmCustomPaymentMethodCallback? _confirmCustomPaymentMethodCallback; FinancialConnectionsEventHandler? _financialConnectionsEventHandler; @override @@ -66,12 +68,31 @@ class MethodChannelStripe extends StripePlatform { if (call.method == 'onConfirmHandlerCallback' && _confirmHandler != null) { final method = ResultParser( - parseJson: (json) => PaymentMethod.fromJson(json)) - .parse(result: call.arguments!, successResultKey: 'paymentMethod'); + parseJson: (json) => PaymentMethod.fromJson(json), + ).parse(result: call.arguments!, successResultKey: 'paymentMethod'); _confirmHandler!( method, call.arguments['shouldSavePaymentMethod'] as bool, ); + } else if (call.method == 'onCustomPaymentMethodConfirmHandlerCallback' && + _confirmCustomPaymentMethodCallback != null) { + final method = + ResultParser( + parseJson: (json) => CustomPaymentMethod.fromJson(json), + ).parse( + result: call.arguments!, + successResultKey: 'customPaymentMethod', + ); + + final billingDetails = ResultParser( + parseJson: (json) => BillingDetails.fromJson(json), + ).parse(result: call.arguments!, successResultKey: 'billingDetails'); + _confirmCustomPaymentMethodCallback!(method, billingDetails, (result) { + _methodChannel.invokeMethod( + 'customPaymentMethodConfirmHandlerCallback', + {'result': result.name}, + ); + }); } else if (call.method == 'onFinancialConnectionsEvent' && _financialConnectionsEventHandler != null) { final event = FinancialConnectionsEvent( @@ -90,15 +111,14 @@ class MethodChannelStripe extends StripePlatform { PaymentMethodParams data, [ PaymentMethodOptions? options, ]) async { - final result = await _methodChannel - .invokeMapMethod('createPaymentMethod', { - 'data': data.toJson(), - 'options': options?.toJson() ?? {}, - }); + final result = await _methodChannel.invokeMapMethod( + 'createPaymentMethod', + {'data': data.toJson(), 'options': options?.toJson() ?? {}}, + ); return ResultParser( - parseJson: (json) => PaymentMethod.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentMethod'); + parseJson: (json) => PaymentMethod.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentMethod'); } @override @@ -109,14 +129,14 @@ class MethodChannelStripe extends StripePlatform { ) async { final result = await _methodChannel .invokeMapMethod('confirmPayment', { - 'paymentIntentClientSecret': paymentIntentClientSecret, - 'params': params?.toJson(), - 'options': options?.toJson() ?? {}, - }); + 'paymentIntentClientSecret': paymentIntentClientSecret, + 'params': params?.toJson(), + 'options': options?.toJson() ?? {}, + }); return ResultParser( - parseJson: (json) => PaymentIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentIntent'); + parseJson: (json) => PaymentIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentIntent'); } @override @@ -127,10 +147,10 @@ class MethodChannelStripe extends StripePlatform { ]) async { final result = await _methodChannel .invokeMapMethod('confirmSetupIntent', { - 'setupIntentClientSecret': setupIntentClientSecret, - 'params': data.toJson(), - 'options': options?.toJson() ?? {}, - }); + 'setupIntentClientSecret': setupIntentClientSecret, + 'params': data.toJson(), + 'options': options?.toJson() ?? {}, + }); return ResultParser( parseJson: (json) => SetupIntent.fromJson(json), @@ -148,32 +168,35 @@ class MethodChannelStripe extends StripePlatform { } @override - Future handleNextAction(String paymentIntentClientSecret, - {String? returnURL}) async { + Future handleNextAction( + String paymentIntentClientSecret, { + String? returnURL, + }) async { final result = await _methodChannel .invokeMapMethod('handleNextAction', { - 'paymentIntentClientSecret': paymentIntentClientSecret, - if (_platformIsIos) 'returnURL': returnURL, - }); + 'paymentIntentClientSecret': paymentIntentClientSecret, + if (_platformIsIos) 'returnURL': returnURL, + }); return ResultParser( - parseJson: (json) => PaymentIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentIntent'); + parseJson: (json) => PaymentIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentIntent'); } @override Future handleNextActionForSetupIntent( - String setupIntentClientSecret, - {String? returnURL}) async { + String setupIntentClientSecret, { + String? returnURL, + }) async { final result = await _methodChannel .invokeMapMethod('handleNextActionForSetup', { - 'setupIntentClientSecret': setupIntentClientSecret, - if (_platformIsIos) 'returnURL': returnURL, - }); + 'setupIntentClientSecret': setupIntentClientSecret, + if (_platformIsIos) 'returnURL': returnURL, + }); return ResultParser( - parseJson: (json) => SetupIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'setupIntent'); + parseJson: (json) => SetupIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'setupIntent'); } @override @@ -186,39 +209,46 @@ class MethodChannelStripe extends StripePlatform { @override Future retrievePaymentIntent(String clientSecret) async { - final result = await _methodChannel - .invokeMapMethod('retrievePaymentIntent', { - 'clientSecret': clientSecret, - }); + final result = await _methodChannel.invokeMapMethod( + 'retrievePaymentIntent', + {'clientSecret': clientSecret}, + ); return ResultParser( - parseJson: (json) => PaymentIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentIntent'); + parseJson: (json) => PaymentIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentIntent'); } @override Future retrieveSetupIntent(String clientSecret) async { - final result = await _methodChannel - .invokeMapMethod('retrieveSetupIntent', { - 'clientSecret': clientSecret, - }); + final result = await _methodChannel.invokeMapMethod( + 'retrieveSetupIntent', + {'clientSecret': clientSecret}, + ); return ResultParser( - parseJson: (json) => SetupIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'setupIntent'); + parseJson: (json) => SetupIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'setupIntent'); } @override Future initPaymentSheet( - SetupPaymentSheetParameters params) async { - final result = await _methodChannel.invokeMethod( - 'initPaymentSheet', - {'params': params.toJson()}, - ); + SetupPaymentSheetParameters params, + ) async { + final result = await _methodChannel.invokeMethod('initPaymentSheet', { + 'params': params.toJson(), + }); if (params.intentConfiguration?.confirmHandler != null) { - _addListenerForDeffered(); _confirmHandler = params.intentConfiguration?.confirmHandler; } + if (params + .customPaymentMethodConfiguration + ?.confirmCustomPaymentMethodCallback != + null) { + _confirmCustomPaymentMethodCallback = params + .customPaymentMethodConfiguration + ?.confirmCustomPaymentMethodCallback; + } if (result is List) { return null; } else { @@ -240,16 +270,16 @@ class MethodChannelStripe extends StripePlatform { @override Future resetPaymentSheetCustomer() async { - await _methodChannel.invokeMethod( - 'resetPaymentSheetCustomer', - {'params': {}}, - ); + await _methodChannel.invokeMethod('resetPaymentSheetCustomer', { + 'params': {}, + }); } @override Future confirmPaymentSheetPayment() async { - final result = await _methodChannel - .invokeMethod('confirmPaymentSheetPayment'); + final result = await _methodChannel.invokeMethod( + 'confirmPaymentSheetPayment', + ); // iOS returns empty list on success if (result is List) { return; @@ -260,14 +290,12 @@ class MethodChannelStripe extends StripePlatform { @override Future initCustomerSheet( - CustomerSheetInitParams params) async { - final result = await _methodChannel.invokeMethod( - 'initCustomerSheet', - { - 'params': params.toJson(), - 'customerAdapterOverrides': {}, - }, - ); + CustomerSheetInitParams params, + ) async { + final result = await _methodChannel.invokeMethod('initCustomerSheet', { + 'params': params.toJson(), + 'customerAdapterOverrides': {}, + }); if (result is List) { return null; @@ -290,7 +318,7 @@ class MethodChannelStripe extends StripePlatform { @override Future - retrieveCustomerSheetPaymentOptionSelection() async { + retrieveCustomerSheetPaymentOptionSelection() async { final result = await _methodChannel.invokeMethod( 'retrieveCustomerSheetPaymentOptionSelection', {}, @@ -309,11 +337,13 @@ class MethodChannelStripe extends StripePlatform { ); final result = await _methodChannel.invokeMapMethod( - 'createToken', {'params': invokeParams}); + 'createToken', + {'params': invokeParams}, + ); return ResultParser( - parseJson: (json) => TokenData.fromJson(json)) - .parse(result: result!, successResultKey: 'token'); + parseJson: (json) => TokenData.fromJson(json), + ).parse(result: result!, successResultKey: 'token'); } @override @@ -323,15 +353,9 @@ class MethodChannelStripe extends StripePlatform { }); } - Future _addListenerForDeffered() async { - await _methodChannel.invokeMethod( - 'addListener', - {'eventName': 'onConfirmHandlerCallback'}, - ); - } - PaymentSheetPaymentOption? _parsePaymentSheetResult( - Map? result) { + Map? result, + ) { if (result != null) { ///iOS sometimes returns empty paymentoption so add workaround for it. if (result.isEmpty || @@ -389,27 +413,31 @@ class MethodChannelStripe extends StripePlatform { @override Future createGooglePayPaymentMethod( - CreateGooglePayPaymentParams params) async { - final result = await _methodChannel - .invokeMapMethod('createGooglePayPaymentMethod', { - 'params': params.toJson(), - }); + CreateGooglePayPaymentParams params, + ) async { + final result = await _methodChannel.invokeMapMethod( + 'createGooglePayPaymentMethod', + {'params': params.toJson()}, + ); return ResultParser( - parseJson: (json) => PaymentMethod.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentMethod'); + parseJson: (json) => PaymentMethod.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentMethod'); } @override Future initGooglePay(GooglePayInitParams params) async { - return await _methodChannel - .invokeMethod('initGooglePay', {'params': params.toJson()}); + return await _methodChannel.invokeMethod('initGooglePay', { + 'params': params.toJson(), + }); } @override Future presentGooglePay(PresentGooglePayParams params) async { final result = await _methodChannel.invokeMapMethod( - 'presentGooglePay', {'params': params.toJson()}); + 'presentGooglePay', + {'params': params.toJson()}, + ); if (result!.containsKey('error')) { throw ResultParser(parseJson: (json) => {}).parseError(result); @@ -421,8 +449,10 @@ class MethodChannelStripe extends StripePlatform { if (!_platformIsAndroid) { return false; } - final isSupported = await _methodChannel - .invokeMethod('isGooglePaySupported', {'params': params.toJson()}); + final isSupported = await _methodChannel.invokeMethod( + 'isGooglePaySupported', + {'params': params.toJson()}, + ); return isSupported ?? false; } @@ -434,10 +464,10 @@ class MethodChannelStripe extends StripePlatform { }) async { bool? isSupported; if (params == null) { - final result = - await _methodChannel.invokeMethod('isPlatformPaySupported', { - 'params': {}, - }); + final result = await _methodChannel.invokeMethod( + 'isPlatformPaySupported', + {'params': {}}, + ); if (result is bool) { isSupported = result; @@ -445,8 +475,10 @@ class MethodChannelStripe extends StripePlatform { StripeException.fromJson(result); } } else { - isSupported = await _methodChannel - .invokeMethod('isPlatformPaySupported', {'params': params.toJson()}); + isSupported = await _methodChannel.invokeMethod( + 'isPlatformPaySupported', + {'params': params.toJson()}, + ); } return isSupported ?? false; @@ -459,10 +491,10 @@ class MethodChannelStripe extends StripePlatform { }) async { final result = await _methodChannel .invokeMapMethod('confirmPlatformPay', { - 'clientSecret': clientSecret, - 'params': params.toJson(), - 'isPaymentIntent': false, - }); + 'clientSecret': clientSecret, + 'params': params.toJson(), + 'isPaymentIntent': false, + }); return ResultParser( parseJson: (json) => SetupIntent.fromJson(json), ).parse(result: result!, successResultKey: 'setupIntent'); @@ -473,12 +505,14 @@ class MethodChannelStripe extends StripePlatform { required String clientSecret, required PlatformPayConfirmParams params, }) async { - final result = await _methodChannel - .invokeMapMethod('confirmPlatformPay', { - 'clientSecret': clientSecret, - 'params': params.toJson(), - 'isPaymentIntent': true, - }); + final result = await _methodChannel.invokeMapMethod( + 'confirmPlatformPay', + { + 'clientSecret': clientSecret, + 'params': params.toJson(), + 'isPaymentIntent': true, + }, + ); return ResultParser( parseJson: (json) => PaymentIntent.fromJson(json), ).parse(result: result!, successResultKey: 'paymentIntent'); @@ -487,11 +521,13 @@ class MethodChannelStripe extends StripePlatform { @override Future createApplePayToken(Map payment) async { final result = await _methodChannel.invokeMapMethod( - 'createApplePayToken', {'payment': payment}); + 'createApplePayToken', + {'payment': payment}, + ); return ResultParser( - parseJson: (json) => TokenData.fromJson(json)) - .parse(result: result!, successResultKey: 'token'); + parseJson: (json) => TokenData.fromJson(json), + ).parse(result: result!, successResultKey: 'token'); } @override @@ -502,16 +538,16 @@ class MethodChannelStripe extends StripePlatform { }) async { final result = await _methodChannel .invokeMapMethod('collectBankAccount', { - 'isPaymentIntent': isPaymentIntent, - 'params': params.toJson(), - 'clientSecret': clientSecret, - }); + 'isPaymentIntent': isPaymentIntent, + 'params': params.toJson(), + 'clientSecret': clientSecret, + }); _financialConnectionsEventHandler = params.onEvent; return ResultParser( - parseJson: (json) => PaymentIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentIntent'); + parseJson: (json) => PaymentIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentIntent'); } @override @@ -522,14 +558,14 @@ class MethodChannelStripe extends StripePlatform { }) async { final result = await _methodChannel .invokeMapMethod('verifyMicrodeposits', { - 'isPaymentIntent': isPaymentIntent, - 'params': params.toJson(), - 'clientSecret': clientSecret, - }); + 'isPaymentIntent': isPaymentIntent, + 'params': params.toJson(), + 'clientSecret': clientSecret, + }); return ResultParser( - parseJson: (json) => PaymentIntent.fromJson(json)) - .parse(result: result!, successResultKey: 'paymentIntent'); + parseJson: (json) => PaymentIntent.fromJson(json), + ).parse(result: result!, successResultKey: 'paymentIntent'); } @override @@ -537,17 +573,13 @@ class MethodChannelStripe extends StripePlatform { final result = await _methodChannel.invokeMapMethod( 'canAddCardToWallet', { - 'params': { - 'cardLastFour': last4, - } + 'params': {'cardLastFour': last4}, }, ); return AddToWalletResult( canAddToWallet: result?['canAddCard'] as bool, - details: AddToWalletDetails.fromJson( - result?['details'], - ), + details: AddToWalletDetails.fromJson(result?['details']), ); } @@ -556,11 +588,10 @@ class MethodChannelStripe extends StripePlatform { required String clientSecret, CollectBankAccountTokenParams? params, }) async { - final result = await _methodChannel - .invokeMapMethod('collectBankAccountToken', { - 'clientSecret': clientSecret, - 'params': params?.toJson(), - }); + final result = await _methodChannel.invokeMapMethod( + 'collectBankAccountToken', + {'clientSecret': clientSecret, 'params': params?.toJson()}, + ); _financialConnectionsEventHandler = params?.onEvent; @@ -578,10 +609,9 @@ class MethodChannelStripe extends StripePlatform { const CollectFinancialConnectionsAccountsParams(), }) async { final result = await _methodChannel.invokeMapMethod( - 'collectFinancialConnectionsAccounts', { - 'clientSecret': clientSecret, - 'params': params?.toJson(), - }); + 'collectFinancialConnectionsAccounts', + {'clientSecret': clientSecret, 'params': params?.toJson()}, + ); _financialConnectionsEventHandler = params?.onEvent; @@ -623,11 +653,10 @@ class MethodChannelStripe extends StripePlatform { }; } - final result = await _methodChannel - .invokeMapMethod('createPlatformPayPaymentMethod', { - 'params': data, - 'usesDeprecatedTokenFlow': usesDeprecatedTokenFlow, - }); + final result = await _methodChannel.invokeMapMethod( + 'createPlatformPayPaymentMethod', + {'params': data, 'usesDeprecatedTokenFlow': usesDeprecatedTokenFlow}, + ); if (result!.containsKey('error')) { throw ResultParser(parseJson: (json) => {}).parseError(result); @@ -637,10 +666,12 @@ class MethodChannelStripe extends StripePlatform { } @override - Future updatePlatformSheet( - {required PlatformPaySheetUpdateParams params}) async { - await _methodChannel - .invokeMethod('updatePlatformPaySheet', {'params': params.toJson()}); + Future updatePlatformSheet({ + required PlatformPaySheetUpdateParams params, + }) async { + await _methodChannel.invokeMethod('updatePlatformPaySheet', { + 'params': params.toJson(), + }); } @override @@ -655,20 +686,21 @@ class MethodChannelStripe extends StripePlatform { @override Future intentCreationCallback( - IntentCreationCallbackParams params) async { - await _methodChannel.invokeMethod( - 'intentCreationCallback', - {'params': params.toJson()}, - ); + IntentCreationCallbackParams params, + ) async { + await _methodChannel.invokeMethod('intentCreationCallback', { + 'params': params.toJson(), + }); } @override Future canAddCardToWallet( - CanAddCardToWalletParams params) async { - final result = await _methodChannel - .invokeMapMethod('canAddCardToWallet', { - 'params': params.toJson(), - }); + CanAddCardToWalletParams params, + ) async { + final result = await _methodChannel.invokeMapMethod( + 'canAddCardToWallet', + {'params': params.toJson()}, + ); if (result!['error'] != null) { throw StripeException.fromJson(result); } @@ -678,10 +710,12 @@ class MethodChannelStripe extends StripePlatform { @override Future isCardInWallet(String cardLastFour) async { - final result = await _methodChannel - .invokeMapMethod('isCardInWallet', { - 'params': {'cardLastFour': cardLastFour}, - }); + final result = await _methodChannel.invokeMapMethod( + 'isCardInWallet', + { + 'params': {'cardLastFour': cardLastFour}, + }, + ); if (result!['error'] != null) { throw StripeException.fromJson(result); } @@ -694,11 +728,11 @@ class MethodChannelStripeFactory { const MethodChannelStripeFactory(); StripePlatform create() => MethodChannelStripe( - methodChannel: const MethodChannel( - 'flutter.stripe/payments', - JSONMethodCodec(), - ), - platformIsIos: Platform.isIOS, - platformIsAndroid: Platform.isAndroid, - ); + methodChannel: const MethodChannel( + 'flutter.stripe/payments', + JSONMethodCodec(), + ), + platformIsIos: Platform.isIOS, + platformIsAndroid: Platform.isAndroid, + ); } diff --git a/packages/stripe_platform_interface/lib/src/models/ach_params.dart b/packages/stripe_platform_interface/lib/src/models/ach_params.dart index e3c219a23..b350e7e35 100644 --- a/packages/stripe_platform_interface/lib/src/models/ach_params.dart +++ b/packages/stripe_platform_interface/lib/src/models/ach_params.dart @@ -5,10 +5,9 @@ part 'ach_params.freezed.dart'; part 'ach_params.g.dart'; @freezed - /// Parameters that provide additional information for collecting the bankaccount /// for ACH payment -class CollectBankAccountParams with _$CollectBankAccountParams { +abstract class CollectBankAccountParams with _$CollectBankAccountParams { @JsonSerializable(explicitToJson: true) const factory CollectBankAccountParams({ /// Billingdetails of the account holder @@ -38,10 +37,10 @@ class CollectBankAccountParams with _$CollectBankAccountParams { } @freezed - /// Parameters that provide additional information for collecting the bankaccount /// for ACH payment -class CollectBankAccountTokenParams with _$CollectBankAccountTokenParams { +abstract class CollectBankAccountTokenParams + with _$CollectBankAccountTokenParams { @JsonSerializable(explicitToJson: true) const factory CollectBankAccountTokenParams({ /// ios only. Style options for colors in Financial connections @@ -63,7 +62,7 @@ class CollectBankAccountTokenParams with _$CollectBankAccountTokenParams { /// Specific payment method data needed for collecting the bank account of /// an payment method @freezed -class CollectBankAccountPaymentMethodData +abstract class CollectBankAccountPaymentMethodData with _$CollectBankAccountPaymentMethodData { @JsonSerializable(explicitToJson: true) const factory CollectBankAccountPaymentMethodData({ @@ -71,16 +70,15 @@ class CollectBankAccountPaymentMethodData }) = _CollectBankAccountPaymentMethodData; factory CollectBankAccountPaymentMethodData.fromJson( - Map json) => - _$CollectBankAccountPaymentMethodDataFromJson(json); + Map json, + ) => _$CollectBankAccountPaymentMethodDataFromJson(json); } /// The type of payment intent used for collecting bank accoutn @freezed - /// Parameters that provide additional information for verifyting microdeposits -class VerifyMicroDepositsParams with _$VerifyMicroDepositsParams { +abstract class VerifyMicroDepositsParams with _$VerifyMicroDepositsParams { @JsonSerializable(explicitToJson: true) const factory VerifyMicroDepositsParams({ /// The amounts of the microdeposits that are deposited on the account. diff --git a/packages/stripe_platform_interface/lib/src/models/ach_params.freezed.dart b/packages/stripe_platform_interface/lib/src/models/ach_params.freezed.dart index b844c90bf..839ea4b0b 100644 --- a/packages/stripe_platform_interface/lib/src/models/ach_params.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/ach_params.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,916 +9,1169 @@ part of 'ach_params.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CollectBankAccountParams _$CollectBankAccountParamsFromJson( - Map json) { - return _CollectBankAccountParams.fromJson(json); -} - /// @nodoc mixin _$CollectBankAccountParams { - /// Billingdetails of the account holder - /// - /// It is required to fill in the name in the billing details - CollectBankAccountPaymentMethodData get paymentMethodData => - throw _privateConstructorUsedError; - - /// The paymentmethod type. At this point only method [PaymentMethodType.USBankAccount] - /// is supported. - PaymentMethodType get paymentMethodType => throw _privateConstructorUsedError; - - /// ios only. Style options for colors in Financial connections - /// - /// By default the bank account collector will automatically choose colors based on the - /// user's system settings. - UserInterfaceStyle? get userInterfaceStyle => - throw _privateConstructorUsedError; - - /// An optional event listener to receive [FinancialConnectionsEvent] for - /// specific events during the process of a user connecting their financial accounts. - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? get onEvent => - throw _privateConstructorUsedError; + +/// Billingdetails of the account holder +/// +/// It is required to fill in the name in the billing details + CollectBankAccountPaymentMethodData get paymentMethodData;/// The paymentmethod type. At this point only method [PaymentMethodType.USBankAccount] +/// is supported. + PaymentMethodType get paymentMethodType;/// ios only. Style options for colors in Financial connections +/// +/// By default the bank account collector will automatically choose colors based on the +/// user's system settings. + UserInterfaceStyle? get userInterfaceStyle;/// An optional event listener to receive [FinancialConnectionsEvent] for +/// specific events during the process of a user connecting their financial accounts. +@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? get onEvent; +/// Create a copy of CollectBankAccountParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CollectBankAccountParamsCopyWith get copyWith => _$CollectBankAccountParamsCopyWithImpl(this as CollectBankAccountParams, _$identity); /// Serializes this CollectBankAccountParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CollectBankAccountParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CollectBankAccountParamsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CollectBankAccountParams&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)&&(identical(other.paymentMethodType, paymentMethodType) || other.paymentMethodType == paymentMethodType)&&(identical(other.userInterfaceStyle, userInterfaceStyle) || other.userInterfaceStyle == userInterfaceStyle)&&(identical(other.onEvent, onEvent) || other.onEvent == onEvent)); } -/// @nodoc -abstract class $CollectBankAccountParamsCopyWith<$Res> { - factory $CollectBankAccountParamsCopyWith(CollectBankAccountParams value, - $Res Function(CollectBankAccountParams) then) = - _$CollectBankAccountParamsCopyWithImpl<$Res, CollectBankAccountParams>; - @useResult - $Res call( - {CollectBankAccountPaymentMethodData paymentMethodData, - PaymentMethodType paymentMethodType, - UserInterfaceStyle? userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? onEvent}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData,paymentMethodType,userInterfaceStyle,onEvent); - $CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData; +@override +String toString() { + return 'CollectBankAccountParams(paymentMethodData: $paymentMethodData, paymentMethodType: $paymentMethodType, userInterfaceStyle: $userInterfaceStyle, onEvent: $onEvent)'; } -/// @nodoc -class _$CollectBankAccountParamsCopyWithImpl<$Res, - $Val extends CollectBankAccountParams> - implements $CollectBankAccountParamsCopyWith<$Res> { - _$CollectBankAccountParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CollectBankAccountParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - Object? paymentMethodType = null, - Object? userInterfaceStyle = freezed, - Object? onEvent = freezed, - }) { - return _then(_value.copyWith( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as CollectBankAccountPaymentMethodData, - paymentMethodType: null == paymentMethodType - ? _value.paymentMethodType - : paymentMethodType // ignore: cast_nullable_to_non_nullable - as PaymentMethodType, - userInterfaceStyle: freezed == userInterfaceStyle - ? _value.userInterfaceStyle - : userInterfaceStyle // ignore: cast_nullable_to_non_nullable - as UserInterfaceStyle?, - onEvent: freezed == onEvent - ? _value.onEvent - : onEvent // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventHandler?, - ) as $Val); - } - - /// Create a copy of CollectBankAccountParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $CollectBankAccountPaymentMethodDataCopyWith<$Res>( - _value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$CollectBankAccountParamsImplCopyWith<$Res> +abstract mixin class $CollectBankAccountParamsCopyWith<$Res> { + factory $CollectBankAccountParamsCopyWith(CollectBankAccountParams value, $Res Function(CollectBankAccountParams) _then) = _$CollectBankAccountParamsCopyWithImpl; +@useResult +$Res call({ + CollectBankAccountPaymentMethodData paymentMethodData, PaymentMethodType paymentMethodType, UserInterfaceStyle? userInterfaceStyle,@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent +}); + + +$CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class _$CollectBankAccountParamsCopyWithImpl<$Res> implements $CollectBankAccountParamsCopyWith<$Res> { - factory _$$CollectBankAccountParamsImplCopyWith( - _$CollectBankAccountParamsImpl value, - $Res Function(_$CollectBankAccountParamsImpl) then) = - __$$CollectBankAccountParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {CollectBankAccountPaymentMethodData paymentMethodData, - PaymentMethodType paymentMethodType, - UserInterfaceStyle? userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? onEvent}); - - @override - $CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData; + _$CollectBankAccountParamsCopyWithImpl(this._self, this._then); + + final CollectBankAccountParams _self; + final $Res Function(CollectBankAccountParams) _then; + +/// Create a copy of CollectBankAccountParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethodData = null,Object? paymentMethodType = null,Object? userInterfaceStyle = freezed,Object? onEvent = freezed,}) { + return _then(_self.copyWith( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as CollectBankAccountPaymentMethodData,paymentMethodType: null == paymentMethodType ? _self.paymentMethodType : paymentMethodType // ignore: cast_nullable_to_non_nullable +as PaymentMethodType,userInterfaceStyle: freezed == userInterfaceStyle ? _self.userInterfaceStyle : userInterfaceStyle // ignore: cast_nullable_to_non_nullable +as UserInterfaceStyle?,onEvent: freezed == onEvent ? _self.onEvent : onEvent // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventHandler?, + )); +} +/// Create a copy of CollectBankAccountParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $CollectBankAccountPaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [CollectBankAccountParams]. +extension CollectBankAccountParamsPatterns on CollectBankAccountParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CollectBankAccountParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CollectBankAccountParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CollectBankAccountParams value) $default,){ +final _that = this; +switch (_that) { +case _CollectBankAccountParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CollectBankAccountParams value)? $default,){ +final _that = this; +switch (_that) { +case _CollectBankAccountParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( CollectBankAccountPaymentMethodData paymentMethodData, PaymentMethodType paymentMethodType, UserInterfaceStyle? userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CollectBankAccountParams() when $default != null: +return $default(_that.paymentMethodData,_that.paymentMethodType,_that.userInterfaceStyle,_that.onEvent);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( CollectBankAccountPaymentMethodData paymentMethodData, PaymentMethodType paymentMethodType, UserInterfaceStyle? userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent) $default,) {final _that = this; +switch (_that) { +case _CollectBankAccountParams(): +return $default(_that.paymentMethodData,_that.paymentMethodType,_that.userInterfaceStyle,_that.onEvent);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( CollectBankAccountPaymentMethodData paymentMethodData, PaymentMethodType paymentMethodType, UserInterfaceStyle? userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent)? $default,) {final _that = this; +switch (_that) { +case _CollectBankAccountParams() when $default != null: +return $default(_that.paymentMethodData,_that.paymentMethodType,_that.userInterfaceStyle,_that.onEvent);case _: + return null; + +} } -/// @nodoc -class __$$CollectBankAccountParamsImplCopyWithImpl<$Res> - extends _$CollectBankAccountParamsCopyWithImpl<$Res, - _$CollectBankAccountParamsImpl> - implements _$$CollectBankAccountParamsImplCopyWith<$Res> { - __$$CollectBankAccountParamsImplCopyWithImpl( - _$CollectBankAccountParamsImpl _value, - $Res Function(_$CollectBankAccountParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CollectBankAccountParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - Object? paymentMethodType = null, - Object? userInterfaceStyle = freezed, - Object? onEvent = freezed, - }) { - return _then(_$CollectBankAccountParamsImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as CollectBankAccountPaymentMethodData, - paymentMethodType: null == paymentMethodType - ? _value.paymentMethodType - : paymentMethodType // ignore: cast_nullable_to_non_nullable - as PaymentMethodType, - userInterfaceStyle: freezed == userInterfaceStyle - ? _value.userInterfaceStyle - : userInterfaceStyle // ignore: cast_nullable_to_non_nullable - as UserInterfaceStyle?, - onEvent: freezed == onEvent - ? _value.onEvent - : onEvent // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventHandler?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CollectBankAccountParamsImpl implements _CollectBankAccountParams { - const _$CollectBankAccountParamsImpl( - {required this.paymentMethodData, - this.paymentMethodType = PaymentMethodType.USBankAccount, - this.userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) this.onEvent}); - - factory _$CollectBankAccountParamsImpl.fromJson(Map json) => - _$$CollectBankAccountParamsImplFromJson(json); - - /// Billingdetails of the account holder - /// - /// It is required to fill in the name in the billing details - @override - final CollectBankAccountPaymentMethodData paymentMethodData; - - /// The paymentmethod type. At this point only method [PaymentMethodType.USBankAccount] - /// is supported. - @override - @JsonKey() - final PaymentMethodType paymentMethodType; - - /// ios only. Style options for colors in Financial connections - /// - /// By default the bank account collector will automatically choose colors based on the - /// user's system settings. - @override - final UserInterfaceStyle? userInterfaceStyle; - - /// An optional event listener to receive [FinancialConnectionsEvent] for - /// specific events during the process of a user connecting their financial accounts. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - final FinancialConnectionsEventHandler? onEvent; - - @override - String toString() { - return 'CollectBankAccountParams(paymentMethodData: $paymentMethodData, paymentMethodType: $paymentMethodType, userInterfaceStyle: $userInterfaceStyle, onEvent: $onEvent)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CollectBankAccountParamsImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData) && - (identical(other.paymentMethodType, paymentMethodType) || - other.paymentMethodType == paymentMethodType) && - (identical(other.userInterfaceStyle, userInterfaceStyle) || - other.userInterfaceStyle == userInterfaceStyle) && - (identical(other.onEvent, onEvent) || other.onEvent == onEvent)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData, - paymentMethodType, userInterfaceStyle, onEvent); - - /// Create a copy of CollectBankAccountParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CollectBankAccountParamsImplCopyWith<_$CollectBankAccountParamsImpl> - get copyWith => __$$CollectBankAccountParamsImplCopyWithImpl< - _$CollectBankAccountParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CollectBankAccountParamsImplToJson( - this, - ); - } -} - -abstract class _CollectBankAccountParams implements CollectBankAccountParams { - const factory _CollectBankAccountParams( - {required final CollectBankAccountPaymentMethodData paymentMethodData, - final PaymentMethodType paymentMethodType, - final UserInterfaceStyle? userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) - final FinancialConnectionsEventHandler? onEvent}) = - _$CollectBankAccountParamsImpl; - - factory _CollectBankAccountParams.fromJson(Map json) = - _$CollectBankAccountParamsImpl.fromJson; - - /// Billingdetails of the account holder - /// - /// It is required to fill in the name in the billing details - @override - CollectBankAccountPaymentMethodData get paymentMethodData; - - /// The paymentmethod type. At this point only method [PaymentMethodType.USBankAccount] - /// is supported. - @override - PaymentMethodType get paymentMethodType; - - /// ios only. Style options for colors in Financial connections - /// - /// By default the bank account collector will automatically choose colors based on the - /// user's system settings. - @override - UserInterfaceStyle? get userInterfaceStyle; - - /// An optional event listener to receive [FinancialConnectionsEvent] for - /// specific events during the process of a user connecting their financial accounts. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? get onEvent; - - /// Create a copy of CollectBankAccountParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CollectBankAccountParamsImplCopyWith<_$CollectBankAccountParamsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CollectBankAccountTokenParams _$CollectBankAccountTokenParamsFromJson( - Map json) { - return _CollectBankAccountTokenParams.fromJson(json); +class _CollectBankAccountParams implements CollectBankAccountParams { + const _CollectBankAccountParams({required this.paymentMethodData, this.paymentMethodType = PaymentMethodType.USBankAccount, this.userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) this.onEvent}); + factory _CollectBankAccountParams.fromJson(Map json) => _$CollectBankAccountParamsFromJson(json); + +/// Billingdetails of the account holder +/// +/// It is required to fill in the name in the billing details +@override final CollectBankAccountPaymentMethodData paymentMethodData; +/// The paymentmethod type. At this point only method [PaymentMethodType.USBankAccount] +/// is supported. +@override@JsonKey() final PaymentMethodType paymentMethodType; +/// ios only. Style options for colors in Financial connections +/// +/// By default the bank account collector will automatically choose colors based on the +/// user's system settings. +@override final UserInterfaceStyle? userInterfaceStyle; +/// An optional event listener to receive [FinancialConnectionsEvent] for +/// specific events during the process of a user connecting their financial accounts. +@override@JsonKey(includeFromJson: false, includeToJson: false) final FinancialConnectionsEventHandler? onEvent; + +/// Create a copy of CollectBankAccountParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CollectBankAccountParamsCopyWith<_CollectBankAccountParams> get copyWith => __$CollectBankAccountParamsCopyWithImpl<_CollectBankAccountParams>(this, _$identity); + +@override +Map toJson() { + return _$CollectBankAccountParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CollectBankAccountParams&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)&&(identical(other.paymentMethodType, paymentMethodType) || other.paymentMethodType == paymentMethodType)&&(identical(other.userInterfaceStyle, userInterfaceStyle) || other.userInterfaceStyle == userInterfaceStyle)&&(identical(other.onEvent, onEvent) || other.onEvent == onEvent)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData,paymentMethodType,userInterfaceStyle,onEvent); + +@override +String toString() { + return 'CollectBankAccountParams(paymentMethodData: $paymentMethodData, paymentMethodType: $paymentMethodType, userInterfaceStyle: $userInterfaceStyle, onEvent: $onEvent)'; +} + + +} + +/// @nodoc +abstract mixin class _$CollectBankAccountParamsCopyWith<$Res> implements $CollectBankAccountParamsCopyWith<$Res> { + factory _$CollectBankAccountParamsCopyWith(_CollectBankAccountParams value, $Res Function(_CollectBankAccountParams) _then) = __$CollectBankAccountParamsCopyWithImpl; +@override @useResult +$Res call({ + CollectBankAccountPaymentMethodData paymentMethodData, PaymentMethodType paymentMethodType, UserInterfaceStyle? userInterfaceStyle,@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent +}); + + +@override $CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$CollectBankAccountParamsCopyWithImpl<$Res> + implements _$CollectBankAccountParamsCopyWith<$Res> { + __$CollectBankAccountParamsCopyWithImpl(this._self, this._then); + + final _CollectBankAccountParams _self; + final $Res Function(_CollectBankAccountParams) _then; + +/// Create a copy of CollectBankAccountParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,Object? paymentMethodType = null,Object? userInterfaceStyle = freezed,Object? onEvent = freezed,}) { + return _then(_CollectBankAccountParams( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as CollectBankAccountPaymentMethodData,paymentMethodType: null == paymentMethodType ? _self.paymentMethodType : paymentMethodType // ignore: cast_nullable_to_non_nullable +as PaymentMethodType,userInterfaceStyle: freezed == userInterfaceStyle ? _self.userInterfaceStyle : userInterfaceStyle // ignore: cast_nullable_to_non_nullable +as UserInterfaceStyle?,onEvent: freezed == onEvent ? _self.onEvent : onEvent // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventHandler?, + )); +} + +/// Create a copy of CollectBankAccountParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CollectBankAccountPaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $CollectBankAccountPaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } + /// @nodoc mixin _$CollectBankAccountTokenParams { - /// ios only. Style options for colors in Financial connections - /// - /// By default the bank account collector will automatically choose colors based on the - /// user's system settings. - UserInterfaceStyle? get userInterfaceStyle => - throw _privateConstructorUsedError; - - /// An optional event listener to receive [FinancialConnectionsEvent] for - /// specific events during the process of a user connecting their financial accounts. - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? get onEvent => - throw _privateConstructorUsedError; + +/// ios only. Style options for colors in Financial connections +/// +/// By default the bank account collector will automatically choose colors based on the +/// user's system settings. + UserInterfaceStyle? get userInterfaceStyle;/// An optional event listener to receive [FinancialConnectionsEvent] for +/// specific events during the process of a user connecting their financial accounts. +@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? get onEvent; +/// Create a copy of CollectBankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CollectBankAccountTokenParamsCopyWith get copyWith => _$CollectBankAccountTokenParamsCopyWithImpl(this as CollectBankAccountTokenParams, _$identity); /// Serializes this CollectBankAccountTokenParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CollectBankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CollectBankAccountTokenParamsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CollectBankAccountTokenParams&&(identical(other.userInterfaceStyle, userInterfaceStyle) || other.userInterfaceStyle == userInterfaceStyle)&&(identical(other.onEvent, onEvent) || other.onEvent == onEvent)); } -/// @nodoc -abstract class $CollectBankAccountTokenParamsCopyWith<$Res> { - factory $CollectBankAccountTokenParamsCopyWith( - CollectBankAccountTokenParams value, - $Res Function(CollectBankAccountTokenParams) then) = - _$CollectBankAccountTokenParamsCopyWithImpl<$Res, - CollectBankAccountTokenParams>; - @useResult - $Res call( - {UserInterfaceStyle? userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? onEvent}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,userInterfaceStyle,onEvent); + +@override +String toString() { + return 'CollectBankAccountTokenParams(userInterfaceStyle: $userInterfaceStyle, onEvent: $onEvent)'; } -/// @nodoc -class _$CollectBankAccountTokenParamsCopyWithImpl<$Res, - $Val extends CollectBankAccountTokenParams> - implements $CollectBankAccountTokenParamsCopyWith<$Res> { - _$CollectBankAccountTokenParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CollectBankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? userInterfaceStyle = freezed, - Object? onEvent = freezed, - }) { - return _then(_value.copyWith( - userInterfaceStyle: freezed == userInterfaceStyle - ? _value.userInterfaceStyle - : userInterfaceStyle // ignore: cast_nullable_to_non_nullable - as UserInterfaceStyle?, - onEvent: freezed == onEvent - ? _value.onEvent - : onEvent // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventHandler?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CollectBankAccountTokenParamsImplCopyWith<$Res> +abstract mixin class $CollectBankAccountTokenParamsCopyWith<$Res> { + factory $CollectBankAccountTokenParamsCopyWith(CollectBankAccountTokenParams value, $Res Function(CollectBankAccountTokenParams) _then) = _$CollectBankAccountTokenParamsCopyWithImpl; +@useResult +$Res call({ + UserInterfaceStyle? userInterfaceStyle,@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent +}); + + + + +} +/// @nodoc +class _$CollectBankAccountTokenParamsCopyWithImpl<$Res> implements $CollectBankAccountTokenParamsCopyWith<$Res> { - factory _$$CollectBankAccountTokenParamsImplCopyWith( - _$CollectBankAccountTokenParamsImpl value, - $Res Function(_$CollectBankAccountTokenParamsImpl) then) = - __$$CollectBankAccountTokenParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {UserInterfaceStyle? userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? onEvent}); + _$CollectBankAccountTokenParamsCopyWithImpl(this._self, this._then); + + final CollectBankAccountTokenParams _self; + final $Res Function(CollectBankAccountTokenParams) _then; + +/// Create a copy of CollectBankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? userInterfaceStyle = freezed,Object? onEvent = freezed,}) { + return _then(_self.copyWith( +userInterfaceStyle: freezed == userInterfaceStyle ? _self.userInterfaceStyle : userInterfaceStyle // ignore: cast_nullable_to_non_nullable +as UserInterfaceStyle?,onEvent: freezed == onEvent ? _self.onEvent : onEvent // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventHandler?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CollectBankAccountTokenParams]. +extension CollectBankAccountTokenParamsPatterns on CollectBankAccountTokenParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CollectBankAccountTokenParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CollectBankAccountTokenParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CollectBankAccountTokenParams value) $default,){ +final _that = this; +switch (_that) { +case _CollectBankAccountTokenParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CollectBankAccountTokenParams value)? $default,){ +final _that = this; +switch (_that) { +case _CollectBankAccountTokenParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( UserInterfaceStyle? userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CollectBankAccountTokenParams() when $default != null: +return $default(_that.userInterfaceStyle,_that.onEvent);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( UserInterfaceStyle? userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent) $default,) {final _that = this; +switch (_that) { +case _CollectBankAccountTokenParams(): +return $default(_that.userInterfaceStyle,_that.onEvent);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( UserInterfaceStyle? userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent)? $default,) {final _that = this; +switch (_that) { +case _CollectBankAccountTokenParams() when $default != null: +return $default(_that.userInterfaceStyle,_that.onEvent);case _: + return null; + +} } -/// @nodoc -class __$$CollectBankAccountTokenParamsImplCopyWithImpl<$Res> - extends _$CollectBankAccountTokenParamsCopyWithImpl<$Res, - _$CollectBankAccountTokenParamsImpl> - implements _$$CollectBankAccountTokenParamsImplCopyWith<$Res> { - __$$CollectBankAccountTokenParamsImplCopyWithImpl( - _$CollectBankAccountTokenParamsImpl _value, - $Res Function(_$CollectBankAccountTokenParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CollectBankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? userInterfaceStyle = freezed, - Object? onEvent = freezed, - }) { - return _then(_$CollectBankAccountTokenParamsImpl( - userInterfaceStyle: freezed == userInterfaceStyle - ? _value.userInterfaceStyle - : userInterfaceStyle // ignore: cast_nullable_to_non_nullable - as UserInterfaceStyle?, - onEvent: freezed == onEvent - ? _value.onEvent - : onEvent // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventHandler?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CollectBankAccountTokenParamsImpl - implements _CollectBankAccountTokenParams { - const _$CollectBankAccountTokenParamsImpl( - {this.userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) this.onEvent}); - - factory _$CollectBankAccountTokenParamsImpl.fromJson( - Map json) => - _$$CollectBankAccountTokenParamsImplFromJson(json); - - /// ios only. Style options for colors in Financial connections - /// - /// By default the bank account collector will automatically choose colors based on the - /// user's system settings. - @override - final UserInterfaceStyle? userInterfaceStyle; - - /// An optional event listener to receive [FinancialConnectionsEvent] for - /// specific events during the process of a user connecting their financial accounts. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - final FinancialConnectionsEventHandler? onEvent; - - @override - String toString() { - return 'CollectBankAccountTokenParams(userInterfaceStyle: $userInterfaceStyle, onEvent: $onEvent)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CollectBankAccountTokenParamsImpl && - (identical(other.userInterfaceStyle, userInterfaceStyle) || - other.userInterfaceStyle == userInterfaceStyle) && - (identical(other.onEvent, onEvent) || other.onEvent == onEvent)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, userInterfaceStyle, onEvent); - - /// Create a copy of CollectBankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CollectBankAccountTokenParamsImplCopyWith< - _$CollectBankAccountTokenParamsImpl> - get copyWith => __$$CollectBankAccountTokenParamsImplCopyWithImpl< - _$CollectBankAccountTokenParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CollectBankAccountTokenParamsImplToJson( - this, - ); - } -} - -abstract class _CollectBankAccountTokenParams - implements CollectBankAccountTokenParams { - const factory _CollectBankAccountTokenParams( - {final UserInterfaceStyle? userInterfaceStyle, - @JsonKey(includeFromJson: false, includeToJson: false) - final FinancialConnectionsEventHandler? onEvent}) = - _$CollectBankAccountTokenParamsImpl; - - factory _CollectBankAccountTokenParams.fromJson(Map json) = - _$CollectBankAccountTokenParamsImpl.fromJson; - - /// ios only. Style options for colors in Financial connections - /// - /// By default the bank account collector will automatically choose colors based on the - /// user's system settings. - @override - UserInterfaceStyle? get userInterfaceStyle; - - /// An optional event listener to receive [FinancialConnectionsEvent] for - /// specific events during the process of a user connecting their financial accounts. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? get onEvent; - - /// Create a copy of CollectBankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CollectBankAccountTokenParamsImplCopyWith< - _$CollectBankAccountTokenParamsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CollectBankAccountPaymentMethodData - _$CollectBankAccountPaymentMethodDataFromJson(Map json) { - return _CollectBankAccountPaymentMethodData.fromJson(json); +class _CollectBankAccountTokenParams implements CollectBankAccountTokenParams { + const _CollectBankAccountTokenParams({this.userInterfaceStyle, @JsonKey(includeFromJson: false, includeToJson: false) this.onEvent}); + factory _CollectBankAccountTokenParams.fromJson(Map json) => _$CollectBankAccountTokenParamsFromJson(json); + +/// ios only. Style options for colors in Financial connections +/// +/// By default the bank account collector will automatically choose colors based on the +/// user's system settings. +@override final UserInterfaceStyle? userInterfaceStyle; +/// An optional event listener to receive [FinancialConnectionsEvent] for +/// specific events during the process of a user connecting their financial accounts. +@override@JsonKey(includeFromJson: false, includeToJson: false) final FinancialConnectionsEventHandler? onEvent; + +/// Create a copy of CollectBankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CollectBankAccountTokenParamsCopyWith<_CollectBankAccountTokenParams> get copyWith => __$CollectBankAccountTokenParamsCopyWithImpl<_CollectBankAccountTokenParams>(this, _$identity); + +@override +Map toJson() { + return _$CollectBankAccountTokenParamsToJson(this, ); } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CollectBankAccountTokenParams&&(identical(other.userInterfaceStyle, userInterfaceStyle) || other.userInterfaceStyle == userInterfaceStyle)&&(identical(other.onEvent, onEvent) || other.onEvent == onEvent)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,userInterfaceStyle,onEvent); + +@override +String toString() { + return 'CollectBankAccountTokenParams(userInterfaceStyle: $userInterfaceStyle, onEvent: $onEvent)'; +} + + +} + +/// @nodoc +abstract mixin class _$CollectBankAccountTokenParamsCopyWith<$Res> implements $CollectBankAccountTokenParamsCopyWith<$Res> { + factory _$CollectBankAccountTokenParamsCopyWith(_CollectBankAccountTokenParams value, $Res Function(_CollectBankAccountTokenParams) _then) = __$CollectBankAccountTokenParamsCopyWithImpl; +@override @useResult +$Res call({ + UserInterfaceStyle? userInterfaceStyle,@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent +}); + + + + +} +/// @nodoc +class __$CollectBankAccountTokenParamsCopyWithImpl<$Res> + implements _$CollectBankAccountTokenParamsCopyWith<$Res> { + __$CollectBankAccountTokenParamsCopyWithImpl(this._self, this._then); + + final _CollectBankAccountTokenParams _self; + final $Res Function(_CollectBankAccountTokenParams) _then; + +/// Create a copy of CollectBankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? userInterfaceStyle = freezed,Object? onEvent = freezed,}) { + return _then(_CollectBankAccountTokenParams( +userInterfaceStyle: freezed == userInterfaceStyle ? _self.userInterfaceStyle : userInterfaceStyle // ignore: cast_nullable_to_non_nullable +as UserInterfaceStyle?,onEvent: freezed == onEvent ? _self.onEvent : onEvent // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventHandler?, + )); +} + + +} + + /// @nodoc mixin _$CollectBankAccountPaymentMethodData { - BillingDetails get billingDetails => throw _privateConstructorUsedError; + + BillingDetails get billingDetails; +/// Create a copy of CollectBankAccountPaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CollectBankAccountPaymentMethodDataCopyWith get copyWith => _$CollectBankAccountPaymentMethodDataCopyWithImpl(this as CollectBankAccountPaymentMethodData, _$identity); /// Serializes this CollectBankAccountPaymentMethodData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CollectBankAccountPaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CollectBankAccountPaymentMethodDataCopyWith< - CollectBankAccountPaymentMethodData> - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CollectBankAccountPaymentMethodData&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); } -/// @nodoc -abstract class $CollectBankAccountPaymentMethodDataCopyWith<$Res> { - factory $CollectBankAccountPaymentMethodDataCopyWith( - CollectBankAccountPaymentMethodData value, - $Res Function(CollectBankAccountPaymentMethodData) then) = - _$CollectBankAccountPaymentMethodDataCopyWithImpl<$Res, - CollectBankAccountPaymentMethodData>; - @useResult - $Res call({BillingDetails billingDetails}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails); - $BillingDetailsCopyWith<$Res> get billingDetails; +@override +String toString() { + return 'CollectBankAccountPaymentMethodData(billingDetails: $billingDetails)'; } -/// @nodoc -class _$CollectBankAccountPaymentMethodDataCopyWithImpl<$Res, - $Val extends CollectBankAccountPaymentMethodData> - implements $CollectBankAccountPaymentMethodDataCopyWith<$Res> { - _$CollectBankAccountPaymentMethodDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CollectBankAccountPaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - }) { - return _then(_value.copyWith( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - ) as $Val); - } - - /// Create a copy of CollectBankAccountPaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res> get billingDetails { - return $BillingDetailsCopyWith<$Res>(_value.billingDetails, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$CollectBankAccountPaymentMethodDataImplCopyWith<$Res> +abstract mixin class $CollectBankAccountPaymentMethodDataCopyWith<$Res> { + factory $CollectBankAccountPaymentMethodDataCopyWith(CollectBankAccountPaymentMethodData value, $Res Function(CollectBankAccountPaymentMethodData) _then) = _$CollectBankAccountPaymentMethodDataCopyWithImpl; +@useResult +$Res call({ + BillingDetails billingDetails +}); + + +$BillingDetailsCopyWith<$Res> get billingDetails; + +} +/// @nodoc +class _$CollectBankAccountPaymentMethodDataCopyWithImpl<$Res> implements $CollectBankAccountPaymentMethodDataCopyWith<$Res> { - factory _$$CollectBankAccountPaymentMethodDataImplCopyWith( - _$CollectBankAccountPaymentMethodDataImpl value, - $Res Function(_$CollectBankAccountPaymentMethodDataImpl) then) = - __$$CollectBankAccountPaymentMethodDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({BillingDetails billingDetails}); + _$CollectBankAccountPaymentMethodDataCopyWithImpl(this._self, this._then); + + final CollectBankAccountPaymentMethodData _self; + final $Res Function(CollectBankAccountPaymentMethodData) _then; + +/// Create a copy of CollectBankAccountPaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = null,}) { + return _then(_self.copyWith( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails, + )); +} +/// Create a copy of CollectBankAccountPaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} +} + - @override - $BillingDetailsCopyWith<$Res> get billingDetails; +/// Adds pattern-matching-related methods to [CollectBankAccountPaymentMethodData]. +extension CollectBankAccountPaymentMethodDataPatterns on CollectBankAccountPaymentMethodData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CollectBankAccountPaymentMethodData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CollectBankAccountPaymentMethodData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CollectBankAccountPaymentMethodData value) $default,){ +final _that = this; +switch (_that) { +case _CollectBankAccountPaymentMethodData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CollectBankAccountPaymentMethodData value)? $default,){ +final _that = this; +switch (_that) { +case _CollectBankAccountPaymentMethodData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BillingDetails billingDetails)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CollectBankAccountPaymentMethodData() when $default != null: +return $default(_that.billingDetails);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BillingDetails billingDetails) $default,) {final _that = this; +switch (_that) { +case _CollectBankAccountPaymentMethodData(): +return $default(_that.billingDetails);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BillingDetails billingDetails)? $default,) {final _that = this; +switch (_that) { +case _CollectBankAccountPaymentMethodData() when $default != null: +return $default(_that.billingDetails);case _: + return null; + +} } -/// @nodoc -class __$$CollectBankAccountPaymentMethodDataImplCopyWithImpl<$Res> - extends _$CollectBankAccountPaymentMethodDataCopyWithImpl<$Res, - _$CollectBankAccountPaymentMethodDataImpl> - implements _$$CollectBankAccountPaymentMethodDataImplCopyWith<$Res> { - __$$CollectBankAccountPaymentMethodDataImplCopyWithImpl( - _$CollectBankAccountPaymentMethodDataImpl _value, - $Res Function(_$CollectBankAccountPaymentMethodDataImpl) _then) - : super(_value, _then); - - /// Create a copy of CollectBankAccountPaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - }) { - return _then(_$CollectBankAccountPaymentMethodDataImpl( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CollectBankAccountPaymentMethodDataImpl - implements _CollectBankAccountPaymentMethodData { - const _$CollectBankAccountPaymentMethodDataImpl( - {required this.billingDetails}); - - factory _$CollectBankAccountPaymentMethodDataImpl.fromJson( - Map json) => - _$$CollectBankAccountPaymentMethodDataImplFromJson(json); - - @override - final BillingDetails billingDetails; - - @override - String toString() { - return 'CollectBankAccountPaymentMethodData(billingDetails: $billingDetails)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CollectBankAccountPaymentMethodDataImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails); - - /// Create a copy of CollectBankAccountPaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CollectBankAccountPaymentMethodDataImplCopyWith< - _$CollectBankAccountPaymentMethodDataImpl> - get copyWith => __$$CollectBankAccountPaymentMethodDataImplCopyWithImpl< - _$CollectBankAccountPaymentMethodDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CollectBankAccountPaymentMethodDataImplToJson( - this, - ); - } -} - -abstract class _CollectBankAccountPaymentMethodData - implements CollectBankAccountPaymentMethodData { - const factory _CollectBankAccountPaymentMethodData( - {required final BillingDetails billingDetails}) = - _$CollectBankAccountPaymentMethodDataImpl; - - factory _CollectBankAccountPaymentMethodData.fromJson( - Map json) = - _$CollectBankAccountPaymentMethodDataImpl.fromJson; - - @override - BillingDetails get billingDetails; - - /// Create a copy of CollectBankAccountPaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CollectBankAccountPaymentMethodDataImplCopyWith< - _$CollectBankAccountPaymentMethodDataImpl> - get copyWith => throw _privateConstructorUsedError; -} - -VerifyMicroDepositsParams _$VerifyMicroDepositsParamsFromJson( - Map json) { - return _VerifyMicroDepositsParams.fromJson(json); +class _CollectBankAccountPaymentMethodData implements CollectBankAccountPaymentMethodData { + const _CollectBankAccountPaymentMethodData({required this.billingDetails}); + factory _CollectBankAccountPaymentMethodData.fromJson(Map json) => _$CollectBankAccountPaymentMethodDataFromJson(json); + +@override final BillingDetails billingDetails; + +/// Create a copy of CollectBankAccountPaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CollectBankAccountPaymentMethodDataCopyWith<_CollectBankAccountPaymentMethodData> get copyWith => __$CollectBankAccountPaymentMethodDataCopyWithImpl<_CollectBankAccountPaymentMethodData>(this, _$identity); + +@override +Map toJson() { + return _$CollectBankAccountPaymentMethodDataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CollectBankAccountPaymentMethodData&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails); + +@override +String toString() { + return 'CollectBankAccountPaymentMethodData(billingDetails: $billingDetails)'; +} + + } +/// @nodoc +abstract mixin class _$CollectBankAccountPaymentMethodDataCopyWith<$Res> implements $CollectBankAccountPaymentMethodDataCopyWith<$Res> { + factory _$CollectBankAccountPaymentMethodDataCopyWith(_CollectBankAccountPaymentMethodData value, $Res Function(_CollectBankAccountPaymentMethodData) _then) = __$CollectBankAccountPaymentMethodDataCopyWithImpl; +@override @useResult +$Res call({ + BillingDetails billingDetails +}); + + +@override $BillingDetailsCopyWith<$Res> get billingDetails; + +} +/// @nodoc +class __$CollectBankAccountPaymentMethodDataCopyWithImpl<$Res> + implements _$CollectBankAccountPaymentMethodDataCopyWith<$Res> { + __$CollectBankAccountPaymentMethodDataCopyWithImpl(this._self, this._then); + + final _CollectBankAccountPaymentMethodData _self; + final $Res Function(_CollectBankAccountPaymentMethodData) _then; + +/// Create a copy of CollectBankAccountPaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = null,}) { + return _then(_CollectBankAccountPaymentMethodData( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails, + )); +} + +/// Create a copy of CollectBankAccountPaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +} +} + + /// @nodoc mixin _$VerifyMicroDepositsParams { - /// The amounts of the microdeposits that are deposited on the account. - /// - /// Make sure that the amount is exactly 2. When using this field make sure - /// [descriptorCode] is `null`. - List? get amounts => throw _privateConstructorUsedError; - /// The descriptor code that is part of the microdepot to the customer bank account. - /// - /// When Using this field make sure [amounts] is `null`. - String? get descriptorCode => throw _privateConstructorUsedError; +/// The amounts of the microdeposits that are deposited on the account. +/// +/// Make sure that the amount is exactly 2. When using this field make sure +/// [descriptorCode] is `null`. + List? get amounts;/// The descriptor code that is part of the microdepot to the customer bank account. +/// +/// When Using this field make sure [amounts] is `null`. + String? get descriptorCode; +/// Create a copy of VerifyMicroDepositsParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$VerifyMicroDepositsParamsCopyWith get copyWith => _$VerifyMicroDepositsParamsCopyWithImpl(this as VerifyMicroDepositsParams, _$identity); /// Serializes this VerifyMicroDepositsParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of VerifyMicroDepositsParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $VerifyMicroDepositsParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is VerifyMicroDepositsParams&&const DeepCollectionEquality().equals(other.amounts, amounts)&&(identical(other.descriptorCode, descriptorCode) || other.descriptorCode == descriptorCode)); } -/// @nodoc -abstract class $VerifyMicroDepositsParamsCopyWith<$Res> { - factory $VerifyMicroDepositsParamsCopyWith(VerifyMicroDepositsParams value, - $Res Function(VerifyMicroDepositsParams) then) = - _$VerifyMicroDepositsParamsCopyWithImpl<$Res, VerifyMicroDepositsParams>; - @useResult - $Res call({List? amounts, String? descriptorCode}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(amounts),descriptorCode); + +@override +String toString() { + return 'VerifyMicroDepositsParams(amounts: $amounts, descriptorCode: $descriptorCode)'; } -/// @nodoc -class _$VerifyMicroDepositsParamsCopyWithImpl<$Res, - $Val extends VerifyMicroDepositsParams> - implements $VerifyMicroDepositsParamsCopyWith<$Res> { - _$VerifyMicroDepositsParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of VerifyMicroDepositsParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amounts = freezed, - Object? descriptorCode = freezed, - }) { - return _then(_value.copyWith( - amounts: freezed == amounts - ? _value.amounts - : amounts // ignore: cast_nullable_to_non_nullable - as List?, - descriptorCode: freezed == descriptorCode - ? _value.descriptorCode - : descriptorCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$VerifyMicroDepositsParamsImplCopyWith<$Res> +abstract mixin class $VerifyMicroDepositsParamsCopyWith<$Res> { + factory $VerifyMicroDepositsParamsCopyWith(VerifyMicroDepositsParams value, $Res Function(VerifyMicroDepositsParams) _then) = _$VerifyMicroDepositsParamsCopyWithImpl; +@useResult +$Res call({ + List? amounts, String? descriptorCode +}); + + + + +} +/// @nodoc +class _$VerifyMicroDepositsParamsCopyWithImpl<$Res> implements $VerifyMicroDepositsParamsCopyWith<$Res> { - factory _$$VerifyMicroDepositsParamsImplCopyWith( - _$VerifyMicroDepositsParamsImpl value, - $Res Function(_$VerifyMicroDepositsParamsImpl) then) = - __$$VerifyMicroDepositsParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({List? amounts, String? descriptorCode}); + _$VerifyMicroDepositsParamsCopyWithImpl(this._self, this._then); + + final VerifyMicroDepositsParams _self; + final $Res Function(VerifyMicroDepositsParams) _then; + +/// Create a copy of VerifyMicroDepositsParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? amounts = freezed,Object? descriptorCode = freezed,}) { + return _then(_self.copyWith( +amounts: freezed == amounts ? _self.amounts : amounts // ignore: cast_nullable_to_non_nullable +as List?,descriptorCode: freezed == descriptorCode ? _self.descriptorCode : descriptorCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [VerifyMicroDepositsParams]. +extension VerifyMicroDepositsParamsPatterns on VerifyMicroDepositsParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _VerifyMicroDepositsParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _VerifyMicroDepositsParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _VerifyMicroDepositsParams value) $default,){ +final _that = this; +switch (_that) { +case _VerifyMicroDepositsParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _VerifyMicroDepositsParams value)? $default,){ +final _that = this; +switch (_that) { +case _VerifyMicroDepositsParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( List? amounts, String? descriptorCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _VerifyMicroDepositsParams() when $default != null: +return $default(_that.amounts,_that.descriptorCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( List? amounts, String? descriptorCode) $default,) {final _that = this; +switch (_that) { +case _VerifyMicroDepositsParams(): +return $default(_that.amounts,_that.descriptorCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( List? amounts, String? descriptorCode)? $default,) {final _that = this; +switch (_that) { +case _VerifyMicroDepositsParams() when $default != null: +return $default(_that.amounts,_that.descriptorCode);case _: + return null; + +} } -/// @nodoc -class __$$VerifyMicroDepositsParamsImplCopyWithImpl<$Res> - extends _$VerifyMicroDepositsParamsCopyWithImpl<$Res, - _$VerifyMicroDepositsParamsImpl> - implements _$$VerifyMicroDepositsParamsImplCopyWith<$Res> { - __$$VerifyMicroDepositsParamsImplCopyWithImpl( - _$VerifyMicroDepositsParamsImpl _value, - $Res Function(_$VerifyMicroDepositsParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of VerifyMicroDepositsParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amounts = freezed, - Object? descriptorCode = freezed, - }) { - return _then(_$VerifyMicroDepositsParamsImpl( - amounts: freezed == amounts - ? _value._amounts - : amounts // ignore: cast_nullable_to_non_nullable - as List?, - descriptorCode: freezed == descriptorCode - ? _value.descriptorCode - : descriptorCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$VerifyMicroDepositsParamsImpl implements _VerifyMicroDepositsParams { - const _$VerifyMicroDepositsParamsImpl( - {final List? amounts, this.descriptorCode}) - : _amounts = amounts; - - factory _$VerifyMicroDepositsParamsImpl.fromJson(Map json) => - _$$VerifyMicroDepositsParamsImplFromJson(json); - - /// The amounts of the microdeposits that are deposited on the account. - /// - /// Make sure that the amount is exactly 2. When using this field make sure - /// [descriptorCode] is `null`. - final List? _amounts; - - /// The amounts of the microdeposits that are deposited on the account. - /// - /// Make sure that the amount is exactly 2. When using this field make sure - /// [descriptorCode] is `null`. - @override - List? get amounts { - final value = _amounts; - if (value == null) return null; - if (_amounts is EqualUnmodifiableListView) return _amounts; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - - /// The descriptor code that is part of the microdepot to the customer bank account. - /// - /// When Using this field make sure [amounts] is `null`. - @override - final String? descriptorCode; - - @override - String toString() { - return 'VerifyMicroDepositsParams(amounts: $amounts, descriptorCode: $descriptorCode)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$VerifyMicroDepositsParamsImpl && - const DeepCollectionEquality().equals(other._amounts, _amounts) && - (identical(other.descriptorCode, descriptorCode) || - other.descriptorCode == descriptorCode)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, - const DeepCollectionEquality().hash(_amounts), descriptorCode); - - /// Create a copy of VerifyMicroDepositsParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$VerifyMicroDepositsParamsImplCopyWith<_$VerifyMicroDepositsParamsImpl> - get copyWith => __$$VerifyMicroDepositsParamsImplCopyWithImpl< - _$VerifyMicroDepositsParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$VerifyMicroDepositsParamsImplToJson( - this, - ); - } -} - -abstract class _VerifyMicroDepositsParams implements VerifyMicroDepositsParams { - const factory _VerifyMicroDepositsParams( - {final List? amounts, - final String? descriptorCode}) = _$VerifyMicroDepositsParamsImpl; - - factory _VerifyMicroDepositsParams.fromJson(Map json) = - _$VerifyMicroDepositsParamsImpl.fromJson; - - /// The amounts of the microdeposits that are deposited on the account. - /// - /// Make sure that the amount is exactly 2. When using this field make sure - /// [descriptorCode] is `null`. - @override - List? get amounts; - - /// The descriptor code that is part of the microdepot to the customer bank account. - /// - /// When Using this field make sure [amounts] is `null`. - @override - String? get descriptorCode; - - /// Create a copy of VerifyMicroDepositsParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$VerifyMicroDepositsParamsImplCopyWith<_$VerifyMicroDepositsParamsImpl> - get copyWith => throw _privateConstructorUsedError; +class _VerifyMicroDepositsParams implements VerifyMicroDepositsParams { + const _VerifyMicroDepositsParams({final List? amounts, this.descriptorCode}): _amounts = amounts; + factory _VerifyMicroDepositsParams.fromJson(Map json) => _$VerifyMicroDepositsParamsFromJson(json); + +/// The amounts of the microdeposits that are deposited on the account. +/// +/// Make sure that the amount is exactly 2. When using this field make sure +/// [descriptorCode] is `null`. + final List? _amounts; +/// The amounts of the microdeposits that are deposited on the account. +/// +/// Make sure that the amount is exactly 2. When using this field make sure +/// [descriptorCode] is `null`. +@override List? get amounts { + final value = _amounts; + if (value == null) return null; + if (_amounts is EqualUnmodifiableListView) return _amounts; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// The descriptor code that is part of the microdepot to the customer bank account. +/// +/// When Using this field make sure [amounts] is `null`. +@override final String? descriptorCode; + +/// Create a copy of VerifyMicroDepositsParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$VerifyMicroDepositsParamsCopyWith<_VerifyMicroDepositsParams> get copyWith => __$VerifyMicroDepositsParamsCopyWithImpl<_VerifyMicroDepositsParams>(this, _$identity); + +@override +Map toJson() { + return _$VerifyMicroDepositsParamsToJson(this, ); } + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _VerifyMicroDepositsParams&&const DeepCollectionEquality().equals(other._amounts, _amounts)&&(identical(other.descriptorCode, descriptorCode) || other.descriptorCode == descriptorCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_amounts),descriptorCode); + +@override +String toString() { + return 'VerifyMicroDepositsParams(amounts: $amounts, descriptorCode: $descriptorCode)'; +} + + +} + +/// @nodoc +abstract mixin class _$VerifyMicroDepositsParamsCopyWith<$Res> implements $VerifyMicroDepositsParamsCopyWith<$Res> { + factory _$VerifyMicroDepositsParamsCopyWith(_VerifyMicroDepositsParams value, $Res Function(_VerifyMicroDepositsParams) _then) = __$VerifyMicroDepositsParamsCopyWithImpl; +@override @useResult +$Res call({ + List? amounts, String? descriptorCode +}); + + + + +} +/// @nodoc +class __$VerifyMicroDepositsParamsCopyWithImpl<$Res> + implements _$VerifyMicroDepositsParamsCopyWith<$Res> { + __$VerifyMicroDepositsParamsCopyWithImpl(this._self, this._then); + + final _VerifyMicroDepositsParams _self; + final $Res Function(_VerifyMicroDepositsParams) _then; + +/// Create a copy of VerifyMicroDepositsParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? amounts = freezed,Object? descriptorCode = freezed,}) { + return _then(_VerifyMicroDepositsParams( +amounts: freezed == amounts ? _self._amounts : amounts // ignore: cast_nullable_to_non_nullable +as List?,descriptorCode: freezed == descriptorCode ? _self.descriptorCode : descriptorCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart b/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart index 126bdf793..65b806806 100644 --- a/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/ach_params.g.dart @@ -6,27 +6,32 @@ part of 'ach_params.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CollectBankAccountParamsImpl _$$CollectBankAccountParamsImplFromJson( - Map json) => - _$CollectBankAccountParamsImpl( - paymentMethodData: CollectBankAccountPaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - paymentMethodType: $enumDecodeNullable( - _$PaymentMethodTypeEnumMap, json['paymentMethodType']) ?? - PaymentMethodType.USBankAccount, - userInterfaceStyle: $enumDecodeNullable( - _$UserInterfaceStyleEnumMap, json['userInterfaceStyle']), - ); +_CollectBankAccountParams _$CollectBankAccountParamsFromJson( + Map json, +) => _CollectBankAccountParams( + paymentMethodData: CollectBankAccountPaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + paymentMethodType: + $enumDecodeNullable( + _$PaymentMethodTypeEnumMap, + json['paymentMethodType'], + ) ?? + PaymentMethodType.USBankAccount, + userInterfaceStyle: $enumDecodeNullable( + _$UserInterfaceStyleEnumMap, + json['userInterfaceStyle'], + ), +); -Map _$$CollectBankAccountParamsImplToJson( - _$CollectBankAccountParamsImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': - _$PaymentMethodTypeEnumMap[instance.paymentMethodType]!, - 'userInterfaceStyle': - _$UserInterfaceStyleEnumMap[instance.userInterfaceStyle], - }; +Map _$CollectBankAccountParamsToJson( + _CollectBankAccountParams instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': _$PaymentMethodTypeEnumMap[instance.paymentMethodType]!, + 'userInterfaceStyle': + _$UserInterfaceStyleEnumMap[instance.userInterfaceStyle], +}; const _$PaymentMethodTypeEnumMap = { PaymentMethodType.AfterpayClearpay: 'AfterpayClearpay', @@ -46,7 +51,6 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.Bancontact: 'Bancontact', PaymentMethodType.Oxxo: 'Oxxo', PaymentMethodType.PayPal: 'PayPal', - PaymentMethodType.Sofort: 'Sofort', PaymentMethodType.Upi: 'Upi', PaymentMethodType.USBankAccount: 'USBankAccount', PaymentMethodType.RevolutPay: 'RevolutPay', @@ -60,46 +64,46 @@ const _$UserInterfaceStyleEnumMap = { UserInterfaceStyle.automatic: 'automatic', }; -_$CollectBankAccountTokenParamsImpl - _$$CollectBankAccountTokenParamsImplFromJson(Map json) => - _$CollectBankAccountTokenParamsImpl( - userInterfaceStyle: $enumDecodeNullable( - _$UserInterfaceStyleEnumMap, json['userInterfaceStyle']), - ); +_CollectBankAccountTokenParams _$CollectBankAccountTokenParamsFromJson( + Map json, +) => _CollectBankAccountTokenParams( + userInterfaceStyle: $enumDecodeNullable( + _$UserInterfaceStyleEnumMap, + json['userInterfaceStyle'], + ), +); -Map _$$CollectBankAccountTokenParamsImplToJson( - _$CollectBankAccountTokenParamsImpl instance) => - { - 'userInterfaceStyle': - _$UserInterfaceStyleEnumMap[instance.userInterfaceStyle], - }; +Map _$CollectBankAccountTokenParamsToJson( + _CollectBankAccountTokenParams instance, +) => { + 'userInterfaceStyle': + _$UserInterfaceStyleEnumMap[instance.userInterfaceStyle], +}; -_$CollectBankAccountPaymentMethodDataImpl - _$$CollectBankAccountPaymentMethodDataImplFromJson( - Map json) => - _$CollectBankAccountPaymentMethodDataImpl( - billingDetails: BillingDetails.fromJson( - json['billingDetails'] as Map), - ); +_CollectBankAccountPaymentMethodData +_$CollectBankAccountPaymentMethodDataFromJson(Map json) => + _CollectBankAccountPaymentMethodData( + billingDetails: BillingDetails.fromJson( + json['billingDetails'] as Map, + ), + ); -Map _$$CollectBankAccountPaymentMethodDataImplToJson( - _$CollectBankAccountPaymentMethodDataImpl instance) => - { - 'billingDetails': instance.billingDetails.toJson(), - }; +Map _$CollectBankAccountPaymentMethodDataToJson( + _CollectBankAccountPaymentMethodData instance, +) => {'billingDetails': instance.billingDetails.toJson()}; -_$VerifyMicroDepositsParamsImpl _$$VerifyMicroDepositsParamsImplFromJson( - Map json) => - _$VerifyMicroDepositsParamsImpl( - amounts: (json['amounts'] as List?) - ?.map((e) => (e as num).toInt()) - .toList(), - descriptorCode: json['descriptorCode'] as String?, - ); +_VerifyMicroDepositsParams _$VerifyMicroDepositsParamsFromJson( + Map json, +) => _VerifyMicroDepositsParams( + amounts: (json['amounts'] as List?) + ?.map((e) => (e as num).toInt()) + .toList(), + descriptorCode: json['descriptorCode'] as String?, +); -Map _$$VerifyMicroDepositsParamsImplToJson( - _$VerifyMicroDepositsParamsImpl instance) => - { - 'amounts': instance.amounts, - 'descriptorCode': instance.descriptorCode, - }; +Map _$VerifyMicroDepositsParamsToJson( + _VerifyMicroDepositsParams instance, +) => { + 'amounts': instance.amounts, + 'descriptorCode': instance.descriptorCode, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/address.dart b/packages/stripe_platform_interface/lib/src/models/address.dart index 31b830148..74ea23bb7 100644 --- a/packages/stripe_platform_interface/lib/src/models/address.dart +++ b/packages/stripe_platform_interface/lib/src/models/address.dart @@ -5,7 +5,7 @@ part 'address.g.dart'; /// Information regarding the Address sheet field @freezed -class AddressDetails with _$AddressDetails { +abstract class AddressDetails with _$AddressDetails { @JsonSerializable(explicitToJson: true) const factory AddressDetails({ /// The customer's full name @@ -23,9 +23,8 @@ class AddressDetails with _$AddressDetails { } @freezed - /// Address information -class Address with _$Address { +abstract class Address with _$Address { const Address._(); @JsonSerializable(explicitToJson: true) const factory Address({ @@ -53,11 +52,11 @@ class Address with _$Address { bool get isEmpty => !isNotEmpty; bool get isNotEmpty => [ - city != null, - country != null, - line1 != null, - line2 != null, - postalCode != null, - state != null, - ].any((v) => v); + city != null, + country != null, + line1 != null, + line2 != null, + postalCode != null, + state != null, + ].any((v) => v); } diff --git a/packages/stripe_platform_interface/lib/src/models/address.freezed.dart b/packages/stripe_platform_interface/lib/src/models/address.freezed.dart index d59839b71..416eeb234 100644 --- a/packages/stripe_platform_interface/lib/src/models/address.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/address.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,515 +9,595 @@ part of 'address.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -AddressDetails _$AddressDetailsFromJson(Map json) { - return _AddressDetails.fromJson(json); -} - /// @nodoc mixin _$AddressDetails { - /// The customer's full name - String? get name => throw _privateConstructorUsedError; - - /// The customer's address - Address? get address => throw _privateConstructorUsedError; - /// the customer's phonumber - String? get phoneNumber => throw _privateConstructorUsedError; +/// The customer's full name + String? get name;/// The customer's address + Address? get address;/// the customer's phonumber + String? get phoneNumber; +/// Create a copy of AddressDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressDetailsCopyWith get copyWith => _$AddressDetailsCopyWithImpl(this as AddressDetails, _$identity); /// Serializes this AddressDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of AddressDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AddressDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AddressDetails&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,address,phoneNumber); + +@override +String toString() { + return 'AddressDetails(name: $name, address: $address, phoneNumber: $phoneNumber)'; } -/// @nodoc -abstract class $AddressDetailsCopyWith<$Res> { - factory $AddressDetailsCopyWith( - AddressDetails value, $Res Function(AddressDetails) then) = - _$AddressDetailsCopyWithImpl<$Res, AddressDetails>; - @useResult - $Res call({String? name, Address? address, String? phoneNumber}); - $AddressCopyWith<$Res>? get address; } /// @nodoc -class _$AddressDetailsCopyWithImpl<$Res, $Val extends AddressDetails> +abstract mixin class $AddressDetailsCopyWith<$Res> { + factory $AddressDetailsCopyWith(AddressDetails value, $Res Function(AddressDetails) _then) = _$AddressDetailsCopyWithImpl; +@useResult +$Res call({ + String? name, Address? address, String? phoneNumber +}); + + +$AddressCopyWith<$Res>? get address; + +} +/// @nodoc +class _$AddressDetailsCopyWithImpl<$Res> implements $AddressDetailsCopyWith<$Res> { - _$AddressDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AddressDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? address = freezed, - Object? phoneNumber = freezed, - }) { - return _then(_value.copyWith( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - phoneNumber: freezed == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + _$AddressDetailsCopyWithImpl(this._self, this._then); + + final AddressDetails _self; + final $Res Function(AddressDetails) _then; + +/// Create a copy of AddressDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? address = freezed,Object? phoneNumber = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of AddressDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - /// Create a copy of AddressDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $AddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} } -/// @nodoc -abstract class _$$AddressDetailsImplCopyWith<$Res> - implements $AddressDetailsCopyWith<$Res> { - factory _$$AddressDetailsImplCopyWith(_$AddressDetailsImpl value, - $Res Function(_$AddressDetailsImpl) then) = - __$$AddressDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? name, Address? address, String? phoneNumber}); - @override - $AddressCopyWith<$Res>? get address; +/// Adds pattern-matching-related methods to [AddressDetails]. +extension AddressDetailsPatterns on AddressDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AddressDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AddressDetails() when $default != null: +return $default(_that);case _: + return orElse(); + } +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AddressDetails value) $default,){ +final _that = this; +switch (_that) { +case _AddressDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -class __$$AddressDetailsImplCopyWithImpl<$Res> - extends _$AddressDetailsCopyWithImpl<$Res, _$AddressDetailsImpl> - implements _$$AddressDetailsImplCopyWith<$Res> { - __$$AddressDetailsImplCopyWithImpl( - _$AddressDetailsImpl _value, $Res Function(_$AddressDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of AddressDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? address = freezed, - Object? phoneNumber = freezed, - }) { - return _then(_$AddressDetailsImpl( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - phoneNumber: freezed == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AddressDetails value)? $default,){ +final _that = this; +switch (_that) { +case _AddressDetails() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name, Address? address, String? phoneNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AddressDetails() when $default != null: +return $default(_that.name,_that.address,_that.phoneNumber);case _: + return orElse(); -@JsonSerializable(explicitToJson: true) -class _$AddressDetailsImpl implements _AddressDetails { - const _$AddressDetailsImpl({this.name, this.address, this.phoneNumber}); +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name, Address? address, String? phoneNumber) $default,) {final _that = this; +switch (_that) { +case _AddressDetails(): +return $default(_that.name,_that.address,_that.phoneNumber);case _: + throw StateError('Unexpected subclass'); - factory _$AddressDetailsImpl.fromJson(Map json) => - _$$AddressDetailsImplFromJson(json); +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name, Address? address, String? phoneNumber)? $default,) {final _that = this; +switch (_that) { +case _AddressDetails() when $default != null: +return $default(_that.name,_that.address,_that.phoneNumber);case _: + return null; - /// The customer's full name - @override - final String? name; +} +} - /// The customer's address - @override - final Address? address; +} - /// the customer's phonumber - @override - final String? phoneNumber; +/// @nodoc - @override - String toString() { - return 'AddressDetails(name: $name, address: $address, phoneNumber: $phoneNumber)'; - } +@JsonSerializable(explicitToJson: true) +class _AddressDetails implements AddressDetails { + const _AddressDetails({this.name, this.address, this.phoneNumber}); + factory _AddressDetails.fromJson(Map json) => _$AddressDetailsFromJson(json); + +/// The customer's full name +@override final String? name; +/// The customer's address +@override final Address? address; +/// the customer's phonumber +@override final String? phoneNumber; + +/// Create a copy of AddressDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressDetailsCopyWith<_AddressDetails> get copyWith => __$AddressDetailsCopyWithImpl<_AddressDetails>(this, _$identity); + +@override +Map toJson() { + return _$AddressDetailsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AddressDetailsImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.address, address) || other.address == address) && - (identical(other.phoneNumber, phoneNumber) || - other.phoneNumber == phoneNumber)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddressDetails&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, address, phoneNumber); - - /// Create a copy of AddressDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AddressDetailsImplCopyWith<_$AddressDetailsImpl> get copyWith => - __$$AddressDetailsImplCopyWithImpl<_$AddressDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$AddressDetailsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,address,phoneNumber); + +@override +String toString() { + return 'AddressDetails(name: $name, address: $address, phoneNumber: $phoneNumber)'; } -abstract class _AddressDetails implements AddressDetails { - const factory _AddressDetails( - {final String? name, - final Address? address, - final String? phoneNumber}) = _$AddressDetailsImpl; - factory _AddressDetails.fromJson(Map json) = - _$AddressDetailsImpl.fromJson; +} - /// The customer's full name - @override - String? get name; +/// @nodoc +abstract mixin class _$AddressDetailsCopyWith<$Res> implements $AddressDetailsCopyWith<$Res> { + factory _$AddressDetailsCopyWith(_AddressDetails value, $Res Function(_AddressDetails) _then) = __$AddressDetailsCopyWithImpl; +@override @useResult +$Res call({ + String? name, Address? address, String? phoneNumber +}); - /// The customer's address - @override - Address? get address; - /// the customer's phonumber - @override - String? get phoneNumber; +@override $AddressCopyWith<$Res>? get address; - /// Create a copy of AddressDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AddressDetailsImplCopyWith<_$AddressDetailsImpl> get copyWith => - throw _privateConstructorUsedError; +} +/// @nodoc +class __$AddressDetailsCopyWithImpl<$Res> + implements _$AddressDetailsCopyWith<$Res> { + __$AddressDetailsCopyWithImpl(this._self, this._then); + + final _AddressDetails _self; + final $Res Function(_AddressDetails) _then; + +/// Create a copy of AddressDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? address = freezed,Object? phoneNumber = freezed,}) { + return _then(_AddressDetails( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); } -Address _$AddressFromJson(Map json) { - return _Address.fromJson(json); +/// Create a copy of AddressDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} } + /// @nodoc mixin _$Address { - /// City, town or district. - String? get city => throw _privateConstructorUsedError; - /// Country - String? get country => throw _privateConstructorUsedError; +/// City, town or district. + String? get city;/// Country + String? get country;/// Address line1 (e.g. Street, C/O , PO Box). + String? get line1;/// Address line2 (e.g. building, appartment or unit). + String? get line2;/// ZIP or postal code. + String? get postalCode;/// State or province. + String? get state; +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressCopyWith
get copyWith => _$AddressCopyWithImpl
(this as Address, _$identity); - /// Address line1 (e.g. Street, C/O , PO Box). - String? get line1 => throw _privateConstructorUsedError; + /// Serializes this Address to a JSON map. + Map toJson(); - /// Address line2 (e.g. building, appartment or unit). - String? get line2 => throw _privateConstructorUsedError; - /// ZIP or postal code. - String? get postalCode => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Address&&(identical(other.city, city) || other.city == city)&&(identical(other.country, country) || other.country == country)&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.state, state) || other.state == state)); +} - /// State or province. - String? get state => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,country,line1,line2,postalCode,state); + +@override +String toString() { + return 'Address(city: $city, country: $country, line1: $line1, line2: $line2, postalCode: $postalCode, state: $state)'; +} - /// Serializes this Address to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of Address - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AddressCopyWith
get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AddressCopyWith<$Res> { - factory $AddressCopyWith(Address value, $Res Function(Address) then) = - _$AddressCopyWithImpl<$Res, Address>; - @useResult - $Res call( - {String? city, - String? country, - String? line1, - String? line2, - String? postalCode, - String? state}); -} +abstract mixin class $AddressCopyWith<$Res> { + factory $AddressCopyWith(Address value, $Res Function(Address) _then) = _$AddressCopyWithImpl; +@useResult +$Res call({ + String? city, String? country, String? line1, String? line2, String? postalCode, String? state +}); + + + +} /// @nodoc -class _$AddressCopyWithImpl<$Res, $Val extends Address> +class _$AddressCopyWithImpl<$Res> implements $AddressCopyWith<$Res> { - _$AddressCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Address - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? city = freezed, - Object? country = freezed, - Object? line1 = freezed, - Object? line2 = freezed, - Object? postalCode = freezed, - Object? state = freezed, - }) { - return _then(_value.copyWith( - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + _$AddressCopyWithImpl(this._self, this._then); + + final Address _self; + final $Res Function(Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? city = freezed,Object? country = freezed,Object? line1 = freezed,Object? line2 = freezed,Object? postalCode = freezed,Object? state = freezed,}) { + return _then(_self.copyWith( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$AddressImplCopyWith<$Res> implements $AddressCopyWith<$Res> { - factory _$$AddressImplCopyWith( - _$AddressImpl value, $Res Function(_$AddressImpl) then) = - __$$AddressImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? city, - String? country, - String? line1, - String? line2, - String? postalCode, - String? state}); } -/// @nodoc -class __$$AddressImplCopyWithImpl<$Res> - extends _$AddressCopyWithImpl<$Res, _$AddressImpl> - implements _$$AddressImplCopyWith<$Res> { - __$$AddressImplCopyWithImpl( - _$AddressImpl _value, $Res Function(_$AddressImpl) _then) - : super(_value, _then); - - /// Create a copy of Address - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? city = freezed, - Object? country = freezed, - Object? line1 = freezed, - Object? line2 = freezed, - Object? postalCode = freezed, - Object? state = freezed, - }) { - return _then(_$AddressImpl( - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - line1: freezed == line1 - ? _value.line1 - : line1 // ignore: cast_nullable_to_non_nullable - as String?, - line2: freezed == line2 - ? _value.line2 - : line2 // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + +/// Adds pattern-matching-related methods to [Address]. +extension AddressPatterns on Address { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Address value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Address value) $default,){ +final _that = this; +switch (_that) { +case _Address(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Address value)? $default,){ +final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? city, String? country, String? line1, String? line2, String? postalCode, String? state)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.city,_that.country,_that.line1,_that.line2,_that.postalCode,_that.state);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? city, String? country, String? line1, String? line2, String? postalCode, String? state) $default,) {final _that = this; +switch (_that) { +case _Address(): +return $default(_that.city,_that.country,_that.line1,_that.line2,_that.postalCode,_that.state);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? city, String? country, String? line1, String? line2, String? postalCode, String? state)? $default,) {final _that = this; +switch (_that) { +case _Address() when $default != null: +return $default(_that.city,_that.country,_that.line1,_that.line2,_that.postalCode,_that.state);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AddressImpl extends _Address { - const _$AddressImpl( - {required this.city, - required this.country, - required this.line1, - required this.line2, - required this.postalCode, - required this.state}) - : super._(); - - factory _$AddressImpl.fromJson(Map json) => - _$$AddressImplFromJson(json); - - /// City, town or district. - @override - final String? city; - - /// Country - @override - final String? country; - - /// Address line1 (e.g. Street, C/O , PO Box). - @override - final String? line1; - - /// Address line2 (e.g. building, appartment or unit). - @override - final String? line2; - - /// ZIP or postal code. - @override - final String? postalCode; - - /// State or province. - @override - final String? state; - - @override - String toString() { - return 'Address(city: $city, country: $country, line1: $line1, line2: $line2, postalCode: $postalCode, state: $state)'; - } +class _Address extends Address { + const _Address({required this.city, required this.country, required this.line1, required this.line2, required this.postalCode, required this.state}): super._(); + factory _Address.fromJson(Map json) => _$AddressFromJson(json); + +/// City, town or district. +@override final String? city; +/// Country +@override final String? country; +/// Address line1 (e.g. Street, C/O , PO Box). +@override final String? line1; +/// Address line2 (e.g. building, appartment or unit). +@override final String? line2; +/// ZIP or postal code. +@override final String? postalCode; +/// State or province. +@override final String? state; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressCopyWith<_Address> get copyWith => __$AddressCopyWithImpl<_Address>(this, _$identity); + +@override +Map toJson() { + return _$AddressToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AddressImpl && - (identical(other.city, city) || other.city == city) && - (identical(other.country, country) || other.country == country) && - (identical(other.line1, line1) || other.line1 == line1) && - (identical(other.line2, line2) || other.line2 == line2) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode) && - (identical(other.state, state) || other.state == state)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Address&&(identical(other.city, city) || other.city == city)&&(identical(other.country, country) || other.country == country)&&(identical(other.line1, line1) || other.line1 == line1)&&(identical(other.line2, line2) || other.line2 == line2)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.state, state) || other.state == state)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, city, country, line1, line2, postalCode, state); - - /// Create a copy of Address - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AddressImplCopyWith<_$AddressImpl> get copyWith => - __$$AddressImplCopyWithImpl<_$AddressImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AddressImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,country,line1,line2,postalCode,state); + +@override +String toString() { + return 'Address(city: $city, country: $country, line1: $line1, line2: $line2, postalCode: $postalCode, state: $state)'; } -abstract class _Address extends Address { - const factory _Address( - {required final String? city, - required final String? country, - required final String? line1, - required final String? line2, - required final String? postalCode, - required final String? state}) = _$AddressImpl; - const _Address._() : super._(); - factory _Address.fromJson(Map json) = _$AddressImpl.fromJson; +} - /// City, town or district. - @override - String? get city; +/// @nodoc +abstract mixin class _$AddressCopyWith<$Res> implements $AddressCopyWith<$Res> { + factory _$AddressCopyWith(_Address value, $Res Function(_Address) _then) = __$AddressCopyWithImpl; +@override @useResult +$Res call({ + String? city, String? country, String? line1, String? line2, String? postalCode, String? state +}); - /// Country - @override - String? get country; - /// Address line1 (e.g. Street, C/O , PO Box). - @override - String? get line1; - /// Address line2 (e.g. building, appartment or unit). - @override - String? get line2; - /// ZIP or postal code. - @override - String? get postalCode; +} +/// @nodoc +class __$AddressCopyWithImpl<$Res> + implements _$AddressCopyWith<$Res> { + __$AddressCopyWithImpl(this._self, this._then); + + final _Address _self; + final $Res Function(_Address) _then; + +/// Create a copy of Address +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? city = freezed,Object? country = freezed,Object? line1 = freezed,Object? line2 = freezed,Object? postalCode = freezed,Object? state = freezed,}) { + return _then(_Address( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,line1: freezed == line1 ? _self.line1 : line1 // ignore: cast_nullable_to_non_nullable +as String?,line2: freezed == line2 ? _self.line2 : line2 // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// State or province. - @override - String? get state; - /// Create a copy of Address - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AddressImplCopyWith<_$AddressImpl> get copyWith => - throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/address.g.dart b/packages/stripe_platform_interface/lib/src/models/address.g.dart index 6a9d5287a..c008653fc 100644 --- a/packages/stripe_platform_interface/lib/src/models/address.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/address.g.dart @@ -6,8 +6,8 @@ part of 'address.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AddressDetailsImpl _$$AddressDetailsImplFromJson(Map json) => - _$AddressDetailsImpl( +_AddressDetails _$AddressDetailsFromJson(Map json) => + _AddressDetails( name: json['name'] as String?, address: json['address'] == null ? null @@ -15,30 +15,27 @@ _$AddressDetailsImpl _$$AddressDetailsImplFromJson(Map json) => phoneNumber: json['phoneNumber'] as String?, ); -Map _$$AddressDetailsImplToJson( - _$AddressDetailsImpl instance) => +Map _$AddressDetailsToJson(_AddressDetails instance) => { 'name': instance.name, 'address': instance.address?.toJson(), 'phoneNumber': instance.phoneNumber, }; -_$AddressImpl _$$AddressImplFromJson(Map json) => - _$AddressImpl( - city: json['city'] as String?, - country: json['country'] as String?, - line1: json['line1'] as String?, - line2: json['line2'] as String?, - postalCode: json['postalCode'] as String?, - state: json['state'] as String?, - ); +_Address _$AddressFromJson(Map json) => _Address( + city: json['city'] as String?, + country: json['country'] as String?, + line1: json['line1'] as String?, + line2: json['line2'] as String?, + postalCode: json['postalCode'] as String?, + state: json['state'] as String?, +); -Map _$$AddressImplToJson(_$AddressImpl instance) => - { - 'city': instance.city, - 'country': instance.country, - 'line1': instance.line1, - 'line2': instance.line2, - 'postalCode': instance.postalCode, - 'state': instance.state, - }; +Map _$AddressToJson(_Address instance) => { + 'city': instance.city, + 'country': instance.country, + 'line1': instance.line1, + 'line2': instance.line2, + 'postalCode': instance.postalCode, + 'state': instance.state, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/address_sheet.dart b/packages/stripe_platform_interface/lib/src/models/address_sheet.dart index d8dc1b465..12958afcc 100644 --- a/packages/stripe_platform_interface/lib/src/models/address_sheet.dart +++ b/packages/stripe_platform_interface/lib/src/models/address_sheet.dart @@ -43,7 +43,8 @@ enum AddressSheetAnimationStyle { } @freezed -class AddressSheetAdditionalFields with _$AddressSheetAdditionalFields { +abstract class AddressSheetAdditionalFields + with _$AddressSheetAdditionalFields { const factory AddressSheetAdditionalFields({ ///Determines whether the phone number is hidden, required, or optional. Defaults to hidden required AddressSheetPhoneNumberField phoneNumber, @@ -69,7 +70,7 @@ enum AddressSheetPhoneNumberField { } @freezed -class CollectAddressResult with _$CollectAddressResult { +abstract class CollectAddressResult with _$CollectAddressResult { const factory CollectAddressResult({ /// The customer's full name required String name, @@ -85,13 +86,13 @@ class CollectAddressResult with _$CollectAddressResult { _$CollectAddressResultFromJson(json); } -typedef OnAddressSheetSubmit = FutureOr Function( - CollectAddressResult result); +typedef OnAddressSheetSubmit = + FutureOr Function(CollectAddressResult result); typedef OnAddressSheetError = FutureOr Function(StripeException error); @freezed -class AddressSheetParams with _$AddressSheetParams { +abstract class AddressSheetParams with _$AddressSheetParams { @JsonSerializable(explicitToJson: true) const factory AddressSheetParams({ /// Whether the address sheet is visible diff --git a/packages/stripe_platform_interface/lib/src/models/address_sheet.freezed.dart b/packages/stripe_platform_interface/lib/src/models/address_sheet.freezed.dart index 28d8bf2c5..2a2afa0ef 100644 --- a/packages/stripe_platform_interface/lib/src/models/address_sheet.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/address_sheet.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,940 +9,974 @@ part of 'address_sheet.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -AddressSheetAdditionalFields _$AddressSheetAdditionalFieldsFromJson( - Map json) { - return _AddressSheetAdditionalFields.fromJson(json); -} - /// @nodoc mixin _$AddressSheetAdditionalFields { - ///Determines whether the phone number is hidden, required, or optional. Defaults to hidden - AddressSheetPhoneNumberField get phoneNumber => - throw _privateConstructorUsedError; - /// The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed - String? get checkboxLabel => throw _privateConstructorUsedError; +///Determines whether the phone number is hidden, required, or optional. Defaults to hidden + AddressSheetPhoneNumberField get phoneNumber;/// The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed + String? get checkboxLabel; +/// Create a copy of AddressSheetAdditionalFields +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressSheetAdditionalFieldsCopyWith get copyWith => _$AddressSheetAdditionalFieldsCopyWithImpl(this as AddressSheetAdditionalFields, _$identity); /// Serializes this AddressSheetAdditionalFields to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of AddressSheetAdditionalFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AddressSheetAdditionalFieldsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AddressSheetAdditionalFields&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.checkboxLabel, checkboxLabel) || other.checkboxLabel == checkboxLabel)); } -/// @nodoc -abstract class $AddressSheetAdditionalFieldsCopyWith<$Res> { - factory $AddressSheetAdditionalFieldsCopyWith( - AddressSheetAdditionalFields value, - $Res Function(AddressSheetAdditionalFields) then) = - _$AddressSheetAdditionalFieldsCopyWithImpl<$Res, - AddressSheetAdditionalFields>; - @useResult - $Res call({AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,phoneNumber,checkboxLabel); + +@override +String toString() { + return 'AddressSheetAdditionalFields(phoneNumber: $phoneNumber, checkboxLabel: $checkboxLabel)'; } -/// @nodoc -class _$AddressSheetAdditionalFieldsCopyWithImpl<$Res, - $Val extends AddressSheetAdditionalFields> - implements $AddressSheetAdditionalFieldsCopyWith<$Res> { - _$AddressSheetAdditionalFieldsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AddressSheetAdditionalFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? phoneNumber = null, - Object? checkboxLabel = freezed, - }) { - return _then(_value.copyWith( - phoneNumber: null == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as AddressSheetPhoneNumberField, - checkboxLabel: freezed == checkboxLabel - ? _value.checkboxLabel - : checkboxLabel // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$AddressSheetAdditionalFieldsImplCopyWith<$Res> +abstract mixin class $AddressSheetAdditionalFieldsCopyWith<$Res> { + factory $AddressSheetAdditionalFieldsCopyWith(AddressSheetAdditionalFields value, $Res Function(AddressSheetAdditionalFields) _then) = _$AddressSheetAdditionalFieldsCopyWithImpl; +@useResult +$Res call({ + AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel +}); + + + + +} +/// @nodoc +class _$AddressSheetAdditionalFieldsCopyWithImpl<$Res> implements $AddressSheetAdditionalFieldsCopyWith<$Res> { - factory _$$AddressSheetAdditionalFieldsImplCopyWith( - _$AddressSheetAdditionalFieldsImpl value, - $Res Function(_$AddressSheetAdditionalFieldsImpl) then) = - __$$AddressSheetAdditionalFieldsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel}); + _$AddressSheetAdditionalFieldsCopyWithImpl(this._self, this._then); + + final AddressSheetAdditionalFields _self; + final $Res Function(AddressSheetAdditionalFields) _then; + +/// Create a copy of AddressSheetAdditionalFields +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? phoneNumber = null,Object? checkboxLabel = freezed,}) { + return _then(_self.copyWith( +phoneNumber: null == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as AddressSheetPhoneNumberField,checkboxLabel: freezed == checkboxLabel ? _self.checkboxLabel : checkboxLabel // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AddressSheetAdditionalFields]. +extension AddressSheetAdditionalFieldsPatterns on AddressSheetAdditionalFields { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AddressSheetAdditionalFields value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AddressSheetAdditionalFields() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AddressSheetAdditionalFields value) $default,){ +final _that = this; +switch (_that) { +case _AddressSheetAdditionalFields(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AddressSheetAdditionalFields value)? $default,){ +final _that = this; +switch (_that) { +case _AddressSheetAdditionalFields() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AddressSheetAdditionalFields() when $default != null: +return $default(_that.phoneNumber,_that.checkboxLabel);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel) $default,) {final _that = this; +switch (_that) { +case _AddressSheetAdditionalFields(): +return $default(_that.phoneNumber,_that.checkboxLabel);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel)? $default,) {final _that = this; +switch (_that) { +case _AddressSheetAdditionalFields() when $default != null: +return $default(_that.phoneNumber,_that.checkboxLabel);case _: + return null; + +} } -/// @nodoc -class __$$AddressSheetAdditionalFieldsImplCopyWithImpl<$Res> - extends _$AddressSheetAdditionalFieldsCopyWithImpl<$Res, - _$AddressSheetAdditionalFieldsImpl> - implements _$$AddressSheetAdditionalFieldsImplCopyWith<$Res> { - __$$AddressSheetAdditionalFieldsImplCopyWithImpl( - _$AddressSheetAdditionalFieldsImpl _value, - $Res Function(_$AddressSheetAdditionalFieldsImpl) _then) - : super(_value, _then); - - /// Create a copy of AddressSheetAdditionalFields - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? phoneNumber = null, - Object? checkboxLabel = freezed, - }) { - return _then(_$AddressSheetAdditionalFieldsImpl( - phoneNumber: null == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as AddressSheetPhoneNumberField, - checkboxLabel: freezed == checkboxLabel - ? _value.checkboxLabel - : checkboxLabel // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$AddressSheetAdditionalFieldsImpl - implements _AddressSheetAdditionalFields { - const _$AddressSheetAdditionalFieldsImpl( - {required this.phoneNumber, required this.checkboxLabel}); - - factory _$AddressSheetAdditionalFieldsImpl.fromJson( - Map json) => - _$$AddressSheetAdditionalFieldsImplFromJson(json); - - ///Determines whether the phone number is hidden, required, or optional. Defaults to hidden - @override - final AddressSheetPhoneNumberField phoneNumber; - - /// The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed - @override - final String? checkboxLabel; - - @override - String toString() { - return 'AddressSheetAdditionalFields(phoneNumber: $phoneNumber, checkboxLabel: $checkboxLabel)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AddressSheetAdditionalFieldsImpl && - (identical(other.phoneNumber, phoneNumber) || - other.phoneNumber == phoneNumber) && - (identical(other.checkboxLabel, checkboxLabel) || - other.checkboxLabel == checkboxLabel)); - } +class _AddressSheetAdditionalFields implements AddressSheetAdditionalFields { + const _AddressSheetAdditionalFields({required this.phoneNumber, required this.checkboxLabel}); + factory _AddressSheetAdditionalFields.fromJson(Map json) => _$AddressSheetAdditionalFieldsFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, phoneNumber, checkboxLabel); - - /// Create a copy of AddressSheetAdditionalFields - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AddressSheetAdditionalFieldsImplCopyWith< - _$AddressSheetAdditionalFieldsImpl> - get copyWith => __$$AddressSheetAdditionalFieldsImplCopyWithImpl< - _$AddressSheetAdditionalFieldsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AddressSheetAdditionalFieldsImplToJson( - this, - ); - } +///Determines whether the phone number is hidden, required, or optional. Defaults to hidden +@override final AddressSheetPhoneNumberField phoneNumber; +/// The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed +@override final String? checkboxLabel; + +/// Create a copy of AddressSheetAdditionalFields +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressSheetAdditionalFieldsCopyWith<_AddressSheetAdditionalFields> get copyWith => __$AddressSheetAdditionalFieldsCopyWithImpl<_AddressSheetAdditionalFields>(this, _$identity); + +@override +Map toJson() { + return _$AddressSheetAdditionalFieldsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddressSheetAdditionalFields&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)&&(identical(other.checkboxLabel, checkboxLabel) || other.checkboxLabel == checkboxLabel)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,phoneNumber,checkboxLabel); + +@override +String toString() { + return 'AddressSheetAdditionalFields(phoneNumber: $phoneNumber, checkboxLabel: $checkboxLabel)'; } -abstract class _AddressSheetAdditionalFields - implements AddressSheetAdditionalFields { - const factory _AddressSheetAdditionalFields( - {required final AddressSheetPhoneNumberField phoneNumber, - required final String? checkboxLabel}) = - _$AddressSheetAdditionalFieldsImpl; - factory _AddressSheetAdditionalFields.fromJson(Map json) = - _$AddressSheetAdditionalFieldsImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$AddressSheetAdditionalFieldsCopyWith<$Res> implements $AddressSheetAdditionalFieldsCopyWith<$Res> { + factory _$AddressSheetAdditionalFieldsCopyWith(_AddressSheetAdditionalFields value, $Res Function(_AddressSheetAdditionalFields) _then) = __$AddressSheetAdditionalFieldsCopyWithImpl; +@override @useResult +$Res call({ + AddressSheetPhoneNumberField phoneNumber, String? checkboxLabel +}); + - ///Determines whether the phone number is hidden, required, or optional. Defaults to hidden - @override - AddressSheetPhoneNumberField get phoneNumber; - /// The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed - @override - String? get checkboxLabel; - /// Create a copy of AddressSheetAdditionalFields - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AddressSheetAdditionalFieldsImplCopyWith< - _$AddressSheetAdditionalFieldsImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$AddressSheetAdditionalFieldsCopyWithImpl<$Res> + implements _$AddressSheetAdditionalFieldsCopyWith<$Res> { + __$AddressSheetAdditionalFieldsCopyWithImpl(this._self, this._then); + + final _AddressSheetAdditionalFields _self; + final $Res Function(_AddressSheetAdditionalFields) _then; + +/// Create a copy of AddressSheetAdditionalFields +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? phoneNumber = null,Object? checkboxLabel = freezed,}) { + return _then(_AddressSheetAdditionalFields( +phoneNumber: null == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as AddressSheetPhoneNumberField,checkboxLabel: freezed == checkboxLabel ? _self.checkboxLabel : checkboxLabel // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + -CollectAddressResult _$CollectAddressResultFromJson(Map json) { - return _CollectAddressResult.fromJson(json); } + /// @nodoc mixin _$CollectAddressResult { - /// The customer's full name - String get name => throw _privateConstructorUsedError; - - /// The customer's address - Address get address => throw _privateConstructorUsedError; - /// The customer's phone number - String? get phoneNumber => throw _privateConstructorUsedError; +/// The customer's full name + String get name;/// The customer's address + Address get address;/// The customer's phone number + String? get phoneNumber; +/// Create a copy of CollectAddressResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CollectAddressResultCopyWith get copyWith => _$CollectAddressResultCopyWithImpl(this as CollectAddressResult, _$identity); /// Serializes this CollectAddressResult to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CollectAddressResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CollectAddressResultCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CollectAddressResult&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)); } -/// @nodoc -abstract class $CollectAddressResultCopyWith<$Res> { - factory $CollectAddressResultCopyWith(CollectAddressResult value, - $Res Function(CollectAddressResult) then) = - _$CollectAddressResultCopyWithImpl<$Res, CollectAddressResult>; - @useResult - $Res call({String name, Address address, String? phoneNumber}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,address,phoneNumber); - $AddressCopyWith<$Res> get address; +@override +String toString() { + return 'CollectAddressResult(name: $name, address: $address, phoneNumber: $phoneNumber)'; } -/// @nodoc -class _$CollectAddressResultCopyWithImpl<$Res, - $Val extends CollectAddressResult> - implements $CollectAddressResultCopyWith<$Res> { - _$CollectAddressResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CollectAddressResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = null, - Object? address = null, - Object? phoneNumber = freezed, - }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address, - phoneNumber: freezed == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } - /// Create a copy of CollectAddressResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res> get address { - return $AddressCopyWith<$Res>(_value.address, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } } /// @nodoc -abstract class _$$CollectAddressResultImplCopyWith<$Res> - implements $CollectAddressResultCopyWith<$Res> { - factory _$$CollectAddressResultImplCopyWith(_$CollectAddressResultImpl value, - $Res Function(_$CollectAddressResultImpl) then) = - __$$CollectAddressResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String name, Address address, String? phoneNumber}); +abstract mixin class $CollectAddressResultCopyWith<$Res> { + factory $CollectAddressResultCopyWith(CollectAddressResult value, $Res Function(CollectAddressResult) _then) = _$CollectAddressResultCopyWithImpl; +@useResult +$Res call({ + String name, Address address, String? phoneNumber +}); - @override - $AddressCopyWith<$Res> get address; -} +$AddressCopyWith<$Res> get address; + +} /// @nodoc -class __$$CollectAddressResultImplCopyWithImpl<$Res> - extends _$CollectAddressResultCopyWithImpl<$Res, _$CollectAddressResultImpl> - implements _$$CollectAddressResultImplCopyWith<$Res> { - __$$CollectAddressResultImplCopyWithImpl(_$CollectAddressResultImpl _value, - $Res Function(_$CollectAddressResultImpl) _then) - : super(_value, _then); - - /// Create a copy of CollectAddressResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = null, - Object? address = null, - Object? phoneNumber = freezed, - }) { - return _then(_$CollectAddressResultImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address, - phoneNumber: freezed == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class _$CollectAddressResultCopyWithImpl<$Res> + implements $CollectAddressResultCopyWith<$Res> { + _$CollectAddressResultCopyWithImpl(this._self, this._then); + + final CollectAddressResult _self; + final $Res Function(CollectAddressResult) _then; + +/// Create a copy of CollectAddressResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? address = null,Object? phoneNumber = freezed,}) { + return _then(_self.copyWith( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of CollectAddressResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res> get address { + + return $AddressCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} } -/// @nodoc -@JsonSerializable() -class _$CollectAddressResultImpl implements _CollectAddressResult { - const _$CollectAddressResultImpl( - {required this.name, required this.address, this.phoneNumber}); - factory _$CollectAddressResultImpl.fromJson(Map json) => - _$$CollectAddressResultImplFromJson(json); +/// Adds pattern-matching-related methods to [CollectAddressResult]. +extension CollectAddressResultPatterns on CollectAddressResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CollectAddressResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CollectAddressResult() when $default != null: +return $default(_that);case _: + return orElse(); - /// The customer's full name - @override - final String name; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CollectAddressResult value) $default,){ +final _that = this; +switch (_that) { +case _CollectAddressResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// The customer's address - @override - final Address address; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CollectAddressResult value)? $default,){ +final _that = this; +switch (_that) { +case _CollectAddressResult() when $default != null: +return $default(_that);case _: + return null; - /// The customer's phone number - @override - final String? phoneNumber; +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String name, Address address, String? phoneNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CollectAddressResult() when $default != null: +return $default(_that.name,_that.address,_that.phoneNumber);case _: + return orElse(); - @override - String toString() { - return 'CollectAddressResult(name: $name, address: $address, phoneNumber: $phoneNumber)'; - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String name, Address address, String? phoneNumber) $default,) {final _that = this; +switch (_that) { +case _CollectAddressResult(): +return $default(_that.name,_that.address,_that.phoneNumber);case _: + throw StateError('Unexpected subclass'); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CollectAddressResultImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.address, address) || other.address == address) && - (identical(other.phoneNumber, phoneNumber) || - other.phoneNumber == phoneNumber)); - } +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String name, Address address, String? phoneNumber)? $default,) {final _that = this; +switch (_that) { +case _CollectAddressResult() when $default != null: +return $default(_that.name,_that.address,_that.phoneNumber);case _: + return null; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, address, phoneNumber); - - /// Create a copy of CollectAddressResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CollectAddressResultImplCopyWith<_$CollectAddressResultImpl> - get copyWith => - __$$CollectAddressResultImplCopyWithImpl<_$CollectAddressResultImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CollectAddressResultImplToJson( - this, - ); - } +} } -abstract class _CollectAddressResult implements CollectAddressResult { - const factory _CollectAddressResult( - {required final String name, - required final Address address, - final String? phoneNumber}) = _$CollectAddressResultImpl; +} - factory _CollectAddressResult.fromJson(Map json) = - _$CollectAddressResultImpl.fromJson; +/// @nodoc +@JsonSerializable() - /// The customer's full name - @override - String get name; +class _CollectAddressResult implements CollectAddressResult { + const _CollectAddressResult({required this.name, required this.address, this.phoneNumber}); + factory _CollectAddressResult.fromJson(Map json) => _$CollectAddressResultFromJson(json); + +/// The customer's full name +@override final String name; +/// The customer's address +@override final Address address; +/// The customer's phone number +@override final String? phoneNumber; + +/// Create a copy of CollectAddressResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CollectAddressResultCopyWith<_CollectAddressResult> get copyWith => __$CollectAddressResultCopyWithImpl<_CollectAddressResult>(this, _$identity); + +@override +Map toJson() { + return _$CollectAddressResultToJson(this, ); +} - /// The customer's address - @override - Address get address; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CollectAddressResult&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)); +} - /// The customer's phone number - @override - String? get phoneNumber; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,address,phoneNumber); - /// Create a copy of CollectAddressResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CollectAddressResultImplCopyWith<_$CollectAddressResultImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'CollectAddressResult(name: $name, address: $address, phoneNumber: $phoneNumber)'; } -AddressSheetParams _$AddressSheetParamsFromJson(Map json) { - return _AddressSheetParams.fromJson(json); + } /// @nodoc -mixin _$AddressSheetParams { - /// Whether the address sheet is visible - bool get visible => throw _privateConstructorUsedError; +abstract mixin class _$CollectAddressResultCopyWith<$Res> implements $CollectAddressResultCopyWith<$Res> { + factory _$CollectAddressResultCopyWith(_CollectAddressResult value, $Res Function(_CollectAddressResult) _then) = __$CollectAddressResultCopyWithImpl; +@override @useResult +$Res call({ + String name, Address address, String? phoneNumber +}); - /// Controls how the modal is presented (after animation). iOS only. - AddressSheetPresentationStyle? get presentationStyle => - throw _privateConstructorUsedError; - /// Controls how the modal animates. iOS only. - AddressSheetAnimationStyle? get animationStyle => - throw _privateConstructorUsedError; +@override $AddressCopyWith<$Res> get address; - /// Configuration for the appearance of the address sheet - PaymentSheetAppearance? get appearance => throw _privateConstructorUsedError; +} +/// @nodoc +class __$CollectAddressResultCopyWithImpl<$Res> + implements _$CollectAddressResultCopyWith<$Res> { + __$CollectAddressResultCopyWithImpl(this._self, this._then); + + final _CollectAddressResult _self; + final $Res Function(_CollectAddressResult) _then; + +/// Create a copy of CollectAddressResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? address = null,Object? phoneNumber = freezed,}) { + return _then(_CollectAddressResult( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// Default values to prepoulate the address sheet - AddressDetails? get defaultValues => throw _privateConstructorUsedError; +/// Create a copy of CollectAddressResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res> get address { + + return $AddressCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// @nodoc +mixin _$AddressSheetParams { - /// Configuration for additional fields besides the physical address - AddressSheetAdditionalFields? get additionalFields => - throw _privateConstructorUsedError; +/// Whether the address sheet is visible + bool get visible;/// Controls how the modal is presented (after animation). iOS only. + AddressSheetPresentationStyle? get presentationStyle;/// Controls how the modal animates. iOS only. + AddressSheetAnimationStyle? get animationStyle;/// Configuration for the appearance of the address sheet + PaymentSheetAppearance? get appearance;/// Default values to prepoulate the address sheet + AddressDetails? get defaultValues;/// Configuration for additional fields besides the physical address + AddressSheetAdditionalFields? get additionalFields;/// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. + List? get allowedCountries;/// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. + List? get autocompleteCountries;/// The title of the primary button displayed at the bottom of the screen. Defaults to "Save Address" + String? get primaryButtonTitle;/// The title of the address sheet. Defaults to "Address" + String? get sheetTitle;/// Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. + String? get googlePlacesApiKey; +/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddressSheetParamsCopyWith get copyWith => _$AddressSheetParamsCopyWithImpl(this as AddressSheetParams, _$identity); - /// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. - List? get allowedCountries => throw _privateConstructorUsedError; + /// Serializes this AddressSheetParams to a JSON map. + Map toJson(); - /// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. - List? get autocompleteCountries => throw _privateConstructorUsedError; - /// The title of the primary button displayed at the bottom of the screen. Defaults to "Save Address" - String? get primaryButtonTitle => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AddressSheetParams&&(identical(other.visible, visible) || other.visible == visible)&&(identical(other.presentationStyle, presentationStyle) || other.presentationStyle == presentationStyle)&&(identical(other.animationStyle, animationStyle) || other.animationStyle == animationStyle)&&(identical(other.appearance, appearance) || other.appearance == appearance)&&(identical(other.defaultValues, defaultValues) || other.defaultValues == defaultValues)&&(identical(other.additionalFields, additionalFields) || other.additionalFields == additionalFields)&&const DeepCollectionEquality().equals(other.allowedCountries, allowedCountries)&&const DeepCollectionEquality().equals(other.autocompleteCountries, autocompleteCountries)&&(identical(other.primaryButtonTitle, primaryButtonTitle) || other.primaryButtonTitle == primaryButtonTitle)&&(identical(other.sheetTitle, sheetTitle) || other.sheetTitle == sheetTitle)&&(identical(other.googlePlacesApiKey, googlePlacesApiKey) || other.googlePlacesApiKey == googlePlacesApiKey)); +} - /// The title of the address sheet. Defaults to "Address" - String? get sheetTitle => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,visible,presentationStyle,animationStyle,appearance,defaultValues,additionalFields,const DeepCollectionEquality().hash(allowedCountries),const DeepCollectionEquality().hash(autocompleteCountries),primaryButtonTitle,sheetTitle,googlePlacesApiKey); - /// Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. - String? get googlePlacesApiKey => throw _privateConstructorUsedError; +@override +String toString() { + return 'AddressSheetParams(visible: $visible, presentationStyle: $presentationStyle, animationStyle: $animationStyle, appearance: $appearance, defaultValues: $defaultValues, additionalFields: $additionalFields, allowedCountries: $allowedCountries, autocompleteCountries: $autocompleteCountries, primaryButtonTitle: $primaryButtonTitle, sheetTitle: $sheetTitle, googlePlacesApiKey: $googlePlacesApiKey)'; +} - /// Serializes this AddressSheetParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AddressSheetParamsCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $AddressSheetParamsCopyWith<$Res> { - factory $AddressSheetParamsCopyWith( - AddressSheetParams value, $Res Function(AddressSheetParams) then) = - _$AddressSheetParamsCopyWithImpl<$Res, AddressSheetParams>; - @useResult - $Res call( - {bool visible, - AddressSheetPresentationStyle? presentationStyle, - AddressSheetAnimationStyle? animationStyle, - PaymentSheetAppearance? appearance, - AddressDetails? defaultValues, - AddressSheetAdditionalFields? additionalFields, - List? allowedCountries, - List? autocompleteCountries, - String? primaryButtonTitle, - String? sheetTitle, - String? googlePlacesApiKey}); - - $PaymentSheetAppearanceCopyWith<$Res>? get appearance; - $AddressDetailsCopyWith<$Res>? get defaultValues; - $AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields; -} +abstract mixin class $AddressSheetParamsCopyWith<$Res> { + factory $AddressSheetParamsCopyWith(AddressSheetParams value, $Res Function(AddressSheetParams) _then) = _$AddressSheetParamsCopyWithImpl; +@useResult +$Res call({ + bool visible, AddressSheetPresentationStyle? presentationStyle, AddressSheetAnimationStyle? animationStyle, PaymentSheetAppearance? appearance, AddressDetails? defaultValues, AddressSheetAdditionalFields? additionalFields, List? allowedCountries, List? autocompleteCountries, String? primaryButtonTitle, String? sheetTitle, String? googlePlacesApiKey +}); + +$PaymentSheetAppearanceCopyWith<$Res>? get appearance;$AddressDetailsCopyWith<$Res>? get defaultValues;$AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields; + +} /// @nodoc -class _$AddressSheetParamsCopyWithImpl<$Res, $Val extends AddressSheetParams> +class _$AddressSheetParamsCopyWithImpl<$Res> implements $AddressSheetParamsCopyWith<$Res> { - _$AddressSheetParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? visible = null, - Object? presentationStyle = freezed, - Object? animationStyle = freezed, - Object? appearance = freezed, - Object? defaultValues = freezed, - Object? additionalFields = freezed, - Object? allowedCountries = freezed, - Object? autocompleteCountries = freezed, - Object? primaryButtonTitle = freezed, - Object? sheetTitle = freezed, - Object? googlePlacesApiKey = freezed, - }) { - return _then(_value.copyWith( - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - presentationStyle: freezed == presentationStyle - ? _value.presentationStyle - : presentationStyle // ignore: cast_nullable_to_non_nullable - as AddressSheetPresentationStyle?, - animationStyle: freezed == animationStyle - ? _value.animationStyle - : animationStyle // ignore: cast_nullable_to_non_nullable - as AddressSheetAnimationStyle?, - appearance: freezed == appearance - ? _value.appearance - : appearance // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearance?, - defaultValues: freezed == defaultValues - ? _value.defaultValues - : defaultValues // ignore: cast_nullable_to_non_nullable - as AddressDetails?, - additionalFields: freezed == additionalFields - ? _value.additionalFields - : additionalFields // ignore: cast_nullable_to_non_nullable - as AddressSheetAdditionalFields?, - allowedCountries: freezed == allowedCountries - ? _value.allowedCountries - : allowedCountries // ignore: cast_nullable_to_non_nullable - as List?, - autocompleteCountries: freezed == autocompleteCountries - ? _value.autocompleteCountries - : autocompleteCountries // ignore: cast_nullable_to_non_nullable - as List?, - primaryButtonTitle: freezed == primaryButtonTitle - ? _value.primaryButtonTitle - : primaryButtonTitle // ignore: cast_nullable_to_non_nullable - as String?, - sheetTitle: freezed == sheetTitle - ? _value.sheetTitle - : sheetTitle // ignore: cast_nullable_to_non_nullable - as String?, - googlePlacesApiKey: freezed == googlePlacesApiKey - ? _value.googlePlacesApiKey - : googlePlacesApiKey // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + _$AddressSheetParamsCopyWithImpl(this._self, this._then); + + final AddressSheetParams _self; + final $Res Function(AddressSheetParams) _then; + +/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? visible = null,Object? presentationStyle = freezed,Object? animationStyle = freezed,Object? appearance = freezed,Object? defaultValues = freezed,Object? additionalFields = freezed,Object? allowedCountries = freezed,Object? autocompleteCountries = freezed,Object? primaryButtonTitle = freezed,Object? sheetTitle = freezed,Object? googlePlacesApiKey = freezed,}) { + return _then(_self.copyWith( +visible: null == visible ? _self.visible : visible // ignore: cast_nullable_to_non_nullable +as bool,presentationStyle: freezed == presentationStyle ? _self.presentationStyle : presentationStyle // ignore: cast_nullable_to_non_nullable +as AddressSheetPresentationStyle?,animationStyle: freezed == animationStyle ? _self.animationStyle : animationStyle // ignore: cast_nullable_to_non_nullable +as AddressSheetAnimationStyle?,appearance: freezed == appearance ? _self.appearance : appearance // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearance?,defaultValues: freezed == defaultValues ? _self.defaultValues : defaultValues // ignore: cast_nullable_to_non_nullable +as AddressDetails?,additionalFields: freezed == additionalFields ? _self.additionalFields : additionalFields // ignore: cast_nullable_to_non_nullable +as AddressSheetAdditionalFields?,allowedCountries: freezed == allowedCountries ? _self.allowedCountries : allowedCountries // ignore: cast_nullable_to_non_nullable +as List?,autocompleteCountries: freezed == autocompleteCountries ? _self.autocompleteCountries : autocompleteCountries // ignore: cast_nullable_to_non_nullable +as List?,primaryButtonTitle: freezed == primaryButtonTitle ? _self.primaryButtonTitle : primaryButtonTitle // ignore: cast_nullable_to_non_nullable +as String?,sheetTitle: freezed == sheetTitle ? _self.sheetTitle : sheetTitle // ignore: cast_nullable_to_non_nullable +as String?,googlePlacesApiKey: freezed == googlePlacesApiKey ? _self.googlePlacesApiKey : googlePlacesApiKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith<$Res>? get appearance { + if (_self.appearance == null) { + return null; } - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetAppearanceCopyWith<$Res>? get appearance { - if (_value.appearance == null) { - return null; - } - - return $PaymentSheetAppearanceCopyWith<$Res>(_value.appearance!, (value) { - return _then(_value.copyWith(appearance: value) as $Val); - }); + return $PaymentSheetAppearanceCopyWith<$Res>(_self.appearance!, (value) { + return _then(_self.copyWith(appearance: value)); + }); +}/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressDetailsCopyWith<$Res>? get defaultValues { + if (_self.defaultValues == null) { + return null; } - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressDetailsCopyWith<$Res>? get defaultValues { - if (_value.defaultValues == null) { - return null; - } - - return $AddressDetailsCopyWith<$Res>(_value.defaultValues!, (value) { - return _then(_value.copyWith(defaultValues: value) as $Val); - }); + return $AddressDetailsCopyWith<$Res>(_self.defaultValues!, (value) { + return _then(_self.copyWith(defaultValues: value)); + }); +}/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields { + if (_self.additionalFields == null) { + return null; } - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields { - if (_value.additionalFields == null) { - return null; - } - - return $AddressSheetAdditionalFieldsCopyWith<$Res>(_value.additionalFields!, - (value) { - return _then(_value.copyWith(additionalFields: value) as $Val); - }); - } + return $AddressSheetAdditionalFieldsCopyWith<$Res>(_self.additionalFields!, (value) { + return _then(_self.copyWith(additionalFields: value)); + }); +} } -/// @nodoc -abstract class _$$AddressSheetParamsImplCopyWith<$Res> - implements $AddressSheetParamsCopyWith<$Res> { - factory _$$AddressSheetParamsImplCopyWith(_$AddressSheetParamsImpl value, - $Res Function(_$AddressSheetParamsImpl) then) = - __$$AddressSheetParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool visible, - AddressSheetPresentationStyle? presentationStyle, - AddressSheetAnimationStyle? animationStyle, - PaymentSheetAppearance? appearance, - AddressDetails? defaultValues, - AddressSheetAdditionalFields? additionalFields, - List? allowedCountries, - List? autocompleteCountries, - String? primaryButtonTitle, - String? sheetTitle, - String? googlePlacesApiKey}); - - @override - $PaymentSheetAppearanceCopyWith<$Res>? get appearance; - @override - $AddressDetailsCopyWith<$Res>? get defaultValues; - @override - $AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields; + +/// Adds pattern-matching-related methods to [AddressSheetParams]. +extension AddressSheetParamsPatterns on AddressSheetParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AddressSheetParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AddressSheetParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AddressSheetParams value) $default,){ +final _that = this; +switch (_that) { +case _AddressSheetParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AddressSheetParams value)? $default,){ +final _that = this; +switch (_that) { +case _AddressSheetParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool visible, AddressSheetPresentationStyle? presentationStyle, AddressSheetAnimationStyle? animationStyle, PaymentSheetAppearance? appearance, AddressDetails? defaultValues, AddressSheetAdditionalFields? additionalFields, List? allowedCountries, List? autocompleteCountries, String? primaryButtonTitle, String? sheetTitle, String? googlePlacesApiKey)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AddressSheetParams() when $default != null: +return $default(_that.visible,_that.presentationStyle,_that.animationStyle,_that.appearance,_that.defaultValues,_that.additionalFields,_that.allowedCountries,_that.autocompleteCountries,_that.primaryButtonTitle,_that.sheetTitle,_that.googlePlacesApiKey);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool visible, AddressSheetPresentationStyle? presentationStyle, AddressSheetAnimationStyle? animationStyle, PaymentSheetAppearance? appearance, AddressDetails? defaultValues, AddressSheetAdditionalFields? additionalFields, List? allowedCountries, List? autocompleteCountries, String? primaryButtonTitle, String? sheetTitle, String? googlePlacesApiKey) $default,) {final _that = this; +switch (_that) { +case _AddressSheetParams(): +return $default(_that.visible,_that.presentationStyle,_that.animationStyle,_that.appearance,_that.defaultValues,_that.additionalFields,_that.allowedCountries,_that.autocompleteCountries,_that.primaryButtonTitle,_that.sheetTitle,_that.googlePlacesApiKey);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool visible, AddressSheetPresentationStyle? presentationStyle, AddressSheetAnimationStyle? animationStyle, PaymentSheetAppearance? appearance, AddressDetails? defaultValues, AddressSheetAdditionalFields? additionalFields, List? allowedCountries, List? autocompleteCountries, String? primaryButtonTitle, String? sheetTitle, String? googlePlacesApiKey)? $default,) {final _that = this; +switch (_that) { +case _AddressSheetParams() when $default != null: +return $default(_that.visible,_that.presentationStyle,_that.animationStyle,_that.appearance,_that.defaultValues,_that.additionalFields,_that.allowedCountries,_that.autocompleteCountries,_that.primaryButtonTitle,_that.sheetTitle,_that.googlePlacesApiKey);case _: + return null; + +} } -/// @nodoc -class __$$AddressSheetParamsImplCopyWithImpl<$Res> - extends _$AddressSheetParamsCopyWithImpl<$Res, _$AddressSheetParamsImpl> - implements _$$AddressSheetParamsImplCopyWith<$Res> { - __$$AddressSheetParamsImplCopyWithImpl(_$AddressSheetParamsImpl _value, - $Res Function(_$AddressSheetParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? visible = null, - Object? presentationStyle = freezed, - Object? animationStyle = freezed, - Object? appearance = freezed, - Object? defaultValues = freezed, - Object? additionalFields = freezed, - Object? allowedCountries = freezed, - Object? autocompleteCountries = freezed, - Object? primaryButtonTitle = freezed, - Object? sheetTitle = freezed, - Object? googlePlacesApiKey = freezed, - }) { - return _then(_$AddressSheetParamsImpl( - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - presentationStyle: freezed == presentationStyle - ? _value.presentationStyle - : presentationStyle // ignore: cast_nullable_to_non_nullable - as AddressSheetPresentationStyle?, - animationStyle: freezed == animationStyle - ? _value.animationStyle - : animationStyle // ignore: cast_nullable_to_non_nullable - as AddressSheetAnimationStyle?, - appearance: freezed == appearance - ? _value.appearance - : appearance // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearance?, - defaultValues: freezed == defaultValues - ? _value.defaultValues - : defaultValues // ignore: cast_nullable_to_non_nullable - as AddressDetails?, - additionalFields: freezed == additionalFields - ? _value.additionalFields - : additionalFields // ignore: cast_nullable_to_non_nullable - as AddressSheetAdditionalFields?, - allowedCountries: freezed == allowedCountries - ? _value._allowedCountries - : allowedCountries // ignore: cast_nullable_to_non_nullable - as List?, - autocompleteCountries: freezed == autocompleteCountries - ? _value._autocompleteCountries - : autocompleteCountries // ignore: cast_nullable_to_non_nullable - as List?, - primaryButtonTitle: freezed == primaryButtonTitle - ? _value.primaryButtonTitle - : primaryButtonTitle // ignore: cast_nullable_to_non_nullable - as String?, - sheetTitle: freezed == sheetTitle - ? _value.sheetTitle - : sheetTitle // ignore: cast_nullable_to_non_nullable - as String?, - googlePlacesApiKey: freezed == googlePlacesApiKey - ? _value.googlePlacesApiKey - : googlePlacesApiKey // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AddressSheetParamsImpl implements _AddressSheetParams { - const _$AddressSheetParamsImpl( - {this.visible = true, - this.presentationStyle, - this.animationStyle, - this.appearance, - this.defaultValues, - this.additionalFields, - final List? allowedCountries, - final List? autocompleteCountries, - this.primaryButtonTitle, - this.sheetTitle, - this.googlePlacesApiKey}) - : _allowedCountries = allowedCountries, - _autocompleteCountries = autocompleteCountries; - - factory _$AddressSheetParamsImpl.fromJson(Map json) => - _$$AddressSheetParamsImplFromJson(json); - - /// Whether the address sheet is visible - @override - @JsonKey() - final bool visible; - - /// Controls how the modal is presented (after animation). iOS only. - @override - final AddressSheetPresentationStyle? presentationStyle; - - /// Controls how the modal animates. iOS only. - @override - final AddressSheetAnimationStyle? animationStyle; - - /// Configuration for the appearance of the address sheet - @override - final PaymentSheetAppearance? appearance; - - /// Default values to prepoulate the address sheet - @override - final AddressDetails? defaultValues; - - /// Configuration for additional fields besides the physical address - @override - final AddressSheetAdditionalFields? additionalFields; - - /// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. - final List? _allowedCountries; - - /// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. - @override - List? get allowedCountries { - final value = _allowedCountries; - if (value == null) return null; - if (_allowedCountries is EqualUnmodifiableListView) - return _allowedCountries; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _AddressSheetParams implements AddressSheetParams { + const _AddressSheetParams({this.visible = true, this.presentationStyle, this.animationStyle, this.appearance, this.defaultValues, this.additionalFields, final List? allowedCountries, final List? autocompleteCountries, this.primaryButtonTitle, this.sheetTitle, this.googlePlacesApiKey}): _allowedCountries = allowedCountries,_autocompleteCountries = autocompleteCountries; + factory _AddressSheetParams.fromJson(Map json) => _$AddressSheetParamsFromJson(json); + +/// Whether the address sheet is visible +@override@JsonKey() final bool visible; +/// Controls how the modal is presented (after animation). iOS only. +@override final AddressSheetPresentationStyle? presentationStyle; +/// Controls how the modal animates. iOS only. +@override final AddressSheetAnimationStyle? animationStyle; +/// Configuration for the appearance of the address sheet +@override final PaymentSheetAppearance? appearance; +/// Default values to prepoulate the address sheet +@override final AddressDetails? defaultValues; +/// Configuration for additional fields besides the physical address +@override final AddressSheetAdditionalFields? additionalFields; +/// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. + final List? _allowedCountries; +/// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. +@override List? get allowedCountries { + final value = _allowedCountries; + if (value == null) return null; + if (_allowedCountries is EqualUnmodifiableListView) return _allowedCountries; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. + final List? _autocompleteCountries; +/// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. +@override List? get autocompleteCountries { + final value = _autocompleteCountries; + if (value == null) return null; + if (_autocompleteCountries is EqualUnmodifiableListView) return _autocompleteCountries; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// The title of the primary button displayed at the bottom of the screen. Defaults to "Save Address" +@override final String? primaryButtonTitle; +/// The title of the address sheet. Defaults to "Address" +@override final String? sheetTitle; +/// Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. +@override final String? googlePlacesApiKey; + +/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddressSheetParamsCopyWith<_AddressSheetParams> get copyWith => __$AddressSheetParamsCopyWithImpl<_AddressSheetParams>(this, _$identity); + +@override +Map toJson() { + return _$AddressSheetParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddressSheetParams&&(identical(other.visible, visible) || other.visible == visible)&&(identical(other.presentationStyle, presentationStyle) || other.presentationStyle == presentationStyle)&&(identical(other.animationStyle, animationStyle) || other.animationStyle == animationStyle)&&(identical(other.appearance, appearance) || other.appearance == appearance)&&(identical(other.defaultValues, defaultValues) || other.defaultValues == defaultValues)&&(identical(other.additionalFields, additionalFields) || other.additionalFields == additionalFields)&&const DeepCollectionEquality().equals(other._allowedCountries, _allowedCountries)&&const DeepCollectionEquality().equals(other._autocompleteCountries, _autocompleteCountries)&&(identical(other.primaryButtonTitle, primaryButtonTitle) || other.primaryButtonTitle == primaryButtonTitle)&&(identical(other.sheetTitle, sheetTitle) || other.sheetTitle == sheetTitle)&&(identical(other.googlePlacesApiKey, googlePlacesApiKey) || other.googlePlacesApiKey == googlePlacesApiKey)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,visible,presentationStyle,animationStyle,appearance,defaultValues,additionalFields,const DeepCollectionEquality().hash(_allowedCountries),const DeepCollectionEquality().hash(_autocompleteCountries),primaryButtonTitle,sheetTitle,googlePlacesApiKey); + +@override +String toString() { + return 'AddressSheetParams(visible: $visible, presentationStyle: $presentationStyle, animationStyle: $animationStyle, appearance: $appearance, defaultValues: $defaultValues, additionalFields: $additionalFields, allowedCountries: $allowedCountries, autocompleteCountries: $autocompleteCountries, primaryButtonTitle: $primaryButtonTitle, sheetTitle: $sheetTitle, googlePlacesApiKey: $googlePlacesApiKey)'; +} - /// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. - final List? _autocompleteCountries; - - /// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. - @override - List? get autocompleteCountries { - final value = _autocompleteCountries; - if (value == null) return null; - if (_autocompleteCountries is EqualUnmodifiableListView) - return _autocompleteCountries; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - /// The title of the primary button displayed at the bottom of the screen. Defaults to "Save Address" - @override - final String? primaryButtonTitle; +} + +/// @nodoc +abstract mixin class _$AddressSheetParamsCopyWith<$Res> implements $AddressSheetParamsCopyWith<$Res> { + factory _$AddressSheetParamsCopyWith(_AddressSheetParams value, $Res Function(_AddressSheetParams) _then) = __$AddressSheetParamsCopyWithImpl; +@override @useResult +$Res call({ + bool visible, AddressSheetPresentationStyle? presentationStyle, AddressSheetAnimationStyle? animationStyle, PaymentSheetAppearance? appearance, AddressDetails? defaultValues, AddressSheetAdditionalFields? additionalFields, List? allowedCountries, List? autocompleteCountries, String? primaryButtonTitle, String? sheetTitle, String? googlePlacesApiKey +}); - /// The title of the address sheet. Defaults to "Address" - @override - final String? sheetTitle; - /// Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. - @override - final String? googlePlacesApiKey; +@override $PaymentSheetAppearanceCopyWith<$Res>? get appearance;@override $AddressDetailsCopyWith<$Res>? get defaultValues;@override $AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields; + +} +/// @nodoc +class __$AddressSheetParamsCopyWithImpl<$Res> + implements _$AddressSheetParamsCopyWith<$Res> { + __$AddressSheetParamsCopyWithImpl(this._self, this._then); + + final _AddressSheetParams _self; + final $Res Function(_AddressSheetParams) _then; + +/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? visible = null,Object? presentationStyle = freezed,Object? animationStyle = freezed,Object? appearance = freezed,Object? defaultValues = freezed,Object? additionalFields = freezed,Object? allowedCountries = freezed,Object? autocompleteCountries = freezed,Object? primaryButtonTitle = freezed,Object? sheetTitle = freezed,Object? googlePlacesApiKey = freezed,}) { + return _then(_AddressSheetParams( +visible: null == visible ? _self.visible : visible // ignore: cast_nullable_to_non_nullable +as bool,presentationStyle: freezed == presentationStyle ? _self.presentationStyle : presentationStyle // ignore: cast_nullable_to_non_nullable +as AddressSheetPresentationStyle?,animationStyle: freezed == animationStyle ? _self.animationStyle : animationStyle // ignore: cast_nullable_to_non_nullable +as AddressSheetAnimationStyle?,appearance: freezed == appearance ? _self.appearance : appearance // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearance?,defaultValues: freezed == defaultValues ? _self.defaultValues : defaultValues // ignore: cast_nullable_to_non_nullable +as AddressDetails?,additionalFields: freezed == additionalFields ? _self.additionalFields : additionalFields // ignore: cast_nullable_to_non_nullable +as AddressSheetAdditionalFields?,allowedCountries: freezed == allowedCountries ? _self._allowedCountries : allowedCountries // ignore: cast_nullable_to_non_nullable +as List?,autocompleteCountries: freezed == autocompleteCountries ? _self._autocompleteCountries : autocompleteCountries // ignore: cast_nullable_to_non_nullable +as List?,primaryButtonTitle: freezed == primaryButtonTitle ? _self.primaryButtonTitle : primaryButtonTitle // ignore: cast_nullable_to_non_nullable +as String?,sheetTitle: freezed == sheetTitle ? _self.sheetTitle : sheetTitle // ignore: cast_nullable_to_non_nullable +as String?,googlePlacesApiKey: freezed == googlePlacesApiKey ? _self.googlePlacesApiKey : googlePlacesApiKey // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - @override - String toString() { - return 'AddressSheetParams(visible: $visible, presentationStyle: $presentationStyle, animationStyle: $animationStyle, appearance: $appearance, defaultValues: $defaultValues, additionalFields: $additionalFields, allowedCountries: $allowedCountries, autocompleteCountries: $autocompleteCountries, primaryButtonTitle: $primaryButtonTitle, sheetTitle: $sheetTitle, googlePlacesApiKey: $googlePlacesApiKey)'; +/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith<$Res>? get appearance { + if (_self.appearance == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AddressSheetParamsImpl && - (identical(other.visible, visible) || other.visible == visible) && - (identical(other.presentationStyle, presentationStyle) || - other.presentationStyle == presentationStyle) && - (identical(other.animationStyle, animationStyle) || - other.animationStyle == animationStyle) && - (identical(other.appearance, appearance) || - other.appearance == appearance) && - (identical(other.defaultValues, defaultValues) || - other.defaultValues == defaultValues) && - (identical(other.additionalFields, additionalFields) || - other.additionalFields == additionalFields) && - const DeepCollectionEquality() - .equals(other._allowedCountries, _allowedCountries) && - const DeepCollectionEquality() - .equals(other._autocompleteCountries, _autocompleteCountries) && - (identical(other.primaryButtonTitle, primaryButtonTitle) || - other.primaryButtonTitle == primaryButtonTitle) && - (identical(other.sheetTitle, sheetTitle) || - other.sheetTitle == sheetTitle) && - (identical(other.googlePlacesApiKey, googlePlacesApiKey) || - other.googlePlacesApiKey == googlePlacesApiKey)); + return $PaymentSheetAppearanceCopyWith<$Res>(_self.appearance!, (value) { + return _then(_self.copyWith(appearance: value)); + }); +}/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressDetailsCopyWith<$Res>? get defaultValues { + if (_self.defaultValues == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - visible, - presentationStyle, - animationStyle, - appearance, - defaultValues, - additionalFields, - const DeepCollectionEquality().hash(_allowedCountries), - const DeepCollectionEquality().hash(_autocompleteCountries), - primaryButtonTitle, - sheetTitle, - googlePlacesApiKey); - - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AddressSheetParamsImplCopyWith<_$AddressSheetParamsImpl> get copyWith => - __$$AddressSheetParamsImplCopyWithImpl<_$AddressSheetParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$AddressSheetParamsImplToJson( - this, - ); + return $AddressDetailsCopyWith<$Res>(_self.defaultValues!, (value) { + return _then(_self.copyWith(defaultValues: value)); + }); +}/// Create a copy of AddressSheetParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressSheetAdditionalFieldsCopyWith<$Res>? get additionalFields { + if (_self.additionalFields == null) { + return null; } -} -abstract class _AddressSheetParams implements AddressSheetParams { - const factory _AddressSheetParams( - {final bool visible, - final AddressSheetPresentationStyle? presentationStyle, - final AddressSheetAnimationStyle? animationStyle, - final PaymentSheetAppearance? appearance, - final AddressDetails? defaultValues, - final AddressSheetAdditionalFields? additionalFields, - final List? allowedCountries, - final List? autocompleteCountries, - final String? primaryButtonTitle, - final String? sheetTitle, - final String? googlePlacesApiKey}) = _$AddressSheetParamsImpl; - - factory _AddressSheetParams.fromJson(Map json) = - _$AddressSheetParamsImpl.fromJson; - - /// Whether the address sheet is visible - @override - bool get visible; - - /// Controls how the modal is presented (after animation). iOS only. - @override - AddressSheetPresentationStyle? get presentationStyle; - - /// Controls how the modal animates. iOS only. - @override - AddressSheetAnimationStyle? get animationStyle; - - /// Configuration for the appearance of the address sheet - @override - PaymentSheetAppearance? get appearance; - - /// Default values to prepoulate the address sheet - @override - AddressDetails? get defaultValues; - - /// Configuration for additional fields besides the physical address - @override - AddressSheetAdditionalFields? get additionalFields; - - /// A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. - @override - List? get allowedCountries; - - /// A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. - @override - List? get autocompleteCountries; - - /// The title of the primary button displayed at the bottom of the screen. Defaults to "Save Address" - @override - String? get primaryButtonTitle; - - /// The title of the address sheet. Defaults to "Address" - @override - String? get sheetTitle; - - /// Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. - @override - String? get googlePlacesApiKey; - - /// Create a copy of AddressSheetParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AddressSheetParamsImplCopyWith<_$AddressSheetParamsImpl> get copyWith => - throw _privateConstructorUsedError; + return $AddressSheetAdditionalFieldsCopyWith<$Res>(_self.additionalFields!, (value) { + return _then(_self.copyWith(additionalFields: value)); + }); } +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/address_sheet.g.dart b/packages/stripe_platform_interface/lib/src/models/address_sheet.g.dart index bac5fbdb9..fb9725210 100644 --- a/packages/stripe_platform_interface/lib/src/models/address_sheet.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/address_sheet.g.dart @@ -6,21 +6,22 @@ part of 'address_sheet.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AddressSheetAdditionalFieldsImpl _$$AddressSheetAdditionalFieldsImplFromJson( - Map json) => - _$AddressSheetAdditionalFieldsImpl( - phoneNumber: $enumDecode( - _$AddressSheetPhoneNumberFieldEnumMap, json['phoneNumber']), - checkboxLabel: json['checkboxLabel'] as String?, - ); +_AddressSheetAdditionalFields _$AddressSheetAdditionalFieldsFromJson( + Map json, +) => _AddressSheetAdditionalFields( + phoneNumber: $enumDecode( + _$AddressSheetPhoneNumberFieldEnumMap, + json['phoneNumber'], + ), + checkboxLabel: json['checkboxLabel'] as String?, +); -Map _$$AddressSheetAdditionalFieldsImplToJson( - _$AddressSheetAdditionalFieldsImpl instance) => - { - 'phoneNumber': - _$AddressSheetPhoneNumberFieldEnumMap[instance.phoneNumber]!, - 'checkboxLabel': instance.checkboxLabel, - }; +Map _$AddressSheetAdditionalFieldsToJson( + _AddressSheetAdditionalFields instance, +) => { + 'phoneNumber': _$AddressSheetPhoneNumberFieldEnumMap[instance.phoneNumber]!, + 'checkboxLabel': instance.checkboxLabel, +}; const _$AddressSheetPhoneNumberFieldEnumMap = { AddressSheetPhoneNumberField.required: 'required', @@ -28,42 +29,48 @@ const _$AddressSheetPhoneNumberFieldEnumMap = { AddressSheetPhoneNumberField.hidden: 'hidden', }; -_$CollectAddressResultImpl _$$CollectAddressResultImplFromJson( - Map json) => - _$CollectAddressResultImpl( - name: json['name'] as String, - address: Address.fromJson(json['address'] as Map), - phoneNumber: json['phoneNumber'] as String?, - ); +_CollectAddressResult _$CollectAddressResultFromJson( + Map json, +) => _CollectAddressResult( + name: json['name'] as String, + address: Address.fromJson(json['address'] as Map), + phoneNumber: json['phoneNumber'] as String?, +); -Map _$$CollectAddressResultImplToJson( - _$CollectAddressResultImpl instance) => - { - 'name': instance.name, - 'address': instance.address, - 'phoneNumber': instance.phoneNumber, - }; +Map _$CollectAddressResultToJson( + _CollectAddressResult instance, +) => { + 'name': instance.name, + 'address': instance.address, + 'phoneNumber': instance.phoneNumber, +}; -_$AddressSheetParamsImpl _$$AddressSheetParamsImplFromJson( - Map json) => - _$AddressSheetParamsImpl( +_AddressSheetParams _$AddressSheetParamsFromJson(Map json) => + _AddressSheetParams( visible: json['visible'] as bool? ?? true, presentationStyle: $enumDecodeNullable( - _$AddressSheetPresentationStyleEnumMap, json['presentationStyle']), + _$AddressSheetPresentationStyleEnumMap, + json['presentationStyle'], + ), animationStyle: $enumDecodeNullable( - _$AddressSheetAnimationStyleEnumMap, json['animationStyle']), + _$AddressSheetAnimationStyleEnumMap, + json['animationStyle'], + ), appearance: json['appearance'] == null ? null : PaymentSheetAppearance.fromJson( - json['appearance'] as Map), + json['appearance'] as Map, + ), defaultValues: json['defaultValues'] == null ? null : AddressDetails.fromJson( - json['defaultValues'] as Map), + json['defaultValues'] as Map, + ), additionalFields: json['additionalFields'] == null ? null : AddressSheetAdditionalFields.fromJson( - json['additionalFields'] as Map), + json['additionalFields'] as Map, + ), allowedCountries: (json['allowedCountries'] as List?) ?.map((e) => e as String) .toList(), @@ -75,8 +82,7 @@ _$AddressSheetParamsImpl _$$AddressSheetParamsImplFromJson( googlePlacesApiKey: json['googlePlacesApiKey'] as String?, ); -Map _$$AddressSheetParamsImplToJson( - _$AddressSheetParamsImpl instance) => +Map _$AddressSheetParamsToJson(_AddressSheetParams instance) => { 'visible': instance.visible, 'presentationStyle': diff --git a/packages/stripe_platform_interface/lib/src/models/app_info.dart b/packages/stripe_platform_interface/lib/src/models/app_info.dart index ababc6e44..6f7a5f4a9 100644 --- a/packages/stripe_platform_interface/lib/src/models/app_info.dart +++ b/packages/stripe_platform_interface/lib/src/models/app_info.dart @@ -4,7 +4,7 @@ part 'app_info.freezed.dart'; part 'app_info.g.dart'; @freezed -class AppInfo with _$AppInfo { +abstract class AppInfo with _$AppInfo { @JsonSerializable(explicitToJson: true) const factory AppInfo({ String? name, diff --git a/packages/stripe_platform_interface/lib/src/models/app_info.freezed.dart b/packages/stripe_platform_interface/lib/src/models/app_info.freezed.dart index f13628500..9e2c62658 100644 --- a/packages/stripe_platform_interface/lib/src/models/app_info.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/app_info.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,206 +9,278 @@ part of 'app_info.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -AppInfo _$AppInfoFromJson(Map json) { - return _AppInfo.fromJson(json); -} - /// @nodoc mixin _$AppInfo { - String? get name => throw _privateConstructorUsedError; - String? get partnerId => throw _privateConstructorUsedError; - String? get url => throw _privateConstructorUsedError; - String? get version => throw _privateConstructorUsedError; + + String? get name; String? get partnerId; String? get url; String? get version; +/// Create a copy of AppInfo +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AppInfoCopyWith get copyWith => _$AppInfoCopyWithImpl(this as AppInfo, _$identity); /// Serializes this AppInfo to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of AppInfo - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AppInfoCopyWith get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AppInfo&&(identical(other.name, name) || other.name == name)&&(identical(other.partnerId, partnerId) || other.partnerId == partnerId)&&(identical(other.url, url) || other.url == url)&&(identical(other.version, version) || other.version == version)); } -/// @nodoc -abstract class $AppInfoCopyWith<$Res> { - factory $AppInfoCopyWith(AppInfo value, $Res Function(AppInfo) then) = - _$AppInfoCopyWithImpl<$Res, AppInfo>; - @useResult - $Res call({String? name, String? partnerId, String? url, String? version}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,partnerId,url,version); + +@override +String toString() { + return 'AppInfo(name: $name, partnerId: $partnerId, url: $url, version: $version)'; +} + + } /// @nodoc -class _$AppInfoCopyWithImpl<$Res, $Val extends AppInfo> +abstract mixin class $AppInfoCopyWith<$Res> { + factory $AppInfoCopyWith(AppInfo value, $Res Function(AppInfo) _then) = _$AppInfoCopyWithImpl; +@useResult +$Res call({ + String? name, String? partnerId, String? url, String? version +}); + + + + +} +/// @nodoc +class _$AppInfoCopyWithImpl<$Res> implements $AppInfoCopyWith<$Res> { - _$AppInfoCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AppInfo - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? partnerId = freezed, - Object? url = freezed, - Object? version = freezed, - }) { - return _then(_value.copyWith( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - partnerId: freezed == partnerId - ? _value.partnerId - : partnerId // ignore: cast_nullable_to_non_nullable - as String?, - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - version: freezed == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + _$AppInfoCopyWithImpl(this._self, this._then); + + final AppInfo _self; + final $Res Function(AppInfo) _then; + +/// Create a copy of AppInfo +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? partnerId = freezed,Object? url = freezed,Object? version = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,partnerId: freezed == partnerId ? _self.partnerId : partnerId // ignore: cast_nullable_to_non_nullable +as String?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?,version: freezed == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$AppInfoImplCopyWith<$Res> implements $AppInfoCopyWith<$Res> { - factory _$$AppInfoImplCopyWith( - _$AppInfoImpl value, $Res Function(_$AppInfoImpl) then) = - __$$AppInfoImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? name, String? partnerId, String? url, String? version}); } -/// @nodoc -class __$$AppInfoImplCopyWithImpl<$Res> - extends _$AppInfoCopyWithImpl<$Res, _$AppInfoImpl> - implements _$$AppInfoImplCopyWith<$Res> { - __$$AppInfoImplCopyWithImpl( - _$AppInfoImpl _value, $Res Function(_$AppInfoImpl) _then) - : super(_value, _then); - - /// Create a copy of AppInfo - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? partnerId = freezed, - Object? url = freezed, - Object? version = freezed, - }) { - return _then(_$AppInfoImpl( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - partnerId: freezed == partnerId - ? _value.partnerId - : partnerId // ignore: cast_nullable_to_non_nullable - as String?, - url: freezed == url - ? _value.url - : url // ignore: cast_nullable_to_non_nullable - as String?, - version: freezed == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + +/// Adds pattern-matching-related methods to [AppInfo]. +extension AppInfoPatterns on AppInfo { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AppInfo value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AppInfo() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AppInfo value) $default,){ +final _that = this; +switch (_that) { +case _AppInfo(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AppInfo value)? $default,){ +final _that = this; +switch (_that) { +case _AppInfo() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? name, String? partnerId, String? url, String? version)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AppInfo() when $default != null: +return $default(_that.name,_that.partnerId,_that.url,_that.version);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? name, String? partnerId, String? url, String? version) $default,) {final _that = this; +switch (_that) { +case _AppInfo(): +return $default(_that.name,_that.partnerId,_that.url,_that.version);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? name, String? partnerId, String? url, String? version)? $default,) {final _that = this; +switch (_that) { +case _AppInfo() when $default != null: +return $default(_that.name,_that.partnerId,_that.url,_that.version);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AppInfoImpl implements _AppInfo { - const _$AppInfoImpl({this.name, this.partnerId, this.url, this.version}); - - factory _$AppInfoImpl.fromJson(Map json) => - _$$AppInfoImplFromJson(json); - - @override - final String? name; - @override - final String? partnerId; - @override - final String? url; - @override - final String? version; - - @override - String toString() { - return 'AppInfo(name: $name, partnerId: $partnerId, url: $url, version: $version)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AppInfoImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.partnerId, partnerId) || - other.partnerId == partnerId) && - (identical(other.url, url) || other.url == url) && - (identical(other.version, version) || other.version == version)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, partnerId, url, version); - - /// Create a copy of AppInfo - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AppInfoImplCopyWith<_$AppInfoImpl> get copyWith => - __$$AppInfoImplCopyWithImpl<_$AppInfoImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AppInfoImplToJson( - this, - ); - } -} - -abstract class _AppInfo implements AppInfo { - const factory _AppInfo( - {final String? name, - final String? partnerId, - final String? url, - final String? version}) = _$AppInfoImpl; - - factory _AppInfo.fromJson(Map json) = _$AppInfoImpl.fromJson; - - @override - String? get name; - @override - String? get partnerId; - @override - String? get url; - @override - String? get version; - - /// Create a copy of AppInfo - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AppInfoImplCopyWith<_$AppInfoImpl> get copyWith => - throw _privateConstructorUsedError; +class _AppInfo implements AppInfo { + const _AppInfo({this.name, this.partnerId, this.url, this.version}); + factory _AppInfo.fromJson(Map json) => _$AppInfoFromJson(json); + +@override final String? name; +@override final String? partnerId; +@override final String? url; +@override final String? version; + +/// Create a copy of AppInfo +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AppInfoCopyWith<_AppInfo> get copyWith => __$AppInfoCopyWithImpl<_AppInfo>(this, _$identity); + +@override +Map toJson() { + return _$AppInfoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppInfo&&(identical(other.name, name) || other.name == name)&&(identical(other.partnerId, partnerId) || other.partnerId == partnerId)&&(identical(other.url, url) || other.url == url)&&(identical(other.version, version) || other.version == version)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,partnerId,url,version); + +@override +String toString() { + return 'AppInfo(name: $name, partnerId: $partnerId, url: $url, version: $version)'; } + + +} + +/// @nodoc +abstract mixin class _$AppInfoCopyWith<$Res> implements $AppInfoCopyWith<$Res> { + factory _$AppInfoCopyWith(_AppInfo value, $Res Function(_AppInfo) _then) = __$AppInfoCopyWithImpl; +@override @useResult +$Res call({ + String? name, String? partnerId, String? url, String? version +}); + + + + +} +/// @nodoc +class __$AppInfoCopyWithImpl<$Res> + implements _$AppInfoCopyWith<$Res> { + __$AppInfoCopyWithImpl(this._self, this._then); + + final _AppInfo _self; + final $Res Function(_AppInfo) _then; + +/// Create a copy of AppInfo +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? partnerId = freezed,Object? url = freezed,Object? version = freezed,}) { + return _then(_AppInfo( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,partnerId: freezed == partnerId ? _self.partnerId : partnerId // ignore: cast_nullable_to_non_nullable +as String?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable +as String?,version: freezed == version ? _self.version : version // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/app_info.g.dart b/packages/stripe_platform_interface/lib/src/models/app_info.g.dart index e4888deeb..5e8526fa4 100644 --- a/packages/stripe_platform_interface/lib/src/models/app_info.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/app_info.g.dart @@ -6,18 +6,16 @@ part of 'app_info.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AppInfoImpl _$$AppInfoImplFromJson(Map json) => - _$AppInfoImpl( - name: json['name'] as String?, - partnerId: json['partnerId'] as String?, - url: json['url'] as String?, - version: json['version'] as String?, - ); +_AppInfo _$AppInfoFromJson(Map json) => _AppInfo( + name: json['name'] as String?, + partnerId: json['partnerId'] as String?, + url: json['url'] as String?, + version: json['version'] as String?, +); -Map _$$AppInfoImplToJson(_$AppInfoImpl instance) => - { - 'name': instance.name, - 'partnerId': instance.partnerId, - 'url': instance.url, - 'version': instance.version, - }; +Map _$AppInfoToJson(_AppInfo instance) => { + 'name': instance.name, + 'partnerId': instance.partnerId, + 'url': instance.url, + 'version': instance.version, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/apple_pay.dart b/packages/stripe_platform_interface/lib/src/models/apple_pay.dart index ecfb4b093..877dde6c6 100644 --- a/packages/stripe_platform_interface/lib/src/models/apple_pay.dart +++ b/packages/stripe_platform_interface/lib/src/models/apple_pay.dart @@ -14,9 +14,8 @@ enum ApplePayShippingMethodType { /// Ready to ship. ready, //final has been replaced with pending as final is a reserved word in dart - /// Shipping is pending. - pending + pending, } /// Enum representing the different fields that can be added to the Apple Pay sheet. @@ -34,21 +33,15 @@ enum ApplePayContactFieldsType { phoneticName, /// Postal adress contact field. - postalAddress + postalAddress, } /// A type that indicates how to ship purchased items -enum ApplePayShippingType { - storePickup, - servicePickup, - delivery, - shipping, -} +enum ApplePayShippingType { storePickup, servicePickup, delivery, shipping } @freezed - /// Shipping method details regarding apple pay -class ApplePayShippingMethod with _$ApplePayShippingMethod { +abstract class ApplePayShippingMethod with _$ApplePayShippingMethod { @JsonSerializable(explicitToJson: true) const factory ApplePayShippingMethod({ /// A short, localized description. @@ -86,12 +79,10 @@ class ApplePayShippingMethod with _$ApplePayShippingMethod { } @Freezed(unionKey: 'paymentType') - /// Object that can be used to explain the different charges on the Apple Pay sheet. -class ApplePayCartSummaryItem with _$ApplePayCartSummaryItem { +abstract class ApplePayCartSummaryItem with _$ApplePayCartSummaryItem { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Immediate') - /// Use this type for payments that will occur immediately. const factory ApplePayCartSummaryItem.immediate({ /// Short localized description of the item. @@ -106,7 +97,6 @@ class ApplePayCartSummaryItem with _$ApplePayCartSummaryItem { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Deferred') - /// Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem const factory ApplePayCartSummaryItem.deferred({ /// Short localized description of the item. @@ -121,7 +111,6 @@ class ApplePayCartSummaryItem with _$ApplePayCartSummaryItem { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Recurring') - /// Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem const factory ApplePayCartSummaryItem.recurring({ /// Short localized description of the item. @@ -149,14 +138,10 @@ class ApplePayCartSummaryItem with _$ApplePayCartSummaryItem { enum ApplePayIntervalUnit { minute, hour, day, month, year } -enum ApplePayMerchantCapability { - supports3DS, - supportsCredit, - supportsDebit, -} +enum ApplePayMerchantCapability { supports3DS, supportsCredit, supportsDebit } @freezed -class ApplePayPresentParams with _$ApplePayPresentParams { +abstract class ApplePayPresentParams with _$ApplePayPresentParams { @JsonSerializable(explicitToJson: true) const factory ApplePayPresentParams({ /// Line Items of the payment request. @@ -188,7 +173,7 @@ class ApplePayPresentParams with _$ApplePayPresentParams { } @freezed -class ApplePayErrorAddressField with _$ApplePayErrorAddressField { +abstract class ApplePayErrorAddressField with _$ApplePayErrorAddressField { @JsonSerializable(explicitToJson: true) const factory ApplePayErrorAddressField({ /// Address field that is affected by the error @@ -205,9 +190,8 @@ class ApplePayErrorAddressField with _$ApplePayErrorAddressField { } @freezed - /// Contact name data for Apple pay -class ApplePayContactName with _$ApplePayContactName { +abstract class ApplePayContactName with _$ApplePayContactName { @JsonSerializable(explicitToJson: true) const factory ApplePayContactName({ String? familyName, @@ -223,9 +207,8 @@ class ApplePayContactName with _$ApplePayContactName { } @freezed - /// Postal address data for Apple pay -class ApplePayPostalAddress with _$ApplePayPostalAddress { +abstract class ApplePayPostalAddress with _$ApplePayPostalAddress { @JsonSerializable(explicitToJson: true) const factory ApplePayPostalAddress({ String? city, @@ -242,10 +225,10 @@ class ApplePayPostalAddress with _$ApplePayPostalAddress { _$ApplePayPostalAddressFromJson(json); } -typedef OnDidSetShippingContact = FutureOr Function( - PlatformPayShippingContact contact); -typedef OnDidSetShippingMethod = FutureOr Function( - ApplePayShippingMethod method); +typedef OnDidSetShippingContact = + FutureOr Function(PlatformPayShippingContact contact); +typedef OnDidSetShippingMethod = + FutureOr Function(ApplePayShippingMethod method); typedef OnCouponCodeEntered = FutureOr Function(String couponCode); typedef OnOrderTracking = FutureOr Function(); diff --git a/packages/stripe_platform_interface/lib/src/models/apple_pay.freezed.dart b/packages/stripe_platform_interface/lib/src/models/apple_pay.freezed.dart index 5e62ae052..01f14720d 100644 --- a/packages/stripe_platform_interface/lib/src/models/apple_pay.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/apple_pay.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,2393 +9,1973 @@ part of 'apple_pay.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ApplePayShippingMethod _$ApplePayShippingMethodFromJson( - Map json) { - return _ApplePayShippingMethod.fromJson(json); -} - /// @nodoc mixin _$ApplePayShippingMethod { - /// A short, localized description. - String get label => throw _privateConstructorUsedError; - /// The cost associated with this shipping option. - String get amount => throw _privateConstructorUsedError; +/// A short, localized description. + String get label;/// The cost associated with this shipping option. + String get amount;/// A unique identifier for the shipping method. + String get identifier;/// When creating items for estimates or charges whose final value is not yet known, set this to true. +/// +/// Defaults to false. + bool? get isPending;/// A user-readable description of the shipping method. +/// +/// For example “Ships in 24 hours.” Don't repeat content + String? get detail;/// The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. +/// +/// Measured in seconds + int? get startDate;/// The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. +/// +/// Measured in seconds. + int? get endDate; +/// Create a copy of ApplePayShippingMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayShippingMethodCopyWith get copyWith => _$ApplePayShippingMethodCopyWithImpl(this as ApplePayShippingMethod, _$identity); - /// A unique identifier for the shipping method. - String get identifier => throw _privateConstructorUsedError; + /// Serializes this ApplePayShippingMethod to a JSON map. + Map toJson(); - /// When creating items for estimates or charges whose final value is not yet known, set this to true. - /// - /// Defaults to false. - bool? get isPending => throw _privateConstructorUsedError; - /// A user-readable description of the shipping method. - /// - /// For example “Ships in 24 hours.” Don't repeat content - String? get detail => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayShippingMethod&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.identifier, identifier) || other.identifier == identifier)&&(identical(other.isPending, isPending) || other.isPending == isPending)&&(identical(other.detail, detail) || other.detail == detail)&&(identical(other.startDate, startDate) || other.startDate == startDate)&&(identical(other.endDate, endDate) || other.endDate == endDate)); +} - /// The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. - /// - /// Measured in seconds - int? get startDate => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,amount,identifier,isPending,detail,startDate,endDate); - /// The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. - /// - /// Measured in seconds. - int? get endDate => throw _privateConstructorUsedError; +@override +String toString() { + return 'ApplePayShippingMethod(label: $label, amount: $amount, identifier: $identifier, isPending: $isPending, detail: $detail, startDate: $startDate, endDate: $endDate)'; +} - /// Serializes this ApplePayShippingMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of ApplePayShippingMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayShippingMethodCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $ApplePayShippingMethodCopyWith<$Res> { - factory $ApplePayShippingMethodCopyWith(ApplePayShippingMethod value, - $Res Function(ApplePayShippingMethod) then) = - _$ApplePayShippingMethodCopyWithImpl<$Res, ApplePayShippingMethod>; - @useResult - $Res call( - {String label, - String amount, - String identifier, - bool? isPending, - String? detail, - int? startDate, - int? endDate}); -} +abstract mixin class $ApplePayShippingMethodCopyWith<$Res> { + factory $ApplePayShippingMethodCopyWith(ApplePayShippingMethod value, $Res Function(ApplePayShippingMethod) _then) = _$ApplePayShippingMethodCopyWithImpl; +@useResult +$Res call({ + String label, String amount, String identifier, bool? isPending, String? detail, int? startDate, int? endDate +}); + + + +} /// @nodoc -class _$ApplePayShippingMethodCopyWithImpl<$Res, - $Val extends ApplePayShippingMethod> +class _$ApplePayShippingMethodCopyWithImpl<$Res> implements $ApplePayShippingMethodCopyWith<$Res> { - _$ApplePayShippingMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayShippingMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? amount = null, - Object? identifier = null, - Object? isPending = freezed, - Object? detail = freezed, - Object? startDate = freezed, - Object? endDate = freezed, - }) { - return _then(_value.copyWith( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - identifier: null == identifier - ? _value.identifier - : identifier // ignore: cast_nullable_to_non_nullable - as String, - isPending: freezed == isPending - ? _value.isPending - : isPending // ignore: cast_nullable_to_non_nullable - as bool?, - detail: freezed == detail - ? _value.detail - : detail // ignore: cast_nullable_to_non_nullable - as String?, - startDate: freezed == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as int?, - endDate: freezed == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } + _$ApplePayShippingMethodCopyWithImpl(this._self, this._then); + + final ApplePayShippingMethod _self; + final $Res Function(ApplePayShippingMethod) _then; + +/// Create a copy of ApplePayShippingMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? label = null,Object? amount = null,Object? identifier = null,Object? isPending = freezed,Object? detail = freezed,Object? startDate = freezed,Object? endDate = freezed,}) { + return _then(_self.copyWith( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String,identifier: null == identifier ? _self.identifier : identifier // ignore: cast_nullable_to_non_nullable +as String,isPending: freezed == isPending ? _self.isPending : isPending // ignore: cast_nullable_to_non_nullable +as bool?,detail: freezed == detail ? _self.detail : detail // ignore: cast_nullable_to_non_nullable +as String?,startDate: freezed == startDate ? _self.startDate : startDate // ignore: cast_nullable_to_non_nullable +as int?,endDate: freezed == endDate ? _self.endDate : endDate // ignore: cast_nullable_to_non_nullable +as int?, + )); } -/// @nodoc -abstract class _$$ApplePayShippingMethodImplCopyWith<$Res> - implements $ApplePayShippingMethodCopyWith<$Res> { - factory _$$ApplePayShippingMethodImplCopyWith( - _$ApplePayShippingMethodImpl value, - $Res Function(_$ApplePayShippingMethodImpl) then) = - __$$ApplePayShippingMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String label, - String amount, - String identifier, - bool? isPending, - String? detail, - int? startDate, - int? endDate}); } -/// @nodoc -class __$$ApplePayShippingMethodImplCopyWithImpl<$Res> - extends _$ApplePayShippingMethodCopyWithImpl<$Res, - _$ApplePayShippingMethodImpl> - implements _$$ApplePayShippingMethodImplCopyWith<$Res> { - __$$ApplePayShippingMethodImplCopyWithImpl( - _$ApplePayShippingMethodImpl _value, - $Res Function(_$ApplePayShippingMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayShippingMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? amount = null, - Object? identifier = null, - Object? isPending = freezed, - Object? detail = freezed, - Object? startDate = freezed, - Object? endDate = freezed, - }) { - return _then(_$ApplePayShippingMethodImpl( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - identifier: null == identifier - ? _value.identifier - : identifier // ignore: cast_nullable_to_non_nullable - as String, - isPending: freezed == isPending - ? _value.isPending - : isPending // ignore: cast_nullable_to_non_nullable - as bool?, - detail: freezed == detail - ? _value.detail - : detail // ignore: cast_nullable_to_non_nullable - as String?, - startDate: freezed == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as int?, - endDate: freezed == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as int?, - )); - } + +/// Adds pattern-matching-related methods to [ApplePayShippingMethod]. +extension ApplePayShippingMethodPatterns on ApplePayShippingMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayShippingMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayShippingMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayShippingMethod value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayShippingMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayShippingMethod value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayShippingMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String label, String amount, String identifier, bool? isPending, String? detail, int? startDate, int? endDate)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayShippingMethod() when $default != null: +return $default(_that.label,_that.amount,_that.identifier,_that.isPending,_that.detail,_that.startDate,_that.endDate);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String label, String amount, String identifier, bool? isPending, String? detail, int? startDate, int? endDate) $default,) {final _that = this; +switch (_that) { +case _ApplePayShippingMethod(): +return $default(_that.label,_that.amount,_that.identifier,_that.isPending,_that.detail,_that.startDate,_that.endDate);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String label, String amount, String identifier, bool? isPending, String? detail, int? startDate, int? endDate)? $default,) {final _that = this; +switch (_that) { +case _ApplePayShippingMethod() when $default != null: +return $default(_that.label,_that.amount,_that.identifier,_that.isPending,_that.detail,_that.startDate,_that.endDate);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayShippingMethodImpl implements _ApplePayShippingMethod { - const _$ApplePayShippingMethodImpl( - {required this.label, - required this.amount, - required this.identifier, - this.isPending, - this.detail, - this.startDate, - this.endDate}); - - factory _$ApplePayShippingMethodImpl.fromJson(Map json) => - _$$ApplePayShippingMethodImplFromJson(json); - - /// A short, localized description. - @override - final String label; - - /// The cost associated with this shipping option. - @override - final String amount; - - /// A unique identifier for the shipping method. - @override - final String identifier; - - /// When creating items for estimates or charges whose final value is not yet known, set this to true. - /// - /// Defaults to false. - @override - final bool? isPending; - - /// A user-readable description of the shipping method. - /// - /// For example “Ships in 24 hours.” Don't repeat content - @override - final String? detail; - - /// The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. - /// - /// Measured in seconds - @override - final int? startDate; - - /// The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. - /// - /// Measured in seconds. - @override - final int? endDate; - - @override - String toString() { - return 'ApplePayShippingMethod(label: $label, amount: $amount, identifier: $identifier, isPending: $isPending, detail: $detail, startDate: $startDate, endDate: $endDate)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayShippingMethodImpl && - (identical(other.label, label) || other.label == label) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.identifier, identifier) || - other.identifier == identifier) && - (identical(other.isPending, isPending) || - other.isPending == isPending) && - (identical(other.detail, detail) || other.detail == detail) && - (identical(other.startDate, startDate) || - other.startDate == startDate) && - (identical(other.endDate, endDate) || other.endDate == endDate)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, label, amount, identifier, - isPending, detail, startDate, endDate); - - /// Create a copy of ApplePayShippingMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayShippingMethodImplCopyWith<_$ApplePayShippingMethodImpl> - get copyWith => __$$ApplePayShippingMethodImplCopyWithImpl< - _$ApplePayShippingMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ApplePayShippingMethodImplToJson( - this, - ); - } -} - -abstract class _ApplePayShippingMethod implements ApplePayShippingMethod { - const factory _ApplePayShippingMethod( - {required final String label, - required final String amount, - required final String identifier, - final bool? isPending, - final String? detail, - final int? startDate, - final int? endDate}) = _$ApplePayShippingMethodImpl; - - factory _ApplePayShippingMethod.fromJson(Map json) = - _$ApplePayShippingMethodImpl.fromJson; - - /// A short, localized description. - @override - String get label; - - /// The cost associated with this shipping option. - @override - String get amount; - - /// A unique identifier for the shipping method. - @override - String get identifier; - - /// When creating items for estimates or charges whose final value is not yet known, set this to true. - /// - /// Defaults to false. - @override - bool? get isPending; - - /// A user-readable description of the shipping method. - /// - /// For example “Ships in 24 hours.” Don't repeat content - @override - String? get detail; - - /// The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. - /// - /// Measured in seconds - @override - int? get startDate; - - /// The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. - /// - /// Measured in seconds. - @override - int? get endDate; - - /// Create a copy of ApplePayShippingMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayShippingMethodImplCopyWith<_$ApplePayShippingMethodImpl> - get copyWith => throw _privateConstructorUsedError; +class _ApplePayShippingMethod implements ApplePayShippingMethod { + const _ApplePayShippingMethod({required this.label, required this.amount, required this.identifier, this.isPending, this.detail, this.startDate, this.endDate}); + factory _ApplePayShippingMethod.fromJson(Map json) => _$ApplePayShippingMethodFromJson(json); + +/// A short, localized description. +@override final String label; +/// The cost associated with this shipping option. +@override final String amount; +/// A unique identifier for the shipping method. +@override final String identifier; +/// When creating items for estimates or charges whose final value is not yet known, set this to true. +/// +/// Defaults to false. +@override final bool? isPending; +/// A user-readable description of the shipping method. +/// +/// For example “Ships in 24 hours.” Don't repeat content +@override final String? detail; +/// The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. +/// +/// Measured in seconds +@override final int? startDate; +/// The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. +/// +/// Measured in seconds. +@override final int? endDate; + +/// Create a copy of ApplePayShippingMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayShippingMethodCopyWith<_ApplePayShippingMethod> get copyWith => __$ApplePayShippingMethodCopyWithImpl<_ApplePayShippingMethod>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayShippingMethodToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayShippingMethod&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.identifier, identifier) || other.identifier == identifier)&&(identical(other.isPending, isPending) || other.isPending == isPending)&&(identical(other.detail, detail) || other.detail == detail)&&(identical(other.startDate, startDate) || other.startDate == startDate)&&(identical(other.endDate, endDate) || other.endDate == endDate)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,amount,identifier,isPending,detail,startDate,endDate); + +@override +String toString() { + return 'ApplePayShippingMethod(label: $label, amount: $amount, identifier: $identifier, isPending: $isPending, detail: $detail, startDate: $startDate, endDate: $endDate)'; +} + + +} + +/// @nodoc +abstract mixin class _$ApplePayShippingMethodCopyWith<$Res> implements $ApplePayShippingMethodCopyWith<$Res> { + factory _$ApplePayShippingMethodCopyWith(_ApplePayShippingMethod value, $Res Function(_ApplePayShippingMethod) _then) = __$ApplePayShippingMethodCopyWithImpl; +@override @useResult +$Res call({ + String label, String amount, String identifier, bool? isPending, String? detail, int? startDate, int? endDate +}); + + + + +} +/// @nodoc +class __$ApplePayShippingMethodCopyWithImpl<$Res> + implements _$ApplePayShippingMethodCopyWith<$Res> { + __$ApplePayShippingMethodCopyWithImpl(this._self, this._then); + + final _ApplePayShippingMethod _self; + final $Res Function(_ApplePayShippingMethod) _then; + +/// Create a copy of ApplePayShippingMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? label = null,Object? amount = null,Object? identifier = null,Object? isPending = freezed,Object? detail = freezed,Object? startDate = freezed,Object? endDate = freezed,}) { + return _then(_ApplePayShippingMethod( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String,identifier: null == identifier ? _self.identifier : identifier // ignore: cast_nullable_to_non_nullable +as String,isPending: freezed == isPending ? _self.isPending : isPending // ignore: cast_nullable_to_non_nullable +as bool?,detail: freezed == detail ? _self.detail : detail // ignore: cast_nullable_to_non_nullable +as String?,startDate: freezed == startDate ? _self.startDate : startDate // ignore: cast_nullable_to_non_nullable +as int?,endDate: freezed == endDate ? _self.endDate : endDate // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + } ApplePayCartSummaryItem _$ApplePayCartSummaryItemFromJson( - Map json) { - switch (json['paymentType']) { - case 'Immediate': - return ImmediateCartSummaryItem.fromJson(json); - case 'Deferred': - return DeferredSummaryItem.fromJson(json); - case 'Recurring': - return RecurringCartSummaryItem.fromJson(json); - - default: - throw CheckedFromJsonException( - json, - 'paymentType', - 'ApplePayCartSummaryItem', - 'Invalid union type "${json['paymentType']}"!'); - } + Map json +) { + switch (json['paymentType']) { + case 'Immediate': + return ImmediateCartSummaryItem.fromJson( + json + ); + case 'Deferred': + return DeferredSummaryItem.fromJson( + json + ); + case 'Recurring': + return RecurringCartSummaryItem.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'paymentType', + 'ApplePayCartSummaryItem', + 'Invalid union type "${json['paymentType']}"!' +); + } + } /// @nodoc mixin _$ApplePayCartSummaryItem { - /// Short localized description of the item. - String get label => throw _privateConstructorUsedError; - - /// The monetary amount. - String get amount => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(String label, String amount, bool? isPending) - immediate, - required TResult Function(String label, String amount, int deferredDate) - deferred, - required TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate) - recurring, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String label, String amount, bool? isPending)? immediate, - TResult? Function(String label, String amount, int deferredDate)? deferred, - TResult? Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String label, String amount, bool? isPending)? immediate, - TResult Function(String label, String amount, int deferredDate)? deferred, - TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(ImmediateCartSummaryItem value) immediate, - required TResult Function(DeferredSummaryItem value) deferred, - required TResult Function(RecurringCartSummaryItem value) recurring, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ImmediateCartSummaryItem value)? immediate, - TResult? Function(DeferredSummaryItem value)? deferred, - TResult? Function(RecurringCartSummaryItem value)? recurring, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ImmediateCartSummaryItem value)? immediate, - TResult Function(DeferredSummaryItem value)? deferred, - TResult Function(RecurringCartSummaryItem value)? recurring, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + +/// Short localized description of the item. + String get label;/// The monetary amount. + String get amount; +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayCartSummaryItemCopyWith get copyWith => _$ApplePayCartSummaryItemCopyWithImpl(this as ApplePayCartSummaryItem, _$identity); /// Serializes this ApplePayCartSummaryItem to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayCartSummaryItemCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayCartSummaryItem&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)); } -/// @nodoc -abstract class $ApplePayCartSummaryItemCopyWith<$Res> { - factory $ApplePayCartSummaryItemCopyWith(ApplePayCartSummaryItem value, - $Res Function(ApplePayCartSummaryItem) then) = - _$ApplePayCartSummaryItemCopyWithImpl<$Res, ApplePayCartSummaryItem>; - @useResult - $Res call({String label, String amount}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,amount); + +@override +String toString() { + return 'ApplePayCartSummaryItem(label: $label, amount: $amount)'; } -/// @nodoc -class _$ApplePayCartSummaryItemCopyWithImpl<$Res, - $Val extends ApplePayCartSummaryItem> - implements $ApplePayCartSummaryItemCopyWith<$Res> { - _$ApplePayCartSummaryItemCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? amount = null, - }) { - return _then(_value.copyWith( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$ImmediateCartSummaryItemImplCopyWith<$Res> +abstract mixin class $ApplePayCartSummaryItemCopyWith<$Res> { + factory $ApplePayCartSummaryItemCopyWith(ApplePayCartSummaryItem value, $Res Function(ApplePayCartSummaryItem) _then) = _$ApplePayCartSummaryItemCopyWithImpl; +@useResult +$Res call({ + String label, String amount +}); + + + + +} +/// @nodoc +class _$ApplePayCartSummaryItemCopyWithImpl<$Res> implements $ApplePayCartSummaryItemCopyWith<$Res> { - factory _$$ImmediateCartSummaryItemImplCopyWith( - _$ImmediateCartSummaryItemImpl value, - $Res Function(_$ImmediateCartSummaryItemImpl) then) = - __$$ImmediateCartSummaryItemImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String label, String amount, bool? isPending}); + _$ApplePayCartSummaryItemCopyWithImpl(this._self, this._then); + + final ApplePayCartSummaryItem _self; + final $Res Function(ApplePayCartSummaryItem) _then; + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? label = null,Object? amount = null,}) { + return _then(_self.copyWith( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePayCartSummaryItem]. +extension ApplePayCartSummaryItemPatterns on ApplePayCartSummaryItem { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( ImmediateCartSummaryItem value)? immediate,TResult Function( DeferredSummaryItem value)? deferred,TResult Function( RecurringCartSummaryItem value)? recurring,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case ImmediateCartSummaryItem() when immediate != null: +return immediate(_that);case DeferredSummaryItem() when deferred != null: +return deferred(_that);case RecurringCartSummaryItem() when recurring != null: +return recurring(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( ImmediateCartSummaryItem value) immediate,required TResult Function( DeferredSummaryItem value) deferred,required TResult Function( RecurringCartSummaryItem value) recurring,}){ +final _that = this; +switch (_that) { +case ImmediateCartSummaryItem(): +return immediate(_that);case DeferredSummaryItem(): +return deferred(_that);case RecurringCartSummaryItem(): +return recurring(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( ImmediateCartSummaryItem value)? immediate,TResult? Function( DeferredSummaryItem value)? deferred,TResult? Function( RecurringCartSummaryItem value)? recurring,}){ +final _that = this; +switch (_that) { +case ImmediateCartSummaryItem() when immediate != null: +return immediate(_that);case DeferredSummaryItem() when deferred != null: +return deferred(_that);case RecurringCartSummaryItem() when recurring != null: +return recurring(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( String label, String amount, bool? isPending)? immediate,TResult Function( String label, String amount, int deferredDate)? deferred,TResult Function( String label, String amount, ApplePayIntervalUnit intervalUnit, int intervalCount, int? startDate, int? endDate)? recurring,required TResult orElse(),}) {final _that = this; +switch (_that) { +case ImmediateCartSummaryItem() when immediate != null: +return immediate(_that.label,_that.amount,_that.isPending);case DeferredSummaryItem() when deferred != null: +return deferred(_that.label,_that.amount,_that.deferredDate);case RecurringCartSummaryItem() when recurring != null: +return recurring(_that.label,_that.amount,_that.intervalUnit,_that.intervalCount,_that.startDate,_that.endDate);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( String label, String amount, bool? isPending) immediate,required TResult Function( String label, String amount, int deferredDate) deferred,required TResult Function( String label, String amount, ApplePayIntervalUnit intervalUnit, int intervalCount, int? startDate, int? endDate) recurring,}) {final _that = this; +switch (_that) { +case ImmediateCartSummaryItem(): +return immediate(_that.label,_that.amount,_that.isPending);case DeferredSummaryItem(): +return deferred(_that.label,_that.amount,_that.deferredDate);case RecurringCartSummaryItem(): +return recurring(_that.label,_that.amount,_that.intervalUnit,_that.intervalCount,_that.startDate,_that.endDate);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( String label, String amount, bool? isPending)? immediate,TResult? Function( String label, String amount, int deferredDate)? deferred,TResult? Function( String label, String amount, ApplePayIntervalUnit intervalUnit, int intervalCount, int? startDate, int? endDate)? recurring,}) {final _that = this; +switch (_that) { +case ImmediateCartSummaryItem() when immediate != null: +return immediate(_that.label,_that.amount,_that.isPending);case DeferredSummaryItem() when deferred != null: +return deferred(_that.label,_that.amount,_that.deferredDate);case RecurringCartSummaryItem() when recurring != null: +return recurring(_that.label,_that.amount,_that.intervalUnit,_that.intervalCount,_that.startDate,_that.endDate);case _: + return null; + +} } -/// @nodoc -class __$$ImmediateCartSummaryItemImplCopyWithImpl<$Res> - extends _$ApplePayCartSummaryItemCopyWithImpl<$Res, - _$ImmediateCartSummaryItemImpl> - implements _$$ImmediateCartSummaryItemImplCopyWith<$Res> { - __$$ImmediateCartSummaryItemImplCopyWithImpl( - _$ImmediateCartSummaryItemImpl _value, - $Res Function(_$ImmediateCartSummaryItemImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? amount = null, - Object? isPending = freezed, - }) { - return _then(_$ImmediateCartSummaryItemImpl( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - isPending: freezed == isPending - ? _value.isPending - : isPending // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ImmediateCartSummaryItemImpl implements ImmediateCartSummaryItem { - const _$ImmediateCartSummaryItemImpl( - {required this.label, - required this.amount, - this.isPending, - final String? $type}) - : $type = $type ?? 'Immediate'; - - factory _$ImmediateCartSummaryItemImpl.fromJson(Map json) => - _$$ImmediateCartSummaryItemImplFromJson(json); - - /// Short localized description of the item. - @override - final String label; - - /// The monetary amount. - @override - final String amount; - - /// When creating items for estimates or charges whose final value is not yet known, set this to true. - @override - final bool? isPending; - - @JsonKey(name: 'paymentType') - final String $type; - - @override - String toString() { - return 'ApplePayCartSummaryItem.immediate(label: $label, amount: $amount, isPending: $isPending)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ImmediateCartSummaryItemImpl && - (identical(other.label, label) || other.label == label) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.isPending, isPending) || - other.isPending == isPending)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, label, amount, isPending); - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ImmediateCartSummaryItemImplCopyWith<_$ImmediateCartSummaryItemImpl> - get copyWith => __$$ImmediateCartSummaryItemImplCopyWithImpl< - _$ImmediateCartSummaryItemImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String label, String amount, bool? isPending) - immediate, - required TResult Function(String label, String amount, int deferredDate) - deferred, - required TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate) - recurring, - }) { - return immediate(label, amount, isPending); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String label, String amount, bool? isPending)? immediate, - TResult? Function(String label, String amount, int deferredDate)? deferred, - TResult? Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - }) { - return immediate?.call(label, amount, isPending); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String label, String amount, bool? isPending)? immediate, - TResult Function(String label, String amount, int deferredDate)? deferred, - TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - required TResult orElse(), - }) { - if (immediate != null) { - return immediate(label, amount, isPending); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ImmediateCartSummaryItem value) immediate, - required TResult Function(DeferredSummaryItem value) deferred, - required TResult Function(RecurringCartSummaryItem value) recurring, - }) { - return immediate(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ImmediateCartSummaryItem value)? immediate, - TResult? Function(DeferredSummaryItem value)? deferred, - TResult? Function(RecurringCartSummaryItem value)? recurring, - }) { - return immediate?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ImmediateCartSummaryItem value)? immediate, - TResult Function(DeferredSummaryItem value)? deferred, - TResult Function(RecurringCartSummaryItem value)? recurring, - required TResult orElse(), - }) { - if (immediate != null) { - return immediate(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$ImmediateCartSummaryItemImplToJson( - this, - ); - } -} - -abstract class ImmediateCartSummaryItem implements ApplePayCartSummaryItem { - const factory ImmediateCartSummaryItem( - {required final String label, - required final String amount, - final bool? isPending}) = _$ImmediateCartSummaryItemImpl; - - factory ImmediateCartSummaryItem.fromJson(Map json) = - _$ImmediateCartSummaryItemImpl.fromJson; - - /// Short localized description of the item. - @override - String get label; - - /// The monetary amount. - @override - String get amount; - - /// When creating items for estimates or charges whose final value is not yet known, set this to true. - bool? get isPending; - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ImmediateCartSummaryItemImplCopyWith<_$ImmediateCartSummaryItemImpl> - get copyWith => throw _privateConstructorUsedError; +class ImmediateCartSummaryItem implements ApplePayCartSummaryItem { + const ImmediateCartSummaryItem({required this.label, required this.amount, this.isPending, final String? $type}): $type = $type ?? 'Immediate'; + factory ImmediateCartSummaryItem.fromJson(Map json) => _$ImmediateCartSummaryItemFromJson(json); + +/// Short localized description of the item. +@override final String label; +/// The monetary amount. +@override final String amount; +/// When creating items for estimates or charges whose final value is not yet known, set this to true. + final bool? isPending; + +@JsonKey(name: 'paymentType') +final String $type; + + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ImmediateCartSummaryItemCopyWith get copyWith => _$ImmediateCartSummaryItemCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$ImmediateCartSummaryItemToJson(this, ); } -/// @nodoc -abstract class _$$DeferredSummaryItemImplCopyWith<$Res> - implements $ApplePayCartSummaryItemCopyWith<$Res> { - factory _$$DeferredSummaryItemImplCopyWith(_$DeferredSummaryItemImpl value, - $Res Function(_$DeferredSummaryItemImpl) then) = - __$$DeferredSummaryItemImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String label, String amount, int deferredDate}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ImmediateCartSummaryItem&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.isPending, isPending) || other.isPending == isPending)); } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,amount,isPending); + +@override +String toString() { + return 'ApplePayCartSummaryItem.immediate(label: $label, amount: $amount, isPending: $isPending)'; +} + + +} + +/// @nodoc +abstract mixin class $ImmediateCartSummaryItemCopyWith<$Res> implements $ApplePayCartSummaryItemCopyWith<$Res> { + factory $ImmediateCartSummaryItemCopyWith(ImmediateCartSummaryItem value, $Res Function(ImmediateCartSummaryItem) _then) = _$ImmediateCartSummaryItemCopyWithImpl; +@override @useResult +$Res call({ + String label, String amount, bool? isPending +}); + + + + +} /// @nodoc -class __$$DeferredSummaryItemImplCopyWithImpl<$Res> - extends _$ApplePayCartSummaryItemCopyWithImpl<$Res, - _$DeferredSummaryItemImpl> - implements _$$DeferredSummaryItemImplCopyWith<$Res> { - __$$DeferredSummaryItemImplCopyWithImpl(_$DeferredSummaryItemImpl _value, - $Res Function(_$DeferredSummaryItemImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? amount = null, - Object? deferredDate = null, - }) { - return _then(_$DeferredSummaryItemImpl( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - deferredDate: null == deferredDate - ? _value.deferredDate - : deferredDate // ignore: cast_nullable_to_non_nullable - as int, - )); - } +class _$ImmediateCartSummaryItemCopyWithImpl<$Res> + implements $ImmediateCartSummaryItemCopyWith<$Res> { + _$ImmediateCartSummaryItemCopyWithImpl(this._self, this._then); + + final ImmediateCartSummaryItem _self; + final $Res Function(ImmediateCartSummaryItem) _then; + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? label = null,Object? amount = null,Object? isPending = freezed,}) { + return _then(ImmediateCartSummaryItem( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String,isPending: freezed == isPending ? _self.isPending : isPending // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$DeferredSummaryItemImpl implements DeferredSummaryItem { - const _$DeferredSummaryItemImpl( - {required this.label, - required this.amount, - required this.deferredDate, - final String? $type}) - : $type = $type ?? 'Deferred'; - - factory _$DeferredSummaryItemImpl.fromJson(Map json) => - _$$DeferredSummaryItemImplFromJson(json); - - /// Short localized description of the item. - @override - final String label; - - /// The monetary amount. - @override - final String amount; - - /// The unix timestamp of the date, in the future, of the payment. Measured in seconds. - @override - final int deferredDate; - - @JsonKey(name: 'paymentType') - final String $type; - - @override - String toString() { - return 'ApplePayCartSummaryItem.deferred(label: $label, amount: $amount, deferredDate: $deferredDate)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DeferredSummaryItemImpl && - (identical(other.label, label) || other.label == label) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.deferredDate, deferredDate) || - other.deferredDate == deferredDate)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, label, amount, deferredDate); - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$DeferredSummaryItemImplCopyWith<_$DeferredSummaryItemImpl> get copyWith => - __$$DeferredSummaryItemImplCopyWithImpl<_$DeferredSummaryItemImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String label, String amount, bool? isPending) - immediate, - required TResult Function(String label, String amount, int deferredDate) - deferred, - required TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate) - recurring, - }) { - return deferred(label, amount, deferredDate); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String label, String amount, bool? isPending)? immediate, - TResult? Function(String label, String amount, int deferredDate)? deferred, - TResult? Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - }) { - return deferred?.call(label, amount, deferredDate); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String label, String amount, bool? isPending)? immediate, - TResult Function(String label, String amount, int deferredDate)? deferred, - TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - required TResult orElse(), - }) { - if (deferred != null) { - return deferred(label, amount, deferredDate); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ImmediateCartSummaryItem value) immediate, - required TResult Function(DeferredSummaryItem value) deferred, - required TResult Function(RecurringCartSummaryItem value) recurring, - }) { - return deferred(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ImmediateCartSummaryItem value)? immediate, - TResult? Function(DeferredSummaryItem value)? deferred, - TResult? Function(RecurringCartSummaryItem value)? recurring, - }) { - return deferred?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ImmediateCartSummaryItem value)? immediate, - TResult Function(DeferredSummaryItem value)? deferred, - TResult Function(RecurringCartSummaryItem value)? recurring, - required TResult orElse(), - }) { - if (deferred != null) { - return deferred(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$DeferredSummaryItemImplToJson( - this, - ); - } -} - -abstract class DeferredSummaryItem implements ApplePayCartSummaryItem { - const factory DeferredSummaryItem( - {required final String label, - required final String amount, - required final int deferredDate}) = _$DeferredSummaryItemImpl; - - factory DeferredSummaryItem.fromJson(Map json) = - _$DeferredSummaryItemImpl.fromJson; - - /// Short localized description of the item. - @override - String get label; - - /// The monetary amount. - @override - String get amount; - - /// The unix timestamp of the date, in the future, of the payment. Measured in seconds. - int get deferredDate; - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DeferredSummaryItemImplCopyWith<_$DeferredSummaryItemImpl> get copyWith => - throw _privateConstructorUsedError; +class DeferredSummaryItem implements ApplePayCartSummaryItem { + const DeferredSummaryItem({required this.label, required this.amount, required this.deferredDate, final String? $type}): $type = $type ?? 'Deferred'; + factory DeferredSummaryItem.fromJson(Map json) => _$DeferredSummaryItemFromJson(json); + +/// Short localized description of the item. +@override final String label; +/// The monetary amount. +@override final String amount; +/// The unix timestamp of the date, in the future, of the payment. Measured in seconds. + final int deferredDate; + +@JsonKey(name: 'paymentType') +final String $type; + + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeferredSummaryItemCopyWith get copyWith => _$DeferredSummaryItemCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$DeferredSummaryItemToJson(this, ); } -/// @nodoc -abstract class _$$RecurringCartSummaryItemImplCopyWith<$Res> - implements $ApplePayCartSummaryItemCopyWith<$Res> { - factory _$$RecurringCartSummaryItemImplCopyWith( - _$RecurringCartSummaryItemImpl value, - $Res Function(_$RecurringCartSummaryItemImpl) then) = - __$$RecurringCartSummaryItemImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeferredSummaryItem&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.deferredDate, deferredDate) || other.deferredDate == deferredDate)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,amount,deferredDate); + +@override +String toString() { + return 'ApplePayCartSummaryItem.deferred(label: $label, amount: $amount, deferredDate: $deferredDate)'; } + +} + +/// @nodoc +abstract mixin class $DeferredSummaryItemCopyWith<$Res> implements $ApplePayCartSummaryItemCopyWith<$Res> { + factory $DeferredSummaryItemCopyWith(DeferredSummaryItem value, $Res Function(DeferredSummaryItem) _then) = _$DeferredSummaryItemCopyWithImpl; +@override @useResult +$Res call({ + String label, String amount, int deferredDate +}); + + + + +} /// @nodoc -class __$$RecurringCartSummaryItemImplCopyWithImpl<$Res> - extends _$ApplePayCartSummaryItemCopyWithImpl<$Res, - _$RecurringCartSummaryItemImpl> - implements _$$RecurringCartSummaryItemImplCopyWith<$Res> { - __$$RecurringCartSummaryItemImplCopyWithImpl( - _$RecurringCartSummaryItemImpl _value, - $Res Function(_$RecurringCartSummaryItemImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? amount = null, - Object? intervalUnit = null, - Object? intervalCount = null, - Object? startDate = freezed, - Object? endDate = freezed, - }) { - return _then(_$RecurringCartSummaryItemImpl( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - intervalUnit: null == intervalUnit - ? _value.intervalUnit - : intervalUnit // ignore: cast_nullable_to_non_nullable - as ApplePayIntervalUnit, - intervalCount: null == intervalCount - ? _value.intervalCount - : intervalCount // ignore: cast_nullable_to_non_nullable - as int, - startDate: freezed == startDate - ? _value.startDate - : startDate // ignore: cast_nullable_to_non_nullable - as int?, - endDate: freezed == endDate - ? _value.endDate - : endDate // ignore: cast_nullable_to_non_nullable - as int?, - )); - } +class _$DeferredSummaryItemCopyWithImpl<$Res> + implements $DeferredSummaryItemCopyWith<$Res> { + _$DeferredSummaryItemCopyWithImpl(this._self, this._then); + + final DeferredSummaryItem _self; + final $Res Function(DeferredSummaryItem) _then; + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? label = null,Object? amount = null,Object? deferredDate = null,}) { + return _then(DeferredSummaryItem( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String,deferredDate: null == deferredDate ? _self.deferredDate : deferredDate // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$RecurringCartSummaryItemImpl implements RecurringCartSummaryItem { - const _$RecurringCartSummaryItemImpl( - {required this.label, - required this.amount, - required this.intervalUnit, - required this.intervalCount, - this.startDate, - this.endDate, - final String? $type}) - : $type = $type ?? 'Recurring'; - - factory _$RecurringCartSummaryItemImpl.fromJson(Map json) => - _$$RecurringCartSummaryItemImplFromJson(json); - - /// Short localized description of the item. - @override - final String label; - - /// The monetary amount. - @override - final String amount; - - /// The amount of time – in calendar units such as day, month, or year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months. - @override - final ApplePayIntervalUnit intervalUnit; - - /// The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months. - @override - final int intervalCount; - - /// The unix timestamp of the start date. Measured in seconds. - @override - final int? startDate; +class RecurringCartSummaryItem implements ApplePayCartSummaryItem { + const RecurringCartSummaryItem({required this.label, required this.amount, required this.intervalUnit, required this.intervalCount, this.startDate, this.endDate, final String? $type}): $type = $type ?? 'Recurring'; + factory RecurringCartSummaryItem.fromJson(Map json) => _$RecurringCartSummaryItemFromJson(json); + +/// Short localized description of the item. +@override final String label; +/// The monetary amount. +@override final String amount; +/// The amount of time – in calendar units such as day, month, or year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months. + final ApplePayIntervalUnit intervalUnit; +/// The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months. + final int intervalCount; +/// The unix timestamp of the start date. Measured in seconds. + final int? startDate; ////The unix timestamp of the end date. Measured in seconds. */ - @override - final int? endDate; - - @JsonKey(name: 'paymentType') - final String $type; - - @override - String toString() { - return 'ApplePayCartSummaryItem.recurring(label: $label, amount: $amount, intervalUnit: $intervalUnit, intervalCount: $intervalCount, startDate: $startDate, endDate: $endDate)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$RecurringCartSummaryItemImpl && - (identical(other.label, label) || other.label == label) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.intervalUnit, intervalUnit) || - other.intervalUnit == intervalUnit) && - (identical(other.intervalCount, intervalCount) || - other.intervalCount == intervalCount) && - (identical(other.startDate, startDate) || - other.startDate == startDate) && - (identical(other.endDate, endDate) || other.endDate == endDate)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, label, amount, intervalUnit, - intervalCount, startDate, endDate); - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$RecurringCartSummaryItemImplCopyWith<_$RecurringCartSummaryItemImpl> - get copyWith => __$$RecurringCartSummaryItemImplCopyWithImpl< - _$RecurringCartSummaryItemImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String label, String amount, bool? isPending) - immediate, - required TResult Function(String label, String amount, int deferredDate) - deferred, - required TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate) - recurring, - }) { - return recurring( - label, amount, intervalUnit, intervalCount, startDate, endDate); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String label, String amount, bool? isPending)? immediate, - TResult? Function(String label, String amount, int deferredDate)? deferred, - TResult? Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - }) { - return recurring?.call( - label, amount, intervalUnit, intervalCount, startDate, endDate); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String label, String amount, bool? isPending)? immediate, - TResult Function(String label, String amount, int deferredDate)? deferred, - TResult Function( - String label, - String amount, - ApplePayIntervalUnit intervalUnit, - int intervalCount, - int? startDate, - int? endDate)? - recurring, - required TResult orElse(), - }) { - if (recurring != null) { - return recurring( - label, amount, intervalUnit, intervalCount, startDate, endDate); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(ImmediateCartSummaryItem value) immediate, - required TResult Function(DeferredSummaryItem value) deferred, - required TResult Function(RecurringCartSummaryItem value) recurring, - }) { - return recurring(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(ImmediateCartSummaryItem value)? immediate, - TResult? Function(DeferredSummaryItem value)? deferred, - TResult? Function(RecurringCartSummaryItem value)? recurring, - }) { - return recurring?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(ImmediateCartSummaryItem value)? immediate, - TResult Function(DeferredSummaryItem value)? deferred, - TResult Function(RecurringCartSummaryItem value)? recurring, - required TResult orElse(), - }) { - if (recurring != null) { - return recurring(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$RecurringCartSummaryItemImplToJson( - this, - ); - } -} - -abstract class RecurringCartSummaryItem implements ApplePayCartSummaryItem { - const factory RecurringCartSummaryItem( - {required final String label, - required final String amount, - required final ApplePayIntervalUnit intervalUnit, - required final int intervalCount, - final int? startDate, - final int? endDate}) = _$RecurringCartSummaryItemImpl; - - factory RecurringCartSummaryItem.fromJson(Map json) = - _$RecurringCartSummaryItemImpl.fromJson; - - /// Short localized description of the item. - @override - String get label; - - /// The monetary amount. - @override - String get amount; - - /// The amount of time – in calendar units such as day, month, or year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months. - ApplePayIntervalUnit get intervalUnit; - - /// The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months. - int get intervalCount; - - /// The unix timestamp of the start date. Measured in seconds. - int? - get startDate; ////The unix timestamp of the end date. Measured in seconds. */ - int? get endDate; - - /// Create a copy of ApplePayCartSummaryItem - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$RecurringCartSummaryItemImplCopyWith<_$RecurringCartSummaryItemImpl> - get copyWith => throw _privateConstructorUsedError; -} - -ApplePayPresentParams _$ApplePayPresentParamsFromJson( - Map json) { - return _ApplePayPresentParams.fromJson(json); + final int? endDate; + +@JsonKey(name: 'paymentType') +final String $type; + + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RecurringCartSummaryItemCopyWith get copyWith => _$RecurringCartSummaryItemCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$RecurringCartSummaryItemToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RecurringCartSummaryItem&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.intervalUnit, intervalUnit) || other.intervalUnit == intervalUnit)&&(identical(other.intervalCount, intervalCount) || other.intervalCount == intervalCount)&&(identical(other.startDate, startDate) || other.startDate == startDate)&&(identical(other.endDate, endDate) || other.endDate == endDate)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,amount,intervalUnit,intervalCount,startDate,endDate); + +@override +String toString() { + return 'ApplePayCartSummaryItem.recurring(label: $label, amount: $amount, intervalUnit: $intervalUnit, intervalCount: $intervalCount, startDate: $startDate, endDate: $endDate)'; +} + + } /// @nodoc -mixin _$ApplePayPresentParams { - /// Line Items of the payment request. - List get cartItems => - throw _privateConstructorUsedError; +abstract mixin class $RecurringCartSummaryItemCopyWith<$Res> implements $ApplePayCartSummaryItemCopyWith<$Res> { + factory $RecurringCartSummaryItemCopyWith(RecurringCartSummaryItem value, $Res Function(RecurringCartSummaryItem) _then) = _$RecurringCartSummaryItemCopyWithImpl; +@override @useResult +$Res call({ + String label, String amount, ApplePayIntervalUnit intervalUnit, int intervalCount, int? startDate, int? endDate +}); + + - /// The two letter ISO 3166 country code representing the merchant. - String get country => throw _privateConstructorUsedError; - /// The three letter ISO 4217 code for the currency. - String get currency => throw _privateConstructorUsedError; +} +/// @nodoc +class _$RecurringCartSummaryItemCopyWithImpl<$Res> + implements $RecurringCartSummaryItemCopyWith<$Res> { + _$RecurringCartSummaryItemCopyWithImpl(this._self, this._then); + + final RecurringCartSummaryItem _self; + final $Res Function(RecurringCartSummaryItem) _then; + +/// Create a copy of ApplePayCartSummaryItem +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? label = null,Object? amount = null,Object? intervalUnit = null,Object? intervalCount = null,Object? startDate = freezed,Object? endDate = freezed,}) { + return _then(RecurringCartSummaryItem( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String,intervalUnit: null == intervalUnit ? _self.intervalUnit : intervalUnit // ignore: cast_nullable_to_non_nullable +as ApplePayIntervalUnit,intervalCount: null == intervalCount ? _self.intervalCount : intervalCount // ignore: cast_nullable_to_non_nullable +as int,startDate: freezed == startDate ? _self.startDate : startDate // ignore: cast_nullable_to_non_nullable +as int?,endDate: freezed == endDate ? _self.endDate : endDate // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + - /// Fields that will be shown on the required shipping address section. If - /// empty no fields will be displayed. - List? get requiredShippingAddressFields => - throw _privateConstructorUsedError; +} - /// Fields that will be shown on the required billing address section. If - /// empty no fields will be displayed. - List? get requiredBillingContactFields => - throw _privateConstructorUsedError; - /// List of available shipping methods for goods. - List? get shippingMethods => - throw _privateConstructorUsedError; +/// @nodoc +mixin _$ApplePayPresentParams { - /// Add support for jcb as additional payment method. - bool get jcbEnabled => throw _privateConstructorUsedError; +/// Line Items of the payment request. + List get cartItems;/// The two letter ISO 3166 country code representing the merchant. + String get country;/// The three letter ISO 4217 code for the currency. + String get currency;/// Fields that will be shown on the required shipping address section. If +/// empty no fields will be displayed. + List? get requiredShippingAddressFields;/// Fields that will be shown on the required billing address section. If +/// empty no fields will be displayed. + List? get requiredBillingContactFields;/// List of available shipping methods for goods. + List? get shippingMethods;/// Add support for jcb as additional payment method. + bool get jcbEnabled; +/// Create a copy of ApplePayPresentParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayPresentParamsCopyWith get copyWith => _$ApplePayPresentParamsCopyWithImpl(this as ApplePayPresentParams, _$identity); /// Serializes this ApplePayPresentParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ApplePayPresentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayPresentParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayPresentParams&&const DeepCollectionEquality().equals(other.cartItems, cartItems)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&const DeepCollectionEquality().equals(other.requiredShippingAddressFields, requiredShippingAddressFields)&&const DeepCollectionEquality().equals(other.requiredBillingContactFields, requiredBillingContactFields)&&const DeepCollectionEquality().equals(other.shippingMethods, shippingMethods)&&(identical(other.jcbEnabled, jcbEnabled) || other.jcbEnabled == jcbEnabled)); } -/// @nodoc -abstract class $ApplePayPresentParamsCopyWith<$Res> { - factory $ApplePayPresentParamsCopyWith(ApplePayPresentParams value, - $Res Function(ApplePayPresentParams) then) = - _$ApplePayPresentParamsCopyWithImpl<$Res, ApplePayPresentParams>; - @useResult - $Res call( - {List cartItems, - String country, - String currency, - List? requiredShippingAddressFields, - List? requiredBillingContactFields, - List? shippingMethods, - bool jcbEnabled}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(cartItems),country,currency,const DeepCollectionEquality().hash(requiredShippingAddressFields),const DeepCollectionEquality().hash(requiredBillingContactFields),const DeepCollectionEquality().hash(shippingMethods),jcbEnabled); + +@override +String toString() { + return 'ApplePayPresentParams(cartItems: $cartItems, country: $country, currency: $currency, requiredShippingAddressFields: $requiredShippingAddressFields, requiredBillingContactFields: $requiredBillingContactFields, shippingMethods: $shippingMethods, jcbEnabled: $jcbEnabled)'; } -/// @nodoc -class _$ApplePayPresentParamsCopyWithImpl<$Res, - $Val extends ApplePayPresentParams> - implements $ApplePayPresentParamsCopyWith<$Res> { - _$ApplePayPresentParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayPresentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? cartItems = null, - Object? country = null, - Object? currency = null, - Object? requiredShippingAddressFields = freezed, - Object? requiredBillingContactFields = freezed, - Object? shippingMethods = freezed, - Object? jcbEnabled = null, - }) { - return _then(_value.copyWith( - cartItems: null == cartItems - ? _value.cartItems - : cartItems // ignore: cast_nullable_to_non_nullable - as List, - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - requiredShippingAddressFields: freezed == requiredShippingAddressFields - ? _value.requiredShippingAddressFields - : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable - as List?, - requiredBillingContactFields: freezed == requiredBillingContactFields - ? _value.requiredBillingContactFields - : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable - as List?, - shippingMethods: freezed == shippingMethods - ? _value.shippingMethods - : shippingMethods // ignore: cast_nullable_to_non_nullable - as List?, - jcbEnabled: null == jcbEnabled - ? _value.jcbEnabled - : jcbEnabled // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } + } /// @nodoc -abstract class _$$ApplePayPresentParamsImplCopyWith<$Res> +abstract mixin class $ApplePayPresentParamsCopyWith<$Res> { + factory $ApplePayPresentParamsCopyWith(ApplePayPresentParams value, $Res Function(ApplePayPresentParams) _then) = _$ApplePayPresentParamsCopyWithImpl; +@useResult +$Res call({ + List cartItems, String country, String currency, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, bool jcbEnabled +}); + + + + +} +/// @nodoc +class _$ApplePayPresentParamsCopyWithImpl<$Res> implements $ApplePayPresentParamsCopyWith<$Res> { - factory _$$ApplePayPresentParamsImplCopyWith( - _$ApplePayPresentParamsImpl value, - $Res Function(_$ApplePayPresentParamsImpl) then) = - __$$ApplePayPresentParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {List cartItems, - String country, - String currency, - List? requiredShippingAddressFields, - List? requiredBillingContactFields, - List? shippingMethods, - bool jcbEnabled}); + _$ApplePayPresentParamsCopyWithImpl(this._self, this._then); + + final ApplePayPresentParams _self; + final $Res Function(ApplePayPresentParams) _then; + +/// Create a copy of ApplePayPresentParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? cartItems = null,Object? country = null,Object? currency = null,Object? requiredShippingAddressFields = freezed,Object? requiredBillingContactFields = freezed,Object? shippingMethods = freezed,Object? jcbEnabled = null,}) { + return _then(_self.copyWith( +cartItems: null == cartItems ? _self.cartItems : cartItems // ignore: cast_nullable_to_non_nullable +as List,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,requiredShippingAddressFields: freezed == requiredShippingAddressFields ? _self.requiredShippingAddressFields : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable +as List?,requiredBillingContactFields: freezed == requiredBillingContactFields ? _self.requiredBillingContactFields : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable +as List?,shippingMethods: freezed == shippingMethods ? _self.shippingMethods : shippingMethods // ignore: cast_nullable_to_non_nullable +as List?,jcbEnabled: null == jcbEnabled ? _self.jcbEnabled : jcbEnabled // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePayPresentParams]. +extension ApplePayPresentParamsPatterns on ApplePayPresentParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayPresentParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayPresentParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayPresentParams value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayPresentParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayPresentParams value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayPresentParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( List cartItems, String country, String currency, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, bool jcbEnabled)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayPresentParams() when $default != null: +return $default(_that.cartItems,_that.country,_that.currency,_that.requiredShippingAddressFields,_that.requiredBillingContactFields,_that.shippingMethods,_that.jcbEnabled);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( List cartItems, String country, String currency, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, bool jcbEnabled) $default,) {final _that = this; +switch (_that) { +case _ApplePayPresentParams(): +return $default(_that.cartItems,_that.country,_that.currency,_that.requiredShippingAddressFields,_that.requiredBillingContactFields,_that.shippingMethods,_that.jcbEnabled);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( List cartItems, String country, String currency, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, bool jcbEnabled)? $default,) {final _that = this; +switch (_that) { +case _ApplePayPresentParams() when $default != null: +return $default(_that.cartItems,_that.country,_that.currency,_that.requiredShippingAddressFields,_that.requiredBillingContactFields,_that.shippingMethods,_that.jcbEnabled);case _: + return null; + +} } -/// @nodoc -class __$$ApplePayPresentParamsImplCopyWithImpl<$Res> - extends _$ApplePayPresentParamsCopyWithImpl<$Res, - _$ApplePayPresentParamsImpl> - implements _$$ApplePayPresentParamsImplCopyWith<$Res> { - __$$ApplePayPresentParamsImplCopyWithImpl(_$ApplePayPresentParamsImpl _value, - $Res Function(_$ApplePayPresentParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayPresentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? cartItems = null, - Object? country = null, - Object? currency = null, - Object? requiredShippingAddressFields = freezed, - Object? requiredBillingContactFields = freezed, - Object? shippingMethods = freezed, - Object? jcbEnabled = null, - }) { - return _then(_$ApplePayPresentParamsImpl( - cartItems: null == cartItems - ? _value._cartItems - : cartItems // ignore: cast_nullable_to_non_nullable - as List, - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - requiredShippingAddressFields: freezed == requiredShippingAddressFields - ? _value._requiredShippingAddressFields - : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable - as List?, - requiredBillingContactFields: freezed == requiredBillingContactFields - ? _value._requiredBillingContactFields - : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable - as List?, - shippingMethods: freezed == shippingMethods - ? _value._shippingMethods - : shippingMethods // ignore: cast_nullable_to_non_nullable - as List?, - jcbEnabled: null == jcbEnabled - ? _value.jcbEnabled - : jcbEnabled // ignore: cast_nullable_to_non_nullable - as bool, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayPresentParamsImpl implements _ApplePayPresentParams { - const _$ApplePayPresentParamsImpl( - {required final List cartItems, - required this.country, - required this.currency, - final List? requiredShippingAddressFields, - final List? requiredBillingContactFields, - final List? shippingMethods, - this.jcbEnabled = false}) - : _cartItems = cartItems, - _requiredShippingAddressFields = requiredShippingAddressFields, - _requiredBillingContactFields = requiredBillingContactFields, - _shippingMethods = shippingMethods; - - factory _$ApplePayPresentParamsImpl.fromJson(Map json) => - _$$ApplePayPresentParamsImplFromJson(json); - - /// Line Items of the payment request. - final List _cartItems; - - /// Line Items of the payment request. - @override - List get cartItems { - if (_cartItems is EqualUnmodifiableListView) return _cartItems; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_cartItems); - } - - /// The two letter ISO 3166 country code representing the merchant. - @override - final String country; - - /// The three letter ISO 4217 code for the currency. - @override - final String currency; - - /// Fields that will be shown on the required shipping address section. If - /// empty no fields will be displayed. - final List? _requiredShippingAddressFields; - - /// Fields that will be shown on the required shipping address section. If - /// empty no fields will be displayed. - @override - List? get requiredShippingAddressFields { - final value = _requiredShippingAddressFields; - if (value == null) return null; - if (_requiredShippingAddressFields is EqualUnmodifiableListView) - return _requiredShippingAddressFields; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - - /// Fields that will be shown on the required billing address section. If - /// empty no fields will be displayed. - final List? _requiredBillingContactFields; - - /// Fields that will be shown on the required billing address section. If - /// empty no fields will be displayed. - @override - List? get requiredBillingContactFields { - final value = _requiredBillingContactFields; - if (value == null) return null; - if (_requiredBillingContactFields is EqualUnmodifiableListView) - return _requiredBillingContactFields; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - - /// List of available shipping methods for goods. - final List? _shippingMethods; - - /// List of available shipping methods for goods. - @override - List? get shippingMethods { - final value = _shippingMethods; - if (value == null) return null; - if (_shippingMethods is EqualUnmodifiableListView) return _shippingMethods; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - - /// Add support for jcb as additional payment method. - @override - @JsonKey() - final bool jcbEnabled; - - @override - String toString() { - return 'ApplePayPresentParams(cartItems: $cartItems, country: $country, currency: $currency, requiredShippingAddressFields: $requiredShippingAddressFields, requiredBillingContactFields: $requiredBillingContactFields, shippingMethods: $shippingMethods, jcbEnabled: $jcbEnabled)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayPresentParamsImpl && - const DeepCollectionEquality() - .equals(other._cartItems, _cartItems) && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - const DeepCollectionEquality().equals( - other._requiredShippingAddressFields, - _requiredShippingAddressFields) && - const DeepCollectionEquality().equals( - other._requiredBillingContactFields, - _requiredBillingContactFields) && - const DeepCollectionEquality() - .equals(other._shippingMethods, _shippingMethods) && - (identical(other.jcbEnabled, jcbEnabled) || - other.jcbEnabled == jcbEnabled)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_cartItems), - country, - currency, - const DeepCollectionEquality().hash(_requiredShippingAddressFields), - const DeepCollectionEquality().hash(_requiredBillingContactFields), - const DeepCollectionEquality().hash(_shippingMethods), - jcbEnabled); - - /// Create a copy of ApplePayPresentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayPresentParamsImplCopyWith<_$ApplePayPresentParamsImpl> - get copyWith => __$$ApplePayPresentParamsImplCopyWithImpl< - _$ApplePayPresentParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ApplePayPresentParamsImplToJson( - this, - ); - } -} - -abstract class _ApplePayPresentParams implements ApplePayPresentParams { - const factory _ApplePayPresentParams( - {required final List cartItems, - required final String country, - required final String currency, - final List? requiredShippingAddressFields, - final List? requiredBillingContactFields, - final List? shippingMethods, - final bool jcbEnabled}) = _$ApplePayPresentParamsImpl; - - factory _ApplePayPresentParams.fromJson(Map json) = - _$ApplePayPresentParamsImpl.fromJson; - - /// Line Items of the payment request. - @override - List get cartItems; - - /// The two letter ISO 3166 country code representing the merchant. - @override - String get country; - - /// The three letter ISO 4217 code for the currency. - @override - String get currency; - - /// Fields that will be shown on the required shipping address section. If - /// empty no fields will be displayed. - @override - List? get requiredShippingAddressFields; - - /// Fields that will be shown on the required billing address section. If - /// empty no fields will be displayed. - @override - List? get requiredBillingContactFields; - - /// List of available shipping methods for goods. - @override - List? get shippingMethods; - - /// Add support for jcb as additional payment method. - @override - bool get jcbEnabled; - - /// Create a copy of ApplePayPresentParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayPresentParamsImplCopyWith<_$ApplePayPresentParamsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -ApplePayErrorAddressField _$ApplePayErrorAddressFieldFromJson( - Map json) { - return _ApplePayErrorAddressField.fromJson(json); +class _ApplePayPresentParams implements ApplePayPresentParams { + const _ApplePayPresentParams({required final List cartItems, required this.country, required this.currency, final List? requiredShippingAddressFields, final List? requiredBillingContactFields, final List? shippingMethods, this.jcbEnabled = false}): _cartItems = cartItems,_requiredShippingAddressFields = requiredShippingAddressFields,_requiredBillingContactFields = requiredBillingContactFields,_shippingMethods = shippingMethods; + factory _ApplePayPresentParams.fromJson(Map json) => _$ApplePayPresentParamsFromJson(json); + +/// Line Items of the payment request. + final List _cartItems; +/// Line Items of the payment request. +@override List get cartItems { + if (_cartItems is EqualUnmodifiableListView) return _cartItems; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_cartItems); +} + +/// The two letter ISO 3166 country code representing the merchant. +@override final String country; +/// The three letter ISO 4217 code for the currency. +@override final String currency; +/// Fields that will be shown on the required shipping address section. If +/// empty no fields will be displayed. + final List? _requiredShippingAddressFields; +/// Fields that will be shown on the required shipping address section. If +/// empty no fields will be displayed. +@override List? get requiredShippingAddressFields { + final value = _requiredShippingAddressFields; + if (value == null) return null; + if (_requiredShippingAddressFields is EqualUnmodifiableListView) return _requiredShippingAddressFields; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// Fields that will be shown on the required billing address section. If +/// empty no fields will be displayed. + final List? _requiredBillingContactFields; +/// Fields that will be shown on the required billing address section. If +/// empty no fields will be displayed. +@override List? get requiredBillingContactFields { + final value = _requiredBillingContactFields; + if (value == null) return null; + if (_requiredBillingContactFields is EqualUnmodifiableListView) return _requiredBillingContactFields; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// List of available shipping methods for goods. + final List? _shippingMethods; +/// List of available shipping methods for goods. +@override List? get shippingMethods { + final value = _shippingMethods; + if (value == null) return null; + if (_shippingMethods is EqualUnmodifiableListView) return _shippingMethods; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); } +/// Add support for jcb as additional payment method. +@override@JsonKey() final bool jcbEnabled; + +/// Create a copy of ApplePayPresentParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayPresentParamsCopyWith<_ApplePayPresentParams> get copyWith => __$ApplePayPresentParamsCopyWithImpl<_ApplePayPresentParams>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayPresentParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayPresentParams&&const DeepCollectionEquality().equals(other._cartItems, _cartItems)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&const DeepCollectionEquality().equals(other._requiredShippingAddressFields, _requiredShippingAddressFields)&&const DeepCollectionEquality().equals(other._requiredBillingContactFields, _requiredBillingContactFields)&&const DeepCollectionEquality().equals(other._shippingMethods, _shippingMethods)&&(identical(other.jcbEnabled, jcbEnabled) || other.jcbEnabled == jcbEnabled)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_cartItems),country,currency,const DeepCollectionEquality().hash(_requiredShippingAddressFields),const DeepCollectionEquality().hash(_requiredBillingContactFields),const DeepCollectionEquality().hash(_shippingMethods),jcbEnabled); + +@override +String toString() { + return 'ApplePayPresentParams(cartItems: $cartItems, country: $country, currency: $currency, requiredShippingAddressFields: $requiredShippingAddressFields, requiredBillingContactFields: $requiredBillingContactFields, shippingMethods: $shippingMethods, jcbEnabled: $jcbEnabled)'; +} + + +} + +/// @nodoc +abstract mixin class _$ApplePayPresentParamsCopyWith<$Res> implements $ApplePayPresentParamsCopyWith<$Res> { + factory _$ApplePayPresentParamsCopyWith(_ApplePayPresentParams value, $Res Function(_ApplePayPresentParams) _then) = __$ApplePayPresentParamsCopyWithImpl; +@override @useResult +$Res call({ + List cartItems, String country, String currency, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, bool jcbEnabled +}); + + + + +} +/// @nodoc +class __$ApplePayPresentParamsCopyWithImpl<$Res> + implements _$ApplePayPresentParamsCopyWith<$Res> { + __$ApplePayPresentParamsCopyWithImpl(this._self, this._then); + + final _ApplePayPresentParams _self; + final $Res Function(_ApplePayPresentParams) _then; + +/// Create a copy of ApplePayPresentParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? cartItems = null,Object? country = null,Object? currency = null,Object? requiredShippingAddressFields = freezed,Object? requiredBillingContactFields = freezed,Object? shippingMethods = freezed,Object? jcbEnabled = null,}) { + return _then(_ApplePayPresentParams( +cartItems: null == cartItems ? _self._cartItems : cartItems // ignore: cast_nullable_to_non_nullable +as List,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,requiredShippingAddressFields: freezed == requiredShippingAddressFields ? _self._requiredShippingAddressFields : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable +as List?,requiredBillingContactFields: freezed == requiredBillingContactFields ? _self._requiredBillingContactFields : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable +as List?,shippingMethods: freezed == shippingMethods ? _self._shippingMethods : shippingMethods // ignore: cast_nullable_to_non_nullable +as List?,jcbEnabled: null == jcbEnabled ? _self.jcbEnabled : jcbEnabled // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + + /// @nodoc mixin _$ApplePayErrorAddressField { - /// Address field that is affected by the error - ApplePayContactFieldsType get field => throw _privateConstructorUsedError; - /// The error message that will be shown when it is invalid - /// - /// Defaults to error in the stripe sdk. - String? get message => throw _privateConstructorUsedError; +/// Address field that is affected by the error + ApplePayContactFieldsType get field;/// The error message that will be shown when it is invalid +/// +/// Defaults to error in the stripe sdk. + String? get message; +/// Create a copy of ApplePayErrorAddressField +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayErrorAddressFieldCopyWith get copyWith => _$ApplePayErrorAddressFieldCopyWithImpl(this as ApplePayErrorAddressField, _$identity); /// Serializes this ApplePayErrorAddressField to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ApplePayErrorAddressField - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayErrorAddressFieldCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayErrorAddressField&&(identical(other.field, field) || other.field == field)&&(identical(other.message, message) || other.message == message)); } -/// @nodoc -abstract class $ApplePayErrorAddressFieldCopyWith<$Res> { - factory $ApplePayErrorAddressFieldCopyWith(ApplePayErrorAddressField value, - $Res Function(ApplePayErrorAddressField) then) = - _$ApplePayErrorAddressFieldCopyWithImpl<$Res, ApplePayErrorAddressField>; - @useResult - $Res call({ApplePayContactFieldsType field, String? message}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,field,message); + +@override +String toString() { + return 'ApplePayErrorAddressField(field: $field, message: $message)'; } -/// @nodoc -class _$ApplePayErrorAddressFieldCopyWithImpl<$Res, - $Val extends ApplePayErrorAddressField> - implements $ApplePayErrorAddressFieldCopyWith<$Res> { - _$ApplePayErrorAddressFieldCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayErrorAddressField - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field = null, - Object? message = freezed, - }) { - return _then(_value.copyWith( - field: null == field - ? _value.field - : field // ignore: cast_nullable_to_non_nullable - as ApplePayContactFieldsType, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ApplePayErrorAddressFieldImplCopyWith<$Res> +abstract mixin class $ApplePayErrorAddressFieldCopyWith<$Res> { + factory $ApplePayErrorAddressFieldCopyWith(ApplePayErrorAddressField value, $Res Function(ApplePayErrorAddressField) _then) = _$ApplePayErrorAddressFieldCopyWithImpl; +@useResult +$Res call({ + ApplePayContactFieldsType field, String? message +}); + + + + +} +/// @nodoc +class _$ApplePayErrorAddressFieldCopyWithImpl<$Res> implements $ApplePayErrorAddressFieldCopyWith<$Res> { - factory _$$ApplePayErrorAddressFieldImplCopyWith( - _$ApplePayErrorAddressFieldImpl value, - $Res Function(_$ApplePayErrorAddressFieldImpl) then) = - __$$ApplePayErrorAddressFieldImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({ApplePayContactFieldsType field, String? message}); + _$ApplePayErrorAddressFieldCopyWithImpl(this._self, this._then); + + final ApplePayErrorAddressField _self; + final $Res Function(ApplePayErrorAddressField) _then; + +/// Create a copy of ApplePayErrorAddressField +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? field = null,Object? message = freezed,}) { + return _then(_self.copyWith( +field: null == field ? _self.field : field // ignore: cast_nullable_to_non_nullable +as ApplePayContactFieldsType,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePayErrorAddressField]. +extension ApplePayErrorAddressFieldPatterns on ApplePayErrorAddressField { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayErrorAddressField value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayErrorAddressField() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayErrorAddressField value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayErrorAddressField(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayErrorAddressField value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayErrorAddressField() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ApplePayContactFieldsType field, String? message)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayErrorAddressField() when $default != null: +return $default(_that.field,_that.message);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ApplePayContactFieldsType field, String? message) $default,) {final _that = this; +switch (_that) { +case _ApplePayErrorAddressField(): +return $default(_that.field,_that.message);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ApplePayContactFieldsType field, String? message)? $default,) {final _that = this; +switch (_that) { +case _ApplePayErrorAddressField() when $default != null: +return $default(_that.field,_that.message);case _: + return null; + +} } -/// @nodoc -class __$$ApplePayErrorAddressFieldImplCopyWithImpl<$Res> - extends _$ApplePayErrorAddressFieldCopyWithImpl<$Res, - _$ApplePayErrorAddressFieldImpl> - implements _$$ApplePayErrorAddressFieldImplCopyWith<$Res> { - __$$ApplePayErrorAddressFieldImplCopyWithImpl( - _$ApplePayErrorAddressFieldImpl _value, - $Res Function(_$ApplePayErrorAddressFieldImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayErrorAddressField - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field = null, - Object? message = freezed, - }) { - return _then(_$ApplePayErrorAddressFieldImpl( - field: null == field - ? _value.field - : field // ignore: cast_nullable_to_non_nullable - as ApplePayContactFieldsType, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayErrorAddressFieldImpl implements _ApplePayErrorAddressField { - const _$ApplePayErrorAddressFieldImpl({required this.field, this.message}); - - factory _$ApplePayErrorAddressFieldImpl.fromJson(Map json) => - _$$ApplePayErrorAddressFieldImplFromJson(json); - - /// Address field that is affected by the error - @override - final ApplePayContactFieldsType field; - - /// The error message that will be shown when it is invalid - /// - /// Defaults to error in the stripe sdk. - @override - final String? message; - - @override - String toString() { - return 'ApplePayErrorAddressField(field: $field, message: $message)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayErrorAddressFieldImpl && - (identical(other.field, field) || other.field == field) && - (identical(other.message, message) || other.message == message)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, field, message); - - /// Create a copy of ApplePayErrorAddressField - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayErrorAddressFieldImplCopyWith<_$ApplePayErrorAddressFieldImpl> - get copyWith => __$$ApplePayErrorAddressFieldImplCopyWithImpl< - _$ApplePayErrorAddressFieldImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ApplePayErrorAddressFieldImplToJson( - this, - ); - } -} - -abstract class _ApplePayErrorAddressField implements ApplePayErrorAddressField { - const factory _ApplePayErrorAddressField( - {required final ApplePayContactFieldsType field, - final String? message}) = _$ApplePayErrorAddressFieldImpl; - - factory _ApplePayErrorAddressField.fromJson(Map json) = - _$ApplePayErrorAddressFieldImpl.fromJson; - - /// Address field that is affected by the error - @override - ApplePayContactFieldsType get field; - - /// The error message that will be shown when it is invalid - /// - /// Defaults to error in the stripe sdk. - @override - String? get message; - - /// Create a copy of ApplePayErrorAddressField - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayErrorAddressFieldImplCopyWith<_$ApplePayErrorAddressFieldImpl> - get copyWith => throw _privateConstructorUsedError; -} - -ApplePayContactName _$ApplePayContactNameFromJson(Map json) { - return _ApplePayContactName.fromJson(json); +class _ApplePayErrorAddressField implements ApplePayErrorAddressField { + const _ApplePayErrorAddressField({required this.field, this.message}); + factory _ApplePayErrorAddressField.fromJson(Map json) => _$ApplePayErrorAddressFieldFromJson(json); + +/// Address field that is affected by the error +@override final ApplePayContactFieldsType field; +/// The error message that will be shown when it is invalid +/// +/// Defaults to error in the stripe sdk. +@override final String? message; + +/// Create a copy of ApplePayErrorAddressField +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayErrorAddressFieldCopyWith<_ApplePayErrorAddressField> get copyWith => __$ApplePayErrorAddressFieldCopyWithImpl<_ApplePayErrorAddressField>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayErrorAddressFieldToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayErrorAddressField&&(identical(other.field, field) || other.field == field)&&(identical(other.message, message) || other.message == message)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,field,message); + +@override +String toString() { + return 'ApplePayErrorAddressField(field: $field, message: $message)'; +} + + +} + +/// @nodoc +abstract mixin class _$ApplePayErrorAddressFieldCopyWith<$Res> implements $ApplePayErrorAddressFieldCopyWith<$Res> { + factory _$ApplePayErrorAddressFieldCopyWith(_ApplePayErrorAddressField value, $Res Function(_ApplePayErrorAddressField) _then) = __$ApplePayErrorAddressFieldCopyWithImpl; +@override @useResult +$Res call({ + ApplePayContactFieldsType field, String? message +}); + + + + } +/// @nodoc +class __$ApplePayErrorAddressFieldCopyWithImpl<$Res> + implements _$ApplePayErrorAddressFieldCopyWith<$Res> { + __$ApplePayErrorAddressFieldCopyWithImpl(this._self, this._then); + + final _ApplePayErrorAddressField _self; + final $Res Function(_ApplePayErrorAddressField) _then; + +/// Create a copy of ApplePayErrorAddressField +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? field = null,Object? message = freezed,}) { + return _then(_ApplePayErrorAddressField( +field: null == field ? _self.field : field // ignore: cast_nullable_to_non_nullable +as ApplePayContactFieldsType,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + /// @nodoc mixin _$ApplePayContactName { - String? get familyName => throw _privateConstructorUsedError; - String? get namePrefix => throw _privateConstructorUsedError; - String? get nameSuffix => throw _privateConstructorUsedError; - String? get givenName => throw _privateConstructorUsedError; - String? get middleName => throw _privateConstructorUsedError; - String? get nickname => throw _privateConstructorUsedError; + + String? get familyName; String? get namePrefix; String? get nameSuffix; String? get givenName; String? get middleName; String? get nickname; +/// Create a copy of ApplePayContactName +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayContactNameCopyWith get copyWith => _$ApplePayContactNameCopyWithImpl(this as ApplePayContactName, _$identity); /// Serializes this ApplePayContactName to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ApplePayContactName - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayContactNameCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayContactName&&(identical(other.familyName, familyName) || other.familyName == familyName)&&(identical(other.namePrefix, namePrefix) || other.namePrefix == namePrefix)&&(identical(other.nameSuffix, nameSuffix) || other.nameSuffix == nameSuffix)&&(identical(other.givenName, givenName) || other.givenName == givenName)&&(identical(other.middleName, middleName) || other.middleName == middleName)&&(identical(other.nickname, nickname) || other.nickname == nickname)); } -/// @nodoc -abstract class $ApplePayContactNameCopyWith<$Res> { - factory $ApplePayContactNameCopyWith( - ApplePayContactName value, $Res Function(ApplePayContactName) then) = - _$ApplePayContactNameCopyWithImpl<$Res, ApplePayContactName>; - @useResult - $Res call( - {String? familyName, - String? namePrefix, - String? nameSuffix, - String? givenName, - String? middleName, - String? nickname}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,familyName,namePrefix,nameSuffix,givenName,middleName,nickname); + +@override +String toString() { + return 'ApplePayContactName(familyName: $familyName, namePrefix: $namePrefix, nameSuffix: $nameSuffix, givenName: $givenName, middleName: $middleName, nickname: $nickname)'; } -/// @nodoc -class _$ApplePayContactNameCopyWithImpl<$Res, $Val extends ApplePayContactName> - implements $ApplePayContactNameCopyWith<$Res> { - _$ApplePayContactNameCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayContactName - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? familyName = freezed, - Object? namePrefix = freezed, - Object? nameSuffix = freezed, - Object? givenName = freezed, - Object? middleName = freezed, - Object? nickname = freezed, - }) { - return _then(_value.copyWith( - familyName: freezed == familyName - ? _value.familyName - : familyName // ignore: cast_nullable_to_non_nullable - as String?, - namePrefix: freezed == namePrefix - ? _value.namePrefix - : namePrefix // ignore: cast_nullable_to_non_nullable - as String?, - nameSuffix: freezed == nameSuffix - ? _value.nameSuffix - : nameSuffix // ignore: cast_nullable_to_non_nullable - as String?, - givenName: freezed == givenName - ? _value.givenName - : givenName // ignore: cast_nullable_to_non_nullable - as String?, - middleName: freezed == middleName - ? _value.middleName - : middleName // ignore: cast_nullable_to_non_nullable - as String?, - nickname: freezed == nickname - ? _value.nickname - : nickname // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ApplePayContactNameImplCopyWith<$Res> +abstract mixin class $ApplePayContactNameCopyWith<$Res> { + factory $ApplePayContactNameCopyWith(ApplePayContactName value, $Res Function(ApplePayContactName) _then) = _$ApplePayContactNameCopyWithImpl; +@useResult +$Res call({ + String? familyName, String? namePrefix, String? nameSuffix, String? givenName, String? middleName, String? nickname +}); + + + + +} +/// @nodoc +class _$ApplePayContactNameCopyWithImpl<$Res> implements $ApplePayContactNameCopyWith<$Res> { - factory _$$ApplePayContactNameImplCopyWith(_$ApplePayContactNameImpl value, - $Res Function(_$ApplePayContactNameImpl) then) = - __$$ApplePayContactNameImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? familyName, - String? namePrefix, - String? nameSuffix, - String? givenName, - String? middleName, - String? nickname}); + _$ApplePayContactNameCopyWithImpl(this._self, this._then); + + final ApplePayContactName _self; + final $Res Function(ApplePayContactName) _then; + +/// Create a copy of ApplePayContactName +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? familyName = freezed,Object? namePrefix = freezed,Object? nameSuffix = freezed,Object? givenName = freezed,Object? middleName = freezed,Object? nickname = freezed,}) { + return _then(_self.copyWith( +familyName: freezed == familyName ? _self.familyName : familyName // ignore: cast_nullable_to_non_nullable +as String?,namePrefix: freezed == namePrefix ? _self.namePrefix : namePrefix // ignore: cast_nullable_to_non_nullable +as String?,nameSuffix: freezed == nameSuffix ? _self.nameSuffix : nameSuffix // ignore: cast_nullable_to_non_nullable +as String?,givenName: freezed == givenName ? _self.givenName : givenName // ignore: cast_nullable_to_non_nullable +as String?,middleName: freezed == middleName ? _self.middleName : middleName // ignore: cast_nullable_to_non_nullable +as String?,nickname: freezed == nickname ? _self.nickname : nickname // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePayContactName]. +extension ApplePayContactNamePatterns on ApplePayContactName { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayContactName value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayContactName() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayContactName value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayContactName(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayContactName value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayContactName() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? familyName, String? namePrefix, String? nameSuffix, String? givenName, String? middleName, String? nickname)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayContactName() when $default != null: +return $default(_that.familyName,_that.namePrefix,_that.nameSuffix,_that.givenName,_that.middleName,_that.nickname);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? familyName, String? namePrefix, String? nameSuffix, String? givenName, String? middleName, String? nickname) $default,) {final _that = this; +switch (_that) { +case _ApplePayContactName(): +return $default(_that.familyName,_that.namePrefix,_that.nameSuffix,_that.givenName,_that.middleName,_that.nickname);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? familyName, String? namePrefix, String? nameSuffix, String? givenName, String? middleName, String? nickname)? $default,) {final _that = this; +switch (_that) { +case _ApplePayContactName() when $default != null: +return $default(_that.familyName,_that.namePrefix,_that.nameSuffix,_that.givenName,_that.middleName,_that.nickname);case _: + return null; + +} } -/// @nodoc -class __$$ApplePayContactNameImplCopyWithImpl<$Res> - extends _$ApplePayContactNameCopyWithImpl<$Res, _$ApplePayContactNameImpl> - implements _$$ApplePayContactNameImplCopyWith<$Res> { - __$$ApplePayContactNameImplCopyWithImpl(_$ApplePayContactNameImpl _value, - $Res Function(_$ApplePayContactNameImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayContactName - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? familyName = freezed, - Object? namePrefix = freezed, - Object? nameSuffix = freezed, - Object? givenName = freezed, - Object? middleName = freezed, - Object? nickname = freezed, - }) { - return _then(_$ApplePayContactNameImpl( - familyName: freezed == familyName - ? _value.familyName - : familyName // ignore: cast_nullable_to_non_nullable - as String?, - namePrefix: freezed == namePrefix - ? _value.namePrefix - : namePrefix // ignore: cast_nullable_to_non_nullable - as String?, - nameSuffix: freezed == nameSuffix - ? _value.nameSuffix - : nameSuffix // ignore: cast_nullable_to_non_nullable - as String?, - givenName: freezed == givenName - ? _value.givenName - : givenName // ignore: cast_nullable_to_non_nullable - as String?, - middleName: freezed == middleName - ? _value.middleName - : middleName // ignore: cast_nullable_to_non_nullable - as String?, - nickname: freezed == nickname - ? _value.nickname - : nickname // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayContactNameImpl implements _ApplePayContactName { - const _$ApplePayContactNameImpl( - {this.familyName, - this.namePrefix, - this.nameSuffix, - this.givenName, - this.middleName, - this.nickname}); - - factory _$ApplePayContactNameImpl.fromJson(Map json) => - _$$ApplePayContactNameImplFromJson(json); - - @override - final String? familyName; - @override - final String? namePrefix; - @override - final String? nameSuffix; - @override - final String? givenName; - @override - final String? middleName; - @override - final String? nickname; - - @override - String toString() { - return 'ApplePayContactName(familyName: $familyName, namePrefix: $namePrefix, nameSuffix: $nameSuffix, givenName: $givenName, middleName: $middleName, nickname: $nickname)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayContactNameImpl && - (identical(other.familyName, familyName) || - other.familyName == familyName) && - (identical(other.namePrefix, namePrefix) || - other.namePrefix == namePrefix) && - (identical(other.nameSuffix, nameSuffix) || - other.nameSuffix == nameSuffix) && - (identical(other.givenName, givenName) || - other.givenName == givenName) && - (identical(other.middleName, middleName) || - other.middleName == middleName) && - (identical(other.nickname, nickname) || - other.nickname == nickname)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, familyName, namePrefix, - nameSuffix, givenName, middleName, nickname); - - /// Create a copy of ApplePayContactName - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayContactNameImplCopyWith<_$ApplePayContactNameImpl> get copyWith => - __$$ApplePayContactNameImplCopyWithImpl<_$ApplePayContactNameImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ApplePayContactNameImplToJson( - this, - ); - } -} - -abstract class _ApplePayContactName implements ApplePayContactName { - const factory _ApplePayContactName( - {final String? familyName, - final String? namePrefix, - final String? nameSuffix, - final String? givenName, - final String? middleName, - final String? nickname}) = _$ApplePayContactNameImpl; - - factory _ApplePayContactName.fromJson(Map json) = - _$ApplePayContactNameImpl.fromJson; - - @override - String? get familyName; - @override - String? get namePrefix; - @override - String? get nameSuffix; - @override - String? get givenName; - @override - String? get middleName; - @override - String? get nickname; - - /// Create a copy of ApplePayContactName - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayContactNameImplCopyWith<_$ApplePayContactNameImpl> get copyWith => - throw _privateConstructorUsedError; -} - -ApplePayPostalAddress _$ApplePayPostalAddressFromJson( - Map json) { - return _ApplePayPostalAddress.fromJson(json); +class _ApplePayContactName implements ApplePayContactName { + const _ApplePayContactName({this.familyName, this.namePrefix, this.nameSuffix, this.givenName, this.middleName, this.nickname}); + factory _ApplePayContactName.fromJson(Map json) => _$ApplePayContactNameFromJson(json); + +@override final String? familyName; +@override final String? namePrefix; +@override final String? nameSuffix; +@override final String? givenName; +@override final String? middleName; +@override final String? nickname; + +/// Create a copy of ApplePayContactName +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayContactNameCopyWith<_ApplePayContactName> get copyWith => __$ApplePayContactNameCopyWithImpl<_ApplePayContactName>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayContactNameToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayContactName&&(identical(other.familyName, familyName) || other.familyName == familyName)&&(identical(other.namePrefix, namePrefix) || other.namePrefix == namePrefix)&&(identical(other.nameSuffix, nameSuffix) || other.nameSuffix == nameSuffix)&&(identical(other.givenName, givenName) || other.givenName == givenName)&&(identical(other.middleName, middleName) || other.middleName == middleName)&&(identical(other.nickname, nickname) || other.nickname == nickname)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,familyName,namePrefix,nameSuffix,givenName,middleName,nickname); + +@override +String toString() { + return 'ApplePayContactName(familyName: $familyName, namePrefix: $namePrefix, nameSuffix: $nameSuffix, givenName: $givenName, middleName: $middleName, nickname: $nickname)'; +} + + +} + +/// @nodoc +abstract mixin class _$ApplePayContactNameCopyWith<$Res> implements $ApplePayContactNameCopyWith<$Res> { + factory _$ApplePayContactNameCopyWith(_ApplePayContactName value, $Res Function(_ApplePayContactName) _then) = __$ApplePayContactNameCopyWithImpl; +@override @useResult +$Res call({ + String? familyName, String? namePrefix, String? nameSuffix, String? givenName, String? middleName, String? nickname +}); + + + + +} +/// @nodoc +class __$ApplePayContactNameCopyWithImpl<$Res> + implements _$ApplePayContactNameCopyWith<$Res> { + __$ApplePayContactNameCopyWithImpl(this._self, this._then); + + final _ApplePayContactName _self; + final $Res Function(_ApplePayContactName) _then; + +/// Create a copy of ApplePayContactName +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? familyName = freezed,Object? namePrefix = freezed,Object? nameSuffix = freezed,Object? givenName = freezed,Object? middleName = freezed,Object? nickname = freezed,}) { + return _then(_ApplePayContactName( +familyName: freezed == familyName ? _self.familyName : familyName // ignore: cast_nullable_to_non_nullable +as String?,namePrefix: freezed == namePrefix ? _self.namePrefix : namePrefix // ignore: cast_nullable_to_non_nullable +as String?,nameSuffix: freezed == nameSuffix ? _self.nameSuffix : nameSuffix // ignore: cast_nullable_to_non_nullable +as String?,givenName: freezed == givenName ? _self.givenName : givenName // ignore: cast_nullable_to_non_nullable +as String?,middleName: freezed == middleName ? _self.middleName : middleName // ignore: cast_nullable_to_non_nullable +as String?,nickname: freezed == nickname ? _self.nickname : nickname // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } + /// @nodoc mixin _$ApplePayPostalAddress { - String? get city => throw _privateConstructorUsedError; - String? get country => throw _privateConstructorUsedError; - String? get postalCode => throw _privateConstructorUsedError; - String? get state => throw _privateConstructorUsedError; - String? get street => throw _privateConstructorUsedError; - String? get isoCountryCode => throw _privateConstructorUsedError; - String? get subAdministrativeArea => throw _privateConstructorUsedError; - String? get subLocality => throw _privateConstructorUsedError; + + String? get city; String? get country; String? get postalCode; String? get state; String? get street; String? get isoCountryCode; String? get subAdministrativeArea; String? get subLocality; +/// Create a copy of ApplePayPostalAddress +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayPostalAddressCopyWith get copyWith => _$ApplePayPostalAddressCopyWithImpl(this as ApplePayPostalAddress, _$identity); /// Serializes this ApplePayPostalAddress to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ApplePayPostalAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayPostalAddressCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayPostalAddress&&(identical(other.city, city) || other.city == city)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.street, street) || other.street == street)&&(identical(other.isoCountryCode, isoCountryCode) || other.isoCountryCode == isoCountryCode)&&(identical(other.subAdministrativeArea, subAdministrativeArea) || other.subAdministrativeArea == subAdministrativeArea)&&(identical(other.subLocality, subLocality) || other.subLocality == subLocality)); } -/// @nodoc -abstract class $ApplePayPostalAddressCopyWith<$Res> { - factory $ApplePayPostalAddressCopyWith(ApplePayPostalAddress value, - $Res Function(ApplePayPostalAddress) then) = - _$ApplePayPostalAddressCopyWithImpl<$Res, ApplePayPostalAddress>; - @useResult - $Res call( - {String? city, - String? country, - String? postalCode, - String? state, - String? street, - String? isoCountryCode, - String? subAdministrativeArea, - String? subLocality}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,country,postalCode,state,street,isoCountryCode,subAdministrativeArea,subLocality); + +@override +String toString() { + return 'ApplePayPostalAddress(city: $city, country: $country, postalCode: $postalCode, state: $state, street: $street, isoCountryCode: $isoCountryCode, subAdministrativeArea: $subAdministrativeArea, subLocality: $subLocality)'; } -/// @nodoc -class _$ApplePayPostalAddressCopyWithImpl<$Res, - $Val extends ApplePayPostalAddress> - implements $ApplePayPostalAddressCopyWith<$Res> { - _$ApplePayPostalAddressCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayPostalAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? city = freezed, - Object? country = freezed, - Object? postalCode = freezed, - Object? state = freezed, - Object? street = freezed, - Object? isoCountryCode = freezed, - Object? subAdministrativeArea = freezed, - Object? subLocality = freezed, - }) { - return _then(_value.copyWith( - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - street: freezed == street - ? _value.street - : street // ignore: cast_nullable_to_non_nullable - as String?, - isoCountryCode: freezed == isoCountryCode - ? _value.isoCountryCode - : isoCountryCode // ignore: cast_nullable_to_non_nullable - as String?, - subAdministrativeArea: freezed == subAdministrativeArea - ? _value.subAdministrativeArea - : subAdministrativeArea // ignore: cast_nullable_to_non_nullable - as String?, - subLocality: freezed == subLocality - ? _value.subLocality - : subLocality // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ApplePayPostalAddressImplCopyWith<$Res> +abstract mixin class $ApplePayPostalAddressCopyWith<$Res> { + factory $ApplePayPostalAddressCopyWith(ApplePayPostalAddress value, $Res Function(ApplePayPostalAddress) _then) = _$ApplePayPostalAddressCopyWithImpl; +@useResult +$Res call({ + String? city, String? country, String? postalCode, String? state, String? street, String? isoCountryCode, String? subAdministrativeArea, String? subLocality +}); + + + + +} +/// @nodoc +class _$ApplePayPostalAddressCopyWithImpl<$Res> implements $ApplePayPostalAddressCopyWith<$Res> { - factory _$$ApplePayPostalAddressImplCopyWith( - _$ApplePayPostalAddressImpl value, - $Res Function(_$ApplePayPostalAddressImpl) then) = - __$$ApplePayPostalAddressImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? city, - String? country, - String? postalCode, - String? state, - String? street, - String? isoCountryCode, - String? subAdministrativeArea, - String? subLocality}); + _$ApplePayPostalAddressCopyWithImpl(this._self, this._then); + + final ApplePayPostalAddress _self; + final $Res Function(ApplePayPostalAddress) _then; + +/// Create a copy of ApplePayPostalAddress +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? city = freezed,Object? country = freezed,Object? postalCode = freezed,Object? state = freezed,Object? street = freezed,Object? isoCountryCode = freezed,Object? subAdministrativeArea = freezed,Object? subLocality = freezed,}) { + return _then(_self.copyWith( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,street: freezed == street ? _self.street : street // ignore: cast_nullable_to_non_nullable +as String?,isoCountryCode: freezed == isoCountryCode ? _self.isoCountryCode : isoCountryCode // ignore: cast_nullable_to_non_nullable +as String?,subAdministrativeArea: freezed == subAdministrativeArea ? _self.subAdministrativeArea : subAdministrativeArea // ignore: cast_nullable_to_non_nullable +as String?,subLocality: freezed == subLocality ? _self.subLocality : subLocality // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePayPostalAddress]. +extension ApplePayPostalAddressPatterns on ApplePayPostalAddress { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayPostalAddress value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayPostalAddress() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayPostalAddress value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayPostalAddress(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayPostalAddress value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayPostalAddress() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? city, String? country, String? postalCode, String? state, String? street, String? isoCountryCode, String? subAdministrativeArea, String? subLocality)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayPostalAddress() when $default != null: +return $default(_that.city,_that.country,_that.postalCode,_that.state,_that.street,_that.isoCountryCode,_that.subAdministrativeArea,_that.subLocality);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? city, String? country, String? postalCode, String? state, String? street, String? isoCountryCode, String? subAdministrativeArea, String? subLocality) $default,) {final _that = this; +switch (_that) { +case _ApplePayPostalAddress(): +return $default(_that.city,_that.country,_that.postalCode,_that.state,_that.street,_that.isoCountryCode,_that.subAdministrativeArea,_that.subLocality);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? city, String? country, String? postalCode, String? state, String? street, String? isoCountryCode, String? subAdministrativeArea, String? subLocality)? $default,) {final _that = this; +switch (_that) { +case _ApplePayPostalAddress() when $default != null: +return $default(_that.city,_that.country,_that.postalCode,_that.state,_that.street,_that.isoCountryCode,_that.subAdministrativeArea,_that.subLocality);case _: + return null; + +} } -/// @nodoc -class __$$ApplePayPostalAddressImplCopyWithImpl<$Res> - extends _$ApplePayPostalAddressCopyWithImpl<$Res, - _$ApplePayPostalAddressImpl> - implements _$$ApplePayPostalAddressImplCopyWith<$Res> { - __$$ApplePayPostalAddressImplCopyWithImpl(_$ApplePayPostalAddressImpl _value, - $Res Function(_$ApplePayPostalAddressImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayPostalAddress - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? city = freezed, - Object? country = freezed, - Object? postalCode = freezed, - Object? state = freezed, - Object? street = freezed, - Object? isoCountryCode = freezed, - Object? subAdministrativeArea = freezed, - Object? subLocality = freezed, - }) { - return _then(_$ApplePayPostalAddressImpl( - city: freezed == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - state: freezed == state - ? _value.state - : state // ignore: cast_nullable_to_non_nullable - as String?, - street: freezed == street - ? _value.street - : street // ignore: cast_nullable_to_non_nullable - as String?, - isoCountryCode: freezed == isoCountryCode - ? _value.isoCountryCode - : isoCountryCode // ignore: cast_nullable_to_non_nullable - as String?, - subAdministrativeArea: freezed == subAdministrativeArea - ? _value.subAdministrativeArea - : subAdministrativeArea // ignore: cast_nullable_to_non_nullable - as String?, - subLocality: freezed == subLocality - ? _value.subLocality - : subLocality // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayPostalAddressImpl implements _ApplePayPostalAddress { - const _$ApplePayPostalAddressImpl( - {this.city, - this.country, - this.postalCode, - this.state, - this.street, - this.isoCountryCode, - this.subAdministrativeArea, - this.subLocality}); - - factory _$ApplePayPostalAddressImpl.fromJson(Map json) => - _$$ApplePayPostalAddressImplFromJson(json); - - @override - final String? city; - @override - final String? country; - @override - final String? postalCode; - @override - final String? state; - @override - final String? street; - @override - final String? isoCountryCode; - @override - final String? subAdministrativeArea; - @override - final String? subLocality; - - @override - String toString() { - return 'ApplePayPostalAddress(city: $city, country: $country, postalCode: $postalCode, state: $state, street: $street, isoCountryCode: $isoCountryCode, subAdministrativeArea: $subAdministrativeArea, subLocality: $subLocality)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayPostalAddressImpl && - (identical(other.city, city) || other.city == city) && - (identical(other.country, country) || other.country == country) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode) && - (identical(other.state, state) || other.state == state) && - (identical(other.street, street) || other.street == street) && - (identical(other.isoCountryCode, isoCountryCode) || - other.isoCountryCode == isoCountryCode) && - (identical(other.subAdministrativeArea, subAdministrativeArea) || - other.subAdministrativeArea == subAdministrativeArea) && - (identical(other.subLocality, subLocality) || - other.subLocality == subLocality)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, city, country, postalCode, state, - street, isoCountryCode, subAdministrativeArea, subLocality); - - /// Create a copy of ApplePayPostalAddress - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayPostalAddressImplCopyWith<_$ApplePayPostalAddressImpl> - get copyWith => __$$ApplePayPostalAddressImplCopyWithImpl< - _$ApplePayPostalAddressImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ApplePayPostalAddressImplToJson( - this, - ); - } -} - -abstract class _ApplePayPostalAddress implements ApplePayPostalAddress { - const factory _ApplePayPostalAddress( - {final String? city, - final String? country, - final String? postalCode, - final String? state, - final String? street, - final String? isoCountryCode, - final String? subAdministrativeArea, - final String? subLocality}) = _$ApplePayPostalAddressImpl; - - factory _ApplePayPostalAddress.fromJson(Map json) = - _$ApplePayPostalAddressImpl.fromJson; - - @override - String? get city; - @override - String? get country; - @override - String? get postalCode; - @override - String? get state; - @override - String? get street; - @override - String? get isoCountryCode; - @override - String? get subAdministrativeArea; - @override - String? get subLocality; - - /// Create a copy of ApplePayPostalAddress - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayPostalAddressImplCopyWith<_$ApplePayPostalAddressImpl> - get copyWith => throw _privateConstructorUsedError; +class _ApplePayPostalAddress implements ApplePayPostalAddress { + const _ApplePayPostalAddress({this.city, this.country, this.postalCode, this.state, this.street, this.isoCountryCode, this.subAdministrativeArea, this.subLocality}); + factory _ApplePayPostalAddress.fromJson(Map json) => _$ApplePayPostalAddressFromJson(json); + +@override final String? city; +@override final String? country; +@override final String? postalCode; +@override final String? state; +@override final String? street; +@override final String? isoCountryCode; +@override final String? subAdministrativeArea; +@override final String? subLocality; + +/// Create a copy of ApplePayPostalAddress +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayPostalAddressCopyWith<_ApplePayPostalAddress> get copyWith => __$ApplePayPostalAddressCopyWithImpl<_ApplePayPostalAddress>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayPostalAddressToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayPostalAddress&&(identical(other.city, city) || other.city == city)&&(identical(other.country, country) || other.country == country)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.street, street) || other.street == street)&&(identical(other.isoCountryCode, isoCountryCode) || other.isoCountryCode == isoCountryCode)&&(identical(other.subAdministrativeArea, subAdministrativeArea) || other.subAdministrativeArea == subAdministrativeArea)&&(identical(other.subLocality, subLocality) || other.subLocality == subLocality)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,city,country,postalCode,state,street,isoCountryCode,subAdministrativeArea,subLocality); + +@override +String toString() { + return 'ApplePayPostalAddress(city: $city, country: $country, postalCode: $postalCode, state: $state, street: $street, isoCountryCode: $isoCountryCode, subAdministrativeArea: $subAdministrativeArea, subLocality: $subLocality)'; +} + + +} + +/// @nodoc +abstract mixin class _$ApplePayPostalAddressCopyWith<$Res> implements $ApplePayPostalAddressCopyWith<$Res> { + factory _$ApplePayPostalAddressCopyWith(_ApplePayPostalAddress value, $Res Function(_ApplePayPostalAddress) _then) = __$ApplePayPostalAddressCopyWithImpl; +@override @useResult +$Res call({ + String? city, String? country, String? postalCode, String? state, String? street, String? isoCountryCode, String? subAdministrativeArea, String? subLocality +}); + + + + } +/// @nodoc +class __$ApplePayPostalAddressCopyWithImpl<$Res> + implements _$ApplePayPostalAddressCopyWith<$Res> { + __$ApplePayPostalAddressCopyWithImpl(this._self, this._then); + + final _ApplePayPostalAddress _self; + final $Res Function(_ApplePayPostalAddress) _then; + +/// Create a copy of ApplePayPostalAddress +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? city = freezed,Object? country = freezed,Object? postalCode = freezed,Object? state = freezed,Object? street = freezed,Object? isoCountryCode = freezed,Object? subAdministrativeArea = freezed,Object? subLocality = freezed,}) { + return _then(_ApplePayPostalAddress( +city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,street: freezed == street ? _self.street : street // ignore: cast_nullable_to_non_nullable +as String?,isoCountryCode: freezed == isoCountryCode ? _self.isoCountryCode : isoCountryCode // ignore: cast_nullable_to_non_nullable +as String?,subAdministrativeArea: freezed == subAdministrativeArea ? _self.subAdministrativeArea : subAdministrativeArea // ignore: cast_nullable_to_non_nullable +as String?,subLocality: freezed == subLocality ? _self.subLocality : subLocality // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/apple_pay.g.dart b/packages/stripe_platform_interface/lib/src/models/apple_pay.g.dart index 2c9f8dbce..1b83fab0a 100644 --- a/packages/stripe_platform_interface/lib/src/models/apple_pay.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/apple_pay.g.dart @@ -6,90 +6,91 @@ part of 'apple_pay.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ApplePayShippingMethodImpl _$$ApplePayShippingMethodImplFromJson( - Map json) => - _$ApplePayShippingMethodImpl( - label: json['label'] as String, - amount: json['amount'] as String, - identifier: json['identifier'] as String, - isPending: json['isPending'] as bool?, - detail: json['detail'] as String?, - startDate: (json['startDate'] as num?)?.toInt(), - endDate: (json['endDate'] as num?)?.toInt(), - ); +_ApplePayShippingMethod _$ApplePayShippingMethodFromJson( + Map json, +) => _ApplePayShippingMethod( + label: json['label'] as String, + amount: json['amount'] as String, + identifier: json['identifier'] as String, + isPending: json['isPending'] as bool?, + detail: json['detail'] as String?, + startDate: (json['startDate'] as num?)?.toInt(), + endDate: (json['endDate'] as num?)?.toInt(), +); + +Map _$ApplePayShippingMethodToJson( + _ApplePayShippingMethod instance, +) => { + 'label': instance.label, + 'amount': instance.amount, + 'identifier': instance.identifier, + 'isPending': instance.isPending, + 'detail': instance.detail, + 'startDate': instance.startDate, + 'endDate': instance.endDate, +}; -Map _$$ApplePayShippingMethodImplToJson( - _$ApplePayShippingMethodImpl instance) => - { - 'label': instance.label, - 'amount': instance.amount, - 'identifier': instance.identifier, - 'isPending': instance.isPending, - 'detail': instance.detail, - 'startDate': instance.startDate, - 'endDate': instance.endDate, - }; - -_$ImmediateCartSummaryItemImpl _$$ImmediateCartSummaryItemImplFromJson( - Map json) => - _$ImmediateCartSummaryItemImpl( - label: json['label'] as String, - amount: json['amount'] as String, - isPending: json['isPending'] as bool?, - $type: json['paymentType'] as String?, - ); +ImmediateCartSummaryItem _$ImmediateCartSummaryItemFromJson( + Map json, +) => ImmediateCartSummaryItem( + label: json['label'] as String, + amount: json['amount'] as String, + isPending: json['isPending'] as bool?, + $type: json['paymentType'] as String?, +); + +Map _$ImmediateCartSummaryItemToJson( + ImmediateCartSummaryItem instance, +) => { + 'label': instance.label, + 'amount': instance.amount, + 'isPending': instance.isPending, + 'paymentType': instance.$type, +}; -Map _$$ImmediateCartSummaryItemImplToJson( - _$ImmediateCartSummaryItemImpl instance) => - { - 'label': instance.label, - 'amount': instance.amount, - 'isPending': instance.isPending, - 'paymentType': instance.$type, - }; - -_$DeferredSummaryItemImpl _$$DeferredSummaryItemImplFromJson( - Map json) => - _$DeferredSummaryItemImpl( +DeferredSummaryItem _$DeferredSummaryItemFromJson(Map json) => + DeferredSummaryItem( label: json['label'] as String, amount: json['amount'] as String, deferredDate: (json['deferredDate'] as num).toInt(), $type: json['paymentType'] as String?, ); -Map _$$DeferredSummaryItemImplToJson( - _$DeferredSummaryItemImpl instance) => - { - 'label': instance.label, - 'amount': instance.amount, - 'deferredDate': instance.deferredDate, - 'paymentType': instance.$type, - }; - -_$RecurringCartSummaryItemImpl _$$RecurringCartSummaryItemImplFromJson( - Map json) => - _$RecurringCartSummaryItemImpl( - label: json['label'] as String, - amount: json['amount'] as String, - intervalUnit: - $enumDecode(_$ApplePayIntervalUnitEnumMap, json['intervalUnit']), - intervalCount: (json['intervalCount'] as num).toInt(), - startDate: (json['startDate'] as num?)?.toInt(), - endDate: (json['endDate'] as num?)?.toInt(), - $type: json['paymentType'] as String?, - ); +Map _$DeferredSummaryItemToJson( + DeferredSummaryItem instance, +) => { + 'label': instance.label, + 'amount': instance.amount, + 'deferredDate': instance.deferredDate, + 'paymentType': instance.$type, +}; -Map _$$RecurringCartSummaryItemImplToJson( - _$RecurringCartSummaryItemImpl instance) => - { - 'label': instance.label, - 'amount': instance.amount, - 'intervalUnit': _$ApplePayIntervalUnitEnumMap[instance.intervalUnit]!, - 'intervalCount': instance.intervalCount, - 'startDate': instance.startDate, - 'endDate': instance.endDate, - 'paymentType': instance.$type, - }; +RecurringCartSummaryItem _$RecurringCartSummaryItemFromJson( + Map json, +) => RecurringCartSummaryItem( + label: json['label'] as String, + amount: json['amount'] as String, + intervalUnit: $enumDecode( + _$ApplePayIntervalUnitEnumMap, + json['intervalUnit'], + ), + intervalCount: (json['intervalCount'] as num).toInt(), + startDate: (json['startDate'] as num?)?.toInt(), + endDate: (json['endDate'] as num?)?.toInt(), + $type: json['paymentType'] as String?, +); + +Map _$RecurringCartSummaryItemToJson( + RecurringCartSummaryItem instance, +) => { + 'label': instance.label, + 'amount': instance.amount, + 'intervalUnit': _$ApplePayIntervalUnitEnumMap[instance.intervalUnit]!, + 'intervalCount': instance.intervalCount, + 'startDate': instance.startDate, + 'endDate': instance.endDate, + 'paymentType': instance.$type, +}; const _$ApplePayIntervalUnitEnumMap = { ApplePayIntervalUnit.minute: 'minute', @@ -99,46 +100,43 @@ const _$ApplePayIntervalUnitEnumMap = { ApplePayIntervalUnit.year: 'year', }; -_$ApplePayPresentParamsImpl _$$ApplePayPresentParamsImplFromJson( - Map json) => - _$ApplePayPresentParamsImpl( - cartItems: (json['cartItems'] as List) - .map((e) => - ApplePayCartSummaryItem.fromJson(e as Map)) +_ApplePayPresentParams _$ApplePayPresentParamsFromJson( + Map json, +) => _ApplePayPresentParams( + cartItems: (json['cartItems'] as List) + .map((e) => ApplePayCartSummaryItem.fromJson(e as Map)) + .toList(), + country: json['country'] as String, + currency: json['currency'] as String, + requiredShippingAddressFields: + (json['requiredShippingAddressFields'] as List?) + ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) .toList(), - country: json['country'] as String, - currency: json['currency'] as String, - requiredShippingAddressFields: - (json['requiredShippingAddressFields'] as List?) - ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) - .toList(), - requiredBillingContactFields: - (json['requiredBillingContactFields'] as List?) - ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) - .toList(), - shippingMethods: (json['shippingMethods'] as List?) - ?.map( - (e) => ApplePayShippingMethod.fromJson(e as Map)) + requiredBillingContactFields: + (json['requiredBillingContactFields'] as List?) + ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) .toList(), - jcbEnabled: json['jcbEnabled'] as bool? ?? false, - ); - -Map _$$ApplePayPresentParamsImplToJson( - _$ApplePayPresentParamsImpl instance) => - { - 'cartItems': instance.cartItems.map((e) => e.toJson()).toList(), - 'country': instance.country, - 'currency': instance.currency, - 'requiredShippingAddressFields': instance.requiredShippingAddressFields - ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) - .toList(), - 'requiredBillingContactFields': instance.requiredBillingContactFields - ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) - .toList(), - 'shippingMethods': - instance.shippingMethods?.map((e) => e.toJson()).toList(), - 'jcbEnabled': instance.jcbEnabled, - }; + shippingMethods: (json['shippingMethods'] as List?) + ?.map((e) => ApplePayShippingMethod.fromJson(e as Map)) + .toList(), + jcbEnabled: json['jcbEnabled'] as bool? ?? false, +); + +Map _$ApplePayPresentParamsToJson( + _ApplePayPresentParams instance, +) => { + 'cartItems': instance.cartItems.map((e) => e.toJson()).toList(), + 'country': instance.country, + 'currency': instance.currency, + 'requiredShippingAddressFields': instance.requiredShippingAddressFields + ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) + .toList(), + 'requiredBillingContactFields': instance.requiredBillingContactFields + ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) + .toList(), + 'shippingMethods': instance.shippingMethods?.map((e) => e.toJson()).toList(), + 'jcbEnabled': instance.jcbEnabled, +}; const _$ApplePayContactFieldsTypeEnumMap = { ApplePayContactFieldsType.emailAddress: 'emailAddress', @@ -148,23 +146,22 @@ const _$ApplePayContactFieldsTypeEnumMap = { ApplePayContactFieldsType.postalAddress: 'postalAddress', }; -_$ApplePayErrorAddressFieldImpl _$$ApplePayErrorAddressFieldImplFromJson( - Map json) => - _$ApplePayErrorAddressFieldImpl( - field: $enumDecode(_$ApplePayContactFieldsTypeEnumMap, json['field']), - message: json['message'] as String?, - ); - -Map _$$ApplePayErrorAddressFieldImplToJson( - _$ApplePayErrorAddressFieldImpl instance) => - { - 'field': _$ApplePayContactFieldsTypeEnumMap[instance.field]!, - 'message': instance.message, - }; +_ApplePayErrorAddressField _$ApplePayErrorAddressFieldFromJson( + Map json, +) => _ApplePayErrorAddressField( + field: $enumDecode(_$ApplePayContactFieldsTypeEnumMap, json['field']), + message: json['message'] as String?, +); + +Map _$ApplePayErrorAddressFieldToJson( + _ApplePayErrorAddressField instance, +) => { + 'field': _$ApplePayContactFieldsTypeEnumMap[instance.field]!, + 'message': instance.message, +}; -_$ApplePayContactNameImpl _$$ApplePayContactNameImplFromJson( - Map json) => - _$ApplePayContactNameImpl( +_ApplePayContactName _$ApplePayContactNameFromJson(Map json) => + _ApplePayContactName( familyName: json['familyName'] as String?, namePrefix: json['namePrefix'] as String?, nameSuffix: json['nameSuffix'] as String?, @@ -173,39 +170,39 @@ _$ApplePayContactNameImpl _$$ApplePayContactNameImplFromJson( nickname: json['nickname'] as String?, ); -Map _$$ApplePayContactNameImplToJson( - _$ApplePayContactNameImpl instance) => - { - 'familyName': instance.familyName, - 'namePrefix': instance.namePrefix, - 'nameSuffix': instance.nameSuffix, - 'givenName': instance.givenName, - 'middleName': instance.middleName, - 'nickname': instance.nickname, - }; - -_$ApplePayPostalAddressImpl _$$ApplePayPostalAddressImplFromJson( - Map json) => - _$ApplePayPostalAddressImpl( - city: json['city'] as String?, - country: json['country'] as String?, - postalCode: json['postalCode'] as String?, - state: json['state'] as String?, - street: json['street'] as String?, - isoCountryCode: json['isoCountryCode'] as String?, - subAdministrativeArea: json['subAdministrativeArea'] as String?, - subLocality: json['subLocality'] as String?, - ); +Map _$ApplePayContactNameToJson( + _ApplePayContactName instance, +) => { + 'familyName': instance.familyName, + 'namePrefix': instance.namePrefix, + 'nameSuffix': instance.nameSuffix, + 'givenName': instance.givenName, + 'middleName': instance.middleName, + 'nickname': instance.nickname, +}; -Map _$$ApplePayPostalAddressImplToJson( - _$ApplePayPostalAddressImpl instance) => - { - 'city': instance.city, - 'country': instance.country, - 'postalCode': instance.postalCode, - 'state': instance.state, - 'street': instance.street, - 'isoCountryCode': instance.isoCountryCode, - 'subAdministrativeArea': instance.subAdministrativeArea, - 'subLocality': instance.subLocality, - }; +_ApplePayPostalAddress _$ApplePayPostalAddressFromJson( + Map json, +) => _ApplePayPostalAddress( + city: json['city'] as String?, + country: json['country'] as String?, + postalCode: json['postalCode'] as String?, + state: json['state'] as String?, + street: json['street'] as String?, + isoCountryCode: json['isoCountryCode'] as String?, + subAdministrativeArea: json['subAdministrativeArea'] as String?, + subLocality: json['subLocality'] as String?, +); + +Map _$ApplePayPostalAddressToJson( + _ApplePayPostalAddress instance, +) => { + 'city': instance.city, + 'country': instance.country, + 'postalCode': instance.postalCode, + 'state': instance.state, + 'street': instance.street, + 'isoCountryCode': instance.isoCountryCode, + 'subAdministrativeArea': instance.subAdministrativeArea, + 'subLocality': instance.subLocality, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/aubecs_form.dart b/packages/stripe_platform_interface/lib/src/models/aubecs_form.dart index 5847af8da..08c990cb0 100644 --- a/packages/stripe_platform_interface/lib/src/models/aubecs_form.dart +++ b/packages/stripe_platform_interface/lib/src/models/aubecs_form.dart @@ -6,22 +6,18 @@ part 'aubecs_form.freezed.dart'; part 'aubecs_form.g.dart'; @freezed - /// Styling information for the AubecsFormField -class AubecsFormStyle with _$AubecsFormStyle { +abstract class AubecsFormStyle with _$AubecsFormStyle { @JsonSerializable(explicitToJson: true) const factory AubecsFormStyle({ @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the textinput Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the errormessage /// Only available for Android Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the place holder text /// Only available for Android Color? placeholderColor, @@ -33,13 +29,11 @@ class AubecsFormStyle with _$AubecsFormStyle { /// Only available for Android int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Background color of the form. /// /// Make sure there is enough contrast with the text color Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the border of the formfields. /// /// Make sure there is enough contrast with the text color @@ -56,9 +50,8 @@ class AubecsFormStyle with _$AubecsFormStyle { } @freezed - /// Input details that will be returned from the form. -class AubecsFormInputDetails with _$AubecsFormInputDetails { +abstract class AubecsFormInputDetails with _$AubecsFormInputDetails { @JsonSerializable(explicitToJson: true) const factory AubecsFormInputDetails({ /// Six digit identifier to identify the branch of an financial institution. diff --git a/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart b/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart index 61f55ca90..a98a0ea98 100644 --- a/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/aubecs_form.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,613 +9,580 @@ part of 'aubecs_form.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -AubecsFormStyle _$AubecsFormStyleFromJson(Map json) { - return _AubecsFormStyle.fromJson(json); -} - /// @nodoc mixin _$AubecsFormStyle { - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textErrorColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderColor => throw _privateConstructorUsedError; - - /// Size of the font in the input form. - int? get fontSize => throw _privateConstructorUsedError; - - /// Borderwith of the form - /// Only available for Android - int? get borderWidth => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get backgroundColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get borderColor => throw _privateConstructorUsedError; - - /// Borderadius of the form - /// Only available for Android - int? get borderRadius => throw _privateConstructorUsedError; + +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get textColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get textErrorColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get placeholderColor;/// Size of the font in the input form. + int? get fontSize;/// Borderwith of the form +/// Only available for Android + int? get borderWidth;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get backgroundColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get borderColor;/// Borderadius of the form +/// Only available for Android + int? get borderRadius; +/// Create a copy of AubecsFormStyle +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AubecsFormStyleCopyWith get copyWith => _$AubecsFormStyleCopyWithImpl(this as AubecsFormStyle, _$identity); /// Serializes this AubecsFormStyle to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of AubecsFormStyle - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AubecsFormStyleCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AubecsFormStyle&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textErrorColor, textErrorColor) || other.textErrorColor == textErrorColor)&&(identical(other.placeholderColor, placeholderColor) || other.placeholderColor == placeholderColor)&&(identical(other.fontSize, fontSize) || other.fontSize == fontSize)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)); } -/// @nodoc -abstract class $AubecsFormStyleCopyWith<$Res> { - factory $AubecsFormStyleCopyWith( - AubecsFormStyle value, $Res Function(AubecsFormStyle) then) = - _$AubecsFormStyleCopyWithImpl<$Res, AubecsFormStyle>; - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor, - int? fontSize, - int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, - int? borderRadius}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,textColor,textErrorColor,placeholderColor,fontSize,borderWidth,backgroundColor,borderColor,borderRadius); + +@override +String toString() { + return 'AubecsFormStyle(textColor: $textColor, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor, fontSize: $fontSize, borderWidth: $borderWidth, backgroundColor: $backgroundColor, borderColor: $borderColor, borderRadius: $borderRadius)'; } -/// @nodoc -class _$AubecsFormStyleCopyWithImpl<$Res, $Val extends AubecsFormStyle> - implements $AubecsFormStyleCopyWith<$Res> { - _$AubecsFormStyleCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AubecsFormStyle - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? textColor = freezed, - Object? textErrorColor = freezed, - Object? placeholderColor = freezed, - Object? fontSize = freezed, - Object? borderWidth = freezed, - Object? backgroundColor = freezed, - Object? borderColor = freezed, - Object? borderRadius = freezed, - }) { - return _then(_value.copyWith( - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as Color?, - textErrorColor: freezed == textErrorColor - ? _value.textErrorColor - : textErrorColor // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderColor: freezed == placeholderColor - ? _value.placeholderColor - : placeholderColor // ignore: cast_nullable_to_non_nullable - as Color?, - fontSize: freezed == fontSize - ? _value.fontSize - : fontSize // ignore: cast_nullable_to_non_nullable - as int?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as int?, - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } + } /// @nodoc -abstract class _$$AubecsFormStyleImplCopyWith<$Res> +abstract mixin class $AubecsFormStyleCopyWith<$Res> { + factory $AubecsFormStyleCopyWith(AubecsFormStyle value, $Res Function(AubecsFormStyle) _then) = _$AubecsFormStyleCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor, int? fontSize, int? borderWidth,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius +}); + + + + +} +/// @nodoc +class _$AubecsFormStyleCopyWithImpl<$Res> implements $AubecsFormStyleCopyWith<$Res> { - factory _$$AubecsFormStyleImplCopyWith(_$AubecsFormStyleImpl value, - $Res Function(_$AubecsFormStyleImpl) then) = - __$$AubecsFormStyleImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor, - int? fontSize, - int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, - int? borderRadius}); + _$AubecsFormStyleCopyWithImpl(this._self, this._then); + + final AubecsFormStyle _self; + final $Res Function(AubecsFormStyle) _then; + +/// Create a copy of AubecsFormStyle +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? textColor = freezed,Object? textErrorColor = freezed,Object? placeholderColor = freezed,Object? fontSize = freezed,Object? borderWidth = freezed,Object? backgroundColor = freezed,Object? borderColor = freezed,Object? borderRadius = freezed,}) { + return _then(_self.copyWith( +textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as Color?,textErrorColor: freezed == textErrorColor ? _self.textErrorColor : textErrorColor // ignore: cast_nullable_to_non_nullable +as Color?,placeholderColor: freezed == placeholderColor ? _self.placeholderColor : placeholderColor // ignore: cast_nullable_to_non_nullable +as Color?,fontSize: freezed == fontSize ? _self.fontSize : fontSize // ignore: cast_nullable_to_non_nullable +as int?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as int?,backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as Color?,borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as Color?,borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AubecsFormStyle]. +extension AubecsFormStylePatterns on AubecsFormStyle { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AubecsFormStyle value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AubecsFormStyle() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AubecsFormStyle value) $default,){ +final _that = this; +switch (_that) { +case _AubecsFormStyle(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AubecsFormStyle value)? $default,){ +final _that = this; +switch (_that) { +case _AubecsFormStyle() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor, int? fontSize, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AubecsFormStyle() when $default != null: +return $default(_that.textColor,_that.textErrorColor,_that.placeholderColor,_that.fontSize,_that.borderWidth,_that.backgroundColor,_that.borderColor,_that.borderRadius);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor, int? fontSize, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius) $default,) {final _that = this; +switch (_that) { +case _AubecsFormStyle(): +return $default(_that.textColor,_that.textErrorColor,_that.placeholderColor,_that.fontSize,_that.borderWidth,_that.backgroundColor,_that.borderColor,_that.borderRadius);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor, int? fontSize, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius)? $default,) {final _that = this; +switch (_that) { +case _AubecsFormStyle() when $default != null: +return $default(_that.textColor,_that.textErrorColor,_that.placeholderColor,_that.fontSize,_that.borderWidth,_that.backgroundColor,_that.borderColor,_that.borderRadius);case _: + return null; + +} } -/// @nodoc -class __$$AubecsFormStyleImplCopyWithImpl<$Res> - extends _$AubecsFormStyleCopyWithImpl<$Res, _$AubecsFormStyleImpl> - implements _$$AubecsFormStyleImplCopyWith<$Res> { - __$$AubecsFormStyleImplCopyWithImpl( - _$AubecsFormStyleImpl _value, $Res Function(_$AubecsFormStyleImpl) _then) - : super(_value, _then); - - /// Create a copy of AubecsFormStyle - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? textColor = freezed, - Object? textErrorColor = freezed, - Object? placeholderColor = freezed, - Object? fontSize = freezed, - Object? borderWidth = freezed, - Object? backgroundColor = freezed, - Object? borderColor = freezed, - Object? borderRadius = freezed, - }) { - return _then(_$AubecsFormStyleImpl( - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as Color?, - textErrorColor: freezed == textErrorColor - ? _value.textErrorColor - : textErrorColor // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderColor: freezed == placeholderColor - ? _value.placeholderColor - : placeholderColor // ignore: cast_nullable_to_non_nullable - as Color?, - fontSize: freezed == fontSize - ? _value.fontSize - : fontSize // ignore: cast_nullable_to_non_nullable - as int?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as int?, - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as int?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AubecsFormStyleImpl implements _AubecsFormStyle { - const _$AubecsFormStyleImpl( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderColor, - this.fontSize, - this.borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.borderColor, - this.borderRadius}); - - factory _$AubecsFormStyleImpl.fromJson(Map json) => - _$$AubecsFormStyleImplFromJson(json); - - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor; - - /// Size of the font in the input form. - @override - final int? fontSize; - - /// Borderwith of the form - /// Only available for Android - @override - final int? borderWidth; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor; - - /// Borderadius of the form - /// Only available for Android - @override - final int? borderRadius; - - @override - String toString() { - return 'AubecsFormStyle(textColor: $textColor, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor, fontSize: $fontSize, borderWidth: $borderWidth, backgroundColor: $backgroundColor, borderColor: $borderColor, borderRadius: $borderRadius)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AubecsFormStyleImpl && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.textErrorColor, textErrorColor) || - other.textErrorColor == textErrorColor) && - (identical(other.placeholderColor, placeholderColor) || - other.placeholderColor == placeholderColor) && - (identical(other.fontSize, fontSize) || - other.fontSize == fontSize) && - (identical(other.borderWidth, borderWidth) || - other.borderWidth == borderWidth) && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.borderColor, borderColor) || - other.borderColor == borderColor) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - textColor, - textErrorColor, - placeholderColor, - fontSize, - borderWidth, - backgroundColor, - borderColor, - borderRadius); - - /// Create a copy of AubecsFormStyle - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AubecsFormStyleImplCopyWith<_$AubecsFormStyleImpl> get copyWith => - __$$AubecsFormStyleImplCopyWithImpl<_$AubecsFormStyleImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$AubecsFormStyleImplToJson( - this, - ); - } -} - -abstract class _AubecsFormStyle implements AubecsFormStyle { - const factory _AubecsFormStyle( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor, - final int? fontSize, - final int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor, - final int? borderRadius}) = _$AubecsFormStyleImpl; - - factory _AubecsFormStyle.fromJson(Map json) = - _$AubecsFormStyleImpl.fromJson; - - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textErrorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderColor; - - /// Size of the font in the input form. - @override - int? get fontSize; - - /// Borderwith of the form - /// Only available for Android - @override - int? get borderWidth; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get backgroundColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get borderColor; - - /// Borderadius of the form - /// Only available for Android - @override - int? get borderRadius; - - /// Create a copy of AubecsFormStyle - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AubecsFormStyleImplCopyWith<_$AubecsFormStyleImpl> get copyWith => - throw _privateConstructorUsedError; -} - -AubecsFormInputDetails _$AubecsFormInputDetailsFromJson( - Map json) { - return _AubecsFormInputDetails.fromJson(json); +class _AubecsFormStyle implements AubecsFormStyle { + const _AubecsFormStyle({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.textColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.placeholderColor, this.fontSize, this.borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.borderColor, this.borderRadius}); + factory _AubecsFormStyle.fromJson(Map json) => _$AubecsFormStyleFromJson(json); + +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? textColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? textErrorColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? placeholderColor; +/// Size of the font in the input form. +@override final int? fontSize; +/// Borderwith of the form +/// Only available for Android +@override final int? borderWidth; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? backgroundColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? borderColor; +/// Borderadius of the form +/// Only available for Android +@override final int? borderRadius; + +/// Create a copy of AubecsFormStyle +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AubecsFormStyleCopyWith<_AubecsFormStyle> get copyWith => __$AubecsFormStyleCopyWithImpl<_AubecsFormStyle>(this, _$identity); + +@override +Map toJson() { + return _$AubecsFormStyleToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AubecsFormStyle&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textErrorColor, textErrorColor) || other.textErrorColor == textErrorColor)&&(identical(other.placeholderColor, placeholderColor) || other.placeholderColor == placeholderColor)&&(identical(other.fontSize, fontSize) || other.fontSize == fontSize)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,textColor,textErrorColor,placeholderColor,fontSize,borderWidth,backgroundColor,borderColor,borderRadius); + +@override +String toString() { + return 'AubecsFormStyle(textColor: $textColor, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor, fontSize: $fontSize, borderWidth: $borderWidth, backgroundColor: $backgroundColor, borderColor: $borderColor, borderRadius: $borderRadius)'; +} + + } /// @nodoc -mixin _$AubecsFormInputDetails { - /// Six digit identifier to identify the branch of an financial institution. - String? get bsbNumber => throw _privateConstructorUsedError; +abstract mixin class _$AubecsFormStyleCopyWith<$Res> implements $AubecsFormStyleCopyWith<$Res> { + factory _$AubecsFormStyleCopyWith(_AubecsFormStyle value, $Res Function(_AubecsFormStyle) _then) = __$AubecsFormStyleCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor, int? fontSize, int? borderWidth,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius +}); - /// The name of the accountholder. - String? get name => throw _privateConstructorUsedError; - /// The account number. - String? get accountNumber => throw _privateConstructorUsedError; - /// Email of the accountholder. - String? get email => throw _privateConstructorUsedError; - /// Serializes this AubecsFormInputDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +/// @nodoc +class __$AubecsFormStyleCopyWithImpl<$Res> + implements _$AubecsFormStyleCopyWith<$Res> { + __$AubecsFormStyleCopyWithImpl(this._self, this._then); + + final _AubecsFormStyle _self; + final $Res Function(_AubecsFormStyle) _then; + +/// Create a copy of AubecsFormStyle +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? textColor = freezed,Object? textErrorColor = freezed,Object? placeholderColor = freezed,Object? fontSize = freezed,Object? borderWidth = freezed,Object? backgroundColor = freezed,Object? borderColor = freezed,Object? borderRadius = freezed,}) { + return _then(_AubecsFormStyle( +textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as Color?,textErrorColor: freezed == textErrorColor ? _self.textErrorColor : textErrorColor // ignore: cast_nullable_to_non_nullable +as Color?,placeholderColor: freezed == placeholderColor ? _self.placeholderColor : placeholderColor // ignore: cast_nullable_to_non_nullable +as Color?,fontSize: freezed == fontSize ? _self.fontSize : fontSize // ignore: cast_nullable_to_non_nullable +as int?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as int?,backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as Color?,borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as Color?,borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + - /// Create a copy of AubecsFormInputDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AubecsFormInputDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; } + /// @nodoc -abstract class $AubecsFormInputDetailsCopyWith<$Res> { - factory $AubecsFormInputDetailsCopyWith(AubecsFormInputDetails value, - $Res Function(AubecsFormInputDetails) then) = - _$AubecsFormInputDetailsCopyWithImpl<$Res, AubecsFormInputDetails>; - @useResult - $Res call( - {String? bsbNumber, String? name, String? accountNumber, String? email}); +mixin _$AubecsFormInputDetails { + +/// Six digit identifier to identify the branch of an financial institution. + String? get bsbNumber;/// The name of the accountholder. + String? get name;/// The account number. + String? get accountNumber;/// Email of the accountholder. + String? get email; +/// Create a copy of AubecsFormInputDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AubecsFormInputDetailsCopyWith get copyWith => _$AubecsFormInputDetailsCopyWithImpl(this as AubecsFormInputDetails, _$identity); + + /// Serializes this AubecsFormInputDetails to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AubecsFormInputDetails&&(identical(other.bsbNumber, bsbNumber) || other.bsbNumber == bsbNumber)&&(identical(other.name, name) || other.name == name)&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.email, email) || other.email == email)); } -/// @nodoc -class _$AubecsFormInputDetailsCopyWithImpl<$Res, - $Val extends AubecsFormInputDetails> - implements $AubecsFormInputDetailsCopyWith<$Res> { - _$AubecsFormInputDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AubecsFormInputDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bsbNumber = freezed, - Object? name = freezed, - Object? accountNumber = freezed, - Object? email = freezed, - }) { - return _then(_value.copyWith( - bsbNumber: freezed == bsbNumber - ? _value.bsbNumber - : bsbNumber // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - accountNumber: freezed == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String?, - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bsbNumber,name,accountNumber,email); + +@override +String toString() { + return 'AubecsFormInputDetails(bsbNumber: $bsbNumber, name: $name, accountNumber: $accountNumber, email: $email)'; } + +} + +/// @nodoc +abstract mixin class $AubecsFormInputDetailsCopyWith<$Res> { + factory $AubecsFormInputDetailsCopyWith(AubecsFormInputDetails value, $Res Function(AubecsFormInputDetails) _then) = _$AubecsFormInputDetailsCopyWithImpl; +@useResult +$Res call({ + String? bsbNumber, String? name, String? accountNumber, String? email +}); + + + + +} /// @nodoc -abstract class _$$AubecsFormInputDetailsImplCopyWith<$Res> +class _$AubecsFormInputDetailsCopyWithImpl<$Res> implements $AubecsFormInputDetailsCopyWith<$Res> { - factory _$$AubecsFormInputDetailsImplCopyWith( - _$AubecsFormInputDetailsImpl value, - $Res Function(_$AubecsFormInputDetailsImpl) then) = - __$$AubecsFormInputDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? bsbNumber, String? name, String? accountNumber, String? email}); + _$AubecsFormInputDetailsCopyWithImpl(this._self, this._then); + + final AubecsFormInputDetails _self; + final $Res Function(AubecsFormInputDetails) _then; + +/// Create a copy of AubecsFormInputDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bsbNumber = freezed,Object? name = freezed,Object? accountNumber = freezed,Object? email = freezed,}) { + return _then(_self.copyWith( +bsbNumber: freezed == bsbNumber ? _self.bsbNumber : bsbNumber // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,accountNumber: freezed == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AubecsFormInputDetails]. +extension AubecsFormInputDetailsPatterns on AubecsFormInputDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AubecsFormInputDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AubecsFormInputDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AubecsFormInputDetails value) $default,){ +final _that = this; +switch (_that) { +case _AubecsFormInputDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AubecsFormInputDetails value)? $default,){ +final _that = this; +switch (_that) { +case _AubecsFormInputDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bsbNumber, String? name, String? accountNumber, String? email)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AubecsFormInputDetails() when $default != null: +return $default(_that.bsbNumber,_that.name,_that.accountNumber,_that.email);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bsbNumber, String? name, String? accountNumber, String? email) $default,) {final _that = this; +switch (_that) { +case _AubecsFormInputDetails(): +return $default(_that.bsbNumber,_that.name,_that.accountNumber,_that.email);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bsbNumber, String? name, String? accountNumber, String? email)? $default,) {final _that = this; +switch (_that) { +case _AubecsFormInputDetails() when $default != null: +return $default(_that.bsbNumber,_that.name,_that.accountNumber,_that.email);case _: + return null; + +} } -/// @nodoc -class __$$AubecsFormInputDetailsImplCopyWithImpl<$Res> - extends _$AubecsFormInputDetailsCopyWithImpl<$Res, - _$AubecsFormInputDetailsImpl> - implements _$$AubecsFormInputDetailsImplCopyWith<$Res> { - __$$AubecsFormInputDetailsImplCopyWithImpl( - _$AubecsFormInputDetailsImpl _value, - $Res Function(_$AubecsFormInputDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of AubecsFormInputDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bsbNumber = freezed, - Object? name = freezed, - Object? accountNumber = freezed, - Object? email = freezed, - }) { - return _then(_$AubecsFormInputDetailsImpl( - bsbNumber: freezed == bsbNumber - ? _value.bsbNumber - : bsbNumber // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - accountNumber: freezed == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String?, - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AubecsFormInputDetailsImpl implements _AubecsFormInputDetails { - const _$AubecsFormInputDetailsImpl( - {this.bsbNumber, this.name, this.accountNumber, this.email}); - - factory _$AubecsFormInputDetailsImpl.fromJson(Map json) => - _$$AubecsFormInputDetailsImplFromJson(json); - - /// Six digit identifier to identify the branch of an financial institution. - @override - final String? bsbNumber; - - /// The name of the accountholder. - @override - final String? name; - - /// The account number. - @override - final String? accountNumber; - - /// Email of the accountholder. - @override - final String? email; - - @override - String toString() { - return 'AubecsFormInputDetails(bsbNumber: $bsbNumber, name: $name, accountNumber: $accountNumber, email: $email)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AubecsFormInputDetailsImpl && - (identical(other.bsbNumber, bsbNumber) || - other.bsbNumber == bsbNumber) && - (identical(other.name, name) || other.name == name) && - (identical(other.accountNumber, accountNumber) || - other.accountNumber == accountNumber) && - (identical(other.email, email) || other.email == email)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, bsbNumber, name, accountNumber, email); - - /// Create a copy of AubecsFormInputDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AubecsFormInputDetailsImplCopyWith<_$AubecsFormInputDetailsImpl> - get copyWith => __$$AubecsFormInputDetailsImplCopyWithImpl< - _$AubecsFormInputDetailsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AubecsFormInputDetailsImplToJson( - this, - ); - } -} - -abstract class _AubecsFormInputDetails implements AubecsFormInputDetails { - const factory _AubecsFormInputDetails( - {final String? bsbNumber, - final String? name, - final String? accountNumber, - final String? email}) = _$AubecsFormInputDetailsImpl; - - factory _AubecsFormInputDetails.fromJson(Map json) = - _$AubecsFormInputDetailsImpl.fromJson; - - /// Six digit identifier to identify the branch of an financial institution. - @override - String? get bsbNumber; - - /// The name of the accountholder. - @override - String? get name; - - /// The account number. - @override - String? get accountNumber; - - /// Email of the accountholder. - @override - String? get email; - - /// Create a copy of AubecsFormInputDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AubecsFormInputDetailsImplCopyWith<_$AubecsFormInputDetailsImpl> - get copyWith => throw _privateConstructorUsedError; +class _AubecsFormInputDetails implements AubecsFormInputDetails { + const _AubecsFormInputDetails({this.bsbNumber, this.name, this.accountNumber, this.email}); + factory _AubecsFormInputDetails.fromJson(Map json) => _$AubecsFormInputDetailsFromJson(json); + +/// Six digit identifier to identify the branch of an financial institution. +@override final String? bsbNumber; +/// The name of the accountholder. +@override final String? name; +/// The account number. +@override final String? accountNumber; +/// Email of the accountholder. +@override final String? email; + +/// Create a copy of AubecsFormInputDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AubecsFormInputDetailsCopyWith<_AubecsFormInputDetails> get copyWith => __$AubecsFormInputDetailsCopyWithImpl<_AubecsFormInputDetails>(this, _$identity); + +@override +Map toJson() { + return _$AubecsFormInputDetailsToJson(this, ); } + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AubecsFormInputDetails&&(identical(other.bsbNumber, bsbNumber) || other.bsbNumber == bsbNumber)&&(identical(other.name, name) || other.name == name)&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.email, email) || other.email == email)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bsbNumber,name,accountNumber,email); + +@override +String toString() { + return 'AubecsFormInputDetails(bsbNumber: $bsbNumber, name: $name, accountNumber: $accountNumber, email: $email)'; +} + + +} + +/// @nodoc +abstract mixin class _$AubecsFormInputDetailsCopyWith<$Res> implements $AubecsFormInputDetailsCopyWith<$Res> { + factory _$AubecsFormInputDetailsCopyWith(_AubecsFormInputDetails value, $Res Function(_AubecsFormInputDetails) _then) = __$AubecsFormInputDetailsCopyWithImpl; +@override @useResult +$Res call({ + String? bsbNumber, String? name, String? accountNumber, String? email +}); + + + + +} +/// @nodoc +class __$AubecsFormInputDetailsCopyWithImpl<$Res> + implements _$AubecsFormInputDetailsCopyWith<$Res> { + __$AubecsFormInputDetailsCopyWithImpl(this._self, this._then); + + final _AubecsFormInputDetails _self; + final $Res Function(_AubecsFormInputDetails) _then; + +/// Create a copy of AubecsFormInputDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bsbNumber = freezed,Object? name = freezed,Object? accountNumber = freezed,Object? email = freezed,}) { + return _then(_AubecsFormInputDetails( +bsbNumber: freezed == bsbNumber ? _self.bsbNumber : bsbNumber // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,accountNumber: freezed == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/aubecs_form.g.dart b/packages/stripe_platform_interface/lib/src/models/aubecs_form.g.dart index 581f39b9d..e4e302a7c 100644 --- a/packages/stripe_platform_interface/lib/src/models/aubecs_form.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/aubecs_form.g.dart @@ -6,9 +6,8 @@ part of 'aubecs_form.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AubecsFormStyleImpl _$$AubecsFormStyleImplFromJson( - Map json) => - _$AubecsFormStyleImpl( +_AubecsFormStyle _$AubecsFormStyleFromJson(Map json) => + _AubecsFormStyle( textColor: ColorKey.fromJson(json['textColor']), textErrorColor: ColorKey.fromJson(json['textErrorColor']), placeholderColor: ColorKey.fromJson(json['placeholderColor']), @@ -19,8 +18,7 @@ _$AubecsFormStyleImpl _$$AubecsFormStyleImplFromJson( borderRadius: (json['borderRadius'] as num?)?.toInt(), ); -Map _$$AubecsFormStyleImplToJson( - _$AubecsFormStyleImpl instance) => +Map _$AubecsFormStyleToJson(_AubecsFormStyle instance) => { 'textColor': ColorKey.toJson(instance.textColor), 'textErrorColor': ColorKey.toJson(instance.textErrorColor), @@ -32,20 +30,20 @@ Map _$$AubecsFormStyleImplToJson( 'borderRadius': instance.borderRadius, }; -_$AubecsFormInputDetailsImpl _$$AubecsFormInputDetailsImplFromJson( - Map json) => - _$AubecsFormInputDetailsImpl( - bsbNumber: json['bsbNumber'] as String?, - name: json['name'] as String?, - accountNumber: json['accountNumber'] as String?, - email: json['email'] as String?, - ); +_AubecsFormInputDetails _$AubecsFormInputDetailsFromJson( + Map json, +) => _AubecsFormInputDetails( + bsbNumber: json['bsbNumber'] as String?, + name: json['name'] as String?, + accountNumber: json['accountNumber'] as String?, + email: json['email'] as String?, +); -Map _$$AubecsFormInputDetailsImplToJson( - _$AubecsFormInputDetailsImpl instance) => - { - 'bsbNumber': instance.bsbNumber, - 'name': instance.name, - 'accountNumber': instance.accountNumber, - 'email': instance.email, - }; +Map _$AubecsFormInputDetailsToJson( + _AubecsFormInputDetails instance, +) => { + 'bsbNumber': instance.bsbNumber, + 'name': instance.name, + 'accountNumber': instance.accountNumber, + 'email': instance.email, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/card_details.dart b/packages/stripe_platform_interface/lib/src/models/card_details.dart index 2d774e817..c490b6314 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_details.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_details.dart @@ -5,7 +5,7 @@ part 'card_details.g.dart'; /// Credit Card Details @freezed -class CardDetails with _$CardDetails { +abstract class CardDetails with _$CardDetails { @JsonSerializable(explicitToJson: true) factory CardDetails({ String? number, diff --git a/packages/stripe_platform_interface/lib/src/models/card_details.freezed.dart b/packages/stripe_platform_interface/lib/src/models/card_details.freezed.dart index 7d8951b5c..1d500ec96 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_details.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_details.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,220 +9,285 @@ part of 'card_details.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CardDetails _$CardDetailsFromJson(Map json) { - return _CardDetailsConstructor.fromJson(json); +CardDetails _$CardDetailsFromJson( + Map json +) { + return _CardDetailsConstructor.fromJson( + json + ); } /// @nodoc mixin _$CardDetails { - String? get number => throw _privateConstructorUsedError; - int? get expirationYear => throw _privateConstructorUsedError; - int? get expirationMonth => throw _privateConstructorUsedError; - String? get cvc => throw _privateConstructorUsedError; + + String? get number; int? get expirationYear; int? get expirationMonth; String? get cvc; +/// Create a copy of CardDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardDetailsCopyWith get copyWith => _$CardDetailsCopyWithImpl(this as CardDetails, _$identity); /// Serializes this CardDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CardDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardDetails&&(identical(other.number, number) || other.number == number)&&(identical(other.expirationYear, expirationYear) || other.expirationYear == expirationYear)&&(identical(other.expirationMonth, expirationMonth) || other.expirationMonth == expirationMonth)&&(identical(other.cvc, cvc) || other.cvc == cvc)); } -/// @nodoc -abstract class $CardDetailsCopyWith<$Res> { - factory $CardDetailsCopyWith( - CardDetails value, $Res Function(CardDetails) then) = - _$CardDetailsCopyWithImpl<$Res, CardDetails>; - @useResult - $Res call( - {String? number, int? expirationYear, int? expirationMonth, String? cvc}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,number,expirationYear,expirationMonth,cvc); + +@override +String toString() { + return 'CardDetails(number: $number, expirationYear: $expirationYear, expirationMonth: $expirationMonth, cvc: $cvc)'; } -/// @nodoc -class _$CardDetailsCopyWithImpl<$Res, $Val extends CardDetails> - implements $CardDetailsCopyWith<$Res> { - _$CardDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? number = freezed, - Object? expirationYear = freezed, - Object? expirationMonth = freezed, - Object? cvc = freezed, - }) { - return _then(_value.copyWith( - number: freezed == number - ? _value.number - : number // ignore: cast_nullable_to_non_nullable - as String?, - expirationYear: freezed == expirationYear - ? _value.expirationYear - : expirationYear // ignore: cast_nullable_to_non_nullable - as int?, - expirationMonth: freezed == expirationMonth - ? _value.expirationMonth - : expirationMonth // ignore: cast_nullable_to_non_nullable - as int?, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardDetailsConstructorImplCopyWith<$Res> +abstract mixin class $CardDetailsCopyWith<$Res> { + factory $CardDetailsCopyWith(CardDetails value, $Res Function(CardDetails) _then) = _$CardDetailsCopyWithImpl; +@useResult +$Res call({ + String? number, int? expirationYear, int? expirationMonth, String? cvc +}); + + + + +} +/// @nodoc +class _$CardDetailsCopyWithImpl<$Res> implements $CardDetailsCopyWith<$Res> { - factory _$$CardDetailsConstructorImplCopyWith( - _$CardDetailsConstructorImpl value, - $Res Function(_$CardDetailsConstructorImpl) then) = - __$$CardDetailsConstructorImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? number, int? expirationYear, int? expirationMonth, String? cvc}); + _$CardDetailsCopyWithImpl(this._self, this._then); + + final CardDetails _self; + final $Res Function(CardDetails) _then; + +/// Create a copy of CardDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? number = freezed,Object? expirationYear = freezed,Object? expirationMonth = freezed,Object? cvc = freezed,}) { + return _then(_self.copyWith( +number: freezed == number ? _self.number : number // ignore: cast_nullable_to_non_nullable +as String?,expirationYear: freezed == expirationYear ? _self.expirationYear : expirationYear // ignore: cast_nullable_to_non_nullable +as int?,expirationMonth: freezed == expirationMonth ? _self.expirationMonth : expirationMonth // ignore: cast_nullable_to_non_nullable +as int?,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardDetails]. +extension CardDetailsPatterns on CardDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardDetailsConstructor value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardDetailsConstructor() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardDetailsConstructor value) $default,){ +final _that = this; +switch (_that) { +case _CardDetailsConstructor(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardDetailsConstructor value)? $default,){ +final _that = this; +switch (_that) { +case _CardDetailsConstructor() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? number, int? expirationYear, int? expirationMonth, String? cvc)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardDetailsConstructor() when $default != null: +return $default(_that.number,_that.expirationYear,_that.expirationMonth,_that.cvc);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? number, int? expirationYear, int? expirationMonth, String? cvc) $default,) {final _that = this; +switch (_that) { +case _CardDetailsConstructor(): +return $default(_that.number,_that.expirationYear,_that.expirationMonth,_that.cvc);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? number, int? expirationYear, int? expirationMonth, String? cvc)? $default,) {final _that = this; +switch (_that) { +case _CardDetailsConstructor() when $default != null: +return $default(_that.number,_that.expirationYear,_that.expirationMonth,_that.cvc);case _: + return null; + +} } -/// @nodoc -class __$$CardDetailsConstructorImplCopyWithImpl<$Res> - extends _$CardDetailsCopyWithImpl<$Res, _$CardDetailsConstructorImpl> - implements _$$CardDetailsConstructorImplCopyWith<$Res> { - __$$CardDetailsConstructorImplCopyWithImpl( - _$CardDetailsConstructorImpl _value, - $Res Function(_$CardDetailsConstructorImpl) _then) - : super(_value, _then); - - /// Create a copy of CardDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? number = freezed, - Object? expirationYear = freezed, - Object? expirationMonth = freezed, - Object? cvc = freezed, - }) { - return _then(_$CardDetailsConstructorImpl( - number: freezed == number - ? _value.number - : number // ignore: cast_nullable_to_non_nullable - as String?, - expirationYear: freezed == expirationYear - ? _value.expirationYear - : expirationYear // ignore: cast_nullable_to_non_nullable - as int?, - expirationMonth: freezed == expirationMonth - ? _value.expirationMonth - : expirationMonth // ignore: cast_nullable_to_non_nullable - as int?, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardDetailsConstructorImpl extends _CardDetailsConstructor { - _$CardDetailsConstructorImpl( - {this.number, this.expirationYear, this.expirationMonth, this.cvc}) - : super._(); - - factory _$CardDetailsConstructorImpl.fromJson(Map json) => - _$$CardDetailsConstructorImplFromJson(json); - - @override - final String? number; - @override - final int? expirationYear; - @override - final int? expirationMonth; - @override - final String? cvc; - - @override - String toString() { - return 'CardDetails(number: $number, expirationYear: $expirationYear, expirationMonth: $expirationMonth, cvc: $cvc)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardDetailsConstructorImpl && - (identical(other.number, number) || other.number == number) && - (identical(other.expirationYear, expirationYear) || - other.expirationYear == expirationYear) && - (identical(other.expirationMonth, expirationMonth) || - other.expirationMonth == expirationMonth) && - (identical(other.cvc, cvc) || other.cvc == cvc)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, number, expirationYear, expirationMonth, cvc); - - /// Create a copy of CardDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardDetailsConstructorImplCopyWith<_$CardDetailsConstructorImpl> - get copyWith => __$$CardDetailsConstructorImplCopyWithImpl< - _$CardDetailsConstructorImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardDetailsConstructorImplToJson( - this, - ); - } -} - -abstract class _CardDetailsConstructor extends CardDetails { - factory _CardDetailsConstructor( - {final String? number, - final int? expirationYear, - final int? expirationMonth, - final String? cvc}) = _$CardDetailsConstructorImpl; - _CardDetailsConstructor._() : super._(); - - factory _CardDetailsConstructor.fromJson(Map json) = - _$CardDetailsConstructorImpl.fromJson; - - @override - String? get number; - @override - int? get expirationYear; - @override - int? get expirationMonth; - @override - String? get cvc; - - /// Create a copy of CardDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardDetailsConstructorImplCopyWith<_$CardDetailsConstructorImpl> - get copyWith => throw _privateConstructorUsedError; +class _CardDetailsConstructor extends CardDetails { + _CardDetailsConstructor({this.number, this.expirationYear, this.expirationMonth, this.cvc}): super._(); + factory _CardDetailsConstructor.fromJson(Map json) => _$CardDetailsConstructorFromJson(json); + +@override final String? number; +@override final int? expirationYear; +@override final int? expirationMonth; +@override final String? cvc; + +/// Create a copy of CardDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardDetailsConstructorCopyWith<_CardDetailsConstructor> get copyWith => __$CardDetailsConstructorCopyWithImpl<_CardDetailsConstructor>(this, _$identity); + +@override +Map toJson() { + return _$CardDetailsConstructorToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardDetailsConstructor&&(identical(other.number, number) || other.number == number)&&(identical(other.expirationYear, expirationYear) || other.expirationYear == expirationYear)&&(identical(other.expirationMonth, expirationMonth) || other.expirationMonth == expirationMonth)&&(identical(other.cvc, cvc) || other.cvc == cvc)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,number,expirationYear,expirationMonth,cvc); + +@override +String toString() { + return 'CardDetails(number: $number, expirationYear: $expirationYear, expirationMonth: $expirationMonth, cvc: $cvc)'; } + + +} + +/// @nodoc +abstract mixin class _$CardDetailsConstructorCopyWith<$Res> implements $CardDetailsCopyWith<$Res> { + factory _$CardDetailsConstructorCopyWith(_CardDetailsConstructor value, $Res Function(_CardDetailsConstructor) _then) = __$CardDetailsConstructorCopyWithImpl; +@override @useResult +$Res call({ + String? number, int? expirationYear, int? expirationMonth, String? cvc +}); + + + + +} +/// @nodoc +class __$CardDetailsConstructorCopyWithImpl<$Res> + implements _$CardDetailsConstructorCopyWith<$Res> { + __$CardDetailsConstructorCopyWithImpl(this._self, this._then); + + final _CardDetailsConstructor _self; + final $Res Function(_CardDetailsConstructor) _then; + +/// Create a copy of CardDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? number = freezed,Object? expirationYear = freezed,Object? expirationMonth = freezed,Object? cvc = freezed,}) { + return _then(_CardDetailsConstructor( +number: freezed == number ? _self.number : number // ignore: cast_nullable_to_non_nullable +as String?,expirationYear: freezed == expirationYear ? _self.expirationYear : expirationYear // ignore: cast_nullable_to_non_nullable +as int?,expirationMonth: freezed == expirationMonth ? _self.expirationMonth : expirationMonth // ignore: cast_nullable_to_non_nullable +as int?,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/card_details.g.dart b/packages/stripe_platform_interface/lib/src/models/card_details.g.dart index 9cb88bc39..0dc72ad5c 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_details.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_details.g.dart @@ -6,20 +6,20 @@ part of 'card_details.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CardDetailsConstructorImpl _$$CardDetailsConstructorImplFromJson( - Map json) => - _$CardDetailsConstructorImpl( - number: json['number'] as String?, - expirationYear: (json['expirationYear'] as num?)?.toInt(), - expirationMonth: (json['expirationMonth'] as num?)?.toInt(), - cvc: json['cvc'] as String?, - ); +_CardDetailsConstructor _$CardDetailsConstructorFromJson( + Map json, +) => _CardDetailsConstructor( + number: json['number'] as String?, + expirationYear: (json['expirationYear'] as num?)?.toInt(), + expirationMonth: (json['expirationMonth'] as num?)?.toInt(), + cvc: json['cvc'] as String?, +); -Map _$$CardDetailsConstructorImplToJson( - _$CardDetailsConstructorImpl instance) => - { - 'number': instance.number, - 'expirationYear': instance.expirationYear, - 'expirationMonth': instance.expirationMonth, - 'cvc': instance.cvc, - }; +Map _$CardDetailsConstructorToJson( + _CardDetailsConstructor instance, +) => { + 'number': instance.number, + 'expirationYear': instance.expirationYear, + 'expirationMonth': instance.expirationMonth, + 'cvc': instance.cvc, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/card_field_input.dart b/packages/stripe_platform_interface/lib/src/models/card_field_input.dart index 9c5236539..fff106af5 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_field_input.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_field_input.dart @@ -9,32 +9,27 @@ part 'card_field_input.freezed.dart'; part 'card_field_input.g.dart'; @freezed - /// Styiling information for the cardfield. -class CardStyle with _$CardStyle { +abstract class CardStyle with _$CardStyle { @JsonSerializable(explicitToJson: true) factory CardStyle({ /// Width for the border. int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Background color of the cardfield /// /// Make sure that there is enough contrast with the text color. Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Border color of the cardfield. Color? borderColor, /// Borderradius that can give the Cardfield rounded corners. int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Cursor color when the card has focus. Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the typed text on the Card fuekd. Color? textColor, @@ -48,7 +43,6 @@ class CardStyle with _$CardStyle { @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the placeholder text. Color? placeholderColor, }) = _CardStyleConstructor; @@ -59,27 +53,25 @@ class CardStyle with _$CardStyle { CardStyle._(); CardStyle apply(CardStyle? style) => copyWith( - borderWidth: style?.borderWidth ?? borderWidth, - backgroundColor: style?.backgroundColor ?? backgroundColor, - borderColor: style?.borderColor ?? borderColor, - borderRadius: style?.borderRadius ?? borderRadius, - cursorColor: style?.cursorColor ?? cursorColor, - textColor: style?.textColor ?? textColor, - fontSize: style?.fontSize ?? fontSize, - textErrorColor: style?.textErrorColor ?? textErrorColor, - placeholderColor: style?.placeholderColor ?? placeholderColor, - fontFamily: style?.fontFamily ?? fontFamily, - ); + borderWidth: style?.borderWidth ?? borderWidth, + backgroundColor: style?.backgroundColor ?? backgroundColor, + borderColor: style?.borderColor ?? borderColor, + borderRadius: style?.borderRadius ?? borderRadius, + cursorColor: style?.cursorColor ?? cursorColor, + textColor: style?.textColor ?? textColor, + fontSize: style?.fontSize ?? fontSize, + textErrorColor: style?.textErrorColor ?? textErrorColor, + placeholderColor: style?.placeholderColor ?? placeholderColor, + fontFamily: style?.fontFamily ?? fontFamily, + ); } @freezed - /// Styiling information for the cardfield. -class CardFormStyle with _$CardFormStyle { +abstract class CardFormStyle with _$CardFormStyle { @JsonSerializable(explicitToJson: true) factory CardFormStyle({ @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Background color of the cardformfield /// /// Make sure that there is enough contrast with the text color. @@ -88,18 +80,15 @@ class CardFormStyle with _$CardFormStyle { /// Width for the border. int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Border color of the cardfield. Color? borderColor, /// Borderradius that can give the Cardfield rounded corners. int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Cursor color when the card has focus. Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the typed text on the Card fuekd. Color? textColor, @@ -110,7 +99,6 @@ class CardFormStyle with _$CardFormStyle { @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - /// Color of the placeholder text. Color? placeholderColor, }) = _CardFormStyleConstructor; @@ -121,22 +109,21 @@ class CardFormStyle with _$CardFormStyle { CardFormStyle._(); CardFormStyle apply(CardFormStyle? style) => copyWith( - backgroundColor: style?.backgroundColor ?? backgroundColor, - borderWidth: style?.borderWidth ?? borderWidth, - borderColor: style?.borderColor ?? borderColor, - borderRadius: style?.borderRadius ?? borderRadius, - cursorColor: style?.cursorColor ?? cursorColor, - textColor: style?.textColor ?? textColor, - fontSize: style?.fontSize ?? fontSize, - textErrorColor: style?.textErrorColor ?? textErrorColor, - placeholderColor: style?.placeholderColor ?? placeholderColor, - ); + backgroundColor: style?.backgroundColor ?? backgroundColor, + borderWidth: style?.borderWidth ?? borderWidth, + borderColor: style?.borderColor ?? borderColor, + borderRadius: style?.borderRadius ?? borderRadius, + cursorColor: style?.cursorColor ?? cursorColor, + textColor: style?.textColor ?? textColor, + fontSize: style?.fontSize ?? fontSize, + textErrorColor: style?.textErrorColor ?? textErrorColor, + placeholderColor: style?.placeholderColor ?? placeholderColor, + ); } @freezed - /// Localized text for the placeholders of the card fields. -class CardPlaceholder with _$CardPlaceholder { +abstract class CardPlaceholder with _$CardPlaceholder { @JsonSerializable(explicitToJson: true) factory CardPlaceholder({ /// Localized placeholder for card number field. @@ -161,17 +148,16 @@ class CardPlaceholder with _$CardPlaceholder { /// /// In case fields are null the original value will be used. CardPlaceholder apply(CardPlaceholder? placeholder) => copyWith( - number: placeholder?.number ?? number, - expiration: placeholder?.expiration ?? expiration, - cvc: placeholder?.cvc ?? cvc, - postalCode: placeholder?.postalCode ?? postalCode, - ); + number: placeholder?.number ?? number, + expiration: placeholder?.expiration ?? expiration, + cvc: placeholder?.cvc ?? cvc, + postalCode: placeholder?.postalCode ?? postalCode, + ); } @freezed - /// User input details. -class CardFieldInputDetails with _$CardFieldInputDetails { +abstract class CardFieldInputDetails with _$CardFieldInputDetails { const CardFieldInputDetails._(); @JsonSerializable(explicitToJson: true) @@ -218,7 +204,7 @@ class CardFieldInputDetails with _$CardFieldInputDetails { /// Used to communicate with the card handler on the native platform side when focus changes. @freezed -class CardFieldFocusName with _$CardFieldFocusName { +abstract class CardFieldFocusName with _$CardFieldFocusName { @JsonSerializable(explicitToJson: true) factory CardFieldFocusName({CardFieldName? focusedField}) = _CardFieldFocusName; @@ -230,26 +216,17 @@ class CardFieldFocusName with _$CardFieldFocusName { /// Enum representing the different fiels on the card field. enum CardFieldName { @JsonValue('CardNumber') - /// Card number field. cardNumber, @JsonValue('Cvc') - /// Cvc field. cvc, @JsonValue('ExpiryDate') - /// Expiry date field. expiryDate, @JsonValue('PostalCode') - /// Postal code field. postalCode, } -enum CardValidationState { - Unknown, - Valid, - Invalid, - Incomplete, -} +enum CardValidationState { Unknown, Valid, Invalid, Incomplete } diff --git a/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart b/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart index a871ee78f..e01a58a1f 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_field_input.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1679 +9,1484 @@ part of 'card_field_input.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CardStyle _$CardStyleFromJson(Map json) { - return _CardStyleConstructor.fromJson(json); +CardStyle _$CardStyleFromJson( + Map json +) { + return _CardStyleConstructor.fromJson( + json + ); } /// @nodoc mixin _$CardStyle { - /// Width for the border. - int? get borderWidth => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get backgroundColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get borderColor => throw _privateConstructorUsedError; - - /// Borderradius that can give the Cardfield rounded corners. - int? get borderRadius => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get cursorColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textColor => throw _privateConstructorUsedError; - - /// Font size. - int? get fontSize => throw _privateConstructorUsedError; - - /// Font family - String? get fontFamily => throw _privateConstructorUsedError; - - /// Color of the input in case incorrect data is entered. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textErrorColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderColor => throw _privateConstructorUsedError; + +/// Width for the border. + int? get borderWidth;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get backgroundColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get borderColor;/// Borderradius that can give the Cardfield rounded corners. + int? get borderRadius;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get cursorColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get textColor;/// Font size. + int? get fontSize;/// Font family + String? get fontFamily;/// Color of the input in case incorrect data is entered. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get textErrorColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get placeholderColor; +/// Create a copy of CardStyle +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardStyleCopyWith get copyWith => _$CardStyleCopyWithImpl(this as CardStyle, _$identity); /// Serializes this CardStyle to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CardStyle - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardStyleCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardStyle&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)&&(identical(other.cursorColor, cursorColor) || other.cursorColor == cursorColor)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.fontSize, fontSize) || other.fontSize == fontSize)&&(identical(other.fontFamily, fontFamily) || other.fontFamily == fontFamily)&&(identical(other.textErrorColor, textErrorColor) || other.textErrorColor == textErrorColor)&&(identical(other.placeholderColor, placeholderColor) || other.placeholderColor == placeholderColor)); } -/// @nodoc -abstract class $CardStyleCopyWith<$Res> { - factory $CardStyleCopyWith(CardStyle value, $Res Function(CardStyle) then) = - _$CardStyleCopyWithImpl<$Res, CardStyle>; - @useResult - $Res call( - {int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, - int? borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, - int? fontSize, - String? fontFamily, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,borderWidth,backgroundColor,borderColor,borderRadius,cursorColor,textColor,fontSize,fontFamily,textErrorColor,placeholderColor); + +@override +String toString() { + return 'CardStyle(borderWidth: $borderWidth, backgroundColor: $backgroundColor, borderColor: $borderColor, borderRadius: $borderRadius, cursorColor: $cursorColor, textColor: $textColor, fontSize: $fontSize, fontFamily: $fontFamily, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor)'; } -/// @nodoc -class _$CardStyleCopyWithImpl<$Res, $Val extends CardStyle> - implements $CardStyleCopyWith<$Res> { - _$CardStyleCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardStyle - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? borderWidth = freezed, - Object? backgroundColor = freezed, - Object? borderColor = freezed, - Object? borderRadius = freezed, - Object? cursorColor = freezed, - Object? textColor = freezed, - Object? fontSize = freezed, - Object? fontFamily = freezed, - Object? textErrorColor = freezed, - Object? placeholderColor = freezed, - }) { - return _then(_value.copyWith( - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as int?, - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as int?, - cursorColor: freezed == cursorColor - ? _value.cursorColor - : cursorColor // ignore: cast_nullable_to_non_nullable - as Color?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as Color?, - fontSize: freezed == fontSize - ? _value.fontSize - : fontSize // ignore: cast_nullable_to_non_nullable - as int?, - fontFamily: freezed == fontFamily - ? _value.fontFamily - : fontFamily // ignore: cast_nullable_to_non_nullable - as String?, - textErrorColor: freezed == textErrorColor - ? _value.textErrorColor - : textErrorColor // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderColor: freezed == placeholderColor - ? _value.placeholderColor - : placeholderColor // ignore: cast_nullable_to_non_nullable - as Color?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardStyleConstructorImplCopyWith<$Res> +abstract mixin class $CardStyleCopyWith<$Res> { + factory $CardStyleCopyWith(CardStyle value, $Res Function(CardStyle) _then) = _$CardStyleCopyWithImpl; +@useResult +$Res call({ + int? borderWidth,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, String? fontFamily,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor +}); + + + + +} +/// @nodoc +class _$CardStyleCopyWithImpl<$Res> implements $CardStyleCopyWith<$Res> { - factory _$$CardStyleConstructorImplCopyWith(_$CardStyleConstructorImpl value, - $Res Function(_$CardStyleConstructorImpl) then) = - __$$CardStyleConstructorImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, - int? borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, - int? fontSize, - String? fontFamily, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); + _$CardStyleCopyWithImpl(this._self, this._then); + + final CardStyle _self; + final $Res Function(CardStyle) _then; + +/// Create a copy of CardStyle +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? borderWidth = freezed,Object? backgroundColor = freezed,Object? borderColor = freezed,Object? borderRadius = freezed,Object? cursorColor = freezed,Object? textColor = freezed,Object? fontSize = freezed,Object? fontFamily = freezed,Object? textErrorColor = freezed,Object? placeholderColor = freezed,}) { + return _then(_self.copyWith( +borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as int?,backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as Color?,borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as Color?,borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as int?,cursorColor: freezed == cursorColor ? _self.cursorColor : cursorColor // ignore: cast_nullable_to_non_nullable +as Color?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as Color?,fontSize: freezed == fontSize ? _self.fontSize : fontSize // ignore: cast_nullable_to_non_nullable +as int?,fontFamily: freezed == fontFamily ? _self.fontFamily : fontFamily // ignore: cast_nullable_to_non_nullable +as String?,textErrorColor: freezed == textErrorColor ? _self.textErrorColor : textErrorColor // ignore: cast_nullable_to_non_nullable +as Color?,placeholderColor: freezed == placeholderColor ? _self.placeholderColor : placeholderColor // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardStyle]. +extension CardStylePatterns on CardStyle { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardStyleConstructor value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardStyleConstructor() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardStyleConstructor value) $default,){ +final _that = this; +switch (_that) { +case _CardStyleConstructor(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardStyleConstructor value)? $default,){ +final _that = this; +switch (_that) { +case _CardStyleConstructor() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, String? fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardStyleConstructor() when $default != null: +return $default(_that.borderWidth,_that.backgroundColor,_that.borderColor,_that.borderRadius,_that.cursorColor,_that.textColor,_that.fontSize,_that.fontFamily,_that.textErrorColor,_that.placeholderColor);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, String? fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor) $default,) {final _that = this; +switch (_that) { +case _CardStyleConstructor(): +return $default(_that.borderWidth,_that.backgroundColor,_that.borderColor,_that.borderRadius,_that.cursorColor,_that.textColor,_that.fontSize,_that.fontFamily,_that.textErrorColor,_that.placeholderColor);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, String? fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor)? $default,) {final _that = this; +switch (_that) { +case _CardStyleConstructor() when $default != null: +return $default(_that.borderWidth,_that.backgroundColor,_that.borderColor,_that.borderRadius,_that.cursorColor,_that.textColor,_that.fontSize,_that.fontFamily,_that.textErrorColor,_that.placeholderColor);case _: + return null; + +} } -/// @nodoc -class __$$CardStyleConstructorImplCopyWithImpl<$Res> - extends _$CardStyleCopyWithImpl<$Res, _$CardStyleConstructorImpl> - implements _$$CardStyleConstructorImplCopyWith<$Res> { - __$$CardStyleConstructorImplCopyWithImpl(_$CardStyleConstructorImpl _value, - $Res Function(_$CardStyleConstructorImpl) _then) - : super(_value, _then); - - /// Create a copy of CardStyle - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? borderWidth = freezed, - Object? backgroundColor = freezed, - Object? borderColor = freezed, - Object? borderRadius = freezed, - Object? cursorColor = freezed, - Object? textColor = freezed, - Object? fontSize = freezed, - Object? fontFamily = freezed, - Object? textErrorColor = freezed, - Object? placeholderColor = freezed, - }) { - return _then(_$CardStyleConstructorImpl( - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as int?, - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as int?, - cursorColor: freezed == cursorColor - ? _value.cursorColor - : cursorColor // ignore: cast_nullable_to_non_nullable - as Color?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as Color?, - fontSize: freezed == fontSize - ? _value.fontSize - : fontSize // ignore: cast_nullable_to_non_nullable - as int?, - fontFamily: freezed == fontFamily - ? _value.fontFamily - : fontFamily // ignore: cast_nullable_to_non_nullable - as String?, - textErrorColor: freezed == textErrorColor - ? _value.textErrorColor - : textErrorColor // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderColor: freezed == placeholderColor - ? _value.placeholderColor - : placeholderColor // ignore: cast_nullable_to_non_nullable - as Color?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardStyleConstructorImpl extends _CardStyleConstructor { - _$CardStyleConstructorImpl( - {this.borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.borderColor, - this.borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textColor, - this.fontSize, - this.fontFamily, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderColor}) - : super._(); - - factory _$CardStyleConstructorImpl.fromJson(Map json) => - _$$CardStyleConstructorImplFromJson(json); - - /// Width for the border. - @override - final int? borderWidth; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor; - - /// Borderradius that can give the Cardfield rounded corners. - @override - final int? borderRadius; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? cursorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor; - - /// Font size. - @override - final int? fontSize; - - /// Font family - @override - final String? fontFamily; - - /// Color of the input in case incorrect data is entered. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor; - - @override - String toString() { - return 'CardStyle(borderWidth: $borderWidth, backgroundColor: $backgroundColor, borderColor: $borderColor, borderRadius: $borderRadius, cursorColor: $cursorColor, textColor: $textColor, fontSize: $fontSize, fontFamily: $fontFamily, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardStyleConstructorImpl && - (identical(other.borderWidth, borderWidth) || - other.borderWidth == borderWidth) && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.borderColor, borderColor) || - other.borderColor == borderColor) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius) && - (identical(other.cursorColor, cursorColor) || - other.cursorColor == cursorColor) && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.fontSize, fontSize) || - other.fontSize == fontSize) && - (identical(other.fontFamily, fontFamily) || - other.fontFamily == fontFamily) && - (identical(other.textErrorColor, textErrorColor) || - other.textErrorColor == textErrorColor) && - (identical(other.placeholderColor, placeholderColor) || - other.placeholderColor == placeholderColor)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - borderWidth, - backgroundColor, - borderColor, - borderRadius, - cursorColor, - textColor, - fontSize, - fontFamily, - textErrorColor, - placeholderColor); - - /// Create a copy of CardStyle - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardStyleConstructorImplCopyWith<_$CardStyleConstructorImpl> - get copyWith => - __$$CardStyleConstructorImplCopyWithImpl<_$CardStyleConstructorImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CardStyleConstructorImplToJson( - this, +class _CardStyleConstructor extends CardStyle { + _CardStyleConstructor({this.borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.backgroundColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.borderColor, this.borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.textColor, this.fontSize, this.fontFamily, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.placeholderColor}): super._(); + factory _CardStyleConstructor.fromJson(Map json) => _$CardStyleConstructorFromJson(json); + +/// Width for the border. +@override final int? borderWidth; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? backgroundColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? borderColor; +/// Borderradius that can give the Cardfield rounded corners. +@override final int? borderRadius; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? cursorColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? textColor; +/// Font size. +@override final int? fontSize; +/// Font family +@override final String? fontFamily; +/// Color of the input in case incorrect data is entered. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? textErrorColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? placeholderColor; + +/// Create a copy of CardStyle +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardStyleConstructorCopyWith<_CardStyleConstructor> get copyWith => __$CardStyleConstructorCopyWithImpl<_CardStyleConstructor>(this, _$identity); + +@override +Map toJson() { + return _$CardStyleConstructorToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardStyleConstructor&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)&&(identical(other.cursorColor, cursorColor) || other.cursorColor == cursorColor)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.fontSize, fontSize) || other.fontSize == fontSize)&&(identical(other.fontFamily, fontFamily) || other.fontFamily == fontFamily)&&(identical(other.textErrorColor, textErrorColor) || other.textErrorColor == textErrorColor)&&(identical(other.placeholderColor, placeholderColor) || other.placeholderColor == placeholderColor)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,borderWidth,backgroundColor,borderColor,borderRadius,cursorColor,textColor,fontSize,fontFamily,textErrorColor,placeholderColor); + +@override +String toString() { + return 'CardStyle(borderWidth: $borderWidth, backgroundColor: $backgroundColor, borderColor: $borderColor, borderRadius: $borderRadius, cursorColor: $cursorColor, textColor: $textColor, fontSize: $fontSize, fontFamily: $fontFamily, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardStyleConstructorCopyWith<$Res> implements $CardStyleCopyWith<$Res> { + factory _$CardStyleConstructorCopyWith(_CardStyleConstructor value, $Res Function(_CardStyleConstructor) _then) = __$CardStyleConstructorCopyWithImpl; +@override @useResult +$Res call({ + int? borderWidth,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, String? fontFamily,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor +}); + + + + +} +/// @nodoc +class __$CardStyleConstructorCopyWithImpl<$Res> + implements _$CardStyleConstructorCopyWith<$Res> { + __$CardStyleConstructorCopyWithImpl(this._self, this._then); + + final _CardStyleConstructor _self; + final $Res Function(_CardStyleConstructor) _then; + +/// Create a copy of CardStyle +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? borderWidth = freezed,Object? backgroundColor = freezed,Object? borderColor = freezed,Object? borderRadius = freezed,Object? cursorColor = freezed,Object? textColor = freezed,Object? fontSize = freezed,Object? fontFamily = freezed,Object? textErrorColor = freezed,Object? placeholderColor = freezed,}) { + return _then(_CardStyleConstructor( +borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as int?,backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as Color?,borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as Color?,borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as int?,cursorColor: freezed == cursorColor ? _self.cursorColor : cursorColor // ignore: cast_nullable_to_non_nullable +as Color?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as Color?,fontSize: freezed == fontSize ? _self.fontSize : fontSize // ignore: cast_nullable_to_non_nullable +as int?,fontFamily: freezed == fontFamily ? _self.fontFamily : fontFamily // ignore: cast_nullable_to_non_nullable +as String?,textErrorColor: freezed == textErrorColor ? _self.textErrorColor : textErrorColor // ignore: cast_nullable_to_non_nullable +as Color?,placeholderColor: freezed == placeholderColor ? _self.placeholderColor : placeholderColor // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + + +} + +CardFormStyle _$CardFormStyleFromJson( + Map json +) { + return _CardFormStyleConstructor.fromJson( + json ); - } -} - -abstract class _CardStyleConstructor extends CardStyle { - factory _CardStyleConstructor( - {final int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor, - final int? borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor, - final int? fontSize, - final String? fontFamily, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor}) = _$CardStyleConstructorImpl; - _CardStyleConstructor._() : super._(); - - factory _CardStyleConstructor.fromJson(Map json) = - _$CardStyleConstructorImpl.fromJson; - - /// Width for the border. - @override - int? get borderWidth; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get backgroundColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get borderColor; - - /// Borderradius that can give the Cardfield rounded corners. - @override - int? get borderRadius; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get cursorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textColor; - - /// Font size. - @override - int? get fontSize; - - /// Font family - @override - String? get fontFamily; - - /// Color of the input in case incorrect data is entered. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textErrorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderColor; - - /// Create a copy of CardStyle - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardStyleConstructorImplCopyWith<_$CardStyleConstructorImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CardFormStyle _$CardFormStyleFromJson(Map json) { - return _CardFormStyleConstructor.fromJson(json); } /// @nodoc mixin _$CardFormStyle { - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get backgroundColor => throw _privateConstructorUsedError; - - /// Width for the border. - int? get borderWidth => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get borderColor => throw _privateConstructorUsedError; - - /// Borderradius that can give the Cardfield rounded corners. - int? get borderRadius => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get cursorColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textColor => throw _privateConstructorUsedError; - - /// Font size. - int? get fontSize => throw _privateConstructorUsedError; - - /// Color of the input in case incorrect data is entered. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textErrorColor => throw _privateConstructorUsedError; - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderColor => throw _privateConstructorUsedError; + +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get backgroundColor;/// Width for the border. + int? get borderWidth;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get borderColor;/// Borderradius that can give the Cardfield rounded corners. + int? get borderRadius;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get cursorColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get textColor;/// Font size. + int? get fontSize;/// Color of the input in case incorrect data is entered. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get textErrorColor;@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get placeholderColor; +/// Create a copy of CardFormStyle +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardFormStyleCopyWith get copyWith => _$CardFormStyleCopyWithImpl(this as CardFormStyle, _$identity); /// Serializes this CardFormStyle to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CardFormStyle - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardFormStyleCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardFormStyle&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)&&(identical(other.cursorColor, cursorColor) || other.cursorColor == cursorColor)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.fontSize, fontSize) || other.fontSize == fontSize)&&(identical(other.textErrorColor, textErrorColor) || other.textErrorColor == textErrorColor)&&(identical(other.placeholderColor, placeholderColor) || other.placeholderColor == placeholderColor)); } -/// @nodoc -abstract class $CardFormStyleCopyWith<$Res> { - factory $CardFormStyleCopyWith( - CardFormStyle value, $Res Function(CardFormStyle) then) = - _$CardFormStyleCopyWithImpl<$Res, CardFormStyle>; - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, - int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, - int? borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, - int? fontSize, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,backgroundColor,borderWidth,borderColor,borderRadius,cursorColor,textColor,fontSize,textErrorColor,placeholderColor); + +@override +String toString() { + return 'CardFormStyle(backgroundColor: $backgroundColor, borderWidth: $borderWidth, borderColor: $borderColor, borderRadius: $borderRadius, cursorColor: $cursorColor, textColor: $textColor, fontSize: $fontSize, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor)'; } -/// @nodoc -class _$CardFormStyleCopyWithImpl<$Res, $Val extends CardFormStyle> - implements $CardFormStyleCopyWith<$Res> { - _$CardFormStyleCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardFormStyle - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? backgroundColor = freezed, - Object? borderWidth = freezed, - Object? borderColor = freezed, - Object? borderRadius = freezed, - Object? cursorColor = freezed, - Object? textColor = freezed, - Object? fontSize = freezed, - Object? textErrorColor = freezed, - Object? placeholderColor = freezed, - }) { - return _then(_value.copyWith( - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as int?, - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as int?, - cursorColor: freezed == cursorColor - ? _value.cursorColor - : cursorColor // ignore: cast_nullable_to_non_nullable - as Color?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as Color?, - fontSize: freezed == fontSize - ? _value.fontSize - : fontSize // ignore: cast_nullable_to_non_nullable - as int?, - textErrorColor: freezed == textErrorColor - ? _value.textErrorColor - : textErrorColor // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderColor: freezed == placeholderColor - ? _value.placeholderColor - : placeholderColor // ignore: cast_nullable_to_non_nullable - as Color?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardFormStyleConstructorImplCopyWith<$Res> +abstract mixin class $CardFormStyleCopyWith<$Res> { + factory $CardFormStyleCopyWith(CardFormStyle value, $Res Function(CardFormStyle) _then) = _$CardFormStyleCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, int? borderWidth,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor +}); + + + + +} +/// @nodoc +class _$CardFormStyleCopyWithImpl<$Res> implements $CardFormStyleCopyWith<$Res> { - factory _$$CardFormStyleConstructorImplCopyWith( - _$CardFormStyleConstructorImpl value, - $Res Function(_$CardFormStyleConstructorImpl) then) = - __$$CardFormStyleConstructorImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? backgroundColor, - int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? borderColor, - int? borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textColor, - int? fontSize, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderColor}); + _$CardFormStyleCopyWithImpl(this._self, this._then); + + final CardFormStyle _self; + final $Res Function(CardFormStyle) _then; + +/// Create a copy of CardFormStyle +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? backgroundColor = freezed,Object? borderWidth = freezed,Object? borderColor = freezed,Object? borderRadius = freezed,Object? cursorColor = freezed,Object? textColor = freezed,Object? fontSize = freezed,Object? textErrorColor = freezed,Object? placeholderColor = freezed,}) { + return _then(_self.copyWith( +backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as Color?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as int?,borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as Color?,borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as int?,cursorColor: freezed == cursorColor ? _self.cursorColor : cursorColor // ignore: cast_nullable_to_non_nullable +as Color?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as Color?,fontSize: freezed == fontSize ? _self.fontSize : fontSize // ignore: cast_nullable_to_non_nullable +as int?,textErrorColor: freezed == textErrorColor ? _self.textErrorColor : textErrorColor // ignore: cast_nullable_to_non_nullable +as Color?,placeholderColor: freezed == placeholderColor ? _self.placeholderColor : placeholderColor // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardFormStyle]. +extension CardFormStylePatterns on CardFormStyle { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardFormStyleConstructor value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardFormStyleConstructor() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardFormStyleConstructor value) $default,){ +final _that = this; +switch (_that) { +case _CardFormStyleConstructor(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardFormStyleConstructor value)? $default,){ +final _that = this; +switch (_that) { +case _CardFormStyleConstructor() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardFormStyleConstructor() when $default != null: +return $default(_that.backgroundColor,_that.borderWidth,_that.borderColor,_that.borderRadius,_that.cursorColor,_that.textColor,_that.fontSize,_that.textErrorColor,_that.placeholderColor);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor) $default,) {final _that = this; +switch (_that) { +case _CardFormStyleConstructor(): +return $default(_that.backgroundColor,_that.borderWidth,_that.borderColor,_that.borderRadius,_that.cursorColor,_that.textColor,_that.fontSize,_that.textErrorColor,_that.placeholderColor);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, int? borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor)? $default,) {final _that = this; +switch (_that) { +case _CardFormStyleConstructor() when $default != null: +return $default(_that.backgroundColor,_that.borderWidth,_that.borderColor,_that.borderRadius,_that.cursorColor,_that.textColor,_that.fontSize,_that.textErrorColor,_that.placeholderColor);case _: + return null; + +} } -/// @nodoc -class __$$CardFormStyleConstructorImplCopyWithImpl<$Res> - extends _$CardFormStyleCopyWithImpl<$Res, _$CardFormStyleConstructorImpl> - implements _$$CardFormStyleConstructorImplCopyWith<$Res> { - __$$CardFormStyleConstructorImplCopyWithImpl( - _$CardFormStyleConstructorImpl _value, - $Res Function(_$CardFormStyleConstructorImpl) _then) - : super(_value, _then); - - /// Create a copy of CardFormStyle - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? backgroundColor = freezed, - Object? borderWidth = freezed, - Object? borderColor = freezed, - Object? borderRadius = freezed, - Object? cursorColor = freezed, - Object? textColor = freezed, - Object? fontSize = freezed, - Object? textErrorColor = freezed, - Object? placeholderColor = freezed, - }) { - return _then(_$CardFormStyleConstructorImpl( - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as int?, - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as Color?, - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as int?, - cursorColor: freezed == cursorColor - ? _value.cursorColor - : cursorColor // ignore: cast_nullable_to_non_nullable - as Color?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as Color?, - fontSize: freezed == fontSize - ? _value.fontSize - : fontSize // ignore: cast_nullable_to_non_nullable - as int?, - textErrorColor: freezed == textErrorColor - ? _value.textErrorColor - : textErrorColor // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderColor: freezed == placeholderColor - ? _value.placeholderColor - : placeholderColor // ignore: cast_nullable_to_non_nullable - as Color?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardFormStyleConstructorImpl extends _CardFormStyleConstructor { - _$CardFormStyleConstructorImpl( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.backgroundColor, - this.borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.borderColor, - this.borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textColor, - this.fontSize, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderColor}) - : super._(); - - factory _$CardFormStyleConstructorImpl.fromJson(Map json) => - _$$CardFormStyleConstructorImplFromJson(json); - - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor; - - /// Width for the border. - @override - final int? borderWidth; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor; - - /// Borderradius that can give the Cardfield rounded corners. - @override - final int? borderRadius; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? cursorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor; - - /// Font size. - @override - final int? fontSize; - - /// Color of the input in case incorrect data is entered. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor; - - @override - String toString() { - return 'CardFormStyle(backgroundColor: $backgroundColor, borderWidth: $borderWidth, borderColor: $borderColor, borderRadius: $borderRadius, cursorColor: $cursorColor, textColor: $textColor, fontSize: $fontSize, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardFormStyleConstructorImpl && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.borderWidth, borderWidth) || - other.borderWidth == borderWidth) && - (identical(other.borderColor, borderColor) || - other.borderColor == borderColor) && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius) && - (identical(other.cursorColor, cursorColor) || - other.cursorColor == cursorColor) && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.fontSize, fontSize) || - other.fontSize == fontSize) && - (identical(other.textErrorColor, textErrorColor) || - other.textErrorColor == textErrorColor) && - (identical(other.placeholderColor, placeholderColor) || - other.placeholderColor == placeholderColor)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - backgroundColor, - borderWidth, - borderColor, - borderRadius, - cursorColor, - textColor, - fontSize, - textErrorColor, - placeholderColor); - - /// Create a copy of CardFormStyle - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardFormStyleConstructorImplCopyWith<_$CardFormStyleConstructorImpl> - get copyWith => __$$CardFormStyleConstructorImplCopyWithImpl< - _$CardFormStyleConstructorImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardFormStyleConstructorImplToJson( - this, +class _CardFormStyleConstructor extends CardFormStyle { + _CardFormStyleConstructor({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.backgroundColor, this.borderWidth, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.borderColor, this.borderRadius, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.cursorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.textColor, this.fontSize, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.textErrorColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.placeholderColor}): super._(); + factory _CardFormStyleConstructor.fromJson(Map json) => _$CardFormStyleConstructorFromJson(json); + +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? backgroundColor; +/// Width for the border. +@override final int? borderWidth; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? borderColor; +/// Borderradius that can give the Cardfield rounded corners. +@override final int? borderRadius; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? cursorColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? textColor; +/// Font size. +@override final int? fontSize; +/// Color of the input in case incorrect data is entered. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? textErrorColor; +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? placeholderColor; + +/// Create a copy of CardFormStyle +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardFormStyleConstructorCopyWith<_CardFormStyleConstructor> get copyWith => __$CardFormStyleConstructorCopyWithImpl<_CardFormStyleConstructor>(this, _$identity); + +@override +Map toJson() { + return _$CardFormStyleConstructorToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardFormStyleConstructor&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)&&(identical(other.cursorColor, cursorColor) || other.cursorColor == cursorColor)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.fontSize, fontSize) || other.fontSize == fontSize)&&(identical(other.textErrorColor, textErrorColor) || other.textErrorColor == textErrorColor)&&(identical(other.placeholderColor, placeholderColor) || other.placeholderColor == placeholderColor)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,backgroundColor,borderWidth,borderColor,borderRadius,cursorColor,textColor,fontSize,textErrorColor,placeholderColor); + +@override +String toString() { + return 'CardFormStyle(backgroundColor: $backgroundColor, borderWidth: $borderWidth, borderColor: $borderColor, borderRadius: $borderRadius, cursorColor: $cursorColor, textColor: $textColor, fontSize: $fontSize, textErrorColor: $textErrorColor, placeholderColor: $placeholderColor)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardFormStyleConstructorCopyWith<$Res> implements $CardFormStyleCopyWith<$Res> { + factory _$CardFormStyleConstructorCopyWith(_CardFormStyleConstructor value, $Res Function(_CardFormStyleConstructor) _then) = __$CardFormStyleConstructorCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? backgroundColor, int? borderWidth,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? borderColor, int? borderRadius,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? cursorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textColor, int? fontSize,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? textErrorColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderColor +}); + + + + +} +/// @nodoc +class __$CardFormStyleConstructorCopyWithImpl<$Res> + implements _$CardFormStyleConstructorCopyWith<$Res> { + __$CardFormStyleConstructorCopyWithImpl(this._self, this._then); + + final _CardFormStyleConstructor _self; + final $Res Function(_CardFormStyleConstructor) _then; + +/// Create a copy of CardFormStyle +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? backgroundColor = freezed,Object? borderWidth = freezed,Object? borderColor = freezed,Object? borderRadius = freezed,Object? cursorColor = freezed,Object? textColor = freezed,Object? fontSize = freezed,Object? textErrorColor = freezed,Object? placeholderColor = freezed,}) { + return _then(_CardFormStyleConstructor( +backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as Color?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as int?,borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as Color?,borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as int?,cursorColor: freezed == cursorColor ? _self.cursorColor : cursorColor // ignore: cast_nullable_to_non_nullable +as Color?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as Color?,fontSize: freezed == fontSize ? _self.fontSize : fontSize // ignore: cast_nullable_to_non_nullable +as int?,textErrorColor: freezed == textErrorColor ? _self.textErrorColor : textErrorColor // ignore: cast_nullable_to_non_nullable +as Color?,placeholderColor: freezed == placeholderColor ? _self.placeholderColor : placeholderColor // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + + +} + +CardPlaceholder _$CardPlaceholderFromJson( + Map json +) { + return _CardPlaceholderConstructor.fromJson( + json ); - } -} - -abstract class _CardFormStyleConstructor extends CardFormStyle { - factory _CardFormStyleConstructor( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? backgroundColor, - final int? borderWidth, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? borderColor, - final int? borderRadius, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? cursorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textColor, - final int? fontSize, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? textErrorColor, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderColor}) = _$CardFormStyleConstructorImpl; - _CardFormStyleConstructor._() : super._(); - - factory _CardFormStyleConstructor.fromJson(Map json) = - _$CardFormStyleConstructorImpl.fromJson; - - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get backgroundColor; - - /// Width for the border. - @override - int? get borderWidth; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get borderColor; - - /// Borderradius that can give the Cardfield rounded corners. - @override - int? get borderRadius; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get cursorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textColor; - - /// Font size. - @override - int? get fontSize; - - /// Color of the input in case incorrect data is entered. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get textErrorColor; - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderColor; - - /// Create a copy of CardFormStyle - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardFormStyleConstructorImplCopyWith<_$CardFormStyleConstructorImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CardPlaceholder _$CardPlaceholderFromJson(Map json) { - return _CardPlaceholderConstructor.fromJson(json); } /// @nodoc mixin _$CardPlaceholder { - /// Localized placeholder for card number field. - String? get number => throw _privateConstructorUsedError; - /// Localized placeholder for expiration field. - String? get expiration => throw _privateConstructorUsedError; +/// Localized placeholder for card number field. + String? get number;/// Localized placeholder for expiration field. + String? get expiration;/// Localized placeholder for cvc field. + String? get cvc;/// Localized placeholder for postal code field. + String? get postalCode; +/// Create a copy of CardPlaceholder +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardPlaceholderCopyWith get copyWith => _$CardPlaceholderCopyWithImpl(this as CardPlaceholder, _$identity); - /// Localized placeholder for cvc field. - String? get cvc => throw _privateConstructorUsedError; + /// Serializes this CardPlaceholder to a JSON map. + Map toJson(); - /// Localized placeholder for postal code field. - String? get postalCode => throw _privateConstructorUsedError; - /// Serializes this CardPlaceholder to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardPlaceholder&&(identical(other.number, number) || other.number == number)&&(identical(other.expiration, expiration) || other.expiration == expiration)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,number,expiration,cvc,postalCode); - /// Create a copy of CardPlaceholder - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardPlaceholderCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'CardPlaceholder(number: $number, expiration: $expiration, cvc: $cvc, postalCode: $postalCode)'; } -/// @nodoc -abstract class $CardPlaceholderCopyWith<$Res> { - factory $CardPlaceholderCopyWith( - CardPlaceholder value, $Res Function(CardPlaceholder) then) = - _$CardPlaceholderCopyWithImpl<$Res, CardPlaceholder>; - @useResult - $Res call( - {String? number, String? expiration, String? cvc, String? postalCode}); + } /// @nodoc -class _$CardPlaceholderCopyWithImpl<$Res, $Val extends CardPlaceholder> - implements $CardPlaceholderCopyWith<$Res> { - _$CardPlaceholderCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardPlaceholder - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? number = freezed, - Object? expiration = freezed, - Object? cvc = freezed, - Object? postalCode = freezed, - }) { - return _then(_value.copyWith( - number: freezed == number - ? _value.number - : number // ignore: cast_nullable_to_non_nullable - as String?, - expiration: freezed == expiration - ? _value.expiration - : expiration // ignore: cast_nullable_to_non_nullable - as String?, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} +abstract mixin class $CardPlaceholderCopyWith<$Res> { + factory $CardPlaceholderCopyWith(CardPlaceholder value, $Res Function(CardPlaceholder) _then) = _$CardPlaceholderCopyWithImpl; +@useResult +$Res call({ + String? number, String? expiration, String? cvc, String? postalCode +}); + + + +} /// @nodoc -abstract class _$$CardPlaceholderConstructorImplCopyWith<$Res> +class _$CardPlaceholderCopyWithImpl<$Res> implements $CardPlaceholderCopyWith<$Res> { - factory _$$CardPlaceholderConstructorImplCopyWith( - _$CardPlaceholderConstructorImpl value, - $Res Function(_$CardPlaceholderConstructorImpl) then) = - __$$CardPlaceholderConstructorImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? number, String? expiration, String? cvc, String? postalCode}); + _$CardPlaceholderCopyWithImpl(this._self, this._then); + + final CardPlaceholder _self; + final $Res Function(CardPlaceholder) _then; + +/// Create a copy of CardPlaceholder +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? number = freezed,Object? expiration = freezed,Object? cvc = freezed,Object? postalCode = freezed,}) { + return _then(_self.copyWith( +number: freezed == number ? _self.number : number // ignore: cast_nullable_to_non_nullable +as String?,expiration: freezed == expiration ? _self.expiration : expiration // ignore: cast_nullable_to_non_nullable +as String?,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardPlaceholder]. +extension CardPlaceholderPatterns on CardPlaceholder { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardPlaceholderConstructor value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardPlaceholderConstructor() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardPlaceholderConstructor value) $default,){ +final _that = this; +switch (_that) { +case _CardPlaceholderConstructor(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardPlaceholderConstructor value)? $default,){ +final _that = this; +switch (_that) { +case _CardPlaceholderConstructor() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? number, String? expiration, String? cvc, String? postalCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardPlaceholderConstructor() when $default != null: +return $default(_that.number,_that.expiration,_that.cvc,_that.postalCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? number, String? expiration, String? cvc, String? postalCode) $default,) {final _that = this; +switch (_that) { +case _CardPlaceholderConstructor(): +return $default(_that.number,_that.expiration,_that.cvc,_that.postalCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? number, String? expiration, String? cvc, String? postalCode)? $default,) {final _that = this; +switch (_that) { +case _CardPlaceholderConstructor() when $default != null: +return $default(_that.number,_that.expiration,_that.cvc,_that.postalCode);case _: + return null; + +} } -/// @nodoc -class __$$CardPlaceholderConstructorImplCopyWithImpl<$Res> - extends _$CardPlaceholderCopyWithImpl<$Res, - _$CardPlaceholderConstructorImpl> - implements _$$CardPlaceholderConstructorImplCopyWith<$Res> { - __$$CardPlaceholderConstructorImplCopyWithImpl( - _$CardPlaceholderConstructorImpl _value, - $Res Function(_$CardPlaceholderConstructorImpl) _then) - : super(_value, _then); - - /// Create a copy of CardPlaceholder - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? number = freezed, - Object? expiration = freezed, - Object? cvc = freezed, - Object? postalCode = freezed, - }) { - return _then(_$CardPlaceholderConstructorImpl( - number: freezed == number - ? _value.number - : number // ignore: cast_nullable_to_non_nullable - as String?, - expiration: freezed == expiration - ? _value.expiration - : expiration // ignore: cast_nullable_to_non_nullable - as String?, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardPlaceholderConstructorImpl extends _CardPlaceholderConstructor { - _$CardPlaceholderConstructorImpl( - {this.number, this.expiration, this.cvc, this.postalCode}) - : super._(); - - factory _$CardPlaceholderConstructorImpl.fromJson( - Map json) => - _$$CardPlaceholderConstructorImplFromJson(json); - - /// Localized placeholder for card number field. - @override - final String? number; - - /// Localized placeholder for expiration field. - @override - final String? expiration; - - /// Localized placeholder for cvc field. - @override - final String? cvc; - - /// Localized placeholder for postal code field. - @override - final String? postalCode; - - @override - String toString() { - return 'CardPlaceholder(number: $number, expiration: $expiration, cvc: $cvc, postalCode: $postalCode)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardPlaceholderConstructorImpl && - (identical(other.number, number) || other.number == number) && - (identical(other.expiration, expiration) || - other.expiration == expiration) && - (identical(other.cvc, cvc) || other.cvc == cvc) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, number, expiration, cvc, postalCode); - - /// Create a copy of CardPlaceholder - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardPlaceholderConstructorImplCopyWith<_$CardPlaceholderConstructorImpl> - get copyWith => __$$CardPlaceholderConstructorImplCopyWithImpl< - _$CardPlaceholderConstructorImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardPlaceholderConstructorImplToJson( - this, - ); - } +class _CardPlaceholderConstructor extends CardPlaceholder { + _CardPlaceholderConstructor({this.number, this.expiration, this.cvc, this.postalCode}): super._(); + factory _CardPlaceholderConstructor.fromJson(Map json) => _$CardPlaceholderConstructorFromJson(json); + +/// Localized placeholder for card number field. +@override final String? number; +/// Localized placeholder for expiration field. +@override final String? expiration; +/// Localized placeholder for cvc field. +@override final String? cvc; +/// Localized placeholder for postal code field. +@override final String? postalCode; + +/// Create a copy of CardPlaceholder +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardPlaceholderConstructorCopyWith<_CardPlaceholderConstructor> get copyWith => __$CardPlaceholderConstructorCopyWithImpl<_CardPlaceholderConstructor>(this, _$identity); + +@override +Map toJson() { + return _$CardPlaceholderConstructorToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardPlaceholderConstructor&&(identical(other.number, number) || other.number == number)&&(identical(other.expiration, expiration) || other.expiration == expiration)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,number,expiration,cvc,postalCode); + +@override +String toString() { + return 'CardPlaceholder(number: $number, expiration: $expiration, cvc: $cvc, postalCode: $postalCode)'; } -abstract class _CardPlaceholderConstructor extends CardPlaceholder { - factory _CardPlaceholderConstructor( - {final String? number, - final String? expiration, - final String? cvc, - final String? postalCode}) = _$CardPlaceholderConstructorImpl; - _CardPlaceholderConstructor._() : super._(); - factory _CardPlaceholderConstructor.fromJson(Map json) = - _$CardPlaceholderConstructorImpl.fromJson; +} - /// Localized placeholder for card number field. - @override - String? get number; +/// @nodoc +abstract mixin class _$CardPlaceholderConstructorCopyWith<$Res> implements $CardPlaceholderCopyWith<$Res> { + factory _$CardPlaceholderConstructorCopyWith(_CardPlaceholderConstructor value, $Res Function(_CardPlaceholderConstructor) _then) = __$CardPlaceholderConstructorCopyWithImpl; +@override @useResult +$Res call({ + String? number, String? expiration, String? cvc, String? postalCode +}); - /// Localized placeholder for expiration field. - @override - String? get expiration; - /// Localized placeholder for cvc field. - @override - String? get cvc; - /// Localized placeholder for postal code field. - @override - String? get postalCode; - /// Create a copy of CardPlaceholder - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardPlaceholderConstructorImplCopyWith<_$CardPlaceholderConstructorImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$CardPlaceholderConstructorCopyWithImpl<$Res> + implements _$CardPlaceholderConstructorCopyWith<$Res> { + __$CardPlaceholderConstructorCopyWithImpl(this._self, this._then); + + final _CardPlaceholderConstructor _self; + final $Res Function(_CardPlaceholderConstructor) _then; + +/// Create a copy of CardPlaceholder +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? number = freezed,Object? expiration = freezed,Object? cvc = freezed,Object? postalCode = freezed,}) { + return _then(_CardPlaceholderConstructor( +number: freezed == number ? _self.number : number // ignore: cast_nullable_to_non_nullable +as String?,expiration: freezed == expiration ? _self.expiration : expiration // ignore: cast_nullable_to_non_nullable +as String?,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?, + )); } -CardFieldInputDetails _$CardFieldInputDetailsFromJson( - Map json) { - return _CardFieldInputDetails.fromJson(json); + } + /// @nodoc mixin _$CardFieldInputDetails { - /// Indicates whether the card field input is complete. - bool get complete => throw _privateConstructorUsedError; - /// Last 4 digits of the entered card number. - String? get last4 => throw _privateConstructorUsedError; +/// Indicates whether the card field input is complete. + bool get complete;/// Last 4 digits of the entered card number. + String? get last4;/// Month of the entered expiry date of the card. + int? get expiryMonth;/// Year of the entered expiry date of the card. + int? get expiryYear;/// Entered postcal code. + String? get postalCode;/// Brand of the card. + String? get brand;/// Card number. +/// This information is not available by default to comply with the PCI compliance + String? get number;/// CVC code. +/// This information is not available by default to comply with the PCI compliance + String? get cvc;/// The [CardValidationState] of the entered expiry date. + CardValidationState get validExpiryDate;/// The [CardValidationState] of the entered cvc. + CardValidationState get validCVC;/// The [CardValidationState] of the entered card number. + CardValidationState get validNumber; +/// Create a copy of CardFieldInputDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardFieldInputDetailsCopyWith get copyWith => _$CardFieldInputDetailsCopyWithImpl(this as CardFieldInputDetails, _$identity); - /// Month of the entered expiry date of the card. - int? get expiryMonth => throw _privateConstructorUsedError; + /// Serializes this CardFieldInputDetails to a JSON map. + Map toJson(); - /// Year of the entered expiry date of the card. - int? get expiryYear => throw _privateConstructorUsedError; - /// Entered postcal code. - String? get postalCode => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardFieldInputDetails&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.expiryMonth, expiryMonth) || other.expiryMonth == expiryMonth)&&(identical(other.expiryYear, expiryYear) || other.expiryYear == expiryYear)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.number, number) || other.number == number)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.validExpiryDate, validExpiryDate) || other.validExpiryDate == validExpiryDate)&&(identical(other.validCVC, validCVC) || other.validCVC == validCVC)&&(identical(other.validNumber, validNumber) || other.validNumber == validNumber)); +} - /// Brand of the card. - String? get brand => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,complete,last4,expiryMonth,expiryYear,postalCode,brand,number,cvc,validExpiryDate,validCVC,validNumber); - /// Card number. - /// This information is not available by default to comply with the PCI compliance - String? get number => throw _privateConstructorUsedError; +@override +String toString() { + return 'CardFieldInputDetails(complete: $complete, last4: $last4, expiryMonth: $expiryMonth, expiryYear: $expiryYear, postalCode: $postalCode, brand: $brand, number: $number, cvc: $cvc, validExpiryDate: $validExpiryDate, validCVC: $validCVC, validNumber: $validNumber)'; +} - /// CVC code. - /// This information is not available by default to comply with the PCI compliance - String? get cvc => throw _privateConstructorUsedError; - /// The [CardValidationState] of the entered expiry date. - CardValidationState get validExpiryDate => throw _privateConstructorUsedError; +} - /// The [CardValidationState] of the entered cvc. - CardValidationState get validCVC => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $CardFieldInputDetailsCopyWith<$Res> { + factory $CardFieldInputDetailsCopyWith(CardFieldInputDetails value, $Res Function(CardFieldInputDetails) _then) = _$CardFieldInputDetailsCopyWithImpl; +@useResult +$Res call({ + bool complete, String? last4, int? expiryMonth, int? expiryYear, String? postalCode, String? brand, String? number, String? cvc, CardValidationState validExpiryDate, CardValidationState validCVC, CardValidationState validNumber +}); - /// The [CardValidationState] of the entered card number. - CardValidationState get validNumber => throw _privateConstructorUsedError; - /// Serializes this CardFieldInputDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of CardFieldInputDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardFieldInputDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $CardFieldInputDetailsCopyWith<$Res> { - factory $CardFieldInputDetailsCopyWith(CardFieldInputDetails value, - $Res Function(CardFieldInputDetails) then) = - _$CardFieldInputDetailsCopyWithImpl<$Res, CardFieldInputDetails>; - @useResult - $Res call( - {bool complete, - String? last4, - int? expiryMonth, - int? expiryYear, - String? postalCode, - String? brand, - String? number, - String? cvc, - CardValidationState validExpiryDate, - CardValidationState validCVC, - CardValidationState validNumber}); } - /// @nodoc -class _$CardFieldInputDetailsCopyWithImpl<$Res, - $Val extends CardFieldInputDetails> +class _$CardFieldInputDetailsCopyWithImpl<$Res> implements $CardFieldInputDetailsCopyWith<$Res> { - _$CardFieldInputDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardFieldInputDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? complete = null, - Object? last4 = freezed, - Object? expiryMonth = freezed, - Object? expiryYear = freezed, - Object? postalCode = freezed, - Object? brand = freezed, - Object? number = freezed, - Object? cvc = freezed, - Object? validExpiryDate = null, - Object? validCVC = null, - Object? validNumber = null, - }) { - return _then(_value.copyWith( - complete: null == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as bool, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - expiryMonth: freezed == expiryMonth - ? _value.expiryMonth - : expiryMonth // ignore: cast_nullable_to_non_nullable - as int?, - expiryYear: freezed == expiryYear - ? _value.expiryYear - : expiryYear // ignore: cast_nullable_to_non_nullable - as int?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String?, - number: freezed == number - ? _value.number - : number // ignore: cast_nullable_to_non_nullable - as String?, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - validExpiryDate: null == validExpiryDate - ? _value.validExpiryDate - : validExpiryDate // ignore: cast_nullable_to_non_nullable - as CardValidationState, - validCVC: null == validCVC - ? _value.validCVC - : validCVC // ignore: cast_nullable_to_non_nullable - as CardValidationState, - validNumber: null == validNumber - ? _value.validNumber - : validNumber // ignore: cast_nullable_to_non_nullable - as CardValidationState, - ) as $Val); - } + _$CardFieldInputDetailsCopyWithImpl(this._self, this._then); + + final CardFieldInputDetails _self; + final $Res Function(CardFieldInputDetails) _then; + +/// Create a copy of CardFieldInputDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? complete = null,Object? last4 = freezed,Object? expiryMonth = freezed,Object? expiryYear = freezed,Object? postalCode = freezed,Object? brand = freezed,Object? number = freezed,Object? cvc = freezed,Object? validExpiryDate = null,Object? validCVC = null,Object? validNumber = null,}) { + return _then(_self.copyWith( +complete: null == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as bool,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,expiryMonth: freezed == expiryMonth ? _self.expiryMonth : expiryMonth // ignore: cast_nullable_to_non_nullable +as int?,expiryYear: freezed == expiryYear ? _self.expiryYear : expiryYear // ignore: cast_nullable_to_non_nullable +as int?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?,brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String?,number: freezed == number ? _self.number : number // ignore: cast_nullable_to_non_nullable +as String?,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,validExpiryDate: null == validExpiryDate ? _self.validExpiryDate : validExpiryDate // ignore: cast_nullable_to_non_nullable +as CardValidationState,validCVC: null == validCVC ? _self.validCVC : validCVC // ignore: cast_nullable_to_non_nullable +as CardValidationState,validNumber: null == validNumber ? _self.validNumber : validNumber // ignore: cast_nullable_to_non_nullable +as CardValidationState, + )); } -/// @nodoc -abstract class _$$CardFieldInputDetailsImplCopyWith<$Res> - implements $CardFieldInputDetailsCopyWith<$Res> { - factory _$$CardFieldInputDetailsImplCopyWith( - _$CardFieldInputDetailsImpl value, - $Res Function(_$CardFieldInputDetailsImpl) then) = - __$$CardFieldInputDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool complete, - String? last4, - int? expiryMonth, - int? expiryYear, - String? postalCode, - String? brand, - String? number, - String? cvc, - CardValidationState validExpiryDate, - CardValidationState validCVC, - CardValidationState validNumber}); } -/// @nodoc -class __$$CardFieldInputDetailsImplCopyWithImpl<$Res> - extends _$CardFieldInputDetailsCopyWithImpl<$Res, - _$CardFieldInputDetailsImpl> - implements _$$CardFieldInputDetailsImplCopyWith<$Res> { - __$$CardFieldInputDetailsImplCopyWithImpl(_$CardFieldInputDetailsImpl _value, - $Res Function(_$CardFieldInputDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of CardFieldInputDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? complete = null, - Object? last4 = freezed, - Object? expiryMonth = freezed, - Object? expiryYear = freezed, - Object? postalCode = freezed, - Object? brand = freezed, - Object? number = freezed, - Object? cvc = freezed, - Object? validExpiryDate = null, - Object? validCVC = null, - Object? validNumber = null, - }) { - return _then(_$CardFieldInputDetailsImpl( - complete: null == complete - ? _value.complete - : complete // ignore: cast_nullable_to_non_nullable - as bool, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - expiryMonth: freezed == expiryMonth - ? _value.expiryMonth - : expiryMonth // ignore: cast_nullable_to_non_nullable - as int?, - expiryYear: freezed == expiryYear - ? _value.expiryYear - : expiryYear // ignore: cast_nullable_to_non_nullable - as int?, - postalCode: freezed == postalCode - ? _value.postalCode - : postalCode // ignore: cast_nullable_to_non_nullable - as String?, - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String?, - number: freezed == number - ? _value.number - : number // ignore: cast_nullable_to_non_nullable - as String?, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - validExpiryDate: null == validExpiryDate - ? _value.validExpiryDate - : validExpiryDate // ignore: cast_nullable_to_non_nullable - as CardValidationState, - validCVC: null == validCVC - ? _value.validCVC - : validCVC // ignore: cast_nullable_to_non_nullable - as CardValidationState, - validNumber: null == validNumber - ? _value.validNumber - : validNumber // ignore: cast_nullable_to_non_nullable - as CardValidationState, - )); - } + +/// Adds pattern-matching-related methods to [CardFieldInputDetails]. +extension CardFieldInputDetailsPatterns on CardFieldInputDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardFieldInputDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardFieldInputDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} } +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardFieldInputDetails value) $default,){ +final _that = this; +switch (_that) { +case _CardFieldInputDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardFieldInputDetails value)? $default,){ +final _that = this; +switch (_that) { +case _CardFieldInputDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool complete, String? last4, int? expiryMonth, int? expiryYear, String? postalCode, String? brand, String? number, String? cvc, CardValidationState validExpiryDate, CardValidationState validCVC, CardValidationState validNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardFieldInputDetails() when $default != null: +return $default(_that.complete,_that.last4,_that.expiryMonth,_that.expiryYear,_that.postalCode,_that.brand,_that.number,_that.cvc,_that.validExpiryDate,_that.validCVC,_that.validNumber);case _: + return orElse(); -@JsonSerializable(explicitToJson: true) -class _$CardFieldInputDetailsImpl extends _CardFieldInputDetails { - const _$CardFieldInputDetailsImpl( - {required this.complete, - this.last4, - this.expiryMonth, - this.expiryYear, - this.postalCode, - this.brand, - this.number, - this.cvc, - this.validExpiryDate = CardValidationState.Unknown, - this.validCVC = CardValidationState.Unknown, - this.validNumber = CardValidationState.Unknown}) - : super._(); - - factory _$CardFieldInputDetailsImpl.fromJson(Map json) => - _$$CardFieldInputDetailsImplFromJson(json); - - /// Indicates whether the card field input is complete. - @override - final bool complete; - - /// Last 4 digits of the entered card number. - @override - final String? last4; - - /// Month of the entered expiry date of the card. - @override - final int? expiryMonth; - - /// Year of the entered expiry date of the card. - @override - final int? expiryYear; - - /// Entered postcal code. - @override - final String? postalCode; - - /// Brand of the card. - @override - final String? brand; - - /// Card number. - /// This information is not available by default to comply with the PCI compliance - @override - final String? number; - - /// CVC code. - /// This information is not available by default to comply with the PCI compliance - @override - final String? cvc; - - /// The [CardValidationState] of the entered expiry date. - @override - @JsonKey() - final CardValidationState validExpiryDate; - - /// The [CardValidationState] of the entered cvc. - @override - @JsonKey() - final CardValidationState validCVC; - - /// The [CardValidationState] of the entered card number. - @override - @JsonKey() - final CardValidationState validNumber; - - @override - String toString() { - return 'CardFieldInputDetails(complete: $complete, last4: $last4, expiryMonth: $expiryMonth, expiryYear: $expiryYear, postalCode: $postalCode, brand: $brand, number: $number, cvc: $cvc, validExpiryDate: $validExpiryDate, validCVC: $validCVC, validNumber: $validNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardFieldInputDetailsImpl && - (identical(other.complete, complete) || - other.complete == complete) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.expiryMonth, expiryMonth) || - other.expiryMonth == expiryMonth) && - (identical(other.expiryYear, expiryYear) || - other.expiryYear == expiryYear) && - (identical(other.postalCode, postalCode) || - other.postalCode == postalCode) && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.number, number) || other.number == number) && - (identical(other.cvc, cvc) || other.cvc == cvc) && - (identical(other.validExpiryDate, validExpiryDate) || - other.validExpiryDate == validExpiryDate) && - (identical(other.validCVC, validCVC) || - other.validCVC == validCVC) && - (identical(other.validNumber, validNumber) || - other.validNumber == validNumber)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - complete, - last4, - expiryMonth, - expiryYear, - postalCode, - brand, - number, - cvc, - validExpiryDate, - validCVC, - validNumber); - - /// Create a copy of CardFieldInputDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardFieldInputDetailsImplCopyWith<_$CardFieldInputDetailsImpl> - get copyWith => __$$CardFieldInputDetailsImplCopyWithImpl< - _$CardFieldInputDetailsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardFieldInputDetailsImplToJson( - this, - ); - } } +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool complete, String? last4, int? expiryMonth, int? expiryYear, String? postalCode, String? brand, String? number, String? cvc, CardValidationState validExpiryDate, CardValidationState validCVC, CardValidationState validNumber) $default,) {final _that = this; +switch (_that) { +case _CardFieldInputDetails(): +return $default(_that.complete,_that.last4,_that.expiryMonth,_that.expiryYear,_that.postalCode,_that.brand,_that.number,_that.cvc,_that.validExpiryDate,_that.validCVC,_that.validNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool complete, String? last4, int? expiryMonth, int? expiryYear, String? postalCode, String? brand, String? number, String? cvc, CardValidationState validExpiryDate, CardValidationState validCVC, CardValidationState validNumber)? $default,) {final _that = this; +switch (_that) { +case _CardFieldInputDetails() when $default != null: +return $default(_that.complete,_that.last4,_that.expiryMonth,_that.expiryYear,_that.postalCode,_that.brand,_that.number,_that.cvc,_that.validExpiryDate,_that.validCVC,_that.validNumber);case _: + return null; -abstract class _CardFieldInputDetails extends CardFieldInputDetails { - const factory _CardFieldInputDetails( - {required final bool complete, - final String? last4, - final int? expiryMonth, - final int? expiryYear, - final String? postalCode, - final String? brand, - final String? number, - final String? cvc, - final CardValidationState validExpiryDate, - final CardValidationState validCVC, - final CardValidationState validNumber}) = _$CardFieldInputDetailsImpl; - const _CardFieldInputDetails._() : super._(); +} +} - factory _CardFieldInputDetails.fromJson(Map json) = - _$CardFieldInputDetailsImpl.fromJson; +} - /// Indicates whether the card field input is complete. - @override - bool get complete; +/// @nodoc - /// Last 4 digits of the entered card number. - @override - String? get last4; +@JsonSerializable(explicitToJson: true) +class _CardFieldInputDetails extends CardFieldInputDetails { + const _CardFieldInputDetails({required this.complete, this.last4, this.expiryMonth, this.expiryYear, this.postalCode, this.brand, this.number, this.cvc, this.validExpiryDate = CardValidationState.Unknown, this.validCVC = CardValidationState.Unknown, this.validNumber = CardValidationState.Unknown}): super._(); + factory _CardFieldInputDetails.fromJson(Map json) => _$CardFieldInputDetailsFromJson(json); + +/// Indicates whether the card field input is complete. +@override final bool complete; +/// Last 4 digits of the entered card number. +@override final String? last4; +/// Month of the entered expiry date of the card. +@override final int? expiryMonth; +/// Year of the entered expiry date of the card. +@override final int? expiryYear; +/// Entered postcal code. +@override final String? postalCode; +/// Brand of the card. +@override final String? brand; +/// Card number. +/// This information is not available by default to comply with the PCI compliance +@override final String? number; +/// CVC code. +/// This information is not available by default to comply with the PCI compliance +@override final String? cvc; +/// The [CardValidationState] of the entered expiry date. +@override@JsonKey() final CardValidationState validExpiryDate; +/// The [CardValidationState] of the entered cvc. +@override@JsonKey() final CardValidationState validCVC; +/// The [CardValidationState] of the entered card number. +@override@JsonKey() final CardValidationState validNumber; + +/// Create a copy of CardFieldInputDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardFieldInputDetailsCopyWith<_CardFieldInputDetails> get copyWith => __$CardFieldInputDetailsCopyWithImpl<_CardFieldInputDetails>(this, _$identity); + +@override +Map toJson() { + return _$CardFieldInputDetailsToJson(this, ); +} - /// Month of the entered expiry date of the card. - @override - int? get expiryMonth; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardFieldInputDetails&&(identical(other.complete, complete) || other.complete == complete)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.expiryMonth, expiryMonth) || other.expiryMonth == expiryMonth)&&(identical(other.expiryYear, expiryYear) || other.expiryYear == expiryYear)&&(identical(other.postalCode, postalCode) || other.postalCode == postalCode)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.number, number) || other.number == number)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.validExpiryDate, validExpiryDate) || other.validExpiryDate == validExpiryDate)&&(identical(other.validCVC, validCVC) || other.validCVC == validCVC)&&(identical(other.validNumber, validNumber) || other.validNumber == validNumber)); +} - /// Year of the entered expiry date of the card. - @override - int? get expiryYear; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,complete,last4,expiryMonth,expiryYear,postalCode,brand,number,cvc,validExpiryDate,validCVC,validNumber); - /// Entered postcal code. - @override - String? get postalCode; +@override +String toString() { + return 'CardFieldInputDetails(complete: $complete, last4: $last4, expiryMonth: $expiryMonth, expiryYear: $expiryYear, postalCode: $postalCode, brand: $brand, number: $number, cvc: $cvc, validExpiryDate: $validExpiryDate, validCVC: $validCVC, validNumber: $validNumber)'; +} - /// Brand of the card. - @override - String? get brand; - /// Card number. - /// This information is not available by default to comply with the PCI compliance - @override - String? get number; +} - /// CVC code. - /// This information is not available by default to comply with the PCI compliance - @override - String? get cvc; +/// @nodoc +abstract mixin class _$CardFieldInputDetailsCopyWith<$Res> implements $CardFieldInputDetailsCopyWith<$Res> { + factory _$CardFieldInputDetailsCopyWith(_CardFieldInputDetails value, $Res Function(_CardFieldInputDetails) _then) = __$CardFieldInputDetailsCopyWithImpl; +@override @useResult +$Res call({ + bool complete, String? last4, int? expiryMonth, int? expiryYear, String? postalCode, String? brand, String? number, String? cvc, CardValidationState validExpiryDate, CardValidationState validCVC, CardValidationState validNumber +}); - /// The [CardValidationState] of the entered expiry date. - @override - CardValidationState get validExpiryDate; - /// The [CardValidationState] of the entered cvc. - @override - CardValidationState get validCVC; - /// The [CardValidationState] of the entered card number. - @override - CardValidationState get validNumber; - /// Create a copy of CardFieldInputDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardFieldInputDetailsImplCopyWith<_$CardFieldInputDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$CardFieldInputDetailsCopyWithImpl<$Res> + implements _$CardFieldInputDetailsCopyWith<$Res> { + __$CardFieldInputDetailsCopyWithImpl(this._self, this._then); + + final _CardFieldInputDetails _self; + final $Res Function(_CardFieldInputDetails) _then; + +/// Create a copy of CardFieldInputDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? complete = null,Object? last4 = freezed,Object? expiryMonth = freezed,Object? expiryYear = freezed,Object? postalCode = freezed,Object? brand = freezed,Object? number = freezed,Object? cvc = freezed,Object? validExpiryDate = null,Object? validCVC = null,Object? validNumber = null,}) { + return _then(_CardFieldInputDetails( +complete: null == complete ? _self.complete : complete // ignore: cast_nullable_to_non_nullable +as bool,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,expiryMonth: freezed == expiryMonth ? _self.expiryMonth : expiryMonth // ignore: cast_nullable_to_non_nullable +as int?,expiryYear: freezed == expiryYear ? _self.expiryYear : expiryYear // ignore: cast_nullable_to_non_nullable +as int?,postalCode: freezed == postalCode ? _self.postalCode : postalCode // ignore: cast_nullable_to_non_nullable +as String?,brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String?,number: freezed == number ? _self.number : number // ignore: cast_nullable_to_non_nullable +as String?,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,validExpiryDate: null == validExpiryDate ? _self.validExpiryDate : validExpiryDate // ignore: cast_nullable_to_non_nullable +as CardValidationState,validCVC: null == validCVC ? _self.validCVC : validCVC // ignore: cast_nullable_to_non_nullable +as CardValidationState,validNumber: null == validNumber ? _self.validNumber : validNumber // ignore: cast_nullable_to_non_nullable +as CardValidationState, + )); +} + -CardFieldFocusName _$CardFieldFocusNameFromJson(Map json) { - return _CardFieldFocusName.fromJson(json); } + /// @nodoc mixin _$CardFieldFocusName { - CardFieldName? get focusedField => throw _privateConstructorUsedError; + + CardFieldName? get focusedField; +/// Create a copy of CardFieldFocusName +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardFieldFocusNameCopyWith get copyWith => _$CardFieldFocusNameCopyWithImpl(this as CardFieldFocusName, _$identity); /// Serializes this CardFieldFocusName to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CardFieldFocusName - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardFieldFocusNameCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardFieldFocusName&&(identical(other.focusedField, focusedField) || other.focusedField == focusedField)); } -/// @nodoc -abstract class $CardFieldFocusNameCopyWith<$Res> { - factory $CardFieldFocusNameCopyWith( - CardFieldFocusName value, $Res Function(CardFieldFocusName) then) = - _$CardFieldFocusNameCopyWithImpl<$Res, CardFieldFocusName>; - @useResult - $Res call({CardFieldName? focusedField}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,focusedField); + +@override +String toString() { + return 'CardFieldFocusName(focusedField: $focusedField)'; } -/// @nodoc -class _$CardFieldFocusNameCopyWithImpl<$Res, $Val extends CardFieldFocusName> - implements $CardFieldFocusNameCopyWith<$Res> { - _$CardFieldFocusNameCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardFieldFocusName - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? focusedField = freezed, - }) { - return _then(_value.copyWith( - focusedField: freezed == focusedField - ? _value.focusedField - : focusedField // ignore: cast_nullable_to_non_nullable - as CardFieldName?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CardFieldFocusNameImplCopyWith<$Res> +abstract mixin class $CardFieldFocusNameCopyWith<$Res> { + factory $CardFieldFocusNameCopyWith(CardFieldFocusName value, $Res Function(CardFieldFocusName) _then) = _$CardFieldFocusNameCopyWithImpl; +@useResult +$Res call({ + CardFieldName? focusedField +}); + + + + +} +/// @nodoc +class _$CardFieldFocusNameCopyWithImpl<$Res> implements $CardFieldFocusNameCopyWith<$Res> { - factory _$$CardFieldFocusNameImplCopyWith(_$CardFieldFocusNameImpl value, - $Res Function(_$CardFieldFocusNameImpl) then) = - __$$CardFieldFocusNameImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({CardFieldName? focusedField}); + _$CardFieldFocusNameCopyWithImpl(this._self, this._then); + + final CardFieldFocusName _self; + final $Res Function(CardFieldFocusName) _then; + +/// Create a copy of CardFieldFocusName +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? focusedField = freezed,}) { + return _then(_self.copyWith( +focusedField: freezed == focusedField ? _self.focusedField : focusedField // ignore: cast_nullable_to_non_nullable +as CardFieldName?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardFieldFocusName]. +extension CardFieldFocusNamePatterns on CardFieldFocusName { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardFieldFocusName value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardFieldFocusName() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardFieldFocusName value) $default,){ +final _that = this; +switch (_that) { +case _CardFieldFocusName(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardFieldFocusName value)? $default,){ +final _that = this; +switch (_that) { +case _CardFieldFocusName() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( CardFieldName? focusedField)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardFieldFocusName() when $default != null: +return $default(_that.focusedField);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( CardFieldName? focusedField) $default,) {final _that = this; +switch (_that) { +case _CardFieldFocusName(): +return $default(_that.focusedField);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( CardFieldName? focusedField)? $default,) {final _that = this; +switch (_that) { +case _CardFieldFocusName() when $default != null: +return $default(_that.focusedField);case _: + return null; + +} } -/// @nodoc -class __$$CardFieldFocusNameImplCopyWithImpl<$Res> - extends _$CardFieldFocusNameCopyWithImpl<$Res, _$CardFieldFocusNameImpl> - implements _$$CardFieldFocusNameImplCopyWith<$Res> { - __$$CardFieldFocusNameImplCopyWithImpl(_$CardFieldFocusNameImpl _value, - $Res Function(_$CardFieldFocusNameImpl) _then) - : super(_value, _then); - - /// Create a copy of CardFieldFocusName - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? focusedField = freezed, - }) { - return _then(_$CardFieldFocusNameImpl( - focusedField: freezed == focusedField - ? _value.focusedField - : focusedField // ignore: cast_nullable_to_non_nullable - as CardFieldName?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardFieldFocusNameImpl implements _CardFieldFocusName { - _$CardFieldFocusNameImpl({this.focusedField}); - - factory _$CardFieldFocusNameImpl.fromJson(Map json) => - _$$CardFieldFocusNameImplFromJson(json); - - @override - final CardFieldName? focusedField; - - @override - String toString() { - return 'CardFieldFocusName(focusedField: $focusedField)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardFieldFocusNameImpl && - (identical(other.focusedField, focusedField) || - other.focusedField == focusedField)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, focusedField); - - /// Create a copy of CardFieldFocusName - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardFieldFocusNameImplCopyWith<_$CardFieldFocusNameImpl> get copyWith => - __$$CardFieldFocusNameImplCopyWithImpl<_$CardFieldFocusNameImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CardFieldFocusNameImplToJson( - this, - ); - } +class _CardFieldFocusName implements CardFieldFocusName { + _CardFieldFocusName({this.focusedField}); + factory _CardFieldFocusName.fromJson(Map json) => _$CardFieldFocusNameFromJson(json); + +@override final CardFieldName? focusedField; + +/// Create a copy of CardFieldFocusName +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardFieldFocusNameCopyWith<_CardFieldFocusName> get copyWith => __$CardFieldFocusNameCopyWithImpl<_CardFieldFocusName>(this, _$identity); + +@override +Map toJson() { + return _$CardFieldFocusNameToJson(this, ); } -abstract class _CardFieldFocusName implements CardFieldFocusName { - factory _CardFieldFocusName({final CardFieldName? focusedField}) = - _$CardFieldFocusNameImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardFieldFocusName&&(identical(other.focusedField, focusedField) || other.focusedField == focusedField)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,focusedField); + +@override +String toString() { + return 'CardFieldFocusName(focusedField: $focusedField)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardFieldFocusNameCopyWith<$Res> implements $CardFieldFocusNameCopyWith<$Res> { + factory _$CardFieldFocusNameCopyWith(_CardFieldFocusName value, $Res Function(_CardFieldFocusName) _then) = __$CardFieldFocusNameCopyWithImpl; +@override @useResult +$Res call({ + CardFieldName? focusedField +}); + + + - factory _CardFieldFocusName.fromJson(Map json) = - _$CardFieldFocusNameImpl.fromJson; +} +/// @nodoc +class __$CardFieldFocusNameCopyWithImpl<$Res> + implements _$CardFieldFocusNameCopyWith<$Res> { + __$CardFieldFocusNameCopyWithImpl(this._self, this._then); + + final _CardFieldFocusName _self; + final $Res Function(_CardFieldFocusName) _then; + +/// Create a copy of CardFieldFocusName +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? focusedField = freezed,}) { + return _then(_CardFieldFocusName( +focusedField: freezed == focusedField ? _self.focusedField : focusedField // ignore: cast_nullable_to_non_nullable +as CardFieldName?, + )); +} - @override - CardFieldName? get focusedField; - /// Create a copy of CardFieldFocusName - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardFieldFocusNameImplCopyWith<_$CardFieldFocusNameImpl> get copyWith => - throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/card_field_input.g.dart b/packages/stripe_platform_interface/lib/src/models/card_field_input.g.dart index bafba9821..55e15f4a0 100644 --- a/packages/stripe_platform_interface/lib/src/models/card_field_input.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/card_field_input.g.dart @@ -6,120 +6,122 @@ part of 'card_field_input.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CardStyleConstructorImpl _$$CardStyleConstructorImplFromJson( - Map json) => - _$CardStyleConstructorImpl( - borderWidth: (json['borderWidth'] as num?)?.toInt(), - backgroundColor: ColorKey.fromJson(json['backgroundColor']), - borderColor: ColorKey.fromJson(json['borderColor']), - borderRadius: (json['borderRadius'] as num?)?.toInt(), - cursorColor: ColorKey.fromJson(json['cursorColor']), - textColor: ColorKey.fromJson(json['textColor']), - fontSize: (json['fontSize'] as num?)?.toInt(), - fontFamily: json['fontFamily'] as String?, - textErrorColor: ColorKey.fromJson(json['textErrorColor']), - placeholderColor: ColorKey.fromJson(json['placeholderColor']), - ); +_CardStyleConstructor _$CardStyleConstructorFromJson( + Map json, +) => _CardStyleConstructor( + borderWidth: (json['borderWidth'] as num?)?.toInt(), + backgroundColor: ColorKey.fromJson(json['backgroundColor']), + borderColor: ColorKey.fromJson(json['borderColor']), + borderRadius: (json['borderRadius'] as num?)?.toInt(), + cursorColor: ColorKey.fromJson(json['cursorColor']), + textColor: ColorKey.fromJson(json['textColor']), + fontSize: (json['fontSize'] as num?)?.toInt(), + fontFamily: json['fontFamily'] as String?, + textErrorColor: ColorKey.fromJson(json['textErrorColor']), + placeholderColor: ColorKey.fromJson(json['placeholderColor']), +); -Map _$$CardStyleConstructorImplToJson( - _$CardStyleConstructorImpl instance) => - { - 'borderWidth': instance.borderWidth, - 'backgroundColor': ColorKey.toJson(instance.backgroundColor), - 'borderColor': ColorKey.toJson(instance.borderColor), - 'borderRadius': instance.borderRadius, - 'cursorColor': ColorKey.toJson(instance.cursorColor), - 'textColor': ColorKey.toJson(instance.textColor), - 'fontSize': instance.fontSize, - 'fontFamily': instance.fontFamily, - 'textErrorColor': ColorKey.toJson(instance.textErrorColor), - 'placeholderColor': ColorKey.toJson(instance.placeholderColor), - }; +Map _$CardStyleConstructorToJson( + _CardStyleConstructor instance, +) => { + 'borderWidth': instance.borderWidth, + 'backgroundColor': ColorKey.toJson(instance.backgroundColor), + 'borderColor': ColorKey.toJson(instance.borderColor), + 'borderRadius': instance.borderRadius, + 'cursorColor': ColorKey.toJson(instance.cursorColor), + 'textColor': ColorKey.toJson(instance.textColor), + 'fontSize': instance.fontSize, + 'fontFamily': instance.fontFamily, + 'textErrorColor': ColorKey.toJson(instance.textErrorColor), + 'placeholderColor': ColorKey.toJson(instance.placeholderColor), +}; -_$CardFormStyleConstructorImpl _$$CardFormStyleConstructorImplFromJson( - Map json) => - _$CardFormStyleConstructorImpl( - backgroundColor: ColorKey.fromJson(json['backgroundColor']), - borderWidth: (json['borderWidth'] as num?)?.toInt(), - borderColor: ColorKey.fromJson(json['borderColor']), - borderRadius: (json['borderRadius'] as num?)?.toInt(), - cursorColor: ColorKey.fromJson(json['cursorColor']), - textColor: ColorKey.fromJson(json['textColor']), - fontSize: (json['fontSize'] as num?)?.toInt(), - textErrorColor: ColorKey.fromJson(json['textErrorColor']), - placeholderColor: ColorKey.fromJson(json['placeholderColor']), - ); +_CardFormStyleConstructor _$CardFormStyleConstructorFromJson( + Map json, +) => _CardFormStyleConstructor( + backgroundColor: ColorKey.fromJson(json['backgroundColor']), + borderWidth: (json['borderWidth'] as num?)?.toInt(), + borderColor: ColorKey.fromJson(json['borderColor']), + borderRadius: (json['borderRadius'] as num?)?.toInt(), + cursorColor: ColorKey.fromJson(json['cursorColor']), + textColor: ColorKey.fromJson(json['textColor']), + fontSize: (json['fontSize'] as num?)?.toInt(), + textErrorColor: ColorKey.fromJson(json['textErrorColor']), + placeholderColor: ColorKey.fromJson(json['placeholderColor']), +); -Map _$$CardFormStyleConstructorImplToJson( - _$CardFormStyleConstructorImpl instance) => - { - 'backgroundColor': ColorKey.toJson(instance.backgroundColor), - 'borderWidth': instance.borderWidth, - 'borderColor': ColorKey.toJson(instance.borderColor), - 'borderRadius': instance.borderRadius, - 'cursorColor': ColorKey.toJson(instance.cursorColor), - 'textColor': ColorKey.toJson(instance.textColor), - 'fontSize': instance.fontSize, - 'textErrorColor': ColorKey.toJson(instance.textErrorColor), - 'placeholderColor': ColorKey.toJson(instance.placeholderColor), - }; +Map _$CardFormStyleConstructorToJson( + _CardFormStyleConstructor instance, +) => { + 'backgroundColor': ColorKey.toJson(instance.backgroundColor), + 'borderWidth': instance.borderWidth, + 'borderColor': ColorKey.toJson(instance.borderColor), + 'borderRadius': instance.borderRadius, + 'cursorColor': ColorKey.toJson(instance.cursorColor), + 'textColor': ColorKey.toJson(instance.textColor), + 'fontSize': instance.fontSize, + 'textErrorColor': ColorKey.toJson(instance.textErrorColor), + 'placeholderColor': ColorKey.toJson(instance.placeholderColor), +}; -_$CardPlaceholderConstructorImpl _$$CardPlaceholderConstructorImplFromJson( - Map json) => - _$CardPlaceholderConstructorImpl( - number: json['number'] as String?, - expiration: json['expiration'] as String?, - cvc: json['cvc'] as String?, - postalCode: json['postalCode'] as String?, - ); +_CardPlaceholderConstructor _$CardPlaceholderConstructorFromJson( + Map json, +) => _CardPlaceholderConstructor( + number: json['number'] as String?, + expiration: json['expiration'] as String?, + cvc: json['cvc'] as String?, + postalCode: json['postalCode'] as String?, +); -Map _$$CardPlaceholderConstructorImplToJson( - _$CardPlaceholderConstructorImpl instance) => - { - 'number': instance.number, - 'expiration': instance.expiration, - 'cvc': instance.cvc, - 'postalCode': instance.postalCode, - }; +Map _$CardPlaceholderConstructorToJson( + _CardPlaceholderConstructor instance, +) => { + 'number': instance.number, + 'expiration': instance.expiration, + 'cvc': instance.cvc, + 'postalCode': instance.postalCode, +}; -_$CardFieldInputDetailsImpl _$$CardFieldInputDetailsImplFromJson( - Map json) => - _$CardFieldInputDetailsImpl( - complete: json['complete'] as bool, - last4: json['last4'] as String?, - expiryMonth: (json['expiryMonth'] as num?)?.toInt(), - expiryYear: (json['expiryYear'] as num?)?.toInt(), - postalCode: json['postalCode'] as String?, - brand: json['brand'] as String?, - number: json['number'] as String?, - cvc: json['cvc'] as String?, - validExpiryDate: $enumDecodeNullable( - _$CardValidationStateEnumMap, json['validExpiryDate']) ?? - CardValidationState.Unknown, - validCVC: - $enumDecodeNullable(_$CardValidationStateEnumMap, json['validCVC']) ?? - CardValidationState.Unknown, - validNumber: $enumDecodeNullable( - _$CardValidationStateEnumMap, json['validNumber']) ?? - CardValidationState.Unknown, - ); +_CardFieldInputDetails _$CardFieldInputDetailsFromJson( + Map json, +) => _CardFieldInputDetails( + complete: json['complete'] as bool, + last4: json['last4'] as String?, + expiryMonth: (json['expiryMonth'] as num?)?.toInt(), + expiryYear: (json['expiryYear'] as num?)?.toInt(), + postalCode: json['postalCode'] as String?, + brand: json['brand'] as String?, + number: json['number'] as String?, + cvc: json['cvc'] as String?, + validExpiryDate: + $enumDecodeNullable( + _$CardValidationStateEnumMap, + json['validExpiryDate'], + ) ?? + CardValidationState.Unknown, + validCVC: + $enumDecodeNullable(_$CardValidationStateEnumMap, json['validCVC']) ?? + CardValidationState.Unknown, + validNumber: + $enumDecodeNullable(_$CardValidationStateEnumMap, json['validNumber']) ?? + CardValidationState.Unknown, +); -Map _$$CardFieldInputDetailsImplToJson( - _$CardFieldInputDetailsImpl instance) => - { - 'complete': instance.complete, - 'last4': instance.last4, - 'expiryMonth': instance.expiryMonth, - 'expiryYear': instance.expiryYear, - 'postalCode': instance.postalCode, - 'brand': instance.brand, - 'number': instance.number, - 'cvc': instance.cvc, - 'validExpiryDate': - _$CardValidationStateEnumMap[instance.validExpiryDate]!, - 'validCVC': _$CardValidationStateEnumMap[instance.validCVC]!, - 'validNumber': _$CardValidationStateEnumMap[instance.validNumber]!, - }; +Map _$CardFieldInputDetailsToJson( + _CardFieldInputDetails instance, +) => { + 'complete': instance.complete, + 'last4': instance.last4, + 'expiryMonth': instance.expiryMonth, + 'expiryYear': instance.expiryYear, + 'postalCode': instance.postalCode, + 'brand': instance.brand, + 'number': instance.number, + 'cvc': instance.cvc, + 'validExpiryDate': _$CardValidationStateEnumMap[instance.validExpiryDate]!, + 'validCVC': _$CardValidationStateEnumMap[instance.validCVC]!, + 'validNumber': _$CardValidationStateEnumMap[instance.validNumber]!, +}; const _$CardValidationStateEnumMap = { CardValidationState.Unknown: 'Unknown', @@ -128,15 +130,15 @@ const _$CardValidationStateEnumMap = { CardValidationState.Incomplete: 'Incomplete', }; -_$CardFieldFocusNameImpl _$$CardFieldFocusNameImplFromJson( - Map json) => - _$CardFieldFocusNameImpl( - focusedField: - $enumDecodeNullable(_$CardFieldNameEnumMap, json['focusedField']), +_CardFieldFocusName _$CardFieldFocusNameFromJson(Map json) => + _CardFieldFocusName( + focusedField: $enumDecodeNullable( + _$CardFieldNameEnumMap, + json['focusedField'], + ), ); -Map _$$CardFieldFocusNameImplToJson( - _$CardFieldFocusNameImpl instance) => +Map _$CardFieldFocusNameToJson(_CardFieldFocusName instance) => { 'focusedField': _$CardFieldNameEnumMap[instance.focusedField], }; diff --git a/packages/stripe_platform_interface/lib/src/models/color.dart b/packages/stripe_platform_interface/lib/src/models/color.dart index 5479fceb6..563901d43 100644 --- a/packages/stripe_platform_interface/lib/src/models/color.dart +++ b/packages/stripe_platform_interface/lib/src/models/color.dart @@ -13,21 +13,17 @@ class ColorKey { return null; } - static Color? fromJson(value) { + static Color? fromJson(Object? value) { throw UnimplementedError(); } } extension ColorX on Color { String get colorHexString { - // ignore: deprecated_member_use - final red = (this.red * 255).toInt().toRadixString(16).padLeft(2, '0'); - // ignore: deprecated_member_use - final green = (this.green * 255).toInt().toRadixString(16).padLeft(2, '0'); - // ignore: deprecated_member_use - final blue = (this.blue * 255).toInt().toRadixString(16).padLeft(2, '0'); - // ignore: deprecated_member_use - final alpha = (this.alpha * 255).toInt().toRadixString(16).padLeft(2, '0'); + final red = (r * 255).toInt().toRadixString(16).padLeft(2, '0'); + final green = (g * 255).toInt().toRadixString(16).padLeft(2, '0'); + final blue = (b * 255).toInt().toRadixString(16).padLeft(2, '0'); + final alpha = (a * 255).toInt().toRadixString(16).padLeft(2, '0'); return '$alpha$red$green$blue'; } diff --git a/packages/stripe_platform_interface/lib/src/models/create_token_data.dart b/packages/stripe_platform_interface/lib/src/models/create_token_data.dart index 029e275b1..69d138b29 100644 --- a/packages/stripe_platform_interface/lib/src/models/create_token_data.dart +++ b/packages/stripe_platform_interface/lib/src/models/create_token_data.dart @@ -7,11 +7,10 @@ part 'create_token_data.g.dart'; //ignore_for_file: constant_identifier_names @freezed - /// parameters that are used to create a token. /// /// At this moment only card tokens are supported. -class CreateTokenParams with _$CreateTokenParams { +abstract class CreateTokenParams with _$CreateTokenParams { @JsonSerializable(explicitToJson: true) @Deprecated('Use [CreateTokenParams.card] instead') const factory CreateTokenParams({ @@ -26,9 +25,8 @@ class CreateTokenParams with _$CreateTokenParams { }) = _CreateTokenParamsLegacy; @JsonSerializable(explicitToJson: true) - const factory CreateTokenParams.card({ - required CardTokenParams params, - }) = _CreateTokenParamsCard; + const factory CreateTokenParams.card({required CardTokenParams params}) = + _CreateTokenParamsCard; @JsonSerializable(explicitToJson: true) const factory CreateTokenParams.bankAccount({ @@ -39,18 +37,16 @@ class CreateTokenParams with _$CreateTokenParams { /// /// See https://stripe.com/docs/api/tokens/create_pii @JsonSerializable(explicitToJson: true) - const factory CreateTokenParams.pii({ - required PIITokenParams params, - }) = _CreateTokenParamsPII; + const factory CreateTokenParams.pii({required PIITokenParams params}) = + _CreateTokenParamsPII; factory CreateTokenParams.fromJson(Map json) => _$CreateTokenParamsFromJson(json); } @freezed - /// parameters that are used to create a token for a card. -class CardTokenParams with _$CardTokenParams { +abstract class CardTokenParams with _$CardTokenParams { const factory CardTokenParams({ /// Type of token. @Default(TokenType.Card) TokenType type, @@ -70,9 +66,8 @@ class CardTokenParams with _$CardTokenParams { } @freezed - /// Parameters that are used to create a token for a personally identifiable information (PII). -class PIITokenParams with _$PIITokenParams { +abstract class PIITokenParams with _$PIITokenParams { const factory PIITokenParams({ /// Type of token. @Default(TokenType.Pii) TokenType type, @@ -86,9 +81,8 @@ class PIITokenParams with _$PIITokenParams { } @freezed - /// parameters needed to create a token for bank account -class BankAccountTokenParams with _$BankAccountTokenParams { +abstract class BankAccountTokenParams with _$BankAccountTokenParams { const factory BankAccountTokenParams({ /// Type of token. @Default(TokenType.BankAccount) TokenType type, @@ -117,9 +111,8 @@ class BankAccountTokenParams with _$BankAccountTokenParams { } @freezed - /// Data that provides information about the token -class TokenData with _$TokenData { +abstract class TokenData with _$TokenData { const TokenData._(); const factory TokenData({ /// Unique identifier of the token @@ -149,9 +142,8 @@ class TokenData with _$TokenData { } @freezed - /// Card data associated with the token -class CardData with _$CardData { +abstract class CardData with _$CardData { @JsonSerializable(explicitToJson: true) const factory CardData({ /// Unique identifier @@ -190,9 +182,8 @@ class CardData with _$CardData { } @freezed - /// Bank account data related to the token -class BankAccount with _$BankAccount { +abstract class BankAccount with _$BankAccount { const factory BankAccount({ /// Unique id for this bank account required String id, @@ -261,7 +252,7 @@ enum BankAccountStatus { Verified, /// Status cannot be determined - Unknown + Unknown, } /// Type of token diff --git a/packages/stripe_platform_interface/lib/src/models/create_token_data.freezed.dart b/packages/stripe_platform_interface/lib/src/models/create_token_data.freezed.dart index 47059663c..f5842d4c6 100644 --- a/packages/stripe_platform_interface/lib/src/models/create_token_data.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/create_token_data.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,2811 +9,2412 @@ part of 'create_token_data.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -CreateTokenParams _$CreateTokenParamsFromJson(Map json) { - switch (json['runtimeType']) { - case 'default': - return _CreateTokenParamsLegacy.fromJson(json); - case 'card': - return _CreateTokenParamsCard.fromJson(json); - case 'bankAccount': - return _CreateTokenParamsBankAccount.fromJson(json); - case 'pii': - return _CreateTokenParamsPII.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'runtimeType', 'CreateTokenParams', - 'Invalid union type "${json['runtimeType']}"!'); - } +CreateTokenParams _$CreateTokenParamsFromJson( + Map json +) { + switch (json['runtimeType']) { + case 'default': + return _CreateTokenParamsLegacy.fromJson( + json + ); + case 'card': + return _CreateTokenParamsCard.fromJson( + json + ); + case 'bankAccount': + return _CreateTokenParamsBankAccount.fromJson( + json + ); + case 'pii': + return _CreateTokenParamsPII.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'runtimeType', + 'CreateTokenParams', + 'Invalid union type "${json['runtimeType']}"!' +); + } + } /// @nodoc mixin _$CreateTokenParams { - @optionalTypeArgs - TResult when( - TResult Function(TokenType type, String? name, Address? address) $default, { - required TResult Function(CardTokenParams params) card, - required TResult Function(BankAccountTokenParams params) bankAccount, - required TResult Function(PIITokenParams params) pii, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(TokenType type, String? name, Address? address)? - $default, { - TResult? Function(CardTokenParams params)? card, - TResult? Function(BankAccountTokenParams params)? bankAccount, - TResult? Function(PIITokenParams params)? pii, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen( - TResult Function(TokenType type, String? name, Address? address)? - $default, { - TResult Function(CardTokenParams params)? card, - TResult Function(BankAccountTokenParams params)? bankAccount, - TResult Function(PIITokenParams params)? pii, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map( - TResult Function(_CreateTokenParamsLegacy value) $default, { - required TResult Function(_CreateTokenParamsCard value) card, - required TResult Function(_CreateTokenParamsBankAccount value) bankAccount, - required TResult Function(_CreateTokenParamsPII value) pii, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CreateTokenParamsLegacy value)? $default, { - TResult? Function(_CreateTokenParamsCard value)? card, - TResult? Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult? Function(_CreateTokenParamsPII value)? pii, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CreateTokenParamsLegacy value)? $default, { - TResult Function(_CreateTokenParamsCard value)? card, - TResult Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult Function(_CreateTokenParamsPII value)? pii, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + /// Serializes this CreateTokenParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} + Map toJson(); -/// @nodoc -abstract class $CreateTokenParamsCopyWith<$Res> { - factory $CreateTokenParamsCopyWith( - CreateTokenParams value, $Res Function(CreateTokenParams) then) = - _$CreateTokenParamsCopyWithImpl<$Res, CreateTokenParams>; -} -/// @nodoc -class _$CreateTokenParamsCopyWithImpl<$Res, $Val extends CreateTokenParams> - implements $CreateTokenParamsCopyWith<$Res> { - _$CreateTokenParamsCopyWithImpl(this._value, this._then); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateTokenParams); +} - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. +@override +String toString() { + return 'CreateTokenParams()'; } -/// @nodoc -abstract class _$$CreateTokenParamsLegacyImplCopyWith<$Res> { - factory _$$CreateTokenParamsLegacyImplCopyWith( - _$CreateTokenParamsLegacyImpl value, - $Res Function(_$CreateTokenParamsLegacyImpl) then) = - __$$CreateTokenParamsLegacyImplCopyWithImpl<$Res>; - @useResult - $Res call({TokenType type, String? name, Address? address}); - $AddressCopyWith<$Res>? get address; } /// @nodoc -class __$$CreateTokenParamsLegacyImplCopyWithImpl<$Res> - extends _$CreateTokenParamsCopyWithImpl<$Res, _$CreateTokenParamsLegacyImpl> - implements _$$CreateTokenParamsLegacyImplCopyWith<$Res> { - __$$CreateTokenParamsLegacyImplCopyWithImpl( - _$CreateTokenParamsLegacyImpl _value, - $Res Function(_$CreateTokenParamsLegacyImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? name = freezed, - Object? address = freezed, - }) { - return _then(_$CreateTokenParamsLegacyImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - )); - } +class $CreateTokenParamsCopyWith<$Res> { +$CreateTokenParamsCopyWith(CreateTokenParams _, $Res Function(CreateTokenParams) __); +} + + +/// Adds pattern-matching-related methods to [CreateTokenParams]. +extension CreateTokenParamsPatterns on CreateTokenParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreateTokenParamsLegacy value)? $default,{TResult Function( _CreateTokenParamsCard value)? card,TResult Function( _CreateTokenParamsBankAccount value)? bankAccount,TResult Function( _CreateTokenParamsPII value)? pii,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreateTokenParamsLegacy() when $default != null: +return $default(_that);case _CreateTokenParamsCard() when card != null: +return card(_that);case _CreateTokenParamsBankAccount() when bankAccount != null: +return bankAccount(_that);case _CreateTokenParamsPII() when pii != null: +return pii(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreateTokenParamsLegacy value) $default,{required TResult Function( _CreateTokenParamsCard value) card,required TResult Function( _CreateTokenParamsBankAccount value) bankAccount,required TResult Function( _CreateTokenParamsPII value) pii,}){ +final _that = this; +switch (_that) { +case _CreateTokenParamsLegacy(): +return $default(_that);case _CreateTokenParamsCard(): +return card(_that);case _CreateTokenParamsBankAccount(): +return bankAccount(_that);case _CreateTokenParamsPII(): +return pii(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreateTokenParamsLegacy value)? $default,{TResult? Function( _CreateTokenParamsCard value)? card,TResult? Function( _CreateTokenParamsBankAccount value)? bankAccount,TResult? Function( _CreateTokenParamsPII value)? pii,}){ +final _that = this; +switch (_that) { +case _CreateTokenParamsLegacy() when $default != null: +return $default(_that);case _CreateTokenParamsCard() when card != null: +return card(_that);case _CreateTokenParamsBankAccount() when bankAccount != null: +return bankAccount(_that);case _CreateTokenParamsPII() when pii != null: +return pii(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( TokenType type, String? name, Address? address)? $default,{TResult Function( CardTokenParams params)? card,TResult Function( BankAccountTokenParams params)? bankAccount,TResult Function( PIITokenParams params)? pii,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreateTokenParamsLegacy() when $default != null: +return $default(_that.type,_that.name,_that.address);case _CreateTokenParamsCard() when card != null: +return card(_that.params);case _CreateTokenParamsBankAccount() when bankAccount != null: +return bankAccount(_that.params);case _CreateTokenParamsPII() when pii != null: +return pii(_that.params);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( TokenType type, String? name, Address? address) $default,{required TResult Function( CardTokenParams params) card,required TResult Function( BankAccountTokenParams params) bankAccount,required TResult Function( PIITokenParams params) pii,}) {final _that = this; +switch (_that) { +case _CreateTokenParamsLegacy(): +return $default(_that.type,_that.name,_that.address);case _CreateTokenParamsCard(): +return card(_that.params);case _CreateTokenParamsBankAccount(): +return bankAccount(_that.params);case _CreateTokenParamsPII(): +return pii(_that.params);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( TokenType type, String? name, Address? address)? $default,{TResult? Function( CardTokenParams params)? card,TResult? Function( BankAccountTokenParams params)? bankAccount,TResult? Function( PIITokenParams params)? pii,}) {final _that = this; +switch (_that) { +case _CreateTokenParamsLegacy() when $default != null: +return $default(_that.type,_that.name,_that.address);case _CreateTokenParamsCard() when card != null: +return card(_that.params);case _CreateTokenParamsBankAccount() when bankAccount != null: +return bankAccount(_that.params);case _CreateTokenParamsPII() when pii != null: +return pii(_that.params);case _: + return null; + +} +} - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $AddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value)); - }); - } } /// @nodoc @JsonSerializable(explicitToJson: true) @Deprecated('Use [CreateTokenParams.card] instead') -class _$CreateTokenParamsLegacyImpl implements _CreateTokenParamsLegacy { - const _$CreateTokenParamsLegacyImpl( - {this.type = TokenType.Card, - this.name, - this.address, - final String? $type}) - : $type = $type ?? 'default'; - - factory _$CreateTokenParamsLegacyImpl.fromJson(Map json) => - _$$CreateTokenParamsLegacyImplFromJson(json); - - /// Type of token. - @override - @JsonKey() - final TokenType type; - - /// Name of the card holder - @override - final String? name; - - /// Additional address details - @override - final Address? address; - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'CreateTokenParams(type: $type, name: $name, address: $address)'; - } +class _CreateTokenParamsLegacy implements CreateTokenParams { + const _CreateTokenParamsLegacy({this.type = TokenType.Card, this.name, this.address, final String? $type}): $type = $type ?? 'default'; + factory _CreateTokenParamsLegacy.fromJson(Map json) => _$CreateTokenParamsLegacyFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenParamsLegacyImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.name, name) || other.name == name) && - (identical(other.address, address) || other.address == address)); - } +/// Type of token. +@JsonKey() final TokenType type; +/// Name of the card holder + final String? name; +/// Additional address details + final Address? address; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, type, name, address); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenParamsLegacyImplCopyWith<_$CreateTokenParamsLegacyImpl> - get copyWith => __$$CreateTokenParamsLegacyImplCopyWithImpl< - _$CreateTokenParamsLegacyImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(TokenType type, String? name, Address? address) $default, { - required TResult Function(CardTokenParams params) card, - required TResult Function(BankAccountTokenParams params) bankAccount, - required TResult Function(PIITokenParams params) pii, - }) { - return $default(type, name, address); - } +@JsonKey(name: 'runtimeType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(TokenType type, String? name, Address? address)? - $default, { - TResult? Function(CardTokenParams params)? card, - TResult? Function(BankAccountTokenParams params)? bankAccount, - TResult? Function(PIITokenParams params)? pii, - }) { - return $default?.call(type, name, address); - } - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(TokenType type, String? name, Address? address)? - $default, { - TResult Function(CardTokenParams params)? card, - TResult Function(BankAccountTokenParams params)? bankAccount, - TResult Function(PIITokenParams params)? pii, - required TResult orElse(), - }) { - if ($default != null) { - return $default(type, name, address); - } - return orElse(); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenParamsLegacyCopyWith<_CreateTokenParamsLegacy> get copyWith => __$CreateTokenParamsLegacyCopyWithImpl<_CreateTokenParamsLegacy>(this, _$identity); - @override - @optionalTypeArgs - TResult map( - TResult Function(_CreateTokenParamsLegacy value) $default, { - required TResult Function(_CreateTokenParamsCard value) card, - required TResult Function(_CreateTokenParamsBankAccount value) bankAccount, - required TResult Function(_CreateTokenParamsPII value) pii, - }) { - return $default(this); - } +@override +Map toJson() { + return _$CreateTokenParamsLegacyToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CreateTokenParamsLegacy value)? $default, { - TResult? Function(_CreateTokenParamsCard value)? card, - TResult? Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult? Function(_CreateTokenParamsPII value)? pii, - }) { - return $default?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenParamsLegacy&&(identical(other.type, type) || other.type == type)&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)); +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CreateTokenParamsLegacy value)? $default, { - TResult Function(_CreateTokenParamsCard value)? card, - TResult Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult Function(_CreateTokenParamsPII value)? pii, - required TResult orElse(), - }) { - if ($default != null) { - return $default(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,name,address); - @override - Map toJson() { - return _$$CreateTokenParamsLegacyImplToJson( - this, - ); - } +@override +String toString() { + return 'CreateTokenParams(type: $type, name: $name, address: $address)'; } -abstract class _CreateTokenParamsLegacy implements CreateTokenParams { - const factory _CreateTokenParamsLegacy( - {final TokenType type, - final String? name, - final Address? address}) = _$CreateTokenParamsLegacyImpl; - factory _CreateTokenParamsLegacy.fromJson(Map json) = - _$CreateTokenParamsLegacyImpl.fromJson; +} - /// Type of token. - TokenType get type; +/// @nodoc +abstract mixin class _$CreateTokenParamsLegacyCopyWith<$Res> implements $CreateTokenParamsCopyWith<$Res> { + factory _$CreateTokenParamsLegacyCopyWith(_CreateTokenParamsLegacy value, $Res Function(_CreateTokenParamsLegacy) _then) = __$CreateTokenParamsLegacyCopyWithImpl; +@useResult +$Res call({ + TokenType type, String? name, Address? address +}); - /// Name of the card holder - String? get name; - /// Additional address details - Address? get address; +$AddressCopyWith<$Res>? get address; - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenParamsLegacyImplCopyWith<_$CreateTokenParamsLegacyImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$CreateTokenParamsCardImplCopyWith<$Res> { - factory _$$CreateTokenParamsCardImplCopyWith( - _$CreateTokenParamsCardImpl value, - $Res Function(_$CreateTokenParamsCardImpl) then) = - __$$CreateTokenParamsCardImplCopyWithImpl<$Res>; - @useResult - $Res call({CardTokenParams params}); +class __$CreateTokenParamsLegacyCopyWithImpl<$Res> + implements _$CreateTokenParamsLegacyCopyWith<$Res> { + __$CreateTokenParamsLegacyCopyWithImpl(this._self, this._then); + + final _CreateTokenParamsLegacy _self; + final $Res Function(_CreateTokenParamsLegacy) _then; - $CardTokenParamsCopyWith<$Res> get params; +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? type = null,Object? name = freezed,Object? address = freezed,}) { + return _then(_CreateTokenParamsLegacy( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?, + )); } -/// @nodoc -class __$$CreateTokenParamsCardImplCopyWithImpl<$Res> - extends _$CreateTokenParamsCopyWithImpl<$Res, _$CreateTokenParamsCardImpl> - implements _$$CreateTokenParamsCardImplCopyWith<$Res> { - __$$CreateTokenParamsCardImplCopyWithImpl(_$CreateTokenParamsCardImpl _value, - $Res Function(_$CreateTokenParamsCardImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? params = null, - }) { - return _then(_$CreateTokenParamsCardImpl( - params: null == params - ? _value.params - : params // ignore: cast_nullable_to_non_nullable - as CardTokenParams, - )); +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardTokenParamsCopyWith<$Res> get params { - return $CardTokenParamsCopyWith<$Res>(_value.params, (value) { - return _then(_value.copyWith(params: value)); - }); - } + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CreateTokenParamsCardImpl implements _CreateTokenParamsCard { - const _$CreateTokenParamsCardImpl({required this.params, final String? $type}) - : $type = $type ?? 'card'; - - factory _$CreateTokenParamsCardImpl.fromJson(Map json) => - _$$CreateTokenParamsCardImplFromJson(json); +class _CreateTokenParamsCard implements CreateTokenParams { + const _CreateTokenParamsCard({required this.params, final String? $type}): $type = $type ?? 'card'; + factory _CreateTokenParamsCard.fromJson(Map json) => _$CreateTokenParamsCardFromJson(json); - @override - final CardTokenParams params; + final CardTokenParams params; - @JsonKey(name: 'runtimeType') - final String $type; +@JsonKey(name: 'runtimeType') +final String $type; - @override - String toString() { - return 'CreateTokenParams.card(params: $params)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenParamsCardImpl && - (identical(other.params, params) || other.params == params)); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenParamsCardCopyWith<_CreateTokenParamsCard> get copyWith => __$CreateTokenParamsCardCopyWithImpl<_CreateTokenParamsCard>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, params); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenParamsCardImplCopyWith<_$CreateTokenParamsCardImpl> - get copyWith => __$$CreateTokenParamsCardImplCopyWithImpl< - _$CreateTokenParamsCardImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(TokenType type, String? name, Address? address) $default, { - required TResult Function(CardTokenParams params) card, - required TResult Function(BankAccountTokenParams params) bankAccount, - required TResult Function(PIITokenParams params) pii, - }) { - return card(params); - } - - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(TokenType type, String? name, Address? address)? - $default, { - TResult? Function(CardTokenParams params)? card, - TResult? Function(BankAccountTokenParams params)? bankAccount, - TResult? Function(PIITokenParams params)? pii, - }) { - return card?.call(params); - } +@override +Map toJson() { + return _$CreateTokenParamsCardToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(TokenType type, String? name, Address? address)? - $default, { - TResult Function(CardTokenParams params)? card, - TResult Function(BankAccountTokenParams params)? bankAccount, - TResult Function(PIITokenParams params)? pii, - required TResult orElse(), - }) { - if (card != null) { - return card(params); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenParamsCard&&(identical(other.params, params) || other.params == params)); +} - @override - @optionalTypeArgs - TResult map( - TResult Function(_CreateTokenParamsLegacy value) $default, { - required TResult Function(_CreateTokenParamsCard value) card, - required TResult Function(_CreateTokenParamsBankAccount value) bankAccount, - required TResult Function(_CreateTokenParamsPII value) pii, - }) { - return card(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,params); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CreateTokenParamsLegacy value)? $default, { - TResult? Function(_CreateTokenParamsCard value)? card, - TResult? Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult? Function(_CreateTokenParamsPII value)? pii, - }) { - return card?.call(this); - } +@override +String toString() { + return 'CreateTokenParams.card(params: $params)'; +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CreateTokenParamsLegacy value)? $default, { - TResult Function(_CreateTokenParamsCard value)? card, - TResult Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult Function(_CreateTokenParamsPII value)? pii, - required TResult orElse(), - }) { - if (card != null) { - return card(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$CreateTokenParamsCardImplToJson( - this, - ); - } } -abstract class _CreateTokenParamsCard implements CreateTokenParams { - const factory _CreateTokenParamsCard( - {required final CardTokenParams params}) = _$CreateTokenParamsCardImpl; +/// @nodoc +abstract mixin class _$CreateTokenParamsCardCopyWith<$Res> implements $CreateTokenParamsCopyWith<$Res> { + factory _$CreateTokenParamsCardCopyWith(_CreateTokenParamsCard value, $Res Function(_CreateTokenParamsCard) _then) = __$CreateTokenParamsCardCopyWithImpl; +@useResult +$Res call({ + CardTokenParams params +}); - factory _CreateTokenParamsCard.fromJson(Map json) = - _$CreateTokenParamsCardImpl.fromJson; - CardTokenParams get params; +$CardTokenParamsCopyWith<$Res> get params; - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenParamsCardImplCopyWith<_$CreateTokenParamsCardImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$CreateTokenParamsBankAccountImplCopyWith<$Res> { - factory _$$CreateTokenParamsBankAccountImplCopyWith( - _$CreateTokenParamsBankAccountImpl value, - $Res Function(_$CreateTokenParamsBankAccountImpl) then) = - __$$CreateTokenParamsBankAccountImplCopyWithImpl<$Res>; - @useResult - $Res call({BankAccountTokenParams params}); +class __$CreateTokenParamsCardCopyWithImpl<$Res> + implements _$CreateTokenParamsCardCopyWith<$Res> { + __$CreateTokenParamsCardCopyWithImpl(this._self, this._then); - $BankAccountTokenParamsCopyWith<$Res> get params; -} + final _CreateTokenParamsCard _self; + final $Res Function(_CreateTokenParamsCard) _then; -/// @nodoc -class __$$CreateTokenParamsBankAccountImplCopyWithImpl<$Res> - extends _$CreateTokenParamsCopyWithImpl<$Res, - _$CreateTokenParamsBankAccountImpl> - implements _$$CreateTokenParamsBankAccountImplCopyWith<$Res> { - __$$CreateTokenParamsBankAccountImplCopyWithImpl( - _$CreateTokenParamsBankAccountImpl _value, - $Res Function(_$CreateTokenParamsBankAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? params = null, - }) { - return _then(_$CreateTokenParamsBankAccountImpl( - params: null == params - ? _value.params - : params // ignore: cast_nullable_to_non_nullable - as BankAccountTokenParams, - )); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? params = null,}) { + return _then(_CreateTokenParamsCard( +params: null == params ? _self.params : params // ignore: cast_nullable_to_non_nullable +as CardTokenParams, + )); +} - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BankAccountTokenParamsCopyWith<$Res> get params { - return $BankAccountTokenParamsCopyWith<$Res>(_value.params, (value) { - return _then(_value.copyWith(params: value)); - }); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardTokenParamsCopyWith<$Res> get params { + + return $CardTokenParamsCopyWith<$Res>(_self.params, (value) { + return _then(_self.copyWith(params: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CreateTokenParamsBankAccountImpl - implements _CreateTokenParamsBankAccount { - const _$CreateTokenParamsBankAccountImpl( - {required this.params, final String? $type}) - : $type = $type ?? 'bankAccount'; +class _CreateTokenParamsBankAccount implements CreateTokenParams { + const _CreateTokenParamsBankAccount({required this.params, final String? $type}): $type = $type ?? 'bankAccount'; + factory _CreateTokenParamsBankAccount.fromJson(Map json) => _$CreateTokenParamsBankAccountFromJson(json); - factory _$CreateTokenParamsBankAccountImpl.fromJson( - Map json) => - _$$CreateTokenParamsBankAccountImplFromJson(json); + final BankAccountTokenParams params; - @override - final BankAccountTokenParams params; +@JsonKey(name: 'runtimeType') +final String $type; - @JsonKey(name: 'runtimeType') - final String $type; - @override - String toString() { - return 'CreateTokenParams.bankAccount(params: $params)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenParamsBankAccountImpl && - (identical(other.params, params) || other.params == params)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, params); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenParamsBankAccountImplCopyWith< - _$CreateTokenParamsBankAccountImpl> - get copyWith => __$$CreateTokenParamsBankAccountImplCopyWithImpl< - _$CreateTokenParamsBankAccountImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(TokenType type, String? name, Address? address) $default, { - required TResult Function(CardTokenParams params) card, - required TResult Function(BankAccountTokenParams params) bankAccount, - required TResult Function(PIITokenParams params) pii, - }) { - return bankAccount(params); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenParamsBankAccountCopyWith<_CreateTokenParamsBankAccount> get copyWith => __$CreateTokenParamsBankAccountCopyWithImpl<_CreateTokenParamsBankAccount>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(TokenType type, String? name, Address? address)? - $default, { - TResult? Function(CardTokenParams params)? card, - TResult? Function(BankAccountTokenParams params)? bankAccount, - TResult? Function(PIITokenParams params)? pii, - }) { - return bankAccount?.call(params); - } +@override +Map toJson() { + return _$CreateTokenParamsBankAccountToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(TokenType type, String? name, Address? address)? - $default, { - TResult Function(CardTokenParams params)? card, - TResult Function(BankAccountTokenParams params)? bankAccount, - TResult Function(PIITokenParams params)? pii, - required TResult orElse(), - }) { - if (bankAccount != null) { - return bankAccount(params); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenParamsBankAccount&&(identical(other.params, params) || other.params == params)); +} - @override - @optionalTypeArgs - TResult map( - TResult Function(_CreateTokenParamsLegacy value) $default, { - required TResult Function(_CreateTokenParamsCard value) card, - required TResult Function(_CreateTokenParamsBankAccount value) bankAccount, - required TResult Function(_CreateTokenParamsPII value) pii, - }) { - return bankAccount(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,params); - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CreateTokenParamsLegacy value)? $default, { - TResult? Function(_CreateTokenParamsCard value)? card, - TResult? Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult? Function(_CreateTokenParamsPII value)? pii, - }) { - return bankAccount?.call(this); - } +@override +String toString() { + return 'CreateTokenParams.bankAccount(params: $params)'; +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CreateTokenParamsLegacy value)? $default, { - TResult Function(_CreateTokenParamsCard value)? card, - TResult Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult Function(_CreateTokenParamsPII value)? pii, - required TResult orElse(), - }) { - if (bankAccount != null) { - return bankAccount(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$CreateTokenParamsBankAccountImplToJson( - this, - ); - } } -abstract class _CreateTokenParamsBankAccount implements CreateTokenParams { - const factory _CreateTokenParamsBankAccount( - {required final BankAccountTokenParams params}) = - _$CreateTokenParamsBankAccountImpl; +/// @nodoc +abstract mixin class _$CreateTokenParamsBankAccountCopyWith<$Res> implements $CreateTokenParamsCopyWith<$Res> { + factory _$CreateTokenParamsBankAccountCopyWith(_CreateTokenParamsBankAccount value, $Res Function(_CreateTokenParamsBankAccount) _then) = __$CreateTokenParamsBankAccountCopyWithImpl; +@useResult +$Res call({ + BankAccountTokenParams params +}); - factory _CreateTokenParamsBankAccount.fromJson(Map json) = - _$CreateTokenParamsBankAccountImpl.fromJson; - BankAccountTokenParams get params; +$BankAccountTokenParamsCopyWith<$Res> get params; - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenParamsBankAccountImplCopyWith< - _$CreateTokenParamsBankAccountImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$CreateTokenParamsPIIImplCopyWith<$Res> { - factory _$$CreateTokenParamsPIIImplCopyWith(_$CreateTokenParamsPIIImpl value, - $Res Function(_$CreateTokenParamsPIIImpl) then) = - __$$CreateTokenParamsPIIImplCopyWithImpl<$Res>; - @useResult - $Res call({PIITokenParams params}); +class __$CreateTokenParamsBankAccountCopyWithImpl<$Res> + implements _$CreateTokenParamsBankAccountCopyWith<$Res> { + __$CreateTokenParamsBankAccountCopyWithImpl(this._self, this._then); - $PIITokenParamsCopyWith<$Res> get params; -} + final _CreateTokenParamsBankAccount _self; + final $Res Function(_CreateTokenParamsBankAccount) _then; -/// @nodoc -class __$$CreateTokenParamsPIIImplCopyWithImpl<$Res> - extends _$CreateTokenParamsCopyWithImpl<$Res, _$CreateTokenParamsPIIImpl> - implements _$$CreateTokenParamsPIIImplCopyWith<$Res> { - __$$CreateTokenParamsPIIImplCopyWithImpl(_$CreateTokenParamsPIIImpl _value, - $Res Function(_$CreateTokenParamsPIIImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? params = null, - }) { - return _then(_$CreateTokenParamsPIIImpl( - params: null == params - ? _value.params - : params // ignore: cast_nullable_to_non_nullable - as PIITokenParams, - )); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? params = null,}) { + return _then(_CreateTokenParamsBankAccount( +params: null == params ? _self.params : params // ignore: cast_nullable_to_non_nullable +as BankAccountTokenParams, + )); +} - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PIITokenParamsCopyWith<$Res> get params { - return $PIITokenParamsCopyWith<$Res>(_value.params, (value) { - return _then(_value.copyWith(params: value)); - }); - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountTokenParamsCopyWith<$Res> get params { + + return $BankAccountTokenParamsCopyWith<$Res>(_self.params, (value) { + return _then(_self.copyWith(params: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CreateTokenParamsPIIImpl implements _CreateTokenParamsPII { - const _$CreateTokenParamsPIIImpl({required this.params, final String? $type}) - : $type = $type ?? 'pii'; +class _CreateTokenParamsPII implements CreateTokenParams { + const _CreateTokenParamsPII({required this.params, final String? $type}): $type = $type ?? 'pii'; + factory _CreateTokenParamsPII.fromJson(Map json) => _$CreateTokenParamsPIIFromJson(json); - factory _$CreateTokenParamsPIIImpl.fromJson(Map json) => - _$$CreateTokenParamsPIIImplFromJson(json); + final PIITokenParams params; - @override - final PIITokenParams params; +@JsonKey(name: 'runtimeType') +final String $type; - @JsonKey(name: 'runtimeType') - final String $type; - @override - String toString() { - return 'CreateTokenParams.pii(params: $params)'; - } +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateTokenParamsPIICopyWith<_CreateTokenParamsPII> get copyWith => __$CreateTokenParamsPIICopyWithImpl<_CreateTokenParamsPII>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateTokenParamsPIIImpl && - (identical(other.params, params) || other.params == params)); - } +@override +Map toJson() { + return _$CreateTokenParamsPIIToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, params); - - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateTokenParamsPIIImplCopyWith<_$CreateTokenParamsPIIImpl> - get copyWith => - __$$CreateTokenParamsPIIImplCopyWithImpl<_$CreateTokenParamsPIIImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when( - TResult Function(TokenType type, String? name, Address? address) $default, { - required TResult Function(CardTokenParams params) card, - required TResult Function(BankAccountTokenParams params) bankAccount, - required TResult Function(PIITokenParams params) pii, - }) { - return pii(params); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateTokenParamsPII&&(identical(other.params, params) || other.params == params)); +} - @override - @optionalTypeArgs - TResult? whenOrNull( - TResult? Function(TokenType type, String? name, Address? address)? - $default, { - TResult? Function(CardTokenParams params)? card, - TResult? Function(BankAccountTokenParams params)? bankAccount, - TResult? Function(PIITokenParams params)? pii, - }) { - return pii?.call(params); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,params); - @override - @optionalTypeArgs - TResult maybeWhen( - TResult Function(TokenType type, String? name, Address? address)? - $default, { - TResult Function(CardTokenParams params)? card, - TResult Function(BankAccountTokenParams params)? bankAccount, - TResult Function(PIITokenParams params)? pii, - required TResult orElse(), - }) { - if (pii != null) { - return pii(params); - } - return orElse(); - } +@override +String toString() { + return 'CreateTokenParams.pii(params: $params)'; +} - @override - @optionalTypeArgs - TResult map( - TResult Function(_CreateTokenParamsLegacy value) $default, { - required TResult Function(_CreateTokenParamsCard value) card, - required TResult Function(_CreateTokenParamsBankAccount value) bankAccount, - required TResult Function(_CreateTokenParamsPII value) pii, - }) { - return pii(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull( - TResult? Function(_CreateTokenParamsLegacy value)? $default, { - TResult? Function(_CreateTokenParamsCard value)? card, - TResult? Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult? Function(_CreateTokenParamsPII value)? pii, - }) { - return pii?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap( - TResult Function(_CreateTokenParamsLegacy value)? $default, { - TResult Function(_CreateTokenParamsCard value)? card, - TResult Function(_CreateTokenParamsBankAccount value)? bankAccount, - TResult Function(_CreateTokenParamsPII value)? pii, - required TResult orElse(), - }) { - if (pii != null) { - return pii(this); - } - return orElse(); - } +/// @nodoc +abstract mixin class _$CreateTokenParamsPIICopyWith<$Res> implements $CreateTokenParamsCopyWith<$Res> { + factory _$CreateTokenParamsPIICopyWith(_CreateTokenParamsPII value, $Res Function(_CreateTokenParamsPII) _then) = __$CreateTokenParamsPIICopyWithImpl; +@useResult +$Res call({ + PIITokenParams params +}); - @override - Map toJson() { - return _$$CreateTokenParamsPIIImplToJson( - this, - ); - } -} -abstract class _CreateTokenParamsPII implements CreateTokenParams { - const factory _CreateTokenParamsPII({required final PIITokenParams params}) = - _$CreateTokenParamsPIIImpl; +$PIITokenParamsCopyWith<$Res> get params; - factory _CreateTokenParamsPII.fromJson(Map json) = - _$CreateTokenParamsPIIImpl.fromJson; +} +/// @nodoc +class __$CreateTokenParamsPIICopyWithImpl<$Res> + implements _$CreateTokenParamsPIICopyWith<$Res> { + __$CreateTokenParamsPIICopyWithImpl(this._self, this._then); - PIITokenParams get params; + final _CreateTokenParamsPII _self; + final $Res Function(_CreateTokenParamsPII) _then; - /// Create a copy of CreateTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateTokenParamsPIIImplCopyWith<_$CreateTokenParamsPIIImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? params = null,}) { + return _then(_CreateTokenParamsPII( +params: null == params ? _self.params : params // ignore: cast_nullable_to_non_nullable +as PIITokenParams, + )); } -CardTokenParams _$CardTokenParamsFromJson(Map json) { - return _CardTokenParams.fromJson(json); +/// Create a copy of CreateTokenParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PIITokenParamsCopyWith<$Res> get params { + + return $PIITokenParamsCopyWith<$Res>(_self.params, (value) { + return _then(_self.copyWith(params: value)); + }); +} } + /// @nodoc mixin _$CardTokenParams { - /// Type of token. - TokenType get type => throw _privateConstructorUsedError; - /// Name of the card holder - String? get name => throw _privateConstructorUsedError; +/// Type of token. + TokenType get type;/// Name of the card holder + String? get name;/// Additional address details + Address? get address;/// The three letter ISO 4217 code for the currency. + String? get currency; +/// Create a copy of CardTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardTokenParamsCopyWith get copyWith => _$CardTokenParamsCopyWithImpl(this as CardTokenParams, _$identity); - /// Additional address details - Address? get address => throw _privateConstructorUsedError; + /// Serializes this CardTokenParams to a JSON map. + Map toJson(); - /// The three letter ISO 4217 code for the currency. - String? get currency => throw _privateConstructorUsedError; - /// Serializes this CardTokenParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardTokenParams&&(identical(other.type, type) || other.type == type)&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)&&(identical(other.currency, currency) || other.currency == currency)); +} - /// Create a copy of CardTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardTokenParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,name,address,currency); + +@override +String toString() { + return 'CardTokenParams(type: $type, name: $name, address: $address, currency: $currency)'; } -/// @nodoc -abstract class $CardTokenParamsCopyWith<$Res> { - factory $CardTokenParamsCopyWith( - CardTokenParams value, $Res Function(CardTokenParams) then) = - _$CardTokenParamsCopyWithImpl<$Res, CardTokenParams>; - @useResult - $Res call({TokenType type, String? name, Address? address, String? currency}); - $AddressCopyWith<$Res>? get address; } /// @nodoc -class _$CardTokenParamsCopyWithImpl<$Res, $Val extends CardTokenParams> - implements $CardTokenParamsCopyWith<$Res> { - _$CardTokenParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? name = freezed, - Object? address = freezed, - Object? currency = freezed, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +abstract mixin class $CardTokenParamsCopyWith<$Res> { + factory $CardTokenParamsCopyWith(CardTokenParams value, $Res Function(CardTokenParams) _then) = _$CardTokenParamsCopyWithImpl; +@useResult +$Res call({ + TokenType type, String? name, Address? address, String? currency +}); - /// Create a copy of CardTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $AddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } -} +$AddressCopyWith<$Res>? get address; + +} /// @nodoc -abstract class _$$CardTokenParamsImplCopyWith<$Res> +class _$CardTokenParamsCopyWithImpl<$Res> implements $CardTokenParamsCopyWith<$Res> { - factory _$$CardTokenParamsImplCopyWith(_$CardTokenParamsImpl value, - $Res Function(_$CardTokenParamsImpl) then) = - __$$CardTokenParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({TokenType type, String? name, Address? address, String? currency}); + _$CardTokenParamsCopyWithImpl(this._self, this._then); + + final CardTokenParams _self; + final $Res Function(CardTokenParams) _then; + +/// Create a copy of CardTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? name = freezed,Object? address = freezed,Object? currency = freezed,}) { + return _then(_self.copyWith( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of CardTokenParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [CardTokenParams]. +extension CardTokenParamsPatterns on CardTokenParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardTokenParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardTokenParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardTokenParams value) $default,){ +final _that = this; +switch (_that) { +case _CardTokenParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardTokenParams value)? $default,){ +final _that = this; +switch (_that) { +case _CardTokenParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( TokenType type, String? name, Address? address, String? currency)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardTokenParams() when $default != null: +return $default(_that.type,_that.name,_that.address,_that.currency);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( TokenType type, String? name, Address? address, String? currency) $default,) {final _that = this; +switch (_that) { +case _CardTokenParams(): +return $default(_that.type,_that.name,_that.address,_that.currency);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( TokenType type, String? name, Address? address, String? currency)? $default,) {final _that = this; +switch (_that) { +case _CardTokenParams() when $default != null: +return $default(_that.type,_that.name,_that.address,_that.currency);case _: + return null; - @override - $AddressCopyWith<$Res>? get address; +} } -/// @nodoc -class __$$CardTokenParamsImplCopyWithImpl<$Res> - extends _$CardTokenParamsCopyWithImpl<$Res, _$CardTokenParamsImpl> - implements _$$CardTokenParamsImplCopyWith<$Res> { - __$$CardTokenParamsImplCopyWithImpl( - _$CardTokenParamsImpl _value, $Res Function(_$CardTokenParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CardTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? name = freezed, - Object? address = freezed, - Object? currency = freezed, - }) { - return _then(_$CardTokenParamsImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$CardTokenParamsImpl implements _CardTokenParams { - const _$CardTokenParamsImpl( - {this.type = TokenType.Card, this.name, this.address, this.currency}); - factory _$CardTokenParamsImpl.fromJson(Map json) => - _$$CardTokenParamsImplFromJson(json); +class _CardTokenParams implements CardTokenParams { + const _CardTokenParams({this.type = TokenType.Card, this.name, this.address, this.currency}); + factory _CardTokenParams.fromJson(Map json) => _$CardTokenParamsFromJson(json); - /// Type of token. - @override - @JsonKey() - final TokenType type; +/// Type of token. +@override@JsonKey() final TokenType type; +/// Name of the card holder +@override final String? name; +/// Additional address details +@override final Address? address; +/// The three letter ISO 4217 code for the currency. +@override final String? currency; - /// Name of the card holder - @override - final String? name; +/// Create a copy of CardTokenParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardTokenParamsCopyWith<_CardTokenParams> get copyWith => __$CardTokenParamsCopyWithImpl<_CardTokenParams>(this, _$identity); - /// Additional address details - @override - final Address? address; - - /// The three letter ISO 4217 code for the currency. - @override - final String? currency; +@override +Map toJson() { + return _$CardTokenParamsToJson(this, ); +} - @override - String toString() { - return 'CardTokenParams(type: $type, name: $name, address: $address, currency: $currency)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardTokenParams&&(identical(other.type, type) || other.type == type)&&(identical(other.name, name) || other.name == name)&&(identical(other.address, address) || other.address == address)&&(identical(other.currency, currency) || other.currency == currency)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardTokenParamsImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.name, name) || other.name == name) && - (identical(other.address, address) || other.address == address) && - (identical(other.currency, currency) || - other.currency == currency)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,name,address,currency); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, type, name, address, currency); - - /// Create a copy of CardTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardTokenParamsImplCopyWith<_$CardTokenParamsImpl> get copyWith => - __$$CardTokenParamsImplCopyWithImpl<_$CardTokenParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CardTokenParamsImplToJson( - this, - ); - } +@override +String toString() { + return 'CardTokenParams(type: $type, name: $name, address: $address, currency: $currency)'; } -abstract class _CardTokenParams implements CardTokenParams { - const factory _CardTokenParams( - {final TokenType type, - final String? name, - final Address? address, - final String? currency}) = _$CardTokenParamsImpl; - factory _CardTokenParams.fromJson(Map json) = - _$CardTokenParamsImpl.fromJson; +} - /// Type of token. - @override - TokenType get type; +/// @nodoc +abstract mixin class _$CardTokenParamsCopyWith<$Res> implements $CardTokenParamsCopyWith<$Res> { + factory _$CardTokenParamsCopyWith(_CardTokenParams value, $Res Function(_CardTokenParams) _then) = __$CardTokenParamsCopyWithImpl; +@override @useResult +$Res call({ + TokenType type, String? name, Address? address, String? currency +}); - /// Name of the card holder - @override - String? get name; - /// Additional address details - @override - Address? get address; +@override $AddressCopyWith<$Res>? get address; - /// The three letter ISO 4217 code for the currency. - @override - String? get currency; +} +/// @nodoc +class __$CardTokenParamsCopyWithImpl<$Res> + implements _$CardTokenParamsCopyWith<$Res> { + __$CardTokenParamsCopyWithImpl(this._self, this._then); - /// Create a copy of CardTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardTokenParamsImplCopyWith<_$CardTokenParamsImpl> get copyWith => - throw _privateConstructorUsedError; + final _CardTokenParams _self; + final $Res Function(_CardTokenParams) _then; + +/// Create a copy of CardTokenParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? name = freezed,Object? address = freezed,Object? currency = freezed,}) { + return _then(_CardTokenParams( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?, + )); } -PIITokenParams _$PIITokenParamsFromJson(Map json) { - return _PIITokenParams.fromJson(json); +/// Create a copy of CardTokenParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); } +} + /// @nodoc mixin _$PIITokenParams { - /// Type of token. - TokenType get type => throw _privateConstructorUsedError; - /// The user's personal ID number - String get personalId => throw _privateConstructorUsedError; +/// Type of token. + TokenType get type;/// The user's personal ID number + String get personalId; +/// Create a copy of PIITokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PIITokenParamsCopyWith get copyWith => _$PIITokenParamsCopyWithImpl(this as PIITokenParams, _$identity); /// Serializes this PIITokenParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PIITokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PIITokenParamsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PIITokenParams&&(identical(other.type, type) || other.type == type)&&(identical(other.personalId, personalId) || other.personalId == personalId)); } -/// @nodoc -abstract class $PIITokenParamsCopyWith<$Res> { - factory $PIITokenParamsCopyWith( - PIITokenParams value, $Res Function(PIITokenParams) then) = - _$PIITokenParamsCopyWithImpl<$Res, PIITokenParams>; - @useResult - $Res call({TokenType type, String personalId}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,personalId); + +@override +String toString() { + return 'PIITokenParams(type: $type, personalId: $personalId)'; } -/// @nodoc -class _$PIITokenParamsCopyWithImpl<$Res, $Val extends PIITokenParams> - implements $PIITokenParamsCopyWith<$Res> { - _$PIITokenParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PIITokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? personalId = null, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - personalId: null == personalId - ? _value.personalId - : personalId // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$PIITokenParamsImplCopyWith<$Res> +abstract mixin class $PIITokenParamsCopyWith<$Res> { + factory $PIITokenParamsCopyWith(PIITokenParams value, $Res Function(PIITokenParams) _then) = _$PIITokenParamsCopyWithImpl; +@useResult +$Res call({ + TokenType type, String personalId +}); + + + + +} +/// @nodoc +class _$PIITokenParamsCopyWithImpl<$Res> implements $PIITokenParamsCopyWith<$Res> { - factory _$$PIITokenParamsImplCopyWith(_$PIITokenParamsImpl value, - $Res Function(_$PIITokenParamsImpl) then) = - __$$PIITokenParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({TokenType type, String personalId}); + _$PIITokenParamsCopyWithImpl(this._self, this._then); + + final PIITokenParams _self; + final $Res Function(PIITokenParams) _then; + +/// Create a copy of PIITokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? personalId = null,}) { + return _then(_self.copyWith( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,personalId: null == personalId ? _self.personalId : personalId // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PIITokenParams]. +extension PIITokenParamsPatterns on PIITokenParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PIITokenParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PIITokenParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PIITokenParams value) $default,){ +final _that = this; +switch (_that) { +case _PIITokenParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PIITokenParams value)? $default,){ +final _that = this; +switch (_that) { +case _PIITokenParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( TokenType type, String personalId)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PIITokenParams() when $default != null: +return $default(_that.type,_that.personalId);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( TokenType type, String personalId) $default,) {final _that = this; +switch (_that) { +case _PIITokenParams(): +return $default(_that.type,_that.personalId);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( TokenType type, String personalId)? $default,) {final _that = this; +switch (_that) { +case _PIITokenParams() when $default != null: +return $default(_that.type,_that.personalId);case _: + return null; + +} } -/// @nodoc -class __$$PIITokenParamsImplCopyWithImpl<$Res> - extends _$PIITokenParamsCopyWithImpl<$Res, _$PIITokenParamsImpl> - implements _$$PIITokenParamsImplCopyWith<$Res> { - __$$PIITokenParamsImplCopyWithImpl( - _$PIITokenParamsImpl _value, $Res Function(_$PIITokenParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of PIITokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? personalId = null, - }) { - return _then(_$PIITokenParamsImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - personalId: null == personalId - ? _value.personalId - : personalId // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable() -class _$PIITokenParamsImpl implements _PIITokenParams { - const _$PIITokenParamsImpl( - {this.type = TokenType.Pii, required this.personalId}); - factory _$PIITokenParamsImpl.fromJson(Map json) => - _$$PIITokenParamsImplFromJson(json); +class _PIITokenParams implements PIITokenParams { + const _PIITokenParams({this.type = TokenType.Pii, required this.personalId}); + factory _PIITokenParams.fromJson(Map json) => _$PIITokenParamsFromJson(json); - /// Type of token. - @override - @JsonKey() - final TokenType type; +/// Type of token. +@override@JsonKey() final TokenType type; +/// The user's personal ID number +@override final String personalId; - /// The user's personal ID number - @override - final String personalId; +/// Create a copy of PIITokenParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PIITokenParamsCopyWith<_PIITokenParams> get copyWith => __$PIITokenParamsCopyWithImpl<_PIITokenParams>(this, _$identity); - @override - String toString() { - return 'PIITokenParams(type: $type, personalId: $personalId)'; - } +@override +Map toJson() { + return _$PIITokenParamsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PIITokenParamsImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.personalId, personalId) || - other.personalId == personalId)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PIITokenParams&&(identical(other.type, type) || other.type == type)&&(identical(other.personalId, personalId) || other.personalId == personalId)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, type, personalId); - - /// Create a copy of PIITokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PIITokenParamsImplCopyWith<_$PIITokenParamsImpl> get copyWith => - __$$PIITokenParamsImplCopyWithImpl<_$PIITokenParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PIITokenParamsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,personalId); + +@override +String toString() { + return 'PIITokenParams(type: $type, personalId: $personalId)'; } -abstract class _PIITokenParams implements PIITokenParams { - const factory _PIITokenParams( - {final TokenType type, - required final String personalId}) = _$PIITokenParamsImpl; - factory _PIITokenParams.fromJson(Map json) = - _$PIITokenParamsImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$PIITokenParamsCopyWith<$Res> implements $PIITokenParamsCopyWith<$Res> { + factory _$PIITokenParamsCopyWith(_PIITokenParams value, $Res Function(_PIITokenParams) _then) = __$PIITokenParamsCopyWithImpl; +@override @useResult +$Res call({ + TokenType type, String personalId +}); + + - /// Type of token. - @override - TokenType get type; - /// The user's personal ID number - @override - String get personalId; +} +/// @nodoc +class __$PIITokenParamsCopyWithImpl<$Res> + implements _$PIITokenParamsCopyWith<$Res> { + __$PIITokenParamsCopyWithImpl(this._self, this._then); - /// Create a copy of PIITokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PIITokenParamsImplCopyWith<_$PIITokenParamsImpl> get copyWith => - throw _privateConstructorUsedError; + final _PIITokenParams _self; + final $Res Function(_PIITokenParams) _then; + +/// Create a copy of PIITokenParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? personalId = null,}) { + return _then(_PIITokenParams( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,personalId: null == personalId ? _self.personalId : personalId // ignore: cast_nullable_to_non_nullable +as String, + )); } -BankAccountTokenParams _$BankAccountTokenParamsFromJson( - Map json) { - return _BankAccountTokenParams.fromJson(json); + } + /// @nodoc mixin _$BankAccountTokenParams { - /// Type of token. - TokenType get type => throw _privateConstructorUsedError; - /// unique number of the account. - String get accountNumber => throw _privateConstructorUsedError; +/// Type of token. + TokenType get type;/// unique number of the account. + String get accountNumber;/// 2 letter code of the country where the account is located + String get country;/// The three letter ISO 4217 code for the currency. + String get currency;/// Full name of the account holder + String? get accountHolderName;/// Entity that is holder of the account. + BankAccountHolderType? get accountHolderType;/// The routing number of the bank account (e.g. needer for US accounts). + String? get routingNumber; +/// Create a copy of BankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BankAccountTokenParamsCopyWith get copyWith => _$BankAccountTokenParamsCopyWithImpl(this as BankAccountTokenParams, _$identity); - /// 2 letter code of the country where the account is located - String get country => throw _privateConstructorUsedError; + /// Serializes this BankAccountTokenParams to a JSON map. + Map toJson(); - /// The three letter ISO 4217 code for the currency. - String get currency => throw _privateConstructorUsedError; - /// Full name of the account holder - String? get accountHolderName => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BankAccountTokenParams&&(identical(other.type, type) || other.type == type)&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)); +} - /// Entity that is holder of the account. - BankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,accountNumber,country,currency,accountHolderName,accountHolderType,routingNumber); - /// The routing number of the bank account (e.g. needer for US accounts). - String? get routingNumber => throw _privateConstructorUsedError; +@override +String toString() { + return 'BankAccountTokenParams(type: $type, accountNumber: $accountNumber, country: $country, currency: $currency, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, routingNumber: $routingNumber)'; +} - /// Serializes this BankAccountTokenParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of BankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BankAccountTokenParamsCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $BankAccountTokenParamsCopyWith<$Res> { - factory $BankAccountTokenParamsCopyWith(BankAccountTokenParams value, - $Res Function(BankAccountTokenParams) then) = - _$BankAccountTokenParamsCopyWithImpl<$Res, BankAccountTokenParams>; - @useResult - $Res call( - {TokenType type, - String accountNumber, - String country, - String currency, - String? accountHolderName, - BankAccountHolderType? accountHolderType, - String? routingNumber}); -} +abstract mixin class $BankAccountTokenParamsCopyWith<$Res> { + factory $BankAccountTokenParamsCopyWith(BankAccountTokenParams value, $Res Function(BankAccountTokenParams) _then) = _$BankAccountTokenParamsCopyWithImpl; +@useResult +$Res call({ + TokenType type, String accountNumber, String country, String currency, String? accountHolderName, BankAccountHolderType? accountHolderType, String? routingNumber +}); + + -/// @nodoc -class _$BankAccountTokenParamsCopyWithImpl<$Res, - $Val extends BankAccountTokenParams> - implements $BankAccountTokenParamsCopyWith<$Res> { - _$BankAccountTokenParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? accountNumber = null, - Object? country = null, - Object? currency = null, - Object? accountHolderName = freezed, - Object? accountHolderType = freezed, - Object? routingNumber = freezed, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - accountNumber: null == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String, - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} +} /// @nodoc -abstract class _$$BankAccountTokenParamsImplCopyWith<$Res> +class _$BankAccountTokenParamsCopyWithImpl<$Res> implements $BankAccountTokenParamsCopyWith<$Res> { - factory _$$BankAccountTokenParamsImplCopyWith( - _$BankAccountTokenParamsImpl value, - $Res Function(_$BankAccountTokenParamsImpl) then) = - __$$BankAccountTokenParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {TokenType type, - String accountNumber, - String country, - String currency, - String? accountHolderName, - BankAccountHolderType? accountHolderType, - String? routingNumber}); + _$BankAccountTokenParamsCopyWithImpl(this._self, this._then); + + final BankAccountTokenParams _self; + final $Res Function(BankAccountTokenParams) _then; + +/// Create a copy of BankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? accountNumber = null,Object? country = null,Object? currency = null,Object? accountHolderName = freezed,Object? accountHolderType = freezed,Object? routingNumber = freezed,}) { + return _then(_self.copyWith( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,accountNumber: null == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BankAccountTokenParams]. +extension BankAccountTokenParamsPatterns on BankAccountTokenParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BankAccountTokenParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BankAccountTokenParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BankAccountTokenParams value) $default,){ +final _that = this; +switch (_that) { +case _BankAccountTokenParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BankAccountTokenParams value)? $default,){ +final _that = this; +switch (_that) { +case _BankAccountTokenParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( TokenType type, String accountNumber, String country, String currency, String? accountHolderName, BankAccountHolderType? accountHolderType, String? routingNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BankAccountTokenParams() when $default != null: +return $default(_that.type,_that.accountNumber,_that.country,_that.currency,_that.accountHolderName,_that.accountHolderType,_that.routingNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( TokenType type, String accountNumber, String country, String currency, String? accountHolderName, BankAccountHolderType? accountHolderType, String? routingNumber) $default,) {final _that = this; +switch (_that) { +case _BankAccountTokenParams(): +return $default(_that.type,_that.accountNumber,_that.country,_that.currency,_that.accountHolderName,_that.accountHolderType,_that.routingNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( TokenType type, String accountNumber, String country, String currency, String? accountHolderName, BankAccountHolderType? accountHolderType, String? routingNumber)? $default,) {final _that = this; +switch (_that) { +case _BankAccountTokenParams() when $default != null: +return $default(_that.type,_that.accountNumber,_that.country,_that.currency,_that.accountHolderName,_that.accountHolderType,_that.routingNumber);case _: + return null; + +} } -/// @nodoc -class __$$BankAccountTokenParamsImplCopyWithImpl<$Res> - extends _$BankAccountTokenParamsCopyWithImpl<$Res, - _$BankAccountTokenParamsImpl> - implements _$$BankAccountTokenParamsImplCopyWith<$Res> { - __$$BankAccountTokenParamsImplCopyWithImpl( - _$BankAccountTokenParamsImpl _value, - $Res Function(_$BankAccountTokenParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of BankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? type = null, - Object? accountNumber = null, - Object? country = null, - Object? currency = null, - Object? accountHolderName = freezed, - Object? accountHolderType = freezed, - Object? routingNumber = freezed, - }) { - return _then(_$BankAccountTokenParamsImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - accountNumber: null == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String, - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$BankAccountTokenParamsImpl implements _BankAccountTokenParams { - const _$BankAccountTokenParamsImpl( - {this.type = TokenType.BankAccount, - required this.accountNumber, - required this.country, - required this.currency, - this.accountHolderName, - this.accountHolderType, - this.routingNumber}); - - factory _$BankAccountTokenParamsImpl.fromJson(Map json) => - _$$BankAccountTokenParamsImplFromJson(json); - - /// Type of token. - @override - @JsonKey() - final TokenType type; - - /// unique number of the account. - @override - final String accountNumber; - - /// 2 letter code of the country where the account is located - @override - final String country; - - /// The three letter ISO 4217 code for the currency. - @override - final String currency; - - /// Full name of the account holder - @override - final String? accountHolderName; - - /// Entity that is holder of the account. - @override - final BankAccountHolderType? accountHolderType; - - /// The routing number of the bank account (e.g. needer for US accounts). - @override - final String? routingNumber; - - @override - String toString() { - return 'BankAccountTokenParams(type: $type, accountNumber: $accountNumber, country: $country, currency: $currency, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, routingNumber: $routingNumber)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BankAccountTokenParamsImpl && - (identical(other.type, type) || other.type == type) && - (identical(other.accountNumber, accountNumber) || - other.accountNumber == accountNumber) && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.accountHolderName, accountHolderName) || - other.accountHolderName == accountHolderName) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber)); - } +class _BankAccountTokenParams implements BankAccountTokenParams { + const _BankAccountTokenParams({this.type = TokenType.BankAccount, required this.accountNumber, required this.country, required this.currency, this.accountHolderName, this.accountHolderType, this.routingNumber}); + factory _BankAccountTokenParams.fromJson(Map json) => _$BankAccountTokenParamsFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, type, accountNumber, country, - currency, accountHolderName, accountHolderType, routingNumber); - - /// Create a copy of BankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BankAccountTokenParamsImplCopyWith<_$BankAccountTokenParamsImpl> - get copyWith => __$$BankAccountTokenParamsImplCopyWithImpl< - _$BankAccountTokenParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$BankAccountTokenParamsImplToJson( - this, - ); - } +/// Type of token. +@override@JsonKey() final TokenType type; +/// unique number of the account. +@override final String accountNumber; +/// 2 letter code of the country where the account is located +@override final String country; +/// The three letter ISO 4217 code for the currency. +@override final String currency; +/// Full name of the account holder +@override final String? accountHolderName; +/// Entity that is holder of the account. +@override final BankAccountHolderType? accountHolderType; +/// The routing number of the bank account (e.g. needer for US accounts). +@override final String? routingNumber; + +/// Create a copy of BankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BankAccountTokenParamsCopyWith<_BankAccountTokenParams> get copyWith => __$BankAccountTokenParamsCopyWithImpl<_BankAccountTokenParams>(this, _$identity); + +@override +Map toJson() { + return _$BankAccountTokenParamsToJson(this, ); } -abstract class _BankAccountTokenParams implements BankAccountTokenParams { - const factory _BankAccountTokenParams( - {final TokenType type, - required final String accountNumber, - required final String country, - required final String currency, - final String? accountHolderName, - final BankAccountHolderType? accountHolderType, - final String? routingNumber}) = _$BankAccountTokenParamsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BankAccountTokenParams&&(identical(other.type, type) || other.type == type)&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)); +} - factory _BankAccountTokenParams.fromJson(Map json) = - _$BankAccountTokenParamsImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,type,accountNumber,country,currency,accountHolderName,accountHolderType,routingNumber); - /// Type of token. - @override - TokenType get type; +@override +String toString() { + return 'BankAccountTokenParams(type: $type, accountNumber: $accountNumber, country: $country, currency: $currency, accountHolderName: $accountHolderName, accountHolderType: $accountHolderType, routingNumber: $routingNumber)'; +} + + +} - /// unique number of the account. - @override - String get accountNumber; +/// @nodoc +abstract mixin class _$BankAccountTokenParamsCopyWith<$Res> implements $BankAccountTokenParamsCopyWith<$Res> { + factory _$BankAccountTokenParamsCopyWith(_BankAccountTokenParams value, $Res Function(_BankAccountTokenParams) _then) = __$BankAccountTokenParamsCopyWithImpl; +@override @useResult +$Res call({ + TokenType type, String accountNumber, String country, String currency, String? accountHolderName, BankAccountHolderType? accountHolderType, String? routingNumber +}); - /// 2 letter code of the country where the account is located - @override - String get country; - /// The three letter ISO 4217 code for the currency. - @override - String get currency; - /// Full name of the account holder - @override - String? get accountHolderName; - /// Entity that is holder of the account. - @override - BankAccountHolderType? get accountHolderType; +} +/// @nodoc +class __$BankAccountTokenParamsCopyWithImpl<$Res> + implements _$BankAccountTokenParamsCopyWith<$Res> { + __$BankAccountTokenParamsCopyWithImpl(this._self, this._then); - /// The routing number of the bank account (e.g. needer for US accounts). - @override - String? get routingNumber; + final _BankAccountTokenParams _self; + final $Res Function(_BankAccountTokenParams) _then; - /// Create a copy of BankAccountTokenParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BankAccountTokenParamsImplCopyWith<_$BankAccountTokenParamsImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of BankAccountTokenParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? accountNumber = null,Object? country = null,Object? currency = null,Object? accountHolderName = freezed,Object? accountHolderType = freezed,Object? routingNumber = freezed,}) { + return _then(_BankAccountTokenParams( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,accountNumber: null == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); } -TokenData _$TokenDataFromJson(Map json) { - return _TokenData.fromJson(json); + } + /// @nodoc mixin _$TokenData { - /// Unique identifier of the token - String get id => throw _privateConstructorUsedError; - /// Timestamp when token was created - @JsonKey(name: 'created') - String get created => throw _privateConstructorUsedError; +/// Unique identifier of the token + String get id;/// Timestamp when token was created +@JsonKey(name: 'created') String get created;/// Type of the token + TokenType get type;/// Whether or not the object exists in livemode + bool get livemode;/// Bank account data + BankAccount? get bankAccount;/// Card data + CardData? get card; +/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$TokenDataCopyWith get copyWith => _$TokenDataCopyWithImpl(this as TokenData, _$identity); - /// Type of the token - TokenType get type => throw _privateConstructorUsedError; + /// Serializes this TokenData to a JSON map. + Map toJson(); - /// Whether or not the object exists in livemode - bool get livemode => throw _privateConstructorUsedError; - /// Bank account data - BankAccount? get bankAccount => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is TokenData&&(identical(other.id, id) || other.id == id)&&(identical(other.created, created) || other.created == created)&&(identical(other.type, type) || other.type == type)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.bankAccount, bankAccount) || other.bankAccount == bankAccount)&&(identical(other.card, card) || other.card == card)); +} - /// Card data - CardData? get card => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,created,type,livemode,bankAccount,card); - /// Serializes this TokenData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $TokenDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'TokenData(id: $id, created: $created, type: $type, livemode: $livemode, bankAccount: $bankAccount, card: $card)'; } -/// @nodoc -abstract class $TokenDataCopyWith<$Res> { - factory $TokenDataCopyWith(TokenData value, $Res Function(TokenData) then) = - _$TokenDataCopyWithImpl<$Res, TokenData>; - @useResult - $Res call( - {String id, - @JsonKey(name: 'created') String created, - TokenType type, - bool livemode, - BankAccount? bankAccount, - CardData? card}); - - $BankAccountCopyWith<$Res>? get bankAccount; - $CardDataCopyWith<$Res>? get card; + } /// @nodoc -class _$TokenDataCopyWithImpl<$Res, $Val extends TokenData> - implements $TokenDataCopyWith<$Res> { - _$TokenDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? created = null, - Object? type = null, - Object? livemode = null, - Object? bankAccount = freezed, - Object? card = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - created: null == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as String, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - bankAccount: freezed == bankAccount - ? _value.bankAccount - : bankAccount // ignore: cast_nullable_to_non_nullable - as BankAccount?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardData?, - ) as $Val); - } +abstract mixin class $TokenDataCopyWith<$Res> { + factory $TokenDataCopyWith(TokenData value, $Res Function(TokenData) _then) = _$TokenDataCopyWithImpl; +@useResult +$Res call({ + String id,@JsonKey(name: 'created') String created, TokenType type, bool livemode, BankAccount? bankAccount, CardData? card +}); - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BankAccountCopyWith<$Res>? get bankAccount { - if (_value.bankAccount == null) { - return null; - } - - return $BankAccountCopyWith<$Res>(_value.bankAccount!, (value) { - return _then(_value.copyWith(bankAccount: value) as $Val); - }); - } - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardDataCopyWith<$Res>? get card { - if (_value.card == null) { - return null; - } - - return $CardDataCopyWith<$Res>(_value.card!, (value) { - return _then(_value.copyWith(card: value) as $Val); - }); - } -} +$BankAccountCopyWith<$Res>? get bankAccount;$CardDataCopyWith<$Res>? get card; +} /// @nodoc -abstract class _$$TokenDataImplCopyWith<$Res> +class _$TokenDataCopyWithImpl<$Res> implements $TokenDataCopyWith<$Res> { - factory _$$TokenDataImplCopyWith( - _$TokenDataImpl value, $Res Function(_$TokenDataImpl) then) = - __$$TokenDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - @JsonKey(name: 'created') String created, - TokenType type, - bool livemode, - BankAccount? bankAccount, - CardData? card}); - - @override - $BankAccountCopyWith<$Res>? get bankAccount; - @override - $CardDataCopyWith<$Res>? get card; + _$TokenDataCopyWithImpl(this._self, this._then); + + final TokenData _self; + final $Res Function(TokenData) _then; + +/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? created = null,Object? type = null,Object? livemode = null,Object? bankAccount = freezed,Object? card = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,created: null == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,bankAccount: freezed == bankAccount ? _self.bankAccount : bankAccount // ignore: cast_nullable_to_non_nullable +as BankAccount?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardData?, + )); +} +/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountCopyWith<$Res>? get bankAccount { + if (_self.bankAccount == null) { + return null; + } + + return $BankAccountCopyWith<$Res>(_self.bankAccount!, (value) { + return _then(_self.copyWith(bankAccount: value)); + }); +}/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardDataCopyWith<$Res>? get card { + if (_self.card == null) { + return null; + } + + return $CardDataCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [TokenData]. +extension TokenDataPatterns on TokenData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _TokenData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _TokenData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _TokenData value) $default,){ +final _that = this; +switch (_that) { +case _TokenData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _TokenData value)? $default,){ +final _that = this; +switch (_that) { +case _TokenData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, @JsonKey(name: 'created') String created, TokenType type, bool livemode, BankAccount? bankAccount, CardData? card)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _TokenData() when $default != null: +return $default(_that.id,_that.created,_that.type,_that.livemode,_that.bankAccount,_that.card);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, @JsonKey(name: 'created') String created, TokenType type, bool livemode, BankAccount? bankAccount, CardData? card) $default,) {final _that = this; +switch (_that) { +case _TokenData(): +return $default(_that.id,_that.created,_that.type,_that.livemode,_that.bankAccount,_that.card);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, @JsonKey(name: 'created') String created, TokenType type, bool livemode, BankAccount? bankAccount, CardData? card)? $default,) {final _that = this; +switch (_that) { +case _TokenData() when $default != null: +return $default(_that.id,_that.created,_that.type,_that.livemode,_that.bankAccount,_that.card);case _: + return null; + +} } -/// @nodoc -class __$$TokenDataImplCopyWithImpl<$Res> - extends _$TokenDataCopyWithImpl<$Res, _$TokenDataImpl> - implements _$$TokenDataImplCopyWith<$Res> { - __$$TokenDataImplCopyWithImpl( - _$TokenDataImpl _value, $Res Function(_$TokenDataImpl) _then) - : super(_value, _then); - - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? created = null, - Object? type = null, - Object? livemode = null, - Object? bankAccount = freezed, - Object? card = freezed, - }) { - return _then(_$TokenDataImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - created: null == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as String, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as TokenType, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - bankAccount: freezed == bankAccount - ? _value.bankAccount - : bankAccount // ignore: cast_nullable_to_non_nullable - as BankAccount?, - card: freezed == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as CardData?, - )); - } } /// @nodoc @JsonSerializable() -class _$TokenDataImpl extends _TokenData { - const _$TokenDataImpl( - {required this.id, - @JsonKey(name: 'created') required this.created, - required this.type, - required this.livemode, - this.bankAccount, - this.card}) - : super._(); - - factory _$TokenDataImpl.fromJson(Map json) => - _$$TokenDataImplFromJson(json); - - /// Unique identifier of the token - @override - final String id; - - /// Timestamp when token was created - @override - @JsonKey(name: 'created') - final String created; - - /// Type of the token - @override - final TokenType type; - - /// Whether or not the object exists in livemode - @override - final bool livemode; - - /// Bank account data - @override - final BankAccount? bankAccount; - - /// Card data - @override - final CardData? card; - - @override - String toString() { - return 'TokenData(id: $id, created: $created, type: $type, livemode: $livemode, bankAccount: $bankAccount, card: $card)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$TokenDataImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.created, created) || other.created == created) && - (identical(other.type, type) || other.type == type) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.bankAccount, bankAccount) || - other.bankAccount == bankAccount) && - (identical(other.card, card) || other.card == card)); - } +class _TokenData extends TokenData { + const _TokenData({required this.id, @JsonKey(name: 'created') required this.created, required this.type, required this.livemode, this.bankAccount, this.card}): super._(); + factory _TokenData.fromJson(Map json) => _$TokenDataFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, id, created, type, livemode, bankAccount, card); - - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$TokenDataImplCopyWith<_$TokenDataImpl> get copyWith => - __$$TokenDataImplCopyWithImpl<_$TokenDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$TokenDataImplToJson( - this, - ); - } +/// Unique identifier of the token +@override final String id; +/// Timestamp when token was created +@override@JsonKey(name: 'created') final String created; +/// Type of the token +@override final TokenType type; +/// Whether or not the object exists in livemode +@override final bool livemode; +/// Bank account data +@override final BankAccount? bankAccount; +/// Card data +@override final CardData? card; + +/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$TokenDataCopyWith<_TokenData> get copyWith => __$TokenDataCopyWithImpl<_TokenData>(this, _$identity); + +@override +Map toJson() { + return _$TokenDataToJson(this, ); } -abstract class _TokenData extends TokenData { - const factory _TokenData( - {required final String id, - @JsonKey(name: 'created') required final String created, - required final TokenType type, - required final bool livemode, - final BankAccount? bankAccount, - final CardData? card}) = _$TokenDataImpl; - const _TokenData._() : super._(); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _TokenData&&(identical(other.id, id) || other.id == id)&&(identical(other.created, created) || other.created == created)&&(identical(other.type, type) || other.type == type)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.bankAccount, bankAccount) || other.bankAccount == bankAccount)&&(identical(other.card, card) || other.card == card)); +} - factory _TokenData.fromJson(Map json) = - _$TokenDataImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,created,type,livemode,bankAccount,card); - /// Unique identifier of the token - @override - String get id; +@override +String toString() { + return 'TokenData(id: $id, created: $created, type: $type, livemode: $livemode, bankAccount: $bankAccount, card: $card)'; +} - /// Timestamp when token was created - @override - @JsonKey(name: 'created') - String get created; - /// Type of the token - @override - TokenType get type; +} - /// Whether or not the object exists in livemode - @override - bool get livemode; +/// @nodoc +abstract mixin class _$TokenDataCopyWith<$Res> implements $TokenDataCopyWith<$Res> { + factory _$TokenDataCopyWith(_TokenData value, $Res Function(_TokenData) _then) = __$TokenDataCopyWithImpl; +@override @useResult +$Res call({ + String id,@JsonKey(name: 'created') String created, TokenType type, bool livemode, BankAccount? bankAccount, CardData? card +}); - /// Bank account data - @override - BankAccount? get bankAccount; - /// Card data - @override - CardData? get card; +@override $BankAccountCopyWith<$Res>? get bankAccount;@override $CardDataCopyWith<$Res>? get card; - /// Create a copy of TokenData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$TokenDataImplCopyWith<_$TokenDataImpl> get copyWith => - throw _privateConstructorUsedError; } +/// @nodoc +class __$TokenDataCopyWithImpl<$Res> + implements _$TokenDataCopyWith<$Res> { + __$TokenDataCopyWithImpl(this._self, this._then); -CardData _$CardDataFromJson(Map json) { - return _CardData.fromJson(json); -} + final _TokenData _self; + final $Res Function(_TokenData) _then; -/// @nodoc -mixin _$CardData { - /// Unique identifier - String? get id => throw _privateConstructorUsedError; +/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? created = null,Object? type = null,Object? livemode = null,Object? bankAccount = freezed,Object? card = freezed,}) { + return _then(_TokenData( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,created: null == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as TokenType,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,bankAccount: freezed == bankAccount ? _self.bankAccount : bankAccount // ignore: cast_nullable_to_non_nullable +as BankAccount?,card: freezed == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as CardData?, + )); +} - /// The brand associated to the card e.g. (visa, amex). - String get brand => throw _privateConstructorUsedError; +/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountCopyWith<$Res>? get bankAccount { + if (_self.bankAccount == null) { + return null; + } - /// Two letter iso code. - String? get country => throw _privateConstructorUsedError; + return $BankAccountCopyWith<$Res>(_self.bankAccount!, (value) { + return _then(_self.copyWith(bankAccount: value)); + }); +}/// Create a copy of TokenData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardDataCopyWith<$Res>? get card { + if (_self.card == null) { + return null; + } - /// The three letter ISO 4217 code for the currency. - String? get currency => throw _privateConstructorUsedError; + return $CardDataCopyWith<$Res>(_self.card!, (value) { + return _then(_self.copyWith(card: value)); + }); +} +} - /// four digit number representing the year of expiry of the card. - int? get expYear => throw _privateConstructorUsedError; - /// two digit number representing the month of expire of the card. - int? get expMonth => throw _privateConstructorUsedError; +/// @nodoc +mixin _$CardData { - /// Fullname of the cardholder - String? get name => throw _privateConstructorUsedError; +/// Unique identifier + String? get id;/// The brand associated to the card e.g. (visa, amex). + String get brand;/// Two letter iso code. + String? get country;/// The three letter ISO 4217 code for the currency. + String? get currency;/// four digit number representing the year of expiry of the card. + int? get expYear;/// two digit number representing the month of expire of the card. + int? get expMonth;/// Fullname of the cardholder + String? get name;/// card funding type e.g. (credit, debit). + String? get funding;/// last four digits of the card. + String? get last4;/// Address of the cardholder + Address? get address; +/// Create a copy of CardData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardDataCopyWith get copyWith => _$CardDataCopyWithImpl(this as CardData, _$identity); - /// card funding type e.g. (credit, debit). - String? get funding => throw _privateConstructorUsedError; + /// Serializes this CardData to a JSON map. + Map toJson(); - /// last four digits of the card. - String? get last4 => throw _privateConstructorUsedError; - /// Address of the cardholder - Address? get address => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardData&&(identical(other.id, id) || other.id == id)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.name, name) || other.name == name)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.address, address) || other.address == address)); +} - /// Serializes this CardData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,brand,country,currency,expYear,expMonth,name,funding,last4,address); - /// Create a copy of CardData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'CardData(id: $id, brand: $brand, country: $country, currency: $currency, expYear: $expYear, expMonth: $expMonth, name: $name, funding: $funding, last4: $last4, address: $address)'; } -/// @nodoc -abstract class $CardDataCopyWith<$Res> { - factory $CardDataCopyWith(CardData value, $Res Function(CardData) then) = - _$CardDataCopyWithImpl<$Res, CardData>; - @useResult - $Res call( - {String? id, - String brand, - String? country, - String? currency, - int? expYear, - int? expMonth, - String? name, - String? funding, - String? last4, - Address? address}); - - $AddressCopyWith<$Res>? get address; + } /// @nodoc -class _$CardDataCopyWithImpl<$Res, $Val extends CardData> - implements $CardDataCopyWith<$Res> { - _$CardDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = freezed, - Object? brand = null, - Object? country = freezed, - Object? currency = freezed, - Object? expYear = freezed, - Object? expMonth = freezed, - Object? name = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? address = freezed, - }) { - return _then(_value.copyWith( - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String?, - brand: null == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - ) as $Val); - } +abstract mixin class $CardDataCopyWith<$Res> { + factory $CardDataCopyWith(CardData value, $Res Function(CardData) _then) = _$CardDataCopyWithImpl; +@useResult +$Res call({ + String? id, String brand, String? country, String? currency, int? expYear, int? expMonth, String? name, String? funding, String? last4, Address? address +}); - /// Create a copy of CardData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $AddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } -} +$AddressCopyWith<$Res>? get address; + +} /// @nodoc -abstract class _$$CardDataImplCopyWith<$Res> +class _$CardDataCopyWithImpl<$Res> implements $CardDataCopyWith<$Res> { - factory _$$CardDataImplCopyWith( - _$CardDataImpl value, $Res Function(_$CardDataImpl) then) = - __$$CardDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? id, - String brand, - String? country, - String? currency, - int? expYear, - int? expMonth, - String? name, - String? funding, - String? last4, - Address? address}); - - @override - $AddressCopyWith<$Res>? get address; + _$CardDataCopyWithImpl(this._self, this._then); + + final CardData _self; + final $Res Function(CardData) _then; + +/// Create a copy of CardData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? brand = null,Object? country = freezed,Object? currency = freezed,Object? expYear = freezed,Object? expMonth = freezed,Object? name = freezed,Object? funding = freezed,Object? last4 = freezed,Object? address = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,brand: null == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?, + )); +} +/// Create a copy of CardData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [CardData]. +extension CardDataPatterns on CardData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CardData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CardData value) $default,){ +final _that = this; +switch (_that) { +case _CardData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CardData value)? $default,){ +final _that = this; +switch (_that) { +case _CardData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? id, String brand, String? country, String? currency, int? expYear, int? expMonth, String? name, String? funding, String? last4, Address? address)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardData() when $default != null: +return $default(_that.id,_that.brand,_that.country,_that.currency,_that.expYear,_that.expMonth,_that.name,_that.funding,_that.last4,_that.address);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? id, String brand, String? country, String? currency, int? expYear, int? expMonth, String? name, String? funding, String? last4, Address? address) $default,) {final _that = this; +switch (_that) { +case _CardData(): +return $default(_that.id,_that.brand,_that.country,_that.currency,_that.expYear,_that.expMonth,_that.name,_that.funding,_that.last4,_that.address);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? id, String brand, String? country, String? currency, int? expYear, int? expMonth, String? name, String? funding, String? last4, Address? address)? $default,) {final _that = this; +switch (_that) { +case _CardData() when $default != null: +return $default(_that.id,_that.brand,_that.country,_that.currency,_that.expYear,_that.expMonth,_that.name,_that.funding,_that.last4,_that.address);case _: + return null; + +} } -/// @nodoc -class __$$CardDataImplCopyWithImpl<$Res> - extends _$CardDataCopyWithImpl<$Res, _$CardDataImpl> - implements _$$CardDataImplCopyWith<$Res> { - __$$CardDataImplCopyWithImpl( - _$CardDataImpl _value, $Res Function(_$CardDataImpl) _then) - : super(_value, _then); - - /// Create a copy of CardData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = freezed, - Object? brand = null, - Object? country = freezed, - Object? currency = freezed, - Object? expYear = freezed, - Object? expMonth = freezed, - Object? name = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? address = freezed, - }) { - return _then(_$CardDataImpl( - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String?, - brand: null == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardDataImpl implements _CardData { - const _$CardDataImpl( - {this.id, - required this.brand, - this.country, - this.currency, - this.expYear, - this.expMonth, - this.name, - this.funding, - this.last4, - this.address}); - - factory _$CardDataImpl.fromJson(Map json) => - _$$CardDataImplFromJson(json); - - /// Unique identifier - @override - final String? id; - - /// The brand associated to the card e.g. (visa, amex). - @override - final String brand; - - /// Two letter iso code. - @override - final String? country; - - /// The three letter ISO 4217 code for the currency. - @override - final String? currency; - - /// four digit number representing the year of expiry of the card. - @override - final int? expYear; - - /// two digit number representing the month of expire of the card. - @override - final int? expMonth; - - /// Fullname of the cardholder - @override - final String? name; - - /// card funding type e.g. (credit, debit). - @override - final String? funding; - - /// last four digits of the card. - @override - final String? last4; - - /// Address of the cardholder - @override - final Address? address; - - @override - String toString() { - return 'CardData(id: $id, brand: $brand, country: $country, currency: $currency, expYear: $expYear, expMonth: $expMonth, name: $name, funding: $funding, last4: $last4, address: $address)'; - } +class _CardData implements CardData { + const _CardData({this.id, required this.brand, this.country, this.currency, this.expYear, this.expMonth, this.name, this.funding, this.last4, this.address}); + factory _CardData.fromJson(Map json) => _$CardDataFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardDataImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.expYear, expYear) || other.expYear == expYear) && - (identical(other.expMonth, expMonth) || - other.expMonth == expMonth) && - (identical(other.name, name) || other.name == name) && - (identical(other.funding, funding) || other.funding == funding) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.address, address) || other.address == address)); - } +/// Unique identifier +@override final String? id; +/// The brand associated to the card e.g. (visa, amex). +@override final String brand; +/// Two letter iso code. +@override final String? country; +/// The three letter ISO 4217 code for the currency. +@override final String? currency; +/// four digit number representing the year of expiry of the card. +@override final int? expYear; +/// two digit number representing the month of expire of the card. +@override final int? expMonth; +/// Fullname of the cardholder +@override final String? name; +/// card funding type e.g. (credit, debit). +@override final String? funding; +/// last four digits of the card. +@override final String? last4; +/// Address of the cardholder +@override final Address? address; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id, brand, country, currency, - expYear, expMonth, name, funding, last4, address); - - /// Create a copy of CardData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardDataImplCopyWith<_$CardDataImpl> get copyWith => - __$$CardDataImplCopyWithImpl<_$CardDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardDataImplToJson( - this, - ); - } +/// Create a copy of CardData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardDataCopyWith<_CardData> get copyWith => __$CardDataCopyWithImpl<_CardData>(this, _$identity); + +@override +Map toJson() { + return _$CardDataToJson(this, ); } -abstract class _CardData implements CardData { - const factory _CardData( - {final String? id, - required final String brand, - final String? country, - final String? currency, - final int? expYear, - final int? expMonth, - final String? name, - final String? funding, - final String? last4, - final Address? address}) = _$CardDataImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardData&&(identical(other.id, id) || other.id == id)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.name, name) || other.name == name)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.address, address) || other.address == address)); +} - factory _CardData.fromJson(Map json) = - _$CardDataImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,brand,country,currency,expYear,expMonth,name,funding,last4,address); - /// Unique identifier - @override - String? get id; +@override +String toString() { + return 'CardData(id: $id, brand: $brand, country: $country, currency: $currency, expYear: $expYear, expMonth: $expMonth, name: $name, funding: $funding, last4: $last4, address: $address)'; +} - /// The brand associated to the card e.g. (visa, amex). - @override - String get brand; - /// Two letter iso code. - @override - String? get country; +} - /// The three letter ISO 4217 code for the currency. - @override - String? get currency; +/// @nodoc +abstract mixin class _$CardDataCopyWith<$Res> implements $CardDataCopyWith<$Res> { + factory _$CardDataCopyWith(_CardData value, $Res Function(_CardData) _then) = __$CardDataCopyWithImpl; +@override @useResult +$Res call({ + String? id, String brand, String? country, String? currency, int? expYear, int? expMonth, String? name, String? funding, String? last4, Address? address +}); - /// four digit number representing the year of expiry of the card. - @override - int? get expYear; - /// two digit number representing the month of expire of the card. - @override - int? get expMonth; +@override $AddressCopyWith<$Res>? get address; - /// Fullname of the cardholder - @override - String? get name; +} +/// @nodoc +class __$CardDataCopyWithImpl<$Res> + implements _$CardDataCopyWith<$Res> { + __$CardDataCopyWithImpl(this._self, this._then); - /// card funding type e.g. (credit, debit). - @override - String? get funding; + final _CardData _self; + final $Res Function(_CardData) _then; - /// last four digits of the card. - @override - String? get last4; +/// Create a copy of CardData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? brand = null,Object? country = freezed,Object? currency = freezed,Object? expYear = freezed,Object? expMonth = freezed,Object? name = freezed,Object? funding = freezed,Object? last4 = freezed,Object? address = freezed,}) { + return _then(_CardData( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,brand: null == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?, + )); +} - /// Address of the cardholder - @override - Address? get address; +/// Create a copy of CardData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } - /// Create a copy of CardData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardDataImplCopyWith<_$CardDataImpl> get copyWith => - throw _privateConstructorUsedError; + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); } - -BankAccount _$BankAccountFromJson(Map json) { - return _BankAccount.fromJson(json); } + /// @nodoc mixin _$BankAccount { - /// Unique id for this bank account - String get id => throw _privateConstructorUsedError; - /// Entity that is holder of the account. - BankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; +/// Unique id for this bank account + String get id;/// Entity that is holder of the account. + BankAccountHolderType? get accountHolderType;/// Name of the bank where the account is registered. + String? get bankName;/// Full name of the account holder + String? get accountHolderName;/// 2 letter code of the country where the account is located + String? get country;/// The three letter ISO 4217 code for the currency. + String? get currency;/// The routing number of the bank account (e.g. needer for US accounts). + String? get routingNumber;/// Status of the bank account. + BankAccountStatus? get status;/// Uniquely identifies the particular bank account. +/// +/// You can use this to check whether or not two bank accounts are the same. + String? get fingerprint;/// Last four numbers of the bank account number + String? get last4; +/// Create a copy of BankAccount +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BankAccountCopyWith get copyWith => _$BankAccountCopyWithImpl(this as BankAccount, _$identity); + + /// Serializes this BankAccount to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BankAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.status, status) || other.status == status)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} - /// Name of the bank where the account is registered. - String? get bankName => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,accountHolderType,bankName,accountHolderName,country,currency,routingNumber,status,fingerprint,last4); - /// Full name of the account holder - String? get accountHolderName => throw _privateConstructorUsedError; +@override +String toString() { + return 'BankAccount(id: $id, accountHolderType: $accountHolderType, bankName: $bankName, accountHolderName: $accountHolderName, country: $country, currency: $currency, routingNumber: $routingNumber, status: $status, fingerprint: $fingerprint, last4: $last4)'; +} - /// 2 letter code of the country where the account is located - String? get country => throw _privateConstructorUsedError; - /// The three letter ISO 4217 code for the currency. - String? get currency => throw _privateConstructorUsedError; +} - /// The routing number of the bank account (e.g. needer for US accounts). - String? get routingNumber => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $BankAccountCopyWith<$Res> { + factory $BankAccountCopyWith(BankAccount value, $Res Function(BankAccount) _then) = _$BankAccountCopyWithImpl; +@useResult +$Res call({ + String id, BankAccountHolderType? accountHolderType, String? bankName, String? accountHolderName, String? country, String? currency, String? routingNumber, BankAccountStatus? status, String? fingerprint, String? last4 +}); - /// Status of the bank account. - BankAccountStatus? get status => throw _privateConstructorUsedError; - /// Uniquely identifies the particular bank account. - /// - /// You can use this to check whether or not two bank accounts are the same. - String? get fingerprint => throw _privateConstructorUsedError; - /// Last four numbers of the bank account number - String? get last4 => throw _privateConstructorUsedError; - /// Serializes this BankAccount to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +/// @nodoc +class _$BankAccountCopyWithImpl<$Res> + implements $BankAccountCopyWith<$Res> { + _$BankAccountCopyWithImpl(this._self, this._then); + + final BankAccount _self; + final $Res Function(BankAccount) _then; + +/// Create a copy of BankAccount +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? accountHolderType = freezed,Object? bankName = freezed,Object? accountHolderName = freezed,Object? country = freezed,Object? currency = freezed,Object? routingNumber = freezed,Object? status = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as BankAccountStatus?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BankAccount]. +extension BankAccountPatterns on BankAccount { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BankAccount value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BankAccount() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BankAccount value) $default,){ +final _that = this; +switch (_that) { +case _BankAccount(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BankAccount value)? $default,){ +final _that = this; +switch (_that) { +case _BankAccount() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, BankAccountHolderType? accountHolderType, String? bankName, String? accountHolderName, String? country, String? currency, String? routingNumber, BankAccountStatus? status, String? fingerprint, String? last4)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BankAccount() when $default != null: +return $default(_that.id,_that.accountHolderType,_that.bankName,_that.accountHolderName,_that.country,_that.currency,_that.routingNumber,_that.status,_that.fingerprint,_that.last4);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, BankAccountHolderType? accountHolderType, String? bankName, String? accountHolderName, String? country, String? currency, String? routingNumber, BankAccountStatus? status, String? fingerprint, String? last4) $default,) {final _that = this; +switch (_that) { +case _BankAccount(): +return $default(_that.id,_that.accountHolderType,_that.bankName,_that.accountHolderName,_that.country,_that.currency,_that.routingNumber,_that.status,_that.fingerprint,_that.last4);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, BankAccountHolderType? accountHolderType, String? bankName, String? accountHolderName, String? country, String? currency, String? routingNumber, BankAccountStatus? status, String? fingerprint, String? last4)? $default,) {final _that = this; +switch (_that) { +case _BankAccount() when $default != null: +return $default(_that.id,_that.accountHolderType,_that.bankName,_that.accountHolderName,_that.country,_that.currency,_that.routingNumber,_that.status,_that.fingerprint,_that.last4);case _: + return null; - /// Create a copy of BankAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BankAccountCopyWith get copyWith => - throw _privateConstructorUsedError; +} } -/// @nodoc -abstract class $BankAccountCopyWith<$Res> { - factory $BankAccountCopyWith( - BankAccount value, $Res Function(BankAccount) then) = - _$BankAccountCopyWithImpl<$Res, BankAccount>; - @useResult - $Res call( - {String id, - BankAccountHolderType? accountHolderType, - String? bankName, - String? accountHolderName, - String? country, - String? currency, - String? routingNumber, - BankAccountStatus? status, - String? fingerprint, - String? last4}); } /// @nodoc -class _$BankAccountCopyWithImpl<$Res, $Val extends BankAccount> - implements $BankAccountCopyWith<$Res> { - _$BankAccountCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BankAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? accountHolderType = freezed, - Object? bankName = freezed, - Object? accountHolderName = freezed, - Object? country = freezed, - Object? currency = freezed, - Object? routingNumber = freezed, - Object? status = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as BankAccountStatus?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +@JsonSerializable() + +class _BankAccount implements BankAccount { + const _BankAccount({required this.id, this.accountHolderType, this.bankName, this.accountHolderName, this.country, this.currency, this.routingNumber, this.status, this.fingerprint, this.last4}); + factory _BankAccount.fromJson(Map json) => _$BankAccountFromJson(json); + +/// Unique id for this bank account +@override final String id; +/// Entity that is holder of the account. +@override final BankAccountHolderType? accountHolderType; +/// Name of the bank where the account is registered. +@override final String? bankName; +/// Full name of the account holder +@override final String? accountHolderName; +/// 2 letter code of the country where the account is located +@override final String? country; +/// The three letter ISO 4217 code for the currency. +@override final String? currency; +/// The routing number of the bank account (e.g. needer for US accounts). +@override final String? routingNumber; +/// Status of the bank account. +@override final BankAccountStatus? status; +/// Uniquely identifies the particular bank account. +/// +/// You can use this to check whether or not two bank accounts are the same. +@override final String? fingerprint; +/// Last four numbers of the bank account number +@override final String? last4; + +/// Create a copy of BankAccount +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BankAccountCopyWith<_BankAccount> get copyWith => __$BankAccountCopyWithImpl<_BankAccount>(this, _$identity); + +@override +Map toJson() { + return _$BankAccountToJson(this, ); } -/// @nodoc -abstract class _$$BankAccountImplCopyWith<$Res> - implements $BankAccountCopyWith<$Res> { - factory _$$BankAccountImplCopyWith( - _$BankAccountImpl value, $Res Function(_$BankAccountImpl) then) = - __$$BankAccountImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - BankAccountHolderType? accountHolderType, - String? bankName, - String? accountHolderName, - String? country, - String? currency, - String? routingNumber, - BankAccountStatus? status, - String? fingerprint, - String? last4}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BankAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.accountHolderName, accountHolderName) || other.accountHolderName == accountHolderName)&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.status, status) || other.status == status)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); } -/// @nodoc -class __$$BankAccountImplCopyWithImpl<$Res> - extends _$BankAccountCopyWithImpl<$Res, _$BankAccountImpl> - implements _$$BankAccountImplCopyWith<$Res> { - __$$BankAccountImplCopyWithImpl( - _$BankAccountImpl _value, $Res Function(_$BankAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of BankAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? accountHolderType = freezed, - Object? bankName = freezed, - Object? accountHolderName = freezed, - Object? country = freezed, - Object? currency = freezed, - Object? routingNumber = freezed, - Object? status = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_$BankAccountImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderName: freezed == accountHolderName - ? _value.accountHolderName - : accountHolderName // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - currency: freezed == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String?, - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as BankAccountStatus?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,accountHolderType,bankName,accountHolderName,country,currency,routingNumber,status,fingerprint,last4); + +@override +String toString() { + return 'BankAccount(id: $id, accountHolderType: $accountHolderType, bankName: $bankName, accountHolderName: $accountHolderName, country: $country, currency: $currency, routingNumber: $routingNumber, status: $status, fingerprint: $fingerprint, last4: $last4)'; +} + + } /// @nodoc -@JsonSerializable() -class _$BankAccountImpl implements _BankAccount { - const _$BankAccountImpl( - {required this.id, - this.accountHolderType, - this.bankName, - this.accountHolderName, - this.country, - this.currency, - this.routingNumber, - this.status, - this.fingerprint, - this.last4}); - - factory _$BankAccountImpl.fromJson(Map json) => - _$$BankAccountImplFromJson(json); - - /// Unique id for this bank account - @override - final String id; - - /// Entity that is holder of the account. - @override - final BankAccountHolderType? accountHolderType; - - /// Name of the bank where the account is registered. - @override - final String? bankName; - - /// Full name of the account holder - @override - final String? accountHolderName; - - /// 2 letter code of the country where the account is located - @override - final String? country; - - /// The three letter ISO 4217 code for the currency. - @override - final String? currency; - - /// The routing number of the bank account (e.g. needer for US accounts). - @override - final String? routingNumber; - - /// Status of the bank account. - @override - final BankAccountStatus? status; - - /// Uniquely identifies the particular bank account. - /// - /// You can use this to check whether or not two bank accounts are the same. - @override - final String? fingerprint; - - /// Last four numbers of the bank account number - @override - final String? last4; - - @override - String toString() { - return 'BankAccount(id: $id, accountHolderType: $accountHolderType, bankName: $bankName, accountHolderName: $accountHolderName, country: $country, currency: $currency, routingNumber: $routingNumber, status: $status, fingerprint: $fingerprint, last4: $last4)'; - } +abstract mixin class _$BankAccountCopyWith<$Res> implements $BankAccountCopyWith<$Res> { + factory _$BankAccountCopyWith(_BankAccount value, $Res Function(_BankAccount) _then) = __$BankAccountCopyWithImpl; +@override @useResult +$Res call({ + String id, BankAccountHolderType? accountHolderType, String? bankName, String? accountHolderName, String? country, String? currency, String? routingNumber, BankAccountStatus? status, String? fingerprint, String? last4 +}); + + - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BankAccountImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.bankName, bankName) || - other.bankName == bankName) && - (identical(other.accountHolderName, accountHolderName) || - other.accountHolderName == accountHolderName) && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.status, status) || other.status == status) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - accountHolderType, - bankName, - accountHolderName, - country, - currency, - routingNumber, - status, - fingerprint, - last4); - - /// Create a copy of BankAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BankAccountImplCopyWith<_$BankAccountImpl> get copyWith => - __$$BankAccountImplCopyWithImpl<_$BankAccountImpl>(this, _$identity); - - @override - Map toJson() { - return _$$BankAccountImplToJson( - this, - ); - } } +/// @nodoc +class __$BankAccountCopyWithImpl<$Res> + implements _$BankAccountCopyWith<$Res> { + __$BankAccountCopyWithImpl(this._self, this._then); + + final _BankAccount _self; + final $Res Function(_BankAccount) _then; -abstract class _BankAccount implements BankAccount { - const factory _BankAccount( - {required final String id, - final BankAccountHolderType? accountHolderType, - final String? bankName, - final String? accountHolderName, - final String? country, - final String? currency, - final String? routingNumber, - final BankAccountStatus? status, - final String? fingerprint, - final String? last4}) = _$BankAccountImpl; - - factory _BankAccount.fromJson(Map json) = - _$BankAccountImpl.fromJson; - - /// Unique id for this bank account - @override - String get id; - - /// Entity that is holder of the account. - @override - BankAccountHolderType? get accountHolderType; - - /// Name of the bank where the account is registered. - @override - String? get bankName; - - /// Full name of the account holder - @override - String? get accountHolderName; - - /// 2 letter code of the country where the account is located - @override - String? get country; - - /// The three letter ISO 4217 code for the currency. - @override - String? get currency; - - /// The routing number of the bank account (e.g. needer for US accounts). - @override - String? get routingNumber; - - /// Status of the bank account. - @override - BankAccountStatus? get status; - - /// Uniquely identifies the particular bank account. - /// - /// You can use this to check whether or not two bank accounts are the same. - @override - String? get fingerprint; - - /// Last four numbers of the bank account number - @override - String? get last4; - - /// Create a copy of BankAccount - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BankAccountImplCopyWith<_$BankAccountImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of BankAccount +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? accountHolderType = freezed,Object? bankName = freezed,Object? accountHolderName = freezed,Object? country = freezed,Object? currency = freezed,Object? routingNumber = freezed,Object? status = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_BankAccount( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,accountHolderName: freezed == accountHolderName ? _self.accountHolderName : accountHolderName // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,currency: freezed == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String?,routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as BankAccountStatus?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); } + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/create_token_data.g.dart b/packages/stripe_platform_interface/lib/src/models/create_token_data.g.dart index 58ed794bc..58d911d43 100644 --- a/packages/stripe_platform_interface/lib/src/models/create_token_data.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/create_token_data.g.dart @@ -6,26 +6,25 @@ part of 'create_token_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CreateTokenParamsLegacyImpl _$$CreateTokenParamsLegacyImplFromJson( - Map json) => - _$CreateTokenParamsLegacyImpl( - type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? - TokenType.Card, - name: json['name'] as String?, - address: json['address'] == null - ? null - : Address.fromJson(json['address'] as Map), - $type: json['runtimeType'] as String?, - ); - -Map _$$CreateTokenParamsLegacyImplToJson( - _$CreateTokenParamsLegacyImpl instance) => - { - 'type': _$TokenTypeEnumMap[instance.type]!, - 'name': instance.name, - 'address': instance.address?.toJson(), - 'runtimeType': instance.$type, - }; +_CreateTokenParamsLegacy _$CreateTokenParamsLegacyFromJson( + Map json, +) => _CreateTokenParamsLegacy( + type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? TokenType.Card, + name: json['name'] as String?, + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + $type: json['runtimeType'] as String?, +); + +Map _$CreateTokenParamsLegacyToJson( + _CreateTokenParamsLegacy instance, +) => { + 'type': _$TokenTypeEnumMap[instance.type]!, + 'name': instance.name, + 'address': instance.address?.toJson(), + 'runtimeType': instance.$type, +}; const _$TokenTypeEnumMap = { TokenType.Card: 'Card', @@ -33,63 +32,62 @@ const _$TokenTypeEnumMap = { TokenType.Pii: 'Pii', }; -_$CreateTokenParamsCardImpl _$$CreateTokenParamsCardImplFromJson( - Map json) => - _$CreateTokenParamsCardImpl( - params: CardTokenParams.fromJson(json['params'] as Map), - $type: json['runtimeType'] as String?, - ); - -Map _$$CreateTokenParamsCardImplToJson( - _$CreateTokenParamsCardImpl instance) => - { - 'params': instance.params.toJson(), - 'runtimeType': instance.$type, - }; - -_$CreateTokenParamsBankAccountImpl _$$CreateTokenParamsBankAccountImplFromJson( - Map json) => - _$CreateTokenParamsBankAccountImpl( - params: BankAccountTokenParams.fromJson( - json['params'] as Map), - $type: json['runtimeType'] as String?, - ); - -Map _$$CreateTokenParamsBankAccountImplToJson( - _$CreateTokenParamsBankAccountImpl instance) => - { - 'params': instance.params.toJson(), - 'runtimeType': instance.$type, - }; +_CreateTokenParamsCard _$CreateTokenParamsCardFromJson( + Map json, +) => _CreateTokenParamsCard( + params: CardTokenParams.fromJson(json['params'] as Map), + $type: json['runtimeType'] as String?, +); + +Map _$CreateTokenParamsCardToJson( + _CreateTokenParamsCard instance, +) => { + 'params': instance.params.toJson(), + 'runtimeType': instance.$type, +}; -_$CreateTokenParamsPIIImpl _$$CreateTokenParamsPIIImplFromJson( - Map json) => - _$CreateTokenParamsPIIImpl( - params: PIITokenParams.fromJson(json['params'] as Map), - $type: json['runtimeType'] as String?, - ); +_CreateTokenParamsBankAccount _$CreateTokenParamsBankAccountFromJson( + Map json, +) => _CreateTokenParamsBankAccount( + params: BankAccountTokenParams.fromJson( + json['params'] as Map, + ), + $type: json['runtimeType'] as String?, +); + +Map _$CreateTokenParamsBankAccountToJson( + _CreateTokenParamsBankAccount instance, +) => { + 'params': instance.params.toJson(), + 'runtimeType': instance.$type, +}; -Map _$$CreateTokenParamsPIIImplToJson( - _$CreateTokenParamsPIIImpl instance) => - { - 'params': instance.params.toJson(), - 'runtimeType': instance.$type, - }; +_CreateTokenParamsPII _$CreateTokenParamsPIIFromJson( + Map json, +) => _CreateTokenParamsPII( + params: PIITokenParams.fromJson(json['params'] as Map), + $type: json['runtimeType'] as String?, +); + +Map _$CreateTokenParamsPIIToJson( + _CreateTokenParamsPII instance, +) => { + 'params': instance.params.toJson(), + 'runtimeType': instance.$type, +}; -_$CardTokenParamsImpl _$$CardTokenParamsImplFromJson( - Map json) => - _$CardTokenParamsImpl( - type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? - TokenType.Card, - name: json['name'] as String?, - address: json['address'] == null - ? null - : Address.fromJson(json['address'] as Map), - currency: json['currency'] as String?, - ); - -Map _$$CardTokenParamsImplToJson( - _$CardTokenParamsImpl instance) => +_CardTokenParams _$CardTokenParamsFromJson( + Map json, +) => _CardTokenParams( + type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? TokenType.Card, + name: json['name'] as String?, + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), + currency: json['currency'] as String?, +); + +Map _$CardTokenParamsToJson(_CardTokenParams instance) => { 'type': _$TokenTypeEnumMap[instance.type]!, 'name': instance.name, @@ -97,46 +95,48 @@ Map _$$CardTokenParamsImplToJson( 'currency': instance.currency, }; -_$PIITokenParamsImpl _$$PIITokenParamsImplFromJson(Map json) => - _$PIITokenParamsImpl( - type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? - TokenType.Pii, - personalId: json['personalId'] as String, - ); +_PIITokenParams _$PIITokenParamsFromJson( + Map json, +) => _PIITokenParams( + type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? TokenType.Pii, + personalId: json['personalId'] as String, +); -Map _$$PIITokenParamsImplToJson( - _$PIITokenParamsImpl instance) => +Map _$PIITokenParamsToJson(_PIITokenParams instance) => { 'type': _$TokenTypeEnumMap[instance.type]!, 'personalId': instance.personalId, }; -_$BankAccountTokenParamsImpl _$$BankAccountTokenParamsImplFromJson( - Map json) => - _$BankAccountTokenParamsImpl( - type: $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? - TokenType.BankAccount, - accountNumber: json['accountNumber'] as String, - country: json['country'] as String, - currency: json['currency'] as String, - accountHolderName: json['accountHolderName'] as String?, - accountHolderType: $enumDecodeNullable( - _$BankAccountHolderTypeEnumMap, json['accountHolderType']), - routingNumber: json['routingNumber'] as String?, - ); - -Map _$$BankAccountTokenParamsImplToJson( - _$BankAccountTokenParamsImpl instance) => - { - 'type': _$TokenTypeEnumMap[instance.type]!, - 'accountNumber': instance.accountNumber, - 'country': instance.country, - 'currency': instance.currency, - 'accountHolderName': instance.accountHolderName, - 'accountHolderType': - _$BankAccountHolderTypeEnumMap[instance.accountHolderType], - 'routingNumber': instance.routingNumber, - }; +_BankAccountTokenParams _$BankAccountTokenParamsFromJson( + Map json, +) => _BankAccountTokenParams( + type: + $enumDecodeNullable(_$TokenTypeEnumMap, json['type']) ?? + TokenType.BankAccount, + accountNumber: json['accountNumber'] as String, + country: json['country'] as String, + currency: json['currency'] as String, + accountHolderName: json['accountHolderName'] as String?, + accountHolderType: $enumDecodeNullable( + _$BankAccountHolderTypeEnumMap, + json['accountHolderType'], + ), + routingNumber: json['routingNumber'] as String?, +); + +Map _$BankAccountTokenParamsToJson( + _BankAccountTokenParams instance, +) => { + 'type': _$TokenTypeEnumMap[instance.type]!, + 'accountNumber': instance.accountNumber, + 'country': instance.country, + 'currency': instance.currency, + 'accountHolderName': instance.accountHolderName, + 'accountHolderType': + _$BankAccountHolderTypeEnumMap[instance.accountHolderType], + 'routingNumber': instance.routingNumber, +}; const _$BankAccountHolderTypeEnumMap = { BankAccountHolderType.Company: 'Company', @@ -144,21 +144,20 @@ const _$BankAccountHolderTypeEnumMap = { BankAccountHolderType.Unknown: 'Unknown', }; -_$TokenDataImpl _$$TokenDataImplFromJson(Map json) => - _$TokenDataImpl( - id: json['id'] as String, - created: json['created'] as String, - type: $enumDecode(_$TokenTypeEnumMap, json['type']), - livemode: json['livemode'] as bool, - bankAccount: json['bankAccount'] == null - ? null - : BankAccount.fromJson(json['bankAccount'] as Map), - card: json['card'] == null - ? null - : CardData.fromJson(json['card'] as Map), - ); - -Map _$$TokenDataImplToJson(_$TokenDataImpl instance) => +_TokenData _$TokenDataFromJson(Map json) => _TokenData( + id: json['id'] as String, + created: json['created'] as String, + type: $enumDecode(_$TokenTypeEnumMap, json['type']), + livemode: json['livemode'] as bool, + bankAccount: json['bankAccount'] == null + ? null + : BankAccount.fromJson(json['bankAccount'] as Map), + card: json['card'] == null + ? null + : CardData.fromJson(json['card'] as Map), +); + +Map _$TokenDataToJson(_TokenData instance) => { 'id': instance.id, 'created': instance.created, @@ -168,52 +167,51 @@ Map _$$TokenDataImplToJson(_$TokenDataImpl instance) => 'card': instance.card, }; -_$CardDataImpl _$$CardDataImplFromJson(Map json) => - _$CardDataImpl( - id: json['id'] as String?, - brand: json['brand'] as String, - country: json['country'] as String?, - currency: json['currency'] as String?, - expYear: (json['expYear'] as num?)?.toInt(), - expMonth: (json['expMonth'] as num?)?.toInt(), - name: json['name'] as String?, - funding: json['funding'] as String?, - last4: json['last4'] as String?, - address: json['address'] == null - ? null - : Address.fromJson(json['address'] as Map), - ); - -Map _$$CardDataImplToJson(_$CardDataImpl instance) => - { - 'id': instance.id, - 'brand': instance.brand, - 'country': instance.country, - 'currency': instance.currency, - 'expYear': instance.expYear, - 'expMonth': instance.expMonth, - 'name': instance.name, - 'funding': instance.funding, - 'last4': instance.last4, - 'address': instance.address?.toJson(), - }; +_CardData _$CardDataFromJson(Map json) => _CardData( + id: json['id'] as String?, + brand: json['brand'] as String, + country: json['country'] as String?, + currency: json['currency'] as String?, + expYear: (json['expYear'] as num?)?.toInt(), + expMonth: (json['expMonth'] as num?)?.toInt(), + name: json['name'] as String?, + funding: json['funding'] as String?, + last4: json['last4'] as String?, + address: json['address'] == null + ? null + : Address.fromJson(json['address'] as Map), +); + +Map _$CardDataToJson(_CardData instance) => { + 'id': instance.id, + 'brand': instance.brand, + 'country': instance.country, + 'currency': instance.currency, + 'expYear': instance.expYear, + 'expMonth': instance.expMonth, + 'name': instance.name, + 'funding': instance.funding, + 'last4': instance.last4, + 'address': instance.address?.toJson(), +}; -_$BankAccountImpl _$$BankAccountImplFromJson(Map json) => - _$BankAccountImpl( - id: json['id'] as String, - accountHolderType: $enumDecodeNullable( - _$BankAccountHolderTypeEnumMap, json['accountHolderType']), - bankName: json['bankName'] as String?, - accountHolderName: json['accountHolderName'] as String?, - country: json['country'] as String?, - currency: json['currency'] as String?, - routingNumber: json['routingNumber'] as String?, - status: $enumDecodeNullable(_$BankAccountStatusEnumMap, json['status']), - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - ); - -Map _$$BankAccountImplToJson(_$BankAccountImpl instance) => +_BankAccount _$BankAccountFromJson(Map json) => _BankAccount( + id: json['id'] as String, + accountHolderType: $enumDecodeNullable( + _$BankAccountHolderTypeEnumMap, + json['accountHolderType'], + ), + bankName: json['bankName'] as String?, + accountHolderName: json['accountHolderName'] as String?, + country: json['country'] as String?, + currency: json['currency'] as String?, + routingNumber: json['routingNumber'] as String?, + status: $enumDecodeNullable(_$BankAccountStatusEnumMap, json['status']), + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, +); + +Map _$BankAccountToJson(_BankAccount instance) => { 'id': instance.id, 'accountHolderType': diff --git a/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart b/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart index 1daf495f2..c5593f8a7 100644 --- a/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart +++ b/packages/stripe_platform_interface/lib/src/models/customer_sheet.dart @@ -9,7 +9,7 @@ part 'customer_sheet.g.dart'; /// /// For more info see https://stripe.com/docs/elements/customer-sheet?platform=react-native @freezed -class CustomerSheetInitParams with _$CustomerSheetInitParams { +abstract class CustomerSheetInitParams with _$CustomerSheetInitParams { @JsonSerializable(explicitToJson: true) const factory CustomerSheetInitParams({ /// Color styling used for the Customersheet UI @@ -45,7 +45,7 @@ class CustomerSheetInitParams with _$CustomerSheetInitParams { /// Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, + billingDetailsCollectionConfiguration, /// URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 String? returnURL, @@ -76,7 +76,7 @@ class CustomerSheetInitParams with _$CustomerSheetInitParams { } @freezed -class CustomerSheetPresentParams with _$CustomerSheetPresentParams { +abstract class CustomerSheetPresentParams with _$CustomerSheetPresentParams { @JsonSerializable(explicitToJson: true) const factory CustomerSheetPresentParams({ /// Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. @@ -95,7 +95,7 @@ class CustomerSheetPresentParams with _$CustomerSheetPresentParams { } @freezed -class CustomerSheetResult with _$CustomerSheetResult { +abstract class CustomerSheetResult with _$CustomerSheetResult { @JsonSerializable(explicitToJson: true) const factory CustomerSheetResult({ /// The users selected payment option, if one exists. @@ -112,12 +112,7 @@ class CustomerSheetResult with _$CustomerSheetResult { _$CustomerSheetResultFromJson(json); } -enum CustomerSheetAnimationStyle { - flip, - curl, - slide, - dissolve, -} +enum CustomerSheetAnimationStyle { flip, curl, slide, dissolve } enum CustomerSheetPresentationStyle { fullscreen, diff --git a/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart b/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart index 6bd0c7566..b5d2a81bd 100644 --- a/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/customer_sheet.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1233 +9,1094 @@ part of 'customer_sheet.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$CustomerSheetInitParams { + +/// Color styling used for the Customersheet UI +@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? get style;/// Appearance of the customersheet. +/// +/// When no appearance defined it will fallback to [style] or Stripe default. + PaymentSheetAppearance? get appearance;/// Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. + String? get setupIntentClientSecret;/// The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id + String get customerId;/// A short-lived token that allows the SDK to access a Customer's payment methods. + String get customerEphemeralKeySecret;/// Your customer-facing business name. The default value is the name of your app. + String? get merchantDisplayName;///This is an experimental feature that may be removed at any time. +/// Defaults to true. If true, the customer can delete all saved payment methods. +/// If false, the customer can't delete if they only have one saved payment method remaining. + bool? get allowsRemovalOfLastSavedPaymentMethod;/// Optional configuration for setting the header text of the Payment Method selection screen + String? get headerTextForSelectionScreen;/// CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. + BillingDetails? get defaultBillingDetails;/// Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. + BillingDetailsCollectionConfiguration? get billingDetailsCollectionConfiguration;/// URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 + String? get returnURL;/// Optional configuration to display a custom message when a saved payment method is removed. iOS only. + String? get removeSavedPaymentMethodMessage;/// Whether to show Apple Pay as an option. Defaults to `false`. + bool get applePayEnabled;/// Whether to show Google Pay as an option. Defaults to `false`. + bool get googlePayEnabled;/// The list of preferred networks that should be used to process payments made with a co-branded card. +/// This value will only be used if your user hasn't selected a network themselves. +@JsonKey(toJson: _cardBrandListToJson) List? get preferredNetworks;/// By default, PaymentSheet will accept all supported cards by Stripe. +/// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. +/// +/// Note: This is only a client-side solution. +///Note: Card brand filtering is not currently supported in Link. + CardBrandAcceptance? get cardBrandAcceptance; +/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CustomerSheetInitParamsCopyWith get copyWith => _$CustomerSheetInitParamsCopyWithImpl(this as CustomerSheetInitParams, _$identity); -CustomerSheetInitParams _$CustomerSheetInitParamsFromJson( - Map json) { - return _CustomerSheetInitParams.fromJson(json); + /// Serializes this CustomerSheetInitParams to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomerSheetInitParams&&(identical(other.style, style) || other.style == style)&&(identical(other.appearance, appearance) || other.appearance == appearance)&&(identical(other.setupIntentClientSecret, setupIntentClientSecret) || other.setupIntentClientSecret == setupIntentClientSecret)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.customerEphemeralKeySecret, customerEphemeralKeySecret) || other.customerEphemeralKeySecret == customerEphemeralKeySecret)&&(identical(other.merchantDisplayName, merchantDisplayName) || other.merchantDisplayName == merchantDisplayName)&&(identical(other.allowsRemovalOfLastSavedPaymentMethod, allowsRemovalOfLastSavedPaymentMethod) || other.allowsRemovalOfLastSavedPaymentMethod == allowsRemovalOfLastSavedPaymentMethod)&&(identical(other.headerTextForSelectionScreen, headerTextForSelectionScreen) || other.headerTextForSelectionScreen == headerTextForSelectionScreen)&&(identical(other.defaultBillingDetails, defaultBillingDetails) || other.defaultBillingDetails == defaultBillingDetails)&&(identical(other.billingDetailsCollectionConfiguration, billingDetailsCollectionConfiguration) || other.billingDetailsCollectionConfiguration == billingDetailsCollectionConfiguration)&&(identical(other.returnURL, returnURL) || other.returnURL == returnURL)&&(identical(other.removeSavedPaymentMethodMessage, removeSavedPaymentMethodMessage) || other.removeSavedPaymentMethodMessage == removeSavedPaymentMethodMessage)&&(identical(other.applePayEnabled, applePayEnabled) || other.applePayEnabled == applePayEnabled)&&(identical(other.googlePayEnabled, googlePayEnabled) || other.googlePayEnabled == googlePayEnabled)&&const DeepCollectionEquality().equals(other.preferredNetworks, preferredNetworks)&&(identical(other.cardBrandAcceptance, cardBrandAcceptance) || other.cardBrandAcceptance == cardBrandAcceptance)); } -/// @nodoc -mixin _$CustomerSheetInitParams { - /// Color styling used for the Customersheet UI - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - ThemeMode? get style => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,style,appearance,setupIntentClientSecret,customerId,customerEphemeralKeySecret,merchantDisplayName,allowsRemovalOfLastSavedPaymentMethod,headerTextForSelectionScreen,defaultBillingDetails,billingDetailsCollectionConfiguration,returnURL,removeSavedPaymentMethodMessage,applePayEnabled,googlePayEnabled,const DeepCollectionEquality().hash(preferredNetworks),cardBrandAcceptance); - /// Appearance of the customersheet. - /// - /// When no appearance defined it will fallback to [style] or Stripe default. - PaymentSheetAppearance? get appearance => throw _privateConstructorUsedError; +@override +String toString() { + return 'CustomerSheetInitParams(style: $style, appearance: $appearance, setupIntentClientSecret: $setupIntentClientSecret, customerId: $customerId, customerEphemeralKeySecret: $customerEphemeralKeySecret, merchantDisplayName: $merchantDisplayName, allowsRemovalOfLastSavedPaymentMethod: $allowsRemovalOfLastSavedPaymentMethod, headerTextForSelectionScreen: $headerTextForSelectionScreen, defaultBillingDetails: $defaultBillingDetails, billingDetailsCollectionConfiguration: $billingDetailsCollectionConfiguration, returnURL: $returnURL, removeSavedPaymentMethodMessage: $removeSavedPaymentMethodMessage, applePayEnabled: $applePayEnabled, googlePayEnabled: $googlePayEnabled, preferredNetworks: $preferredNetworks, cardBrandAcceptance: $cardBrandAcceptance)'; +} - /// Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. - String? get setupIntentClientSecret => throw _privateConstructorUsedError; - /// The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id - String get customerId => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract mixin class $CustomerSheetInitParamsCopyWith<$Res> { + factory $CustomerSheetInitParamsCopyWith(CustomerSheetInitParams value, $Res Function(CustomerSheetInitParams) _then) = _$CustomerSheetInitParamsCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled,@JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance +}); - /// A short-lived token that allows the SDK to access a Customer's payment methods. - String get customerEphemeralKeySecret => throw _privateConstructorUsedError; - /// Your customer-facing business name. The default value is the name of your app. - String? get merchantDisplayName => throw _privateConstructorUsedError; +$PaymentSheetAppearanceCopyWith<$Res>? get appearance;$BillingDetailsCopyWith<$Res>? get defaultBillingDetails;$BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration;$CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance; + +} +/// @nodoc +class _$CustomerSheetInitParamsCopyWithImpl<$Res> + implements $CustomerSheetInitParamsCopyWith<$Res> { + _$CustomerSheetInitParamsCopyWithImpl(this._self, this._then); + + final CustomerSheetInitParams _self; + final $Res Function(CustomerSheetInitParams) _then; + +/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? style = freezed,Object? appearance = freezed,Object? setupIntentClientSecret = freezed,Object? customerId = null,Object? customerEphemeralKeySecret = null,Object? merchantDisplayName = freezed,Object? allowsRemovalOfLastSavedPaymentMethod = freezed,Object? headerTextForSelectionScreen = freezed,Object? defaultBillingDetails = freezed,Object? billingDetailsCollectionConfiguration = freezed,Object? returnURL = freezed,Object? removeSavedPaymentMethodMessage = freezed,Object? applePayEnabled = null,Object? googlePayEnabled = null,Object? preferredNetworks = freezed,Object? cardBrandAcceptance = freezed,}) { + return _then(_self.copyWith( +style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as ThemeMode?,appearance: freezed == appearance ? _self.appearance : appearance // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearance?,setupIntentClientSecret: freezed == setupIntentClientSecret ? _self.setupIntentClientSecret : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable +as String?,customerId: null == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable +as String,customerEphemeralKeySecret: null == customerEphemeralKeySecret ? _self.customerEphemeralKeySecret : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable +as String,merchantDisplayName: freezed == merchantDisplayName ? _self.merchantDisplayName : merchantDisplayName // ignore: cast_nullable_to_non_nullable +as String?,allowsRemovalOfLastSavedPaymentMethod: freezed == allowsRemovalOfLastSavedPaymentMethod ? _self.allowsRemovalOfLastSavedPaymentMethod : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable +as bool?,headerTextForSelectionScreen: freezed == headerTextForSelectionScreen ? _self.headerTextForSelectionScreen : headerTextForSelectionScreen // ignore: cast_nullable_to_non_nullable +as String?,defaultBillingDetails: freezed == defaultBillingDetails ? _self.defaultBillingDetails : defaultBillingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,billingDetailsCollectionConfiguration: freezed == billingDetailsCollectionConfiguration ? _self.billingDetailsCollectionConfiguration : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable +as BillingDetailsCollectionConfiguration?,returnURL: freezed == returnURL ? _self.returnURL : returnURL // ignore: cast_nullable_to_non_nullable +as String?,removeSavedPaymentMethodMessage: freezed == removeSavedPaymentMethodMessage ? _self.removeSavedPaymentMethodMessage : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable +as String?,applePayEnabled: null == applePayEnabled ? _self.applePayEnabled : applePayEnabled // ignore: cast_nullable_to_non_nullable +as bool,googlePayEnabled: null == googlePayEnabled ? _self.googlePayEnabled : googlePayEnabled // ignore: cast_nullable_to_non_nullable +as bool,preferredNetworks: freezed == preferredNetworks ? _self.preferredNetworks : preferredNetworks // ignore: cast_nullable_to_non_nullable +as List?,cardBrandAcceptance: freezed == cardBrandAcceptance ? _self.cardBrandAcceptance : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptance?, + )); +} +/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith<$Res>? get appearance { + if (_self.appearance == null) { + return null; + } - ///This is an experimental feature that may be removed at any time. - /// Defaults to true. If true, the customer can delete all saved payment methods. - /// If false, the customer can't delete if they only have one saved payment method remaining. - bool? get allowsRemovalOfLastSavedPaymentMethod => - throw _privateConstructorUsedError; + return $PaymentSheetAppearanceCopyWith<$Res>(_self.appearance!, (value) { + return _then(_self.copyWith(appearance: value)); + }); +}/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get defaultBillingDetails { + if (_self.defaultBillingDetails == null) { + return null; + } - /// Optional configuration for setting the header text of the Payment Method selection screen - String? get headerTextForSelectionScreen => - throw _privateConstructorUsedError; + return $BillingDetailsCopyWith<$Res>(_self.defaultBillingDetails!, (value) { + return _then(_self.copyWith(defaultBillingDetails: value)); + }); +}/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration { + if (_self.billingDetailsCollectionConfiguration == null) { + return null; + } - /// CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. - BillingDetails? get defaultBillingDetails => - throw _privateConstructorUsedError; + return $BillingDetailsCollectionConfigurationCopyWith<$Res>(_self.billingDetailsCollectionConfiguration!, (value) { + return _then(_self.copyWith(billingDetailsCollectionConfiguration: value)); + }); +}/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance { + if (_self.cardBrandAcceptance == null) { + return null; + } - /// Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. - BillingDetailsCollectionConfiguration? - get billingDetailsCollectionConfiguration => - throw _privateConstructorUsedError; + return $CardBrandAcceptanceCopyWith<$Res>(_self.cardBrandAcceptance!, (value) { + return _then(_self.copyWith(cardBrandAcceptance: value)); + }); +} +} - /// URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 - String? get returnURL => throw _privateConstructorUsedError; - /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. - String? get removeSavedPaymentMethodMessage => - throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [CustomerSheetInitParams]. +extension CustomerSheetInitParamsPatterns on CustomerSheetInitParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CustomerSheetInitParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CustomerSheetInitParams() when $default != null: +return $default(_that);case _: + return orElse(); - /// Whether to show Apple Pay as an option. Defaults to `false`. - bool get applePayEnabled => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CustomerSheetInitParams value) $default,){ +final _that = this; +switch (_that) { +case _CustomerSheetInitParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// Whether to show Google Pay as an option. Defaults to `false`. - bool get googlePayEnabled => throw _privateConstructorUsedError; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CustomerSheetInitParams value)? $default,){ +final _that = this; +switch (_that) { +case _CustomerSheetInitParams() when $default != null: +return $default(_that);case _: + return null; - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - @JsonKey(toJson: _cardBrandListToJson) - List? get preferredNetworks => throw _privateConstructorUsedError; +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CustomerSheetInitParams() when $default != null: +return $default(_that.style,_that.appearance,_that.setupIntentClientSecret,_that.customerId,_that.customerEphemeralKeySecret,_that.merchantDisplayName,_that.allowsRemovalOfLastSavedPaymentMethod,_that.headerTextForSelectionScreen,_that.defaultBillingDetails,_that.billingDetailsCollectionConfiguration,_that.returnURL,_that.removeSavedPaymentMethodMessage,_that.applePayEnabled,_that.googlePayEnabled,_that.preferredNetworks,_that.cardBrandAcceptance);case _: + return orElse(); - /// By default, PaymentSheet will accept all supported cards by Stripe. - /// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. - /// - /// Note: This is only a client-side solution. - ///Note: Card brand filtering is not currently supported in Link. - CardBrandAcceptance? get cardBrandAcceptance => - throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance) $default,) {final _that = this; +switch (_that) { +case _CustomerSheetInitParams(): +return $default(_that.style,_that.appearance,_that.setupIntentClientSecret,_that.customerId,_that.customerEphemeralKeySecret,_that.merchantDisplayName,_that.allowsRemovalOfLastSavedPaymentMethod,_that.headerTextForSelectionScreen,_that.defaultBillingDetails,_that.billingDetailsCollectionConfiguration,_that.returnURL,_that.removeSavedPaymentMethodMessage,_that.applePayEnabled,_that.googlePayEnabled,_that.preferredNetworks,_that.cardBrandAcceptance);case _: + throw StateError('Unexpected subclass'); - /// Serializes this CustomerSheetInitParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)? $default,) {final _that = this; +switch (_that) { +case _CustomerSheetInitParams() when $default != null: +return $default(_that.style,_that.appearance,_that.setupIntentClientSecret,_that.customerId,_that.customerEphemeralKeySecret,_that.merchantDisplayName,_that.allowsRemovalOfLastSavedPaymentMethod,_that.headerTextForSelectionScreen,_that.defaultBillingDetails,_that.billingDetailsCollectionConfiguration,_that.returnURL,_that.removeSavedPaymentMethodMessage,_that.applePayEnabled,_that.googlePayEnabled,_that.preferredNetworks,_that.cardBrandAcceptance);case _: + return null; - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CustomerSheetInitParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +} } -/// @nodoc -abstract class $CustomerSheetInitParamsCopyWith<$Res> { - factory $CustomerSheetInitParamsCopyWith(CustomerSheetInitParams value, - $Res Function(CustomerSheetInitParams) then) = - _$CustomerSheetInitParamsCopyWithImpl<$Res, CustomerSheetInitParams>; - @useResult - $Res call( - {@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, - PaymentSheetAppearance? appearance, - String? setupIntentClientSecret, - String customerId, - String customerEphemeralKeySecret, - String? merchantDisplayName, - bool? allowsRemovalOfLastSavedPaymentMethod, - String? headerTextForSelectionScreen, - BillingDetails? defaultBillingDetails, - BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, - String? returnURL, - String? removeSavedPaymentMethodMessage, - bool applePayEnabled, - bool googlePayEnabled, - @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance}); - - $PaymentSheetAppearanceCopyWith<$Res>? get appearance; - $BillingDetailsCopyWith<$Res>? get defaultBillingDetails; - $BillingDetailsCollectionConfigurationCopyWith<$Res>? - get billingDetailsCollectionConfiguration; - $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance; } /// @nodoc -class _$CustomerSheetInitParamsCopyWithImpl<$Res, - $Val extends CustomerSheetInitParams> - implements $CustomerSheetInitParamsCopyWith<$Res> { - _$CustomerSheetInitParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? style = freezed, - Object? appearance = freezed, - Object? setupIntentClientSecret = freezed, - Object? customerId = null, - Object? customerEphemeralKeySecret = null, - Object? merchantDisplayName = freezed, - Object? allowsRemovalOfLastSavedPaymentMethod = freezed, - Object? headerTextForSelectionScreen = freezed, - Object? defaultBillingDetails = freezed, - Object? billingDetailsCollectionConfiguration = freezed, - Object? returnURL = freezed, - Object? removeSavedPaymentMethodMessage = freezed, - Object? applePayEnabled = null, - Object? googlePayEnabled = null, - Object? preferredNetworks = freezed, - Object? cardBrandAcceptance = freezed, - }) { - return _then(_value.copyWith( - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as ThemeMode?, - appearance: freezed == appearance - ? _value.appearance - : appearance // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearance?, - setupIntentClientSecret: freezed == setupIntentClientSecret - ? _value.setupIntentClientSecret - : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - customerId: null == customerId - ? _value.customerId - : customerId // ignore: cast_nullable_to_non_nullable - as String, - customerEphemeralKeySecret: null == customerEphemeralKeySecret - ? _value.customerEphemeralKeySecret - : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable - as String, - merchantDisplayName: freezed == merchantDisplayName - ? _value.merchantDisplayName - : merchantDisplayName // ignore: cast_nullable_to_non_nullable - as String?, - allowsRemovalOfLastSavedPaymentMethod: freezed == - allowsRemovalOfLastSavedPaymentMethod - ? _value.allowsRemovalOfLastSavedPaymentMethod - : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable - as bool?, - headerTextForSelectionScreen: freezed == headerTextForSelectionScreen - ? _value.headerTextForSelectionScreen - : headerTextForSelectionScreen // ignore: cast_nullable_to_non_nullable - as String?, - defaultBillingDetails: freezed == defaultBillingDetails - ? _value.defaultBillingDetails - : defaultBillingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - billingDetailsCollectionConfiguration: freezed == - billingDetailsCollectionConfiguration - ? _value.billingDetailsCollectionConfiguration - : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable - as BillingDetailsCollectionConfiguration?, - returnURL: freezed == returnURL - ? _value.returnURL - : returnURL // ignore: cast_nullable_to_non_nullable - as String?, - removeSavedPaymentMethodMessage: freezed == - removeSavedPaymentMethodMessage - ? _value.removeSavedPaymentMethodMessage - : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable - as String?, - applePayEnabled: null == applePayEnabled - ? _value.applePayEnabled - : applePayEnabled // ignore: cast_nullable_to_non_nullable - as bool, - googlePayEnabled: null == googlePayEnabled - ? _value.googlePayEnabled - : googlePayEnabled // ignore: cast_nullable_to_non_nullable - as bool, - preferredNetworks: freezed == preferredNetworks - ? _value.preferredNetworks - : preferredNetworks // ignore: cast_nullable_to_non_nullable - as List?, - cardBrandAcceptance: freezed == cardBrandAcceptance - ? _value.cardBrandAcceptance - : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptance?, - ) as $Val); - } - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetAppearanceCopyWith<$Res>? get appearance { - if (_value.appearance == null) { - return null; - } - - return $PaymentSheetAppearanceCopyWith<$Res>(_value.appearance!, (value) { - return _then(_value.copyWith(appearance: value) as $Val); - }); - } +@JsonSerializable(explicitToJson: true) +class _CustomerSheetInitParams implements CustomerSheetInitParams { + const _CustomerSheetInitParams({@JsonKey(toJson: UserInterfaceStyleKey.toJson) this.style, this.appearance, this.setupIntentClientSecret, required this.customerId, required this.customerEphemeralKeySecret, this.merchantDisplayName, this.allowsRemovalOfLastSavedPaymentMethod, this.headerTextForSelectionScreen, this.defaultBillingDetails, this.billingDetailsCollectionConfiguration, this.returnURL, this.removeSavedPaymentMethodMessage, this.applePayEnabled = true, this.googlePayEnabled = true, @JsonKey(toJson: _cardBrandListToJson) final List? preferredNetworks, this.cardBrandAcceptance}): _preferredNetworks = preferredNetworks; + factory _CustomerSheetInitParams.fromJson(Map json) => _$CustomerSheetInitParamsFromJson(json); + +/// Color styling used for the Customersheet UI +@override@JsonKey(toJson: UserInterfaceStyleKey.toJson) final ThemeMode? style; +/// Appearance of the customersheet. +/// +/// When no appearance defined it will fallback to [style] or Stripe default. +@override final PaymentSheetAppearance? appearance; +/// Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. +@override final String? setupIntentClientSecret; +/// The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id +@override final String customerId; +/// A short-lived token that allows the SDK to access a Customer's payment methods. +@override final String customerEphemeralKeySecret; +/// Your customer-facing business name. The default value is the name of your app. +@override final String? merchantDisplayName; +///This is an experimental feature that may be removed at any time. +/// Defaults to true. If true, the customer can delete all saved payment methods. +/// If false, the customer can't delete if they only have one saved payment method remaining. +@override final bool? allowsRemovalOfLastSavedPaymentMethod; +/// Optional configuration for setting the header text of the Payment Method selection screen +@override final String? headerTextForSelectionScreen; +/// CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. +@override final BillingDetails? defaultBillingDetails; +/// Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. +@override final BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration; +/// URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 +@override final String? returnURL; +/// Optional configuration to display a custom message when a saved payment method is removed. iOS only. +@override final String? removeSavedPaymentMethodMessage; +/// Whether to show Apple Pay as an option. Defaults to `false`. +@override@JsonKey() final bool applePayEnabled; +/// Whether to show Google Pay as an option. Defaults to `false`. +@override@JsonKey() final bool googlePayEnabled; +/// The list of preferred networks that should be used to process payments made with a co-branded card. +/// This value will only be used if your user hasn't selected a network themselves. + final List? _preferredNetworks; +/// The list of preferred networks that should be used to process payments made with a co-branded card. +/// This value will only be used if your user hasn't selected a network themselves. +@override@JsonKey(toJson: _cardBrandListToJson) List? get preferredNetworks { + final value = _preferredNetworks; + if (value == null) return null; + if (_preferredNetworks is EqualUnmodifiableListView) return _preferredNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get defaultBillingDetails { - if (_value.defaultBillingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.defaultBillingDetails!, - (value) { - return _then(_value.copyWith(defaultBillingDetails: value) as $Val); - }); - } +/// By default, PaymentSheet will accept all supported cards by Stripe. +/// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. +/// +/// Note: This is only a client-side solution. +///Note: Card brand filtering is not currently supported in Link. +@override final CardBrandAcceptance? cardBrandAcceptance; + +/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CustomerSheetInitParamsCopyWith<_CustomerSheetInitParams> get copyWith => __$CustomerSheetInitParamsCopyWithImpl<_CustomerSheetInitParams>(this, _$identity); + +@override +Map toJson() { + return _$CustomerSheetInitParamsToJson(this, ); +} - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCollectionConfigurationCopyWith<$Res>? - get billingDetailsCollectionConfiguration { - if (_value.billingDetailsCollectionConfiguration == null) { - return null; - } - - return $BillingDetailsCollectionConfigurationCopyWith<$Res>( - _value.billingDetailsCollectionConfiguration!, (value) { - return _then(_value.copyWith(billingDetailsCollectionConfiguration: value) - as $Val); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CustomerSheetInitParams&&(identical(other.style, style) || other.style == style)&&(identical(other.appearance, appearance) || other.appearance == appearance)&&(identical(other.setupIntentClientSecret, setupIntentClientSecret) || other.setupIntentClientSecret == setupIntentClientSecret)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.customerEphemeralKeySecret, customerEphemeralKeySecret) || other.customerEphemeralKeySecret == customerEphemeralKeySecret)&&(identical(other.merchantDisplayName, merchantDisplayName) || other.merchantDisplayName == merchantDisplayName)&&(identical(other.allowsRemovalOfLastSavedPaymentMethod, allowsRemovalOfLastSavedPaymentMethod) || other.allowsRemovalOfLastSavedPaymentMethod == allowsRemovalOfLastSavedPaymentMethod)&&(identical(other.headerTextForSelectionScreen, headerTextForSelectionScreen) || other.headerTextForSelectionScreen == headerTextForSelectionScreen)&&(identical(other.defaultBillingDetails, defaultBillingDetails) || other.defaultBillingDetails == defaultBillingDetails)&&(identical(other.billingDetailsCollectionConfiguration, billingDetailsCollectionConfiguration) || other.billingDetailsCollectionConfiguration == billingDetailsCollectionConfiguration)&&(identical(other.returnURL, returnURL) || other.returnURL == returnURL)&&(identical(other.removeSavedPaymentMethodMessage, removeSavedPaymentMethodMessage) || other.removeSavedPaymentMethodMessage == removeSavedPaymentMethodMessage)&&(identical(other.applePayEnabled, applePayEnabled) || other.applePayEnabled == applePayEnabled)&&(identical(other.googlePayEnabled, googlePayEnabled) || other.googlePayEnabled == googlePayEnabled)&&const DeepCollectionEquality().equals(other._preferredNetworks, _preferredNetworks)&&(identical(other.cardBrandAcceptance, cardBrandAcceptance) || other.cardBrandAcceptance == cardBrandAcceptance)); +} - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance { - if (_value.cardBrandAcceptance == null) { - return null; - } - - return $CardBrandAcceptanceCopyWith<$Res>(_value.cardBrandAcceptance!, - (value) { - return _then(_value.copyWith(cardBrandAcceptance: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,style,appearance,setupIntentClientSecret,customerId,customerEphemeralKeySecret,merchantDisplayName,allowsRemovalOfLastSavedPaymentMethod,headerTextForSelectionScreen,defaultBillingDetails,billingDetailsCollectionConfiguration,returnURL,removeSavedPaymentMethodMessage,applePayEnabled,googlePayEnabled,const DeepCollectionEquality().hash(_preferredNetworks),cardBrandAcceptance); + +@override +String toString() { + return 'CustomerSheetInitParams(style: $style, appearance: $appearance, setupIntentClientSecret: $setupIntentClientSecret, customerId: $customerId, customerEphemeralKeySecret: $customerEphemeralKeySecret, merchantDisplayName: $merchantDisplayName, allowsRemovalOfLastSavedPaymentMethod: $allowsRemovalOfLastSavedPaymentMethod, headerTextForSelectionScreen: $headerTextForSelectionScreen, defaultBillingDetails: $defaultBillingDetails, billingDetailsCollectionConfiguration: $billingDetailsCollectionConfiguration, returnURL: $returnURL, removeSavedPaymentMethodMessage: $removeSavedPaymentMethodMessage, applePayEnabled: $applePayEnabled, googlePayEnabled: $googlePayEnabled, preferredNetworks: $preferredNetworks, cardBrandAcceptance: $cardBrandAcceptance)'; } -/// @nodoc -abstract class _$$CustomerSheetInitParamsImplCopyWith<$Res> - implements $CustomerSheetInitParamsCopyWith<$Res> { - factory _$$CustomerSheetInitParamsImplCopyWith( - _$CustomerSheetInitParamsImpl value, - $Res Function(_$CustomerSheetInitParamsImpl) then) = - __$$CustomerSheetInitParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, - PaymentSheetAppearance? appearance, - String? setupIntentClientSecret, - String customerId, - String customerEphemeralKeySecret, - String? merchantDisplayName, - bool? allowsRemovalOfLastSavedPaymentMethod, - String? headerTextForSelectionScreen, - BillingDetails? defaultBillingDetails, - BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, - String? returnURL, - String? removeSavedPaymentMethodMessage, - bool applePayEnabled, - bool googlePayEnabled, - @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance}); - - @override - $PaymentSheetAppearanceCopyWith<$Res>? get appearance; - @override - $BillingDetailsCopyWith<$Res>? get defaultBillingDetails; - @override - $BillingDetailsCollectionConfigurationCopyWith<$Res>? - get billingDetailsCollectionConfiguration; - @override - $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance; + } /// @nodoc -class __$$CustomerSheetInitParamsImplCopyWithImpl<$Res> - extends _$CustomerSheetInitParamsCopyWithImpl<$Res, - _$CustomerSheetInitParamsImpl> - implements _$$CustomerSheetInitParamsImplCopyWith<$Res> { - __$$CustomerSheetInitParamsImplCopyWithImpl( - _$CustomerSheetInitParamsImpl _value, - $Res Function(_$CustomerSheetInitParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? style = freezed, - Object? appearance = freezed, - Object? setupIntentClientSecret = freezed, - Object? customerId = null, - Object? customerEphemeralKeySecret = null, - Object? merchantDisplayName = freezed, - Object? allowsRemovalOfLastSavedPaymentMethod = freezed, - Object? headerTextForSelectionScreen = freezed, - Object? defaultBillingDetails = freezed, - Object? billingDetailsCollectionConfiguration = freezed, - Object? returnURL = freezed, - Object? removeSavedPaymentMethodMessage = freezed, - Object? applePayEnabled = null, - Object? googlePayEnabled = null, - Object? preferredNetworks = freezed, - Object? cardBrandAcceptance = freezed, - }) { - return _then(_$CustomerSheetInitParamsImpl( - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as ThemeMode?, - appearance: freezed == appearance - ? _value.appearance - : appearance // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearance?, - setupIntentClientSecret: freezed == setupIntentClientSecret - ? _value.setupIntentClientSecret - : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - customerId: null == customerId - ? _value.customerId - : customerId // ignore: cast_nullable_to_non_nullable - as String, - customerEphemeralKeySecret: null == customerEphemeralKeySecret - ? _value.customerEphemeralKeySecret - : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable - as String, - merchantDisplayName: freezed == merchantDisplayName - ? _value.merchantDisplayName - : merchantDisplayName // ignore: cast_nullable_to_non_nullable - as String?, - allowsRemovalOfLastSavedPaymentMethod: freezed == - allowsRemovalOfLastSavedPaymentMethod - ? _value.allowsRemovalOfLastSavedPaymentMethod - : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable - as bool?, - headerTextForSelectionScreen: freezed == headerTextForSelectionScreen - ? _value.headerTextForSelectionScreen - : headerTextForSelectionScreen // ignore: cast_nullable_to_non_nullable - as String?, - defaultBillingDetails: freezed == defaultBillingDetails - ? _value.defaultBillingDetails - : defaultBillingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - billingDetailsCollectionConfiguration: freezed == - billingDetailsCollectionConfiguration - ? _value.billingDetailsCollectionConfiguration - : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable - as BillingDetailsCollectionConfiguration?, - returnURL: freezed == returnURL - ? _value.returnURL - : returnURL // ignore: cast_nullable_to_non_nullable - as String?, - removeSavedPaymentMethodMessage: freezed == - removeSavedPaymentMethodMessage - ? _value.removeSavedPaymentMethodMessage - : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable - as String?, - applePayEnabled: null == applePayEnabled - ? _value.applePayEnabled - : applePayEnabled // ignore: cast_nullable_to_non_nullable - as bool, - googlePayEnabled: null == googlePayEnabled - ? _value.googlePayEnabled - : googlePayEnabled // ignore: cast_nullable_to_non_nullable - as bool, - preferredNetworks: freezed == preferredNetworks - ? _value._preferredNetworks - : preferredNetworks // ignore: cast_nullable_to_non_nullable - as List?, - cardBrandAcceptance: freezed == cardBrandAcceptance - ? _value.cardBrandAcceptance - : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptance?, - )); - } -} +abstract mixin class _$CustomerSheetInitParamsCopyWith<$Res> implements $CustomerSheetInitParamsCopyWith<$Res> { + factory _$CustomerSheetInitParamsCopyWith(_CustomerSheetInitParams value, $Res Function(_CustomerSheetInitParams) _then) = __$CustomerSheetInitParamsCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled,@JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance +}); + + +@override $PaymentSheetAppearanceCopyWith<$Res>? get appearance;@override $BillingDetailsCopyWith<$Res>? get defaultBillingDetails;@override $BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration;@override $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance; +} /// @nodoc +class __$CustomerSheetInitParamsCopyWithImpl<$Res> + implements _$CustomerSheetInitParamsCopyWith<$Res> { + __$CustomerSheetInitParamsCopyWithImpl(this._self, this._then); + + final _CustomerSheetInitParams _self; + final $Res Function(_CustomerSheetInitParams) _then; + +/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? style = freezed,Object? appearance = freezed,Object? setupIntentClientSecret = freezed,Object? customerId = null,Object? customerEphemeralKeySecret = null,Object? merchantDisplayName = freezed,Object? allowsRemovalOfLastSavedPaymentMethod = freezed,Object? headerTextForSelectionScreen = freezed,Object? defaultBillingDetails = freezed,Object? billingDetailsCollectionConfiguration = freezed,Object? returnURL = freezed,Object? removeSavedPaymentMethodMessage = freezed,Object? applePayEnabled = null,Object? googlePayEnabled = null,Object? preferredNetworks = freezed,Object? cardBrandAcceptance = freezed,}) { + return _then(_CustomerSheetInitParams( +style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as ThemeMode?,appearance: freezed == appearance ? _self.appearance : appearance // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearance?,setupIntentClientSecret: freezed == setupIntentClientSecret ? _self.setupIntentClientSecret : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable +as String?,customerId: null == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable +as String,customerEphemeralKeySecret: null == customerEphemeralKeySecret ? _self.customerEphemeralKeySecret : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable +as String,merchantDisplayName: freezed == merchantDisplayName ? _self.merchantDisplayName : merchantDisplayName // ignore: cast_nullable_to_non_nullable +as String?,allowsRemovalOfLastSavedPaymentMethod: freezed == allowsRemovalOfLastSavedPaymentMethod ? _self.allowsRemovalOfLastSavedPaymentMethod : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable +as bool?,headerTextForSelectionScreen: freezed == headerTextForSelectionScreen ? _self.headerTextForSelectionScreen : headerTextForSelectionScreen // ignore: cast_nullable_to_non_nullable +as String?,defaultBillingDetails: freezed == defaultBillingDetails ? _self.defaultBillingDetails : defaultBillingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,billingDetailsCollectionConfiguration: freezed == billingDetailsCollectionConfiguration ? _self.billingDetailsCollectionConfiguration : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable +as BillingDetailsCollectionConfiguration?,returnURL: freezed == returnURL ? _self.returnURL : returnURL // ignore: cast_nullable_to_non_nullable +as String?,removeSavedPaymentMethodMessage: freezed == removeSavedPaymentMethodMessage ? _self.removeSavedPaymentMethodMessage : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable +as String?,applePayEnabled: null == applePayEnabled ? _self.applePayEnabled : applePayEnabled // ignore: cast_nullable_to_non_nullable +as bool,googlePayEnabled: null == googlePayEnabled ? _self.googlePayEnabled : googlePayEnabled // ignore: cast_nullable_to_non_nullable +as bool,preferredNetworks: freezed == preferredNetworks ? _self._preferredNetworks : preferredNetworks // ignore: cast_nullable_to_non_nullable +as List?,cardBrandAcceptance: freezed == cardBrandAcceptance ? _self.cardBrandAcceptance : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptance?, + )); +} -@JsonSerializable(explicitToJson: true) -class _$CustomerSheetInitParamsImpl implements _CustomerSheetInitParams { - const _$CustomerSheetInitParamsImpl( - {@JsonKey(toJson: UserInterfaceStyleKey.toJson) this.style, - this.appearance, - this.setupIntentClientSecret, - required this.customerId, - required this.customerEphemeralKeySecret, - this.merchantDisplayName, - this.allowsRemovalOfLastSavedPaymentMethod, - this.headerTextForSelectionScreen, - this.defaultBillingDetails, - this.billingDetailsCollectionConfiguration, - this.returnURL, - this.removeSavedPaymentMethodMessage, - this.applePayEnabled = true, - this.googlePayEnabled = true, - @JsonKey(toJson: _cardBrandListToJson) - final List? preferredNetworks, - this.cardBrandAcceptance}) - : _preferredNetworks = preferredNetworks; - - factory _$CustomerSheetInitParamsImpl.fromJson(Map json) => - _$$CustomerSheetInitParamsImplFromJson(json); - - /// Color styling used for the Customersheet UI - @override - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - final ThemeMode? style; - - /// Appearance of the customersheet. - /// - /// When no appearance defined it will fallback to [style] or Stripe default. - @override - final PaymentSheetAppearance? appearance; - - /// Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. - @override - final String? setupIntentClientSecret; - - /// The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id - @override - final String customerId; - - /// A short-lived token that allows the SDK to access a Customer's payment methods. - @override - final String customerEphemeralKeySecret; - - /// Your customer-facing business name. The default value is the name of your app. - @override - final String? merchantDisplayName; - - ///This is an experimental feature that may be removed at any time. - /// Defaults to true. If true, the customer can delete all saved payment methods. - /// If false, the customer can't delete if they only have one saved payment method remaining. - @override - final bool? allowsRemovalOfLastSavedPaymentMethod; - - /// Optional configuration for setting the header text of the Payment Method selection screen - @override - final String? headerTextForSelectionScreen; - - /// CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. - @override - final BillingDetails? defaultBillingDetails; - - /// Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. - @override - final BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration; - - /// URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 - @override - final String? returnURL; - - /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. - @override - final String? removeSavedPaymentMethodMessage; - - /// Whether to show Apple Pay as an option. Defaults to `false`. - @override - @JsonKey() - final bool applePayEnabled; - - /// Whether to show Google Pay as an option. Defaults to `false`. - @override - @JsonKey() - final bool googlePayEnabled; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - final List? _preferredNetworks; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - @override - @JsonKey(toJson: _cardBrandListToJson) - List? get preferredNetworks { - final value = _preferredNetworks; - if (value == null) return null; - if (_preferredNetworks is EqualUnmodifiableListView) - return _preferredNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); +/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith<$Res>? get appearance { + if (_self.appearance == null) { + return null; } - /// By default, PaymentSheet will accept all supported cards by Stripe. - /// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. - /// - /// Note: This is only a client-side solution. - ///Note: Card brand filtering is not currently supported in Link. - @override - final CardBrandAcceptance? cardBrandAcceptance; - - @override - String toString() { - return 'CustomerSheetInitParams(style: $style, appearance: $appearance, setupIntentClientSecret: $setupIntentClientSecret, customerId: $customerId, customerEphemeralKeySecret: $customerEphemeralKeySecret, merchantDisplayName: $merchantDisplayName, allowsRemovalOfLastSavedPaymentMethod: $allowsRemovalOfLastSavedPaymentMethod, headerTextForSelectionScreen: $headerTextForSelectionScreen, defaultBillingDetails: $defaultBillingDetails, billingDetailsCollectionConfiguration: $billingDetailsCollectionConfiguration, returnURL: $returnURL, removeSavedPaymentMethodMessage: $removeSavedPaymentMethodMessage, applePayEnabled: $applePayEnabled, googlePayEnabled: $googlePayEnabled, preferredNetworks: $preferredNetworks, cardBrandAcceptance: $cardBrandAcceptance)'; + return $PaymentSheetAppearanceCopyWith<$Res>(_self.appearance!, (value) { + return _then(_self.copyWith(appearance: value)); + }); +}/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get defaultBillingDetails { + if (_self.defaultBillingDetails == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CustomerSheetInitParamsImpl && - (identical(other.style, style) || other.style == style) && - (identical(other.appearance, appearance) || - other.appearance == appearance) && - (identical(other.setupIntentClientSecret, setupIntentClientSecret) || - other.setupIntentClientSecret == setupIntentClientSecret) && - (identical(other.customerId, customerId) || - other.customerId == customerId) && - (identical(other.customerEphemeralKeySecret, customerEphemeralKeySecret) || - other.customerEphemeralKeySecret == - customerEphemeralKeySecret) && - (identical(other.merchantDisplayName, merchantDisplayName) || - other.merchantDisplayName == merchantDisplayName) && - (identical(other.allowsRemovalOfLastSavedPaymentMethod, allowsRemovalOfLastSavedPaymentMethod) || - other.allowsRemovalOfLastSavedPaymentMethod == - allowsRemovalOfLastSavedPaymentMethod) && - (identical(other.headerTextForSelectionScreen, headerTextForSelectionScreen) || - other.headerTextForSelectionScreen == - headerTextForSelectionScreen) && - (identical(other.defaultBillingDetails, defaultBillingDetails) || - other.defaultBillingDetails == defaultBillingDetails) && - (identical(other.billingDetailsCollectionConfiguration, - billingDetailsCollectionConfiguration) || - other.billingDetailsCollectionConfiguration == - billingDetailsCollectionConfiguration) && - (identical(other.returnURL, returnURL) || - other.returnURL == returnURL) && - (identical(other.removeSavedPaymentMethodMessage, removeSavedPaymentMethodMessage) || - other.removeSavedPaymentMethodMessage == - removeSavedPaymentMethodMessage) && - (identical(other.applePayEnabled, applePayEnabled) || - other.applePayEnabled == applePayEnabled) && - (identical(other.googlePayEnabled, googlePayEnabled) || - other.googlePayEnabled == googlePayEnabled) && - const DeepCollectionEquality() - .equals(other._preferredNetworks, _preferredNetworks) && - (identical(other.cardBrandAcceptance, cardBrandAcceptance) || - other.cardBrandAcceptance == cardBrandAcceptance)); + return $BillingDetailsCopyWith<$Res>(_self.defaultBillingDetails!, (value) { + return _then(_self.copyWith(defaultBillingDetails: value)); + }); +}/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration { + if (_self.billingDetailsCollectionConfiguration == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - style, - appearance, - setupIntentClientSecret, - customerId, - customerEphemeralKeySecret, - merchantDisplayName, - allowsRemovalOfLastSavedPaymentMethod, - headerTextForSelectionScreen, - defaultBillingDetails, - billingDetailsCollectionConfiguration, - returnURL, - removeSavedPaymentMethodMessage, - applePayEnabled, - googlePayEnabled, - const DeepCollectionEquality().hash(_preferredNetworks), - cardBrandAcceptance); - - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CustomerSheetInitParamsImplCopyWith<_$CustomerSheetInitParamsImpl> - get copyWith => __$$CustomerSheetInitParamsImplCopyWithImpl< - _$CustomerSheetInitParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CustomerSheetInitParamsImplToJson( - this, - ); + return $BillingDetailsCollectionConfigurationCopyWith<$Res>(_self.billingDetailsCollectionConfiguration!, (value) { + return _then(_self.copyWith(billingDetailsCollectionConfiguration: value)); + }); +}/// Create a copy of CustomerSheetInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance { + if (_self.cardBrandAcceptance == null) { + return null; } -} -abstract class _CustomerSheetInitParams implements CustomerSheetInitParams { - const factory _CustomerSheetInitParams( - {@JsonKey(toJson: UserInterfaceStyleKey.toJson) final ThemeMode? style, - final PaymentSheetAppearance? appearance, - final String? setupIntentClientSecret, - required final String customerId, - required final String customerEphemeralKeySecret, - final String? merchantDisplayName, - final bool? allowsRemovalOfLastSavedPaymentMethod, - final String? headerTextForSelectionScreen, - final BillingDetails? defaultBillingDetails, - final BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, - final String? returnURL, - final String? removeSavedPaymentMethodMessage, - final bool applePayEnabled, - final bool googlePayEnabled, - @JsonKey(toJson: _cardBrandListToJson) - final List? preferredNetworks, - final CardBrandAcceptance? - cardBrandAcceptance}) = _$CustomerSheetInitParamsImpl; - - factory _CustomerSheetInitParams.fromJson(Map json) = - _$CustomerSheetInitParamsImpl.fromJson; - - /// Color styling used for the Customersheet UI - @override - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - ThemeMode? get style; - - /// Appearance of the customersheet. - /// - /// When no appearance defined it will fallback to [style] or Stripe default. - @override - PaymentSheetAppearance? get appearance; - - /// Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. - @override - String? get setupIntentClientSecret; - - /// The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id - @override - String get customerId; - - /// A short-lived token that allows the SDK to access a Customer's payment methods. - @override - String get customerEphemeralKeySecret; - - /// Your customer-facing business name. The default value is the name of your app. - @override - String? get merchantDisplayName; - - ///This is an experimental feature that may be removed at any time. - /// Defaults to true. If true, the customer can delete all saved payment methods. - /// If false, the customer can't delete if they only have one saved payment method remaining. - @override - bool? get allowsRemovalOfLastSavedPaymentMethod; - - /// Optional configuration for setting the header text of the Payment Method selection screen - @override - String? get headerTextForSelectionScreen; - - /// CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. - @override - BillingDetails? get defaultBillingDetails; - - /// Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. - @override - BillingDetailsCollectionConfiguration? - get billingDetailsCollectionConfiguration; - - /// URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 - @override - String? get returnURL; - - /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. - @override - String? get removeSavedPaymentMethodMessage; - - /// Whether to show Apple Pay as an option. Defaults to `false`. - @override - bool get applePayEnabled; - - /// Whether to show Google Pay as an option. Defaults to `false`. - @override - bool get googlePayEnabled; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - @override - @JsonKey(toJson: _cardBrandListToJson) - List? get preferredNetworks; - - /// By default, PaymentSheet will accept all supported cards by Stripe. - /// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. - /// - /// Note: This is only a client-side solution. - ///Note: Card brand filtering is not currently supported in Link. - @override - CardBrandAcceptance? get cardBrandAcceptance; - - /// Create a copy of CustomerSheetInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CustomerSheetInitParamsImplCopyWith<_$CustomerSheetInitParamsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CustomerSheetPresentParams _$CustomerSheetPresentParamsFromJson( - Map json) { - return _CustomerSheetPresentParams.fromJson(json); + return $CardBrandAcceptanceCopyWith<$Res>(_self.cardBrandAcceptance!, (value) { + return _then(_self.copyWith(cardBrandAcceptance: value)); + }); +} } + /// @nodoc mixin _$CustomerSheetPresentParams { - /// Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. - /// See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. - CustomerSheetPresentationStyle? get presentationStyle => - throw _privateConstructorUsedError; - - /// Controls how the modal animates. iOS only. - CustomerSheetAnimationStyle? get animationStyle => - throw _privateConstructorUsedError; - /// Time (in milliseconds) before the Customer Sheet will automatically dismiss. - int? get timeout => throw _privateConstructorUsedError; +/// Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. +/// See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. + CustomerSheetPresentationStyle? get presentationStyle;/// Controls how the modal animates. iOS only. + CustomerSheetAnimationStyle? get animationStyle;/// Time (in milliseconds) before the Customer Sheet will automatically dismiss. + int? get timeout; +/// Create a copy of CustomerSheetPresentParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CustomerSheetPresentParamsCopyWith get copyWith => _$CustomerSheetPresentParamsCopyWithImpl(this as CustomerSheetPresentParams, _$identity); /// Serializes this CustomerSheetPresentParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CustomerSheetPresentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CustomerSheetPresentParamsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomerSheetPresentParams&&(identical(other.presentationStyle, presentationStyle) || other.presentationStyle == presentationStyle)&&(identical(other.animationStyle, animationStyle) || other.animationStyle == animationStyle)&&(identical(other.timeout, timeout) || other.timeout == timeout)); } -/// @nodoc -abstract class $CustomerSheetPresentParamsCopyWith<$Res> { - factory $CustomerSheetPresentParamsCopyWith(CustomerSheetPresentParams value, - $Res Function(CustomerSheetPresentParams) then) = - _$CustomerSheetPresentParamsCopyWithImpl<$Res, - CustomerSheetPresentParams>; - @useResult - $Res call( - {CustomerSheetPresentationStyle? presentationStyle, - CustomerSheetAnimationStyle? animationStyle, - int? timeout}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,presentationStyle,animationStyle,timeout); + +@override +String toString() { + return 'CustomerSheetPresentParams(presentationStyle: $presentationStyle, animationStyle: $animationStyle, timeout: $timeout)'; } -/// @nodoc -class _$CustomerSheetPresentParamsCopyWithImpl<$Res, - $Val extends CustomerSheetPresentParams> - implements $CustomerSheetPresentParamsCopyWith<$Res> { - _$CustomerSheetPresentParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CustomerSheetPresentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? presentationStyle = freezed, - Object? animationStyle = freezed, - Object? timeout = freezed, - }) { - return _then(_value.copyWith( - presentationStyle: freezed == presentationStyle - ? _value.presentationStyle - : presentationStyle // ignore: cast_nullable_to_non_nullable - as CustomerSheetPresentationStyle?, - animationStyle: freezed == animationStyle - ? _value.animationStyle - : animationStyle // ignore: cast_nullable_to_non_nullable - as CustomerSheetAnimationStyle?, - timeout: freezed == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CustomerSheetPresentParamsImplCopyWith<$Res> +abstract mixin class $CustomerSheetPresentParamsCopyWith<$Res> { + factory $CustomerSheetPresentParamsCopyWith(CustomerSheetPresentParams value, $Res Function(CustomerSheetPresentParams) _then) = _$CustomerSheetPresentParamsCopyWithImpl; +@useResult +$Res call({ + CustomerSheetPresentationStyle? presentationStyle, CustomerSheetAnimationStyle? animationStyle, int? timeout +}); + + + + +} +/// @nodoc +class _$CustomerSheetPresentParamsCopyWithImpl<$Res> implements $CustomerSheetPresentParamsCopyWith<$Res> { - factory _$$CustomerSheetPresentParamsImplCopyWith( - _$CustomerSheetPresentParamsImpl value, - $Res Function(_$CustomerSheetPresentParamsImpl) then) = - __$$CustomerSheetPresentParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {CustomerSheetPresentationStyle? presentationStyle, - CustomerSheetAnimationStyle? animationStyle, - int? timeout}); + _$CustomerSheetPresentParamsCopyWithImpl(this._self, this._then); + + final CustomerSheetPresentParams _self; + final $Res Function(CustomerSheetPresentParams) _then; + +/// Create a copy of CustomerSheetPresentParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? presentationStyle = freezed,Object? animationStyle = freezed,Object? timeout = freezed,}) { + return _then(_self.copyWith( +presentationStyle: freezed == presentationStyle ? _self.presentationStyle : presentationStyle // ignore: cast_nullable_to_non_nullable +as CustomerSheetPresentationStyle?,animationStyle: freezed == animationStyle ? _self.animationStyle : animationStyle // ignore: cast_nullable_to_non_nullable +as CustomerSheetAnimationStyle?,timeout: freezed == timeout ? _self.timeout : timeout // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CustomerSheetPresentParams]. +extension CustomerSheetPresentParamsPatterns on CustomerSheetPresentParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CustomerSheetPresentParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CustomerSheetPresentParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CustomerSheetPresentParams value) $default,){ +final _that = this; +switch (_that) { +case _CustomerSheetPresentParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CustomerSheetPresentParams value)? $default,){ +final _that = this; +switch (_that) { +case _CustomerSheetPresentParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( CustomerSheetPresentationStyle? presentationStyle, CustomerSheetAnimationStyle? animationStyle, int? timeout)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CustomerSheetPresentParams() when $default != null: +return $default(_that.presentationStyle,_that.animationStyle,_that.timeout);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( CustomerSheetPresentationStyle? presentationStyle, CustomerSheetAnimationStyle? animationStyle, int? timeout) $default,) {final _that = this; +switch (_that) { +case _CustomerSheetPresentParams(): +return $default(_that.presentationStyle,_that.animationStyle,_that.timeout);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( CustomerSheetPresentationStyle? presentationStyle, CustomerSheetAnimationStyle? animationStyle, int? timeout)? $default,) {final _that = this; +switch (_that) { +case _CustomerSheetPresentParams() when $default != null: +return $default(_that.presentationStyle,_that.animationStyle,_that.timeout);case _: + return null; + +} } -/// @nodoc -class __$$CustomerSheetPresentParamsImplCopyWithImpl<$Res> - extends _$CustomerSheetPresentParamsCopyWithImpl<$Res, - _$CustomerSheetPresentParamsImpl> - implements _$$CustomerSheetPresentParamsImplCopyWith<$Res> { - __$$CustomerSheetPresentParamsImplCopyWithImpl( - _$CustomerSheetPresentParamsImpl _value, - $Res Function(_$CustomerSheetPresentParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CustomerSheetPresentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? presentationStyle = freezed, - Object? animationStyle = freezed, - Object? timeout = freezed, - }) { - return _then(_$CustomerSheetPresentParamsImpl( - presentationStyle: freezed == presentationStyle - ? _value.presentationStyle - : presentationStyle // ignore: cast_nullable_to_non_nullable - as CustomerSheetPresentationStyle?, - animationStyle: freezed == animationStyle - ? _value.animationStyle - : animationStyle // ignore: cast_nullable_to_non_nullable - as CustomerSheetAnimationStyle?, - timeout: freezed == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as int?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CustomerSheetPresentParamsImpl implements _CustomerSheetPresentParams { - const _$CustomerSheetPresentParamsImpl( - {this.presentationStyle, this.animationStyle, this.timeout}); - - factory _$CustomerSheetPresentParamsImpl.fromJson( - Map json) => - _$$CustomerSheetPresentParamsImplFromJson(json); - - /// Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. - /// See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. - @override - final CustomerSheetPresentationStyle? presentationStyle; - - /// Controls how the modal animates. iOS only. - @override - final CustomerSheetAnimationStyle? animationStyle; - - /// Time (in milliseconds) before the Customer Sheet will automatically dismiss. - @override - final int? timeout; - - @override - String toString() { - return 'CustomerSheetPresentParams(presentationStyle: $presentationStyle, animationStyle: $animationStyle, timeout: $timeout)'; - } +class _CustomerSheetPresentParams implements CustomerSheetPresentParams { + const _CustomerSheetPresentParams({this.presentationStyle, this.animationStyle, this.timeout}); + factory _CustomerSheetPresentParams.fromJson(Map json) => _$CustomerSheetPresentParamsFromJson(json); + +/// Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. +/// See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. +@override final CustomerSheetPresentationStyle? presentationStyle; +/// Controls how the modal animates. iOS only. +@override final CustomerSheetAnimationStyle? animationStyle; +/// Time (in milliseconds) before the Customer Sheet will automatically dismiss. +@override final int? timeout; + +/// Create a copy of CustomerSheetPresentParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CustomerSheetPresentParamsCopyWith<_CustomerSheetPresentParams> get copyWith => __$CustomerSheetPresentParamsCopyWithImpl<_CustomerSheetPresentParams>(this, _$identity); + +@override +Map toJson() { + return _$CustomerSheetPresentParamsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CustomerSheetPresentParamsImpl && - (identical(other.presentationStyle, presentationStyle) || - other.presentationStyle == presentationStyle) && - (identical(other.animationStyle, animationStyle) || - other.animationStyle == animationStyle) && - (identical(other.timeout, timeout) || other.timeout == timeout)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CustomerSheetPresentParams&&(identical(other.presentationStyle, presentationStyle) || other.presentationStyle == presentationStyle)&&(identical(other.animationStyle, animationStyle) || other.animationStyle == animationStyle)&&(identical(other.timeout, timeout) || other.timeout == timeout)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, presentationStyle, animationStyle, timeout); - - /// Create a copy of CustomerSheetPresentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CustomerSheetPresentParamsImplCopyWith<_$CustomerSheetPresentParamsImpl> - get copyWith => __$$CustomerSheetPresentParamsImplCopyWithImpl< - _$CustomerSheetPresentParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CustomerSheetPresentParamsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,presentationStyle,animationStyle,timeout); + +@override +String toString() { + return 'CustomerSheetPresentParams(presentationStyle: $presentationStyle, animationStyle: $animationStyle, timeout: $timeout)'; } -abstract class _CustomerSheetPresentParams - implements CustomerSheetPresentParams { - const factory _CustomerSheetPresentParams( - {final CustomerSheetPresentationStyle? presentationStyle, - final CustomerSheetAnimationStyle? animationStyle, - final int? timeout}) = _$CustomerSheetPresentParamsImpl; - factory _CustomerSheetPresentParams.fromJson(Map json) = - _$CustomerSheetPresentParamsImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$CustomerSheetPresentParamsCopyWith<$Res> implements $CustomerSheetPresentParamsCopyWith<$Res> { + factory _$CustomerSheetPresentParamsCopyWith(_CustomerSheetPresentParams value, $Res Function(_CustomerSheetPresentParams) _then) = __$CustomerSheetPresentParamsCopyWithImpl; +@override @useResult +$Res call({ + CustomerSheetPresentationStyle? presentationStyle, CustomerSheetAnimationStyle? animationStyle, int? timeout +}); - /// Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. - /// See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. - @override - CustomerSheetPresentationStyle? get presentationStyle; - /// Controls how the modal animates. iOS only. - @override - CustomerSheetAnimationStyle? get animationStyle; - /// Time (in milliseconds) before the Customer Sheet will automatically dismiss. - @override - int? get timeout; - /// Create a copy of CustomerSheetPresentParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CustomerSheetPresentParamsImplCopyWith<_$CustomerSheetPresentParamsImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$CustomerSheetPresentParamsCopyWithImpl<$Res> + implements _$CustomerSheetPresentParamsCopyWith<$Res> { + __$CustomerSheetPresentParamsCopyWithImpl(this._self, this._then); + + final _CustomerSheetPresentParams _self; + final $Res Function(_CustomerSheetPresentParams) _then; + +/// Create a copy of CustomerSheetPresentParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? presentationStyle = freezed,Object? animationStyle = freezed,Object? timeout = freezed,}) { + return _then(_CustomerSheetPresentParams( +presentationStyle: freezed == presentationStyle ? _self.presentationStyle : presentationStyle // ignore: cast_nullable_to_non_nullable +as CustomerSheetPresentationStyle?,animationStyle: freezed == animationStyle ? _self.animationStyle : animationStyle // ignore: cast_nullable_to_non_nullable +as CustomerSheetAnimationStyle?,timeout: freezed == timeout ? _self.timeout : timeout // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + -CustomerSheetResult _$CustomerSheetResultFromJson(Map json) { - return _CustomerSheetResult.fromJson(json); } + /// @nodoc mixin _$CustomerSheetResult { - /// The users selected payment option, if one exists. - PaymentSheetPaymentOption? get paymentOption => - throw _privateConstructorUsedError; - /// The Stripe PaymentMethod associated with the paymentOption, if it exists. - PaymentMethod? get paymentMethod => throw _privateConstructorUsedError; - - /// The error that occurred - StripeError? get error => throw _privateConstructorUsedError; +/// The users selected payment option, if one exists. + PaymentSheetPaymentOption? get paymentOption;/// The Stripe PaymentMethod associated with the paymentOption, if it exists. + PaymentMethod? get paymentMethod;/// The error that occurred + StripeError? get error; +/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CustomerSheetResultCopyWith get copyWith => _$CustomerSheetResultCopyWithImpl(this as CustomerSheetResult, _$identity); /// Serializes this CustomerSheetResult to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CustomerSheetResultCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomerSheetResult&&(identical(other.paymentOption, paymentOption) || other.paymentOption == paymentOption)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.error, error) || other.error == error)); } -/// @nodoc -abstract class $CustomerSheetResultCopyWith<$Res> { - factory $CustomerSheetResultCopyWith( - CustomerSheetResult value, $Res Function(CustomerSheetResult) then) = - _$CustomerSheetResultCopyWithImpl<$Res, CustomerSheetResult>; - @useResult - $Res call( - {PaymentSheetPaymentOption? paymentOption, - PaymentMethod? paymentMethod, - StripeError? error}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentOption,paymentMethod,error); - $PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption; - $PaymentMethodCopyWith<$Res>? get paymentMethod; - $StripeErrorCopyWith? get error; +@override +String toString() { + return 'CustomerSheetResult(paymentOption: $paymentOption, paymentMethod: $paymentMethod, error: $error)'; } + +} + +/// @nodoc +abstract mixin class $CustomerSheetResultCopyWith<$Res> { + factory $CustomerSheetResultCopyWith(CustomerSheetResult value, $Res Function(CustomerSheetResult) _then) = _$CustomerSheetResultCopyWithImpl; +@useResult +$Res call({ + PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, StripeError? error +}); + + +$PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption;$PaymentMethodCopyWith<$Res>? get paymentMethod;$StripeErrorCopyWith? get error; + +} /// @nodoc -class _$CustomerSheetResultCopyWithImpl<$Res, $Val extends CustomerSheetResult> +class _$CustomerSheetResultCopyWithImpl<$Res> implements $CustomerSheetResultCopyWith<$Res> { - _$CustomerSheetResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentOption = freezed, - Object? paymentMethod = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - paymentOption: freezed == paymentOption - ? _value.paymentOption - : paymentOption // ignore: cast_nullable_to_non_nullable - as PaymentSheetPaymentOption?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as PaymentMethod?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - ) as $Val); + _$CustomerSheetResultCopyWithImpl(this._self, this._then); + + final CustomerSheetResult _self; + final $Res Function(CustomerSheetResult) _then; + +/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentOption = freezed,Object? paymentMethod = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +paymentOption: freezed == paymentOption ? _self.paymentOption : paymentOption // ignore: cast_nullable_to_non_nullable +as PaymentSheetPaymentOption?,paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as PaymentMethod?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} +/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption { + if (_self.paymentOption == null) { + return null; } - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption { - if (_value.paymentOption == null) { - return null; - } - - return $PaymentSheetPaymentOptionCopyWith<$Res>(_value.paymentOption!, - (value) { - return _then(_value.copyWith(paymentOption: value) as $Val); - }); + return $PaymentSheetPaymentOptionCopyWith<$Res>(_self.paymentOption!, (value) { + return _then(_self.copyWith(paymentOption: value)); + }); +}/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; } - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodCopyWith<$Res>? get paymentMethod { - if (_value.paymentMethod == null) { - return null; - } - - return $PaymentMethodCopyWith<$Res>(_value.paymentMethod!, (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); + return $PaymentMethodCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith? get error { + if (_self.error == null) { + return null; } - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeErrorCopyWith? get error { - if (_value.error == null) { - return null; - } - - return $StripeErrorCopyWith(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + return $StripeErrorCopyWith(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } -/// @nodoc -abstract class _$$CustomerSheetResultImplCopyWith<$Res> - implements $CustomerSheetResultCopyWith<$Res> { - factory _$$CustomerSheetResultImplCopyWith(_$CustomerSheetResultImpl value, - $Res Function(_$CustomerSheetResultImpl) then) = - __$$CustomerSheetResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentSheetPaymentOption? paymentOption, - PaymentMethod? paymentMethod, - StripeError? error}); - - @override - $PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption; - @override - $PaymentMethodCopyWith<$Res>? get paymentMethod; - @override - $StripeErrorCopyWith? get error; + +/// Adds pattern-matching-related methods to [CustomerSheetResult]. +extension CustomerSheetResultPatterns on CustomerSheetResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CustomerSheetResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CustomerSheetResult() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CustomerSheetResult value) $default,){ +final _that = this; +switch (_that) { +case _CustomerSheetResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CustomerSheetResult value)? $default,){ +final _that = this; +switch (_that) { +case _CustomerSheetResult() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, StripeError? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CustomerSheetResult() when $default != null: +return $default(_that.paymentOption,_that.paymentMethod,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, StripeError? error) $default,) {final _that = this; +switch (_that) { +case _CustomerSheetResult(): +return $default(_that.paymentOption,_that.paymentMethod,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, StripeError? error)? $default,) {final _that = this; +switch (_that) { +case _CustomerSheetResult() when $default != null: +return $default(_that.paymentOption,_that.paymentMethod,_that.error);case _: + return null; + +} } -/// @nodoc -class __$$CustomerSheetResultImplCopyWithImpl<$Res> - extends _$CustomerSheetResultCopyWithImpl<$Res, _$CustomerSheetResultImpl> - implements _$$CustomerSheetResultImplCopyWith<$Res> { - __$$CustomerSheetResultImplCopyWithImpl(_$CustomerSheetResultImpl _value, - $Res Function(_$CustomerSheetResultImpl) _then) - : super(_value, _then); - - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentOption = freezed, - Object? paymentMethod = freezed, - Object? error = freezed, - }) { - return _then(_$CustomerSheetResultImpl( - paymentOption: freezed == paymentOption - ? _value.paymentOption - : paymentOption // ignore: cast_nullable_to_non_nullable - as PaymentSheetPaymentOption?, - paymentMethod: freezed == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as PaymentMethod?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeError?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CustomerSheetResultImpl implements _CustomerSheetResult { - const _$CustomerSheetResultImpl( - {this.paymentOption, this.paymentMethod, this.error}); +class _CustomerSheetResult implements CustomerSheetResult { + const _CustomerSheetResult({this.paymentOption, this.paymentMethod, this.error}); + factory _CustomerSheetResult.fromJson(Map json) => _$CustomerSheetResultFromJson(json); + +/// The users selected payment option, if one exists. +@override final PaymentSheetPaymentOption? paymentOption; +/// The Stripe PaymentMethod associated with the paymentOption, if it exists. +@override final PaymentMethod? paymentMethod; +/// The error that occurred +@override final StripeError? error; + +/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CustomerSheetResultCopyWith<_CustomerSheetResult> get copyWith => __$CustomerSheetResultCopyWithImpl<_CustomerSheetResult>(this, _$identity); + +@override +Map toJson() { + return _$CustomerSheetResultToJson(this, ); +} - factory _$CustomerSheetResultImpl.fromJson(Map json) => - _$$CustomerSheetResultImplFromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CustomerSheetResult&&(identical(other.paymentOption, paymentOption) || other.paymentOption == paymentOption)&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.error, error) || other.error == error)); +} - /// The users selected payment option, if one exists. - @override - final PaymentSheetPaymentOption? paymentOption; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentOption,paymentMethod,error); - /// The Stripe PaymentMethod associated with the paymentOption, if it exists. - @override - final PaymentMethod? paymentMethod; +@override +String toString() { + return 'CustomerSheetResult(paymentOption: $paymentOption, paymentMethod: $paymentMethod, error: $error)'; +} - /// The error that occurred - @override - final StripeError? error; - @override - String toString() { - return 'CustomerSheetResult(paymentOption: $paymentOption, paymentMethod: $paymentMethod, error: $error)'; - } +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CustomerSheetResultImpl && - (identical(other.paymentOption, paymentOption) || - other.paymentOption == paymentOption) && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.error, error) || other.error == error)); - } +/// @nodoc +abstract mixin class _$CustomerSheetResultCopyWith<$Res> implements $CustomerSheetResultCopyWith<$Res> { + factory _$CustomerSheetResultCopyWith(_CustomerSheetResult value, $Res Function(_CustomerSheetResult) _then) = __$CustomerSheetResultCopyWithImpl; +@override @useResult +$Res call({ + PaymentSheetPaymentOption? paymentOption, PaymentMethod? paymentMethod, StripeError? error +}); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, paymentOption, paymentMethod, error); - - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CustomerSheetResultImplCopyWith<_$CustomerSheetResultImpl> get copyWith => - __$$CustomerSheetResultImplCopyWithImpl<_$CustomerSheetResultImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CustomerSheetResultImplToJson( - this, - ); - } -} -abstract class _CustomerSheetResult implements CustomerSheetResult { - const factory _CustomerSheetResult( - {final PaymentSheetPaymentOption? paymentOption, - final PaymentMethod? paymentMethod, - final StripeError? error}) = _$CustomerSheetResultImpl; +@override $PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption;@override $PaymentMethodCopyWith<$Res>? get paymentMethod;@override $StripeErrorCopyWith? get error; - factory _CustomerSheetResult.fromJson(Map json) = - _$CustomerSheetResultImpl.fromJson; +} +/// @nodoc +class __$CustomerSheetResultCopyWithImpl<$Res> + implements _$CustomerSheetResultCopyWith<$Res> { + __$CustomerSheetResultCopyWithImpl(this._self, this._then); + + final _CustomerSheetResult _self; + final $Res Function(_CustomerSheetResult) _then; + +/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentOption = freezed,Object? paymentMethod = freezed,Object? error = freezed,}) { + return _then(_CustomerSheetResult( +paymentOption: freezed == paymentOption ? _self.paymentOption : paymentOption // ignore: cast_nullable_to_non_nullable +as PaymentSheetPaymentOption?,paymentMethod: freezed == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as PaymentMethod?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeError?, + )); +} - /// The users selected payment option, if one exists. - @override - PaymentSheetPaymentOption? get paymentOption; +/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPaymentOptionCopyWith<$Res>? get paymentOption { + if (_self.paymentOption == null) { + return null; + } - /// The Stripe PaymentMethod associated with the paymentOption, if it exists. - @override - PaymentMethod? get paymentMethod; + return $PaymentSheetPaymentOptionCopyWith<$Res>(_self.paymentOption!, (value) { + return _then(_self.copyWith(paymentOption: value)); + }); +}/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith<$Res>? get paymentMethod { + if (_self.paymentMethod == null) { + return null; + } - /// The error that occurred - @override - StripeError? get error; + return $PaymentMethodCopyWith<$Res>(_self.paymentMethod!, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of CustomerSheetResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeErrorCopyWith? get error { + if (_self.error == null) { + return null; + } - /// Create a copy of CustomerSheetResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CustomerSheetResultImplCopyWith<_$CustomerSheetResultImpl> get copyWith => - throw _privateConstructorUsedError; + return $StripeErrorCopyWith(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); } +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart b/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart index 230b684a4..b51066bdd 100644 --- a/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/customer_sheet.g.dart @@ -6,69 +6,71 @@ part of 'customer_sheet.dart'; // JsonSerializableGenerator // ************************************************************************** -_$CustomerSheetInitParamsImpl _$$CustomerSheetInitParamsImplFromJson( - Map json) => - _$CustomerSheetInitParamsImpl( - style: $enumDecodeNullable(_$ThemeModeEnumMap, json['style']), - appearance: json['appearance'] == null - ? null - : PaymentSheetAppearance.fromJson( - json['appearance'] as Map), - setupIntentClientSecret: json['setupIntentClientSecret'] as String?, - customerId: json['customerId'] as String, - customerEphemeralKeySecret: json['customerEphemeralKeySecret'] as String, - merchantDisplayName: json['merchantDisplayName'] as String?, - allowsRemovalOfLastSavedPaymentMethod: - json['allowsRemovalOfLastSavedPaymentMethod'] as bool?, - headerTextForSelectionScreen: - json['headerTextForSelectionScreen'] as String?, - defaultBillingDetails: json['defaultBillingDetails'] == null - ? null - : BillingDetails.fromJson( - json['defaultBillingDetails'] as Map), - billingDetailsCollectionConfiguration: - json['billingDetailsCollectionConfiguration'] == null - ? null - : BillingDetailsCollectionConfiguration.fromJson( - json['billingDetailsCollectionConfiguration'] - as Map), - returnURL: json['returnURL'] as String?, - removeSavedPaymentMethodMessage: - json['removeSavedPaymentMethodMessage'] as String?, - applePayEnabled: json['applePayEnabled'] as bool? ?? true, - googlePayEnabled: json['googlePayEnabled'] as bool? ?? true, - preferredNetworks: (json['preferredNetworks'] as List?) - ?.map((e) => $enumDecode(_$CardBrandEnumMap, e)) - .toList(), - cardBrandAcceptance: json['cardBrandAcceptance'] == null - ? null - : CardBrandAcceptance.fromJson( - json['cardBrandAcceptance'] as Map), - ); +_CustomerSheetInitParams _$CustomerSheetInitParamsFromJson( + Map json, +) => _CustomerSheetInitParams( + style: $enumDecodeNullable(_$ThemeModeEnumMap, json['style']), + appearance: json['appearance'] == null + ? null + : PaymentSheetAppearance.fromJson( + json['appearance'] as Map, + ), + setupIntentClientSecret: json['setupIntentClientSecret'] as String?, + customerId: json['customerId'] as String, + customerEphemeralKeySecret: json['customerEphemeralKeySecret'] as String, + merchantDisplayName: json['merchantDisplayName'] as String?, + allowsRemovalOfLastSavedPaymentMethod: + json['allowsRemovalOfLastSavedPaymentMethod'] as bool?, + headerTextForSelectionScreen: json['headerTextForSelectionScreen'] as String?, + defaultBillingDetails: json['defaultBillingDetails'] == null + ? null + : BillingDetails.fromJson( + json['defaultBillingDetails'] as Map, + ), + billingDetailsCollectionConfiguration: + json['billingDetailsCollectionConfiguration'] == null + ? null + : BillingDetailsCollectionConfiguration.fromJson( + json['billingDetailsCollectionConfiguration'] as Map, + ), + returnURL: json['returnURL'] as String?, + removeSavedPaymentMethodMessage: + json['removeSavedPaymentMethodMessage'] as String?, + applePayEnabled: json['applePayEnabled'] as bool? ?? true, + googlePayEnabled: json['googlePayEnabled'] as bool? ?? true, + preferredNetworks: (json['preferredNetworks'] as List?) + ?.map((e) => $enumDecode(_$CardBrandEnumMap, e)) + .toList(), + cardBrandAcceptance: json['cardBrandAcceptance'] == null + ? null + : CardBrandAcceptance.fromJson( + json['cardBrandAcceptance'] as Map, + ), +); -Map _$$CustomerSheetInitParamsImplToJson( - _$CustomerSheetInitParamsImpl instance) => - { - 'style': UserInterfaceStyleKey.toJson(instance.style), - 'appearance': instance.appearance?.toJson(), - 'setupIntentClientSecret': instance.setupIntentClientSecret, - 'customerId': instance.customerId, - 'customerEphemeralKeySecret': instance.customerEphemeralKeySecret, - 'merchantDisplayName': instance.merchantDisplayName, - 'allowsRemovalOfLastSavedPaymentMethod': - instance.allowsRemovalOfLastSavedPaymentMethod, - 'headerTextForSelectionScreen': instance.headerTextForSelectionScreen, - 'defaultBillingDetails': instance.defaultBillingDetails?.toJson(), - 'billingDetailsCollectionConfiguration': - instance.billingDetailsCollectionConfiguration?.toJson(), - 'returnURL': instance.returnURL, - 'removeSavedPaymentMethodMessage': - instance.removeSavedPaymentMethodMessage, - 'applePayEnabled': instance.applePayEnabled, - 'googlePayEnabled': instance.googlePayEnabled, - 'preferredNetworks': _cardBrandListToJson(instance.preferredNetworks), - 'cardBrandAcceptance': instance.cardBrandAcceptance?.toJson(), - }; +Map _$CustomerSheetInitParamsToJson( + _CustomerSheetInitParams instance, +) => { + 'style': UserInterfaceStyleKey.toJson(instance.style), + 'appearance': instance.appearance?.toJson(), + 'setupIntentClientSecret': instance.setupIntentClientSecret, + 'customerId': instance.customerId, + 'customerEphemeralKeySecret': instance.customerEphemeralKeySecret, + 'merchantDisplayName': instance.merchantDisplayName, + 'allowsRemovalOfLastSavedPaymentMethod': + instance.allowsRemovalOfLastSavedPaymentMethod, + 'headerTextForSelectionScreen': instance.headerTextForSelectionScreen, + 'defaultBillingDetails': instance.defaultBillingDetails?.toJson(), + 'billingDetailsCollectionConfiguration': instance + .billingDetailsCollectionConfiguration + ?.toJson(), + 'returnURL': instance.returnURL, + 'removeSavedPaymentMethodMessage': instance.removeSavedPaymentMethodMessage, + 'applePayEnabled': instance.applePayEnabled, + 'googlePayEnabled': instance.googlePayEnabled, + 'preferredNetworks': _cardBrandListToJson(instance.preferredNetworks), + 'cardBrandAcceptance': instance.cardBrandAcceptance?.toJson(), +}; const _$ThemeModeEnumMap = { ThemeMode.system: 'system', @@ -88,25 +90,29 @@ const _$CardBrandEnumMap = { CardBrand.Unknown: 'Unknown', }; -_$CustomerSheetPresentParamsImpl _$$CustomerSheetPresentParamsImplFromJson( - Map json) => - _$CustomerSheetPresentParamsImpl( - presentationStyle: $enumDecodeNullable( - _$CustomerSheetPresentationStyleEnumMap, json['presentationStyle']), - animationStyle: $enumDecodeNullable( - _$CustomerSheetAnimationStyleEnumMap, json['animationStyle']), - timeout: (json['timeout'] as num?)?.toInt(), - ); +_CustomerSheetPresentParams _$CustomerSheetPresentParamsFromJson( + Map json, +) => _CustomerSheetPresentParams( + presentationStyle: $enumDecodeNullable( + _$CustomerSheetPresentationStyleEnumMap, + json['presentationStyle'], + ), + animationStyle: $enumDecodeNullable( + _$CustomerSheetAnimationStyleEnumMap, + json['animationStyle'], + ), + timeout: (json['timeout'] as num?)?.toInt(), +); -Map _$$CustomerSheetPresentParamsImplToJson( - _$CustomerSheetPresentParamsImpl instance) => - { - 'presentationStyle': - _$CustomerSheetPresentationStyleEnumMap[instance.presentationStyle], - 'animationStyle': - _$CustomerSheetAnimationStyleEnumMap[instance.animationStyle], - 'timeout': instance.timeout, - }; +Map _$CustomerSheetPresentParamsToJson( + _CustomerSheetPresentParams instance, +) => { + 'presentationStyle': + _$CustomerSheetPresentationStyleEnumMap[instance.presentationStyle], + 'animationStyle': + _$CustomerSheetAnimationStyleEnumMap[instance.animationStyle], + 'timeout': instance.timeout, +}; const _$CustomerSheetPresentationStyleEnumMap = { CustomerSheetPresentationStyle.fullscreen: 'fullscreen', @@ -124,27 +130,26 @@ const _$CustomerSheetAnimationStyleEnumMap = { CustomerSheetAnimationStyle.dissolve: 'dissolve', }; -_$CustomerSheetResultImpl _$$CustomerSheetResultImplFromJson( - Map json) => - _$CustomerSheetResultImpl( - paymentOption: json['paymentOption'] == null - ? null - : PaymentSheetPaymentOption.fromJson( - json['paymentOption'] as Map), - paymentMethod: json['paymentMethod'] == null - ? null - : PaymentMethod.fromJson( - json['paymentMethod'] as Map), - error: json['error'] == null - ? null - : StripeError.fromJson( - json['error'] as Map), - ); +_CustomerSheetResult _$CustomerSheetResultFromJson( + Map json, +) => _CustomerSheetResult( + paymentOption: json['paymentOption'] == null + ? null + : PaymentSheetPaymentOption.fromJson( + json['paymentOption'] as Map, + ), + paymentMethod: json['paymentMethod'] == null + ? null + : PaymentMethod.fromJson(json['paymentMethod'] as Map), + error: json['error'] == null + ? null + : StripeError.fromJson(json['error'] as Map), +); -Map _$$CustomerSheetResultImplToJson( - _$CustomerSheetResultImpl instance) => - { - 'paymentOption': instance.paymentOption?.toJson(), - 'paymentMethod': instance.paymentMethod?.toJson(), - 'error': instance.error?.toJson(), - }; +Map _$CustomerSheetResultToJson( + _CustomerSheetResult instance, +) => { + 'paymentOption': instance.paymentOption?.toJson(), + 'paymentMethod': instance.paymentMethod?.toJson(), + 'error': instance.error?.toJson(), +}; diff --git a/packages/stripe_platform_interface/lib/src/models/errors.dart b/packages/stripe_platform_interface/lib/src/models/errors.dart index 82fafeaf8..a0a756a17 100644 --- a/packages/stripe_platform_interface/lib/src/models/errors.dart +++ b/packages/stripe_platform_interface/lib/src/models/errors.dart @@ -15,9 +15,8 @@ enum AddressSheetError { unknown } enum CustomerSheetError { unknown, failed, canceled } @freezed - /// Wrapper class that represents an error with the Stripe platform. -class StripeError with _$StripeError implements Exception { +abstract class StripeError with _$StripeError implements Exception { @JsonSerializable(explicitToJson: true) const factory StripeError({ @Default('Unknown error') String message, @@ -34,9 +33,8 @@ T _dataFromJson(Map input) => input['code'] as T; Map _dataToJson(T input) => {'code': input}; @freezed - /// Exception retrieved from the Stripe platform. -class StripeException with _$StripeException implements Exception { +abstract class StripeException with _$StripeException implements Exception { const factory StripeException({ /// error details required LocalizedErrorMessage error, @@ -47,9 +45,8 @@ class StripeException with _$StripeException implements Exception { } @freezed - /// Provides details about the error -class LocalizedErrorMessage with _$LocalizedErrorMessage { +abstract class LocalizedErrorMessage with _$LocalizedErrorMessage { @JsonSerializable(explicitToJson: true) const factory LocalizedErrorMessage({ /// The error code for example Cancelled diff --git a/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart b/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart index 77ebd213d..82a06addc 100644 --- a/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/errors.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,658 +9,852 @@ part of 'errors.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -StripeError _$StripeErrorFromJson(Map json) { - return _StripeErrorGeneric.fromJson(json); +StripeError _$StripeErrorFromJson( + Map json +) { + return _StripeErrorGeneric.fromJson( + json + ); } /// @nodoc mixin _$StripeError { - String get message => throw _privateConstructorUsedError; - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - T get code => throw _privateConstructorUsedError; + + String get message;@JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T get code; +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StripeErrorCopyWith> get copyWith => _$StripeErrorCopyWithImpl>(this as StripeError, _$identity); /// Serializes this StripeError to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $StripeErrorCopyWith> get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StripeError&&(identical(other.message, message) || other.message == message)&&const DeepCollectionEquality().equals(other.code, code)); } -/// @nodoc -abstract class $StripeErrorCopyWith { - factory $StripeErrorCopyWith( - StripeError value, $Res Function(StripeError) then) = - _$StripeErrorCopyWithImpl>; - @useResult - $Res call( - {String message, - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message,const DeepCollectionEquality().hash(code)); + +@override +String toString() { + return 'StripeError<$T>(message: $message, code: $code)'; } -/// @nodoc -class _$StripeErrorCopyWithImpl> - implements $StripeErrorCopyWith { - _$StripeErrorCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? message = null, - Object? code = freezed, - }) { - return _then(_value.copyWith( - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as T, - ) as $Val); - } + } /// @nodoc -abstract class _$$StripeErrorGenericImplCopyWith +abstract mixin class $StripeErrorCopyWith { + factory $StripeErrorCopyWith(StripeError value, $Res Function(StripeError) _then) = _$StripeErrorCopyWithImpl; +@useResult +$Res call({ + String message,@JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code +}); + + + + +} +/// @nodoc +class _$StripeErrorCopyWithImpl implements $StripeErrorCopyWith { - factory _$$StripeErrorGenericImplCopyWith(_$StripeErrorGenericImpl value, - $Res Function(_$StripeErrorGenericImpl) then) = - __$$StripeErrorGenericImplCopyWithImpl; - @override - @useResult - $Res call( - {String message, - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code}); + _$StripeErrorCopyWithImpl(this._self, this._then); + + final StripeError _self; + final $Res Function(StripeError) _then; + +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? message = null,Object? code = freezed,}) { + return _then(_self.copyWith( +message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String,code: freezed == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as T, + )); +} + +} + + +/// Adds pattern-matching-related methods to [StripeError]. +extension StripeErrorPatterns on StripeError { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StripeErrorGeneric value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StripeErrorGeneric() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StripeErrorGeneric value) $default,){ +final _that = this; +switch (_that) { +case _StripeErrorGeneric(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StripeErrorGeneric value)? $default,){ +final _that = this; +switch (_that) { +case _StripeErrorGeneric() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String message, @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StripeErrorGeneric() when $default != null: +return $default(_that.message,_that.code);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String message, @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code) $default,) {final _that = this; +switch (_that) { +case _StripeErrorGeneric(): +return $default(_that.message,_that.code);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String message, @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code)? $default,) {final _that = this; +switch (_that) { +case _StripeErrorGeneric() when $default != null: +return $default(_that.message,_that.code);case _: + return null; + +} } -/// @nodoc -class __$$StripeErrorGenericImplCopyWithImpl - extends _$StripeErrorCopyWithImpl> - implements _$$StripeErrorGenericImplCopyWith { - __$$StripeErrorGenericImplCopyWithImpl(_$StripeErrorGenericImpl _value, - $Res Function(_$StripeErrorGenericImpl) _then) - : super(_value, _then); - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? message = null, - Object? code = freezed, - }) { - return _then(_$StripeErrorGenericImpl( - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as T, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$StripeErrorGenericImpl implements _StripeErrorGeneric { - const _$StripeErrorGenericImpl( - {this.message = 'Unknown error', - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - required this.code}); - - factory _$StripeErrorGenericImpl.fromJson(Map json) => - _$$StripeErrorGenericImplFromJson(json); - - @override - @JsonKey() - final String message; - @override - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - final T code; - - @override - String toString() { - return 'StripeError<$T>(message: $message, code: $code)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$StripeErrorGenericImpl && - (identical(other.message, message) || other.message == message) && - const DeepCollectionEquality().equals(other.code, code)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, message, const DeepCollectionEquality().hash(code)); - - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$StripeErrorGenericImplCopyWith> - get copyWith => __$$StripeErrorGenericImplCopyWithImpl>(this, _$identity); - - @override - Map toJson() { - return _$$StripeErrorGenericImplToJson( - this, - ); - } +class _StripeErrorGeneric implements StripeError { + const _StripeErrorGeneric({this.message = 'Unknown error', @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) required this.code}); + factory _StripeErrorGeneric.fromJson(Map json) => _$StripeErrorGenericFromJson(json); + +@override@JsonKey() final String message; +@override@JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) final T code; + +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StripeErrorGenericCopyWith> get copyWith => __$StripeErrorGenericCopyWithImpl>(this, _$identity); + +@override +Map toJson() { + return _$StripeErrorGenericToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StripeErrorGeneric&&(identical(other.message, message) || other.message == message)&&const DeepCollectionEquality().equals(other.code, code)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message,const DeepCollectionEquality().hash(code)); + +@override +String toString() { + return 'StripeError<$T>(message: $message, code: $code)'; } -abstract class _StripeErrorGeneric implements StripeError { - const factory _StripeErrorGeneric( - {final String message, - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - required final T code}) = _$StripeErrorGenericImpl; - factory _StripeErrorGeneric.fromJson(Map json) = - _$StripeErrorGenericImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$StripeErrorGenericCopyWith implements $StripeErrorCopyWith { + factory _$StripeErrorGenericCopyWith(_StripeErrorGeneric value, $Res Function(_StripeErrorGeneric) _then) = __$StripeErrorGenericCopyWithImpl; +@override @useResult +$Res call({ + String message,@JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) T code +}); + + - @override - String get message; - @override - @JsonKey(fromJson: _dataFromJson, toJson: _dataToJson) - T get code; - /// Create a copy of StripeError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$StripeErrorGenericImplCopyWith> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$StripeErrorGenericCopyWithImpl + implements _$StripeErrorGenericCopyWith { + __$StripeErrorGenericCopyWithImpl(this._self, this._then); + + final _StripeErrorGeneric _self; + final $Res Function(_StripeErrorGeneric) _then; + +/// Create a copy of StripeError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? message = null,Object? code = freezed,}) { + return _then(_StripeErrorGeneric( +message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String,code: freezed == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as T, + )); } -StripeException _$StripeExceptionFromJson(Map json) { - return _StripeException.fromJson(json); + } + /// @nodoc mixin _$StripeException { - /// error details - LocalizedErrorMessage get error => throw _privateConstructorUsedError; + +/// error details + LocalizedErrorMessage get error; +/// Create a copy of StripeException +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StripeExceptionCopyWith get copyWith => _$StripeExceptionCopyWithImpl(this as StripeException, _$identity); /// Serializes this StripeException to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of StripeException - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $StripeExceptionCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StripeException&&(identical(other.error, error) || other.error == error)); } -/// @nodoc -abstract class $StripeExceptionCopyWith<$Res> { - factory $StripeExceptionCopyWith( - StripeException value, $Res Function(StripeException) then) = - _$StripeExceptionCopyWithImpl<$Res, StripeException>; - @useResult - $Res call({LocalizedErrorMessage error}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,error); - $LocalizedErrorMessageCopyWith<$Res> get error; +@override +String toString() { + return 'StripeException(error: $error)'; } -/// @nodoc -class _$StripeExceptionCopyWithImpl<$Res, $Val extends StripeException> - implements $StripeExceptionCopyWith<$Res> { - _$StripeExceptionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of StripeException - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? error = null, - }) { - return _then(_value.copyWith( - error: null == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as LocalizedErrorMessage, - ) as $Val); - } - - /// Create a copy of StripeException - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $LocalizedErrorMessageCopyWith<$Res> get error { - return $LocalizedErrorMessageCopyWith<$Res>(_value.error, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$StripeExceptionImplCopyWith<$Res> +abstract mixin class $StripeExceptionCopyWith<$Res> { + factory $StripeExceptionCopyWith(StripeException value, $Res Function(StripeException) _then) = _$StripeExceptionCopyWithImpl; +@useResult +$Res call({ + LocalizedErrorMessage error +}); + + +$LocalizedErrorMessageCopyWith<$Res> get error; + +} +/// @nodoc +class _$StripeExceptionCopyWithImpl<$Res> implements $StripeExceptionCopyWith<$Res> { - factory _$$StripeExceptionImplCopyWith(_$StripeExceptionImpl value, - $Res Function(_$StripeExceptionImpl) then) = - __$$StripeExceptionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({LocalizedErrorMessage error}); + _$StripeExceptionCopyWithImpl(this._self, this._then); + + final StripeException _self; + final $Res Function(StripeException) _then; + +/// Create a copy of StripeException +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? error = null,}) { + return _then(_self.copyWith( +error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as LocalizedErrorMessage, + )); +} +/// Create a copy of StripeException +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LocalizedErrorMessageCopyWith<$Res> get error { + + return $LocalizedErrorMessageCopyWith<$Res>(_self.error, (value) { + return _then(_self.copyWith(error: value)); + }); +} +} + - @override - $LocalizedErrorMessageCopyWith<$Res> get error; +/// Adds pattern-matching-related methods to [StripeException]. +extension StripeExceptionPatterns on StripeException { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _StripeException value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _StripeException() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _StripeException value) $default,){ +final _that = this; +switch (_that) { +case _StripeException(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StripeException value)? $default,){ +final _that = this; +switch (_that) { +case _StripeException() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( LocalizedErrorMessage error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _StripeException() when $default != null: +return $default(_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( LocalizedErrorMessage error) $default,) {final _that = this; +switch (_that) { +case _StripeException(): +return $default(_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( LocalizedErrorMessage error)? $default,) {final _that = this; +switch (_that) { +case _StripeException() when $default != null: +return $default(_that.error);case _: + return null; + +} } -/// @nodoc -class __$$StripeExceptionImplCopyWithImpl<$Res> - extends _$StripeExceptionCopyWithImpl<$Res, _$StripeExceptionImpl> - implements _$$StripeExceptionImplCopyWith<$Res> { - __$$StripeExceptionImplCopyWithImpl( - _$StripeExceptionImpl _value, $Res Function(_$StripeExceptionImpl) _then) - : super(_value, _then); - - /// Create a copy of StripeException - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? error = null, - }) { - return _then(_$StripeExceptionImpl( - error: null == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as LocalizedErrorMessage, - )); - } } /// @nodoc @JsonSerializable() -class _$StripeExceptionImpl implements _StripeException { - const _$StripeExceptionImpl({required this.error}); - - factory _$StripeExceptionImpl.fromJson(Map json) => - _$$StripeExceptionImplFromJson(json); - - /// error details - @override - final LocalizedErrorMessage error; - - @override - String toString() { - return 'StripeException(error: $error)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$StripeExceptionImpl && - (identical(other.error, error) || other.error == error)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, error); - - /// Create a copy of StripeException - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$StripeExceptionImplCopyWith<_$StripeExceptionImpl> get copyWith => - __$$StripeExceptionImplCopyWithImpl<_$StripeExceptionImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$StripeExceptionImplToJson( - this, - ); - } + +class _StripeException implements StripeException { + const _StripeException({required this.error}); + factory _StripeException.fromJson(Map json) => _$StripeExceptionFromJson(json); + +/// error details +@override final LocalizedErrorMessage error; + +/// Create a copy of StripeException +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$StripeExceptionCopyWith<_StripeException> get copyWith => __$StripeExceptionCopyWithImpl<_StripeException>(this, _$identity); + +@override +Map toJson() { + return _$StripeExceptionToJson(this, ); } -abstract class _StripeException implements StripeException { - const factory _StripeException({required final LocalizedErrorMessage error}) = - _$StripeExceptionImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _StripeException&&(identical(other.error, error) || other.error == error)); +} - factory _StripeException.fromJson(Map json) = - _$StripeExceptionImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,error); + +@override +String toString() { + return 'StripeException(error: $error)'; +} - /// error details - @override - LocalizedErrorMessage get error; - /// Create a copy of StripeException - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$StripeExceptionImplCopyWith<_$StripeExceptionImpl> get copyWith => - throw _privateConstructorUsedError; } -LocalizedErrorMessage _$LocalizedErrorMessageFromJson( - Map json) { - return _LocalizedErrorMessage.fromJson(json); +/// @nodoc +abstract mixin class _$StripeExceptionCopyWith<$Res> implements $StripeExceptionCopyWith<$Res> { + factory _$StripeExceptionCopyWith(_StripeException value, $Res Function(_StripeException) _then) = __$StripeExceptionCopyWithImpl; +@override @useResult +$Res call({ + LocalizedErrorMessage error +}); + + +@override $LocalizedErrorMessageCopyWith<$Res> get error; + } +/// @nodoc +class __$StripeExceptionCopyWithImpl<$Res> + implements _$StripeExceptionCopyWith<$Res> { + __$StripeExceptionCopyWithImpl(this._self, this._then); + + final _StripeException _self; + final $Res Function(_StripeException) _then; + +/// Create a copy of StripeException +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? error = null,}) { + return _then(_StripeException( +error: null == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as LocalizedErrorMessage, + )); +} + +/// Create a copy of StripeException +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LocalizedErrorMessageCopyWith<$Res> get error { + + return $LocalizedErrorMessageCopyWith<$Res>(_self.error, (value) { + return _then(_self.copyWith(error: value)); + }); +} +} + /// @nodoc mixin _$LocalizedErrorMessage { - /// The error code for example Cancelled - @JsonKey(unknownEnumValue: FailureCode.Unknown) - FailureCode get code => throw _privateConstructorUsedError; - /// Localized error message if any - String? get localizedMessage => throw _privateConstructorUsedError; +/// The error code for example Cancelled +@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode get code;/// Localized error message if any + String? get localizedMessage;/// Generic untranslated error message. + String? get message;/// Stripe error code + String? get stripeErrorCode;/// Code in case payment is declined + String? get declineCode;/// Error type + String? get type; +/// Create a copy of LocalizedErrorMessage +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LocalizedErrorMessageCopyWith get copyWith => _$LocalizedErrorMessageCopyWithImpl(this as LocalizedErrorMessage, _$identity); - /// Generic untranslated error message. - String? get message => throw _privateConstructorUsedError; + /// Serializes this LocalizedErrorMessage to a JSON map. + Map toJson(); - /// Stripe error code - String? get stripeErrorCode => throw _privateConstructorUsedError; - /// Code in case payment is declined - String? get declineCode => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LocalizedErrorMessage&&(identical(other.code, code) || other.code == code)&&(identical(other.localizedMessage, localizedMessage) || other.localizedMessage == localizedMessage)&&(identical(other.message, message) || other.message == message)&&(identical(other.stripeErrorCode, stripeErrorCode) || other.stripeErrorCode == stripeErrorCode)&&(identical(other.declineCode, declineCode) || other.declineCode == declineCode)&&(identical(other.type, type) || other.type == type)); +} - /// Error type - String? get type => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,code,localizedMessage,message,stripeErrorCode,declineCode,type); + +@override +String toString() { + return 'LocalizedErrorMessage(code: $code, localizedMessage: $localizedMessage, message: $message, stripeErrorCode: $stripeErrorCode, declineCode: $declineCode, type: $type)'; +} - /// Serializes this LocalizedErrorMessage to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of LocalizedErrorMessage - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $LocalizedErrorMessageCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $LocalizedErrorMessageCopyWith<$Res> { - factory $LocalizedErrorMessageCopyWith(LocalizedErrorMessage value, - $Res Function(LocalizedErrorMessage) then) = - _$LocalizedErrorMessageCopyWithImpl<$Res, LocalizedErrorMessage>; - @useResult - $Res call( - {@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, - String? localizedMessage, - String? message, - String? stripeErrorCode, - String? declineCode, - String? type}); -} +abstract mixin class $LocalizedErrorMessageCopyWith<$Res> { + factory $LocalizedErrorMessageCopyWith(LocalizedErrorMessage value, $Res Function(LocalizedErrorMessage) _then) = _$LocalizedErrorMessageCopyWithImpl; +@useResult +$Res call({ +@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, String? localizedMessage, String? message, String? stripeErrorCode, String? declineCode, String? type +}); + + + +} /// @nodoc -class _$LocalizedErrorMessageCopyWithImpl<$Res, - $Val extends LocalizedErrorMessage> +class _$LocalizedErrorMessageCopyWithImpl<$Res> implements $LocalizedErrorMessageCopyWith<$Res> { - _$LocalizedErrorMessageCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of LocalizedErrorMessage - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? code = null, - Object? localizedMessage = freezed, - Object? message = freezed, - Object? stripeErrorCode = freezed, - Object? declineCode = freezed, - Object? type = freezed, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as FailureCode, - localizedMessage: freezed == localizedMessage - ? _value.localizedMessage - : localizedMessage // ignore: cast_nullable_to_non_nullable - as String?, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - stripeErrorCode: freezed == stripeErrorCode - ? _value.stripeErrorCode - : stripeErrorCode // ignore: cast_nullable_to_non_nullable - as String?, - declineCode: freezed == declineCode - ? _value.declineCode - : declineCode // ignore: cast_nullable_to_non_nullable - as String?, - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + _$LocalizedErrorMessageCopyWithImpl(this._self, this._then); + + final LocalizedErrorMessage _self; + final $Res Function(LocalizedErrorMessage) _then; + +/// Create a copy of LocalizedErrorMessage +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? code = null,Object? localizedMessage = freezed,Object? message = freezed,Object? stripeErrorCode = freezed,Object? declineCode = freezed,Object? type = freezed,}) { + return _then(_self.copyWith( +code: null == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as FailureCode,localizedMessage: freezed == localizedMessage ? _self.localizedMessage : localizedMessage // ignore: cast_nullable_to_non_nullable +as String?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,stripeErrorCode: freezed == stripeErrorCode ? _self.stripeErrorCode : stripeErrorCode // ignore: cast_nullable_to_non_nullable +as String?,declineCode: freezed == declineCode ? _self.declineCode : declineCode // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$LocalizedErrorMessageImplCopyWith<$Res> - implements $LocalizedErrorMessageCopyWith<$Res> { - factory _$$LocalizedErrorMessageImplCopyWith( - _$LocalizedErrorMessageImpl value, - $Res Function(_$LocalizedErrorMessageImpl) then) = - __$$LocalizedErrorMessageImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, - String? localizedMessage, - String? message, - String? stripeErrorCode, - String? declineCode, - String? type}); } -/// @nodoc -class __$$LocalizedErrorMessageImplCopyWithImpl<$Res> - extends _$LocalizedErrorMessageCopyWithImpl<$Res, - _$LocalizedErrorMessageImpl> - implements _$$LocalizedErrorMessageImplCopyWith<$Res> { - __$$LocalizedErrorMessageImplCopyWithImpl(_$LocalizedErrorMessageImpl _value, - $Res Function(_$LocalizedErrorMessageImpl) _then) - : super(_value, _then); - - /// Create a copy of LocalizedErrorMessage - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? code = null, - Object? localizedMessage = freezed, - Object? message = freezed, - Object? stripeErrorCode = freezed, - Object? declineCode = freezed, - Object? type = freezed, - }) { - return _then(_$LocalizedErrorMessageImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as FailureCode, - localizedMessage: freezed == localizedMessage - ? _value.localizedMessage - : localizedMessage // ignore: cast_nullable_to_non_nullable - as String?, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - stripeErrorCode: freezed == stripeErrorCode - ? _value.stripeErrorCode - : stripeErrorCode // ignore: cast_nullable_to_non_nullable - as String?, - declineCode: freezed == declineCode - ? _value.declineCode - : declineCode // ignore: cast_nullable_to_non_nullable - as String?, - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + +/// Adds pattern-matching-related methods to [LocalizedErrorMessage]. +extension LocalizedErrorMessagePatterns on LocalizedErrorMessage { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LocalizedErrorMessage value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LocalizedErrorMessage() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LocalizedErrorMessage value) $default,){ +final _that = this; +switch (_that) { +case _LocalizedErrorMessage(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LocalizedErrorMessage value)? $default,){ +final _that = this; +switch (_that) { +case _LocalizedErrorMessage() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, String? localizedMessage, String? message, String? stripeErrorCode, String? declineCode, String? type)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LocalizedErrorMessage() when $default != null: +return $default(_that.code,_that.localizedMessage,_that.message,_that.stripeErrorCode,_that.declineCode,_that.type);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, String? localizedMessage, String? message, String? stripeErrorCode, String? declineCode, String? type) $default,) {final _that = this; +switch (_that) { +case _LocalizedErrorMessage(): +return $default(_that.code,_that.localizedMessage,_that.message,_that.stripeErrorCode,_that.declineCode,_that.type);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, String? localizedMessage, String? message, String? stripeErrorCode, String? declineCode, String? type)? $default,) {final _that = this; +switch (_that) { +case _LocalizedErrorMessage() when $default != null: +return $default(_that.code,_that.localizedMessage,_that.message,_that.stripeErrorCode,_that.declineCode,_that.type);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$LocalizedErrorMessageImpl implements _LocalizedErrorMessage { - const _$LocalizedErrorMessageImpl( - {@JsonKey(unknownEnumValue: FailureCode.Unknown) required this.code, - this.localizedMessage, - this.message, - this.stripeErrorCode, - this.declineCode, - this.type}); - - factory _$LocalizedErrorMessageImpl.fromJson(Map json) => - _$$LocalizedErrorMessageImplFromJson(json); - - /// The error code for example Cancelled - @override - @JsonKey(unknownEnumValue: FailureCode.Unknown) - final FailureCode code; - - /// Localized error message if any - @override - final String? localizedMessage; - - /// Generic untranslated error message. - @override - final String? message; - - /// Stripe error code - @override - final String? stripeErrorCode; - - /// Code in case payment is declined - @override - final String? declineCode; - - /// Error type - @override - final String? type; - - @override - String toString() { - return 'LocalizedErrorMessage(code: $code, localizedMessage: $localizedMessage, message: $message, stripeErrorCode: $stripeErrorCode, declineCode: $declineCode, type: $type)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$LocalizedErrorMessageImpl && - (identical(other.code, code) || other.code == code) && - (identical(other.localizedMessage, localizedMessage) || - other.localizedMessage == localizedMessage) && - (identical(other.message, message) || other.message == message) && - (identical(other.stripeErrorCode, stripeErrorCode) || - other.stripeErrorCode == stripeErrorCode) && - (identical(other.declineCode, declineCode) || - other.declineCode == declineCode) && - (identical(other.type, type) || other.type == type)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, code, localizedMessage, message, - stripeErrorCode, declineCode, type); - - /// Create a copy of LocalizedErrorMessage - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$LocalizedErrorMessageImplCopyWith<_$LocalizedErrorMessageImpl> - get copyWith => __$$LocalizedErrorMessageImplCopyWithImpl< - _$LocalizedErrorMessageImpl>(this, _$identity); - - @override - Map toJson() { - return _$$LocalizedErrorMessageImplToJson( - this, - ); - } -} - -abstract class _LocalizedErrorMessage implements LocalizedErrorMessage { - const factory _LocalizedErrorMessage( - {@JsonKey(unknownEnumValue: FailureCode.Unknown) - required final FailureCode code, - final String? localizedMessage, - final String? message, - final String? stripeErrorCode, - final String? declineCode, - final String? type}) = _$LocalizedErrorMessageImpl; - - factory _LocalizedErrorMessage.fromJson(Map json) = - _$LocalizedErrorMessageImpl.fromJson; - - /// The error code for example Cancelled - @override - @JsonKey(unknownEnumValue: FailureCode.Unknown) - FailureCode get code; - - /// Localized error message if any - @override - String? get localizedMessage; - - /// Generic untranslated error message. - @override - String? get message; - - /// Stripe error code - @override - String? get stripeErrorCode; - - /// Code in case payment is declined - @override - String? get declineCode; - - /// Error type - @override - String? get type; - - /// Create a copy of LocalizedErrorMessage - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$LocalizedErrorMessageImplCopyWith<_$LocalizedErrorMessageImpl> - get copyWith => throw _privateConstructorUsedError; +class _LocalizedErrorMessage implements LocalizedErrorMessage { + const _LocalizedErrorMessage({@JsonKey(unknownEnumValue: FailureCode.Unknown) required this.code, this.localizedMessage, this.message, this.stripeErrorCode, this.declineCode, this.type}); + factory _LocalizedErrorMessage.fromJson(Map json) => _$LocalizedErrorMessageFromJson(json); + +/// The error code for example Cancelled +@override@JsonKey(unknownEnumValue: FailureCode.Unknown) final FailureCode code; +/// Localized error message if any +@override final String? localizedMessage; +/// Generic untranslated error message. +@override final String? message; +/// Stripe error code +@override final String? stripeErrorCode; +/// Code in case payment is declined +@override final String? declineCode; +/// Error type +@override final String? type; + +/// Create a copy of LocalizedErrorMessage +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LocalizedErrorMessageCopyWith<_LocalizedErrorMessage> get copyWith => __$LocalizedErrorMessageCopyWithImpl<_LocalizedErrorMessage>(this, _$identity); + +@override +Map toJson() { + return _$LocalizedErrorMessageToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LocalizedErrorMessage&&(identical(other.code, code) || other.code == code)&&(identical(other.localizedMessage, localizedMessage) || other.localizedMessage == localizedMessage)&&(identical(other.message, message) || other.message == message)&&(identical(other.stripeErrorCode, stripeErrorCode) || other.stripeErrorCode == stripeErrorCode)&&(identical(other.declineCode, declineCode) || other.declineCode == declineCode)&&(identical(other.type, type) || other.type == type)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,code,localizedMessage,message,stripeErrorCode,declineCode,type); + +@override +String toString() { + return 'LocalizedErrorMessage(code: $code, localizedMessage: $localizedMessage, message: $message, stripeErrorCode: $stripeErrorCode, declineCode: $declineCode, type: $type)'; +} + + +} + +/// @nodoc +abstract mixin class _$LocalizedErrorMessageCopyWith<$Res> implements $LocalizedErrorMessageCopyWith<$Res> { + factory _$LocalizedErrorMessageCopyWith(_LocalizedErrorMessage value, $Res Function(_LocalizedErrorMessage) _then) = __$LocalizedErrorMessageCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(unknownEnumValue: FailureCode.Unknown) FailureCode code, String? localizedMessage, String? message, String? stripeErrorCode, String? declineCode, String? type +}); + + + + +} +/// @nodoc +class __$LocalizedErrorMessageCopyWithImpl<$Res> + implements _$LocalizedErrorMessageCopyWith<$Res> { + __$LocalizedErrorMessageCopyWithImpl(this._self, this._then); + + final _LocalizedErrorMessage _self; + final $Res Function(_LocalizedErrorMessage) _then; + +/// Create a copy of LocalizedErrorMessage +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? code = null,Object? localizedMessage = freezed,Object? message = freezed,Object? stripeErrorCode = freezed,Object? declineCode = freezed,Object? type = freezed,}) { + return _then(_LocalizedErrorMessage( +code: null == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as FailureCode,localizedMessage: freezed == localizedMessage ? _self.localizedMessage : localizedMessage // ignore: cast_nullable_to_non_nullable +as String?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,stripeErrorCode: freezed == stripeErrorCode ? _self.stripeErrorCode : stripeErrorCode // ignore: cast_nullable_to_non_nullable +as String?,declineCode: freezed == declineCode ? _self.declineCode : declineCode // ignore: cast_nullable_to_non_nullable +as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String?, + )); } + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/errors.g.dart b/packages/stripe_platform_interface/lib/src/models/errors.g.dart index c9ad22a31..e2d2c5c5b 100644 --- a/packages/stripe_platform_interface/lib/src/models/errors.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/errors.g.dart @@ -6,55 +6,55 @@ part of 'errors.dart'; // JsonSerializableGenerator // ************************************************************************** -_$StripeErrorGenericImpl _$$StripeErrorGenericImplFromJson( - Map json) => - _$StripeErrorGenericImpl( - message: json['message'] as String? ?? 'Unknown error', - code: _dataFromJson(json['code'] as Map), - ); +_StripeErrorGeneric _$StripeErrorGenericFromJson( + Map json, +) => _StripeErrorGeneric( + message: json['message'] as String? ?? 'Unknown error', + code: _dataFromJson(json['code'] as Map), +); -Map _$$StripeErrorGenericImplToJson( - _$StripeErrorGenericImpl instance) => - { - 'message': instance.message, - 'code': _dataToJson(instance.code), - }; +Map _$StripeErrorGenericToJson( + _StripeErrorGeneric instance, +) => { + 'message': instance.message, + 'code': _dataToJson(instance.code), +}; -_$StripeExceptionImpl _$$StripeExceptionImplFromJson( - Map json) => - _$StripeExceptionImpl( - error: - LocalizedErrorMessage.fromJson(json['error'] as Map), +_StripeException _$StripeExceptionFromJson(Map json) => + _StripeException( + error: LocalizedErrorMessage.fromJson( + json['error'] as Map, + ), ); -Map _$$StripeExceptionImplToJson( - _$StripeExceptionImpl instance) => - { - 'error': instance.error, - }; +Map _$StripeExceptionToJson(_StripeException instance) => + {'error': instance.error}; -_$LocalizedErrorMessageImpl _$$LocalizedErrorMessageImplFromJson( - Map json) => - _$LocalizedErrorMessageImpl( - code: $enumDecode(_$FailureCodeEnumMap, json['code'], - unknownValue: FailureCode.Unknown), - localizedMessage: json['localizedMessage'] as String?, - message: json['message'] as String?, - stripeErrorCode: json['stripeErrorCode'] as String?, - declineCode: json['declineCode'] as String?, - type: json['type'] as String?, - ); +_LocalizedErrorMessage _$LocalizedErrorMessageFromJson( + Map json, +) => _LocalizedErrorMessage( + code: $enumDecode( + _$FailureCodeEnumMap, + json['code'], + unknownValue: FailureCode.Unknown, + ), + localizedMessage: json['localizedMessage'] as String?, + message: json['message'] as String?, + stripeErrorCode: json['stripeErrorCode'] as String?, + declineCode: json['declineCode'] as String?, + type: json['type'] as String?, +); -Map _$$LocalizedErrorMessageImplToJson( - _$LocalizedErrorMessageImpl instance) => - { - 'code': _$FailureCodeEnumMap[instance.code]!, - 'localizedMessage': instance.localizedMessage, - 'message': instance.message, - 'stripeErrorCode': instance.stripeErrorCode, - 'declineCode': instance.declineCode, - 'type': instance.type, - }; +Map _$LocalizedErrorMessageToJson( + _LocalizedErrorMessage instance, +) => { + 'code': _$FailureCodeEnumMap[instance.code]!, + 'localizedMessage': instance.localizedMessage, + 'message': instance.message, + 'stripeErrorCode': instance.stripeErrorCode, + 'declineCode': instance.declineCode, + 'type': instance.type, +}; const _$FailureCodeEnumMap = { FailureCode.Failed: 'Failed', diff --git a/packages/stripe_platform_interface/lib/src/models/financial_connections.dart b/packages/stripe_platform_interface/lib/src/models/financial_connections.dart index 537ee63a6..a0f9e56a1 100644 --- a/packages/stripe_platform_interface/lib/src/models/financial_connections.dart +++ b/packages/stripe_platform_interface/lib/src/models/financial_connections.dart @@ -7,19 +7,21 @@ part 'financial_connections.freezed.dart'; part 'financial_connections.g.dart'; @freezed -class FinancialConnectionSessionResult with _$FinancialConnectionSessionResult { +abstract class FinancialConnectionSessionResult + with _$FinancialConnectionSessionResult { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionSessionResult({ required FinancialConnectionSession session, }) = _FinancialConnectionSessionResult; factory FinancialConnectionSessionResult.fromJson( - Map json) => - _$FinancialConnectionSessionResultFromJson(json); + Map json, + ) => _$FinancialConnectionSessionResultFromJson(json); } @freezed -class FinancialConnectionTokenResult with _$FinancialConnectionTokenResult { +abstract class FinancialConnectionTokenResult + with _$FinancialConnectionTokenResult { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionTokenResult({ required FinancialConnectionSession session, @@ -31,9 +33,8 @@ class FinancialConnectionTokenResult with _$FinancialConnectionTokenResult { } @freezed - /// Data related to the session retrieved from the financial connection. -class FinancialConnectionSession with _$FinancialConnectionSession { +abstract class FinancialConnectionSession with _$FinancialConnectionSession { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionSession({ /// Unique id for this session @@ -54,9 +55,8 @@ class FinancialConnectionSession with _$FinancialConnectionSession { } @freezed - /// Data related to the session retrieved from the financial connection. -class FinancialConnectionBankAccountToken +abstract class FinancialConnectionBankAccountToken with _$FinancialConnectionBankAccountToken { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionBankAccountToken({ @@ -77,13 +77,13 @@ class FinancialConnectionBankAccountToken }) = _FinancialConnectionBankAccountToken; factory FinancialConnectionBankAccountToken.fromJson( - Map json) => - _$FinancialConnectionBankAccountTokenFromJson(json); + Map json, + ) => _$FinancialConnectionBankAccountTokenFromJson(json); } /// Data linked to an account @freezed -class FinancialConnectionAccount with _$FinancialConnectionAccount { +abstract class FinancialConnectionAccount with _$FinancialConnectionAccount { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionAccount({ /// Unique id for this Financial connection account. @@ -124,7 +124,7 @@ class FinancialConnectionAccount with _$FinancialConnectionAccount { /// Support payment method types for this account. required List - supportedPaymentMethodTypes, + supportedPaymentMethodTypes, }) = _FinancialConnectionAccount; factory FinancialConnectionAccount.fromJson(Map json) => @@ -132,7 +132,7 @@ class FinancialConnectionAccount with _$FinancialConnectionAccount { } @freezed -class BalanceRefresh with _$BalanceRefresh { +abstract class BalanceRefresh with _$BalanceRefresh { @JsonSerializable(explicitToJson: true) const factory BalanceRefresh({ /// Status of the balance refresh attempt @@ -148,7 +148,7 @@ class BalanceRefresh with _$BalanceRefresh { /// information related to the bank account @freezed -class AccountBalance with _$AccountBalance { +abstract class AccountBalance with _$AccountBalance { @JsonSerializable(explicitToJson: true) const factory AccountBalance({ /// Unix timestamp in milliseconds of time the external instition calculated this balance. @@ -192,10 +192,7 @@ enum AccountSubcategory { savings, } -enum FinancialConnectionsPaymentMethodType { - usBankAccount, - link, -} +enum FinancialConnectionsPaymentMethodType { usBankAccount, link } enum AccountPermission { balances, @@ -215,7 +212,7 @@ enum FinancialConnectSheetError { Failed, Canceled } /// Parameters associated with the `collectFinancialConnectionsAccounts` method. @freezed -class CollectFinancialConnectionsAccountsParams +abstract class CollectFinancialConnectionsAccountsParams with _$CollectFinancialConnectionsAccountsParams { @JsonSerializable(explicitToJson: true) const factory CollectFinancialConnectionsAccountsParams({ @@ -228,13 +225,12 @@ class CollectFinancialConnectionsAccountsParams }) = _CollectFinancialConnectionsAccountsParams; factory CollectFinancialConnectionsAccountsParams.fromJson( - Map json) => - _$CollectFinancialConnectionsAccountsParamsFromJson(json); + Map json, + ) => _$CollectFinancialConnectionsAccountsParamsFromJson(json); } -typedef FinancialConnectionsEventHandler = void Function( - FinancialConnectionsEvent event, -); +typedef FinancialConnectionsEventHandler = + void Function(FinancialConnectionsEvent event); ///Theme options for colors used in our UI. enum UserInterfaceStyle { @@ -250,7 +246,7 @@ enum UserInterfaceStyle { /// The event that occurred during the Financial Connections process. @freezed -class FinancialConnectionsEvent with _$FinancialConnectionsEvent { +abstract class FinancialConnectionsEvent with _$FinancialConnectionsEvent { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionsEvent({ /// The event's name. Represents the type of event that has occurred during the Financial Connections process. @@ -266,7 +262,7 @@ class FinancialConnectionsEvent with _$FinancialConnectionsEvent { /// The metadata of the financial connections event @freezed -class FinancialConnectionsEventMetadata +abstract class FinancialConnectionsEventMetadata with _$FinancialConnectionsEventMetadata { @JsonSerializable(explicitToJson: true) const factory FinancialConnectionsEventMetadata({ @@ -281,8 +277,8 @@ class FinancialConnectionsEventMetadata }) = _FinancialConnectionsEventMetadata; factory FinancialConnectionsEventMetadata.fromJson( - Map json) => - _$FinancialConnectionsEventMetadataFromJson(json); + Map json, + ) => _$FinancialConnectionsEventMetadataFromJson(json); } enum FinancialConnectionsEventName { @@ -317,7 +313,7 @@ enum FinancialConnectionsEventName { cancel, /// Invoked when the modal is launched in an external browser. After this event, no other events will be sent until the completion of the browser session. - flow_launched_in_browser; + flow_launched_in_browser, } enum FinancialConnectionsEventErrorCode { diff --git a/packages/stripe_platform_interface/lib/src/models/financial_connections.freezed.dart b/packages/stripe_platform_interface/lib/src/models/financial_connections.freezed.dart index d174a0a1a..3e6915b4b 100644 --- a/packages/stripe_platform_interface/lib/src/models/financial_connections.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/financial_connections.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,2683 +9,3019 @@ part of 'financial_connections.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -FinancialConnectionSessionResult _$FinancialConnectionSessionResultFromJson( - Map json) { - return _FinancialConnectionSessionResult.fromJson(json); -} - /// @nodoc mixin _$FinancialConnectionSessionResult { - FinancialConnectionSession get session => throw _privateConstructorUsedError; + + FinancialConnectionSession get session; +/// Create a copy of FinancialConnectionSessionResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionSessionResultCopyWith get copyWith => _$FinancialConnectionSessionResultCopyWithImpl(this as FinancialConnectionSessionResult, _$identity); /// Serializes this FinancialConnectionSessionResult to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of FinancialConnectionSessionResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionSessionResultCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionSessionResult&&(identical(other.session, session) || other.session == session)); } -/// @nodoc -abstract class $FinancialConnectionSessionResultCopyWith<$Res> { - factory $FinancialConnectionSessionResultCopyWith( - FinancialConnectionSessionResult value, - $Res Function(FinancialConnectionSessionResult) then) = - _$FinancialConnectionSessionResultCopyWithImpl<$Res, - FinancialConnectionSessionResult>; - @useResult - $Res call({FinancialConnectionSession session}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,session); - $FinancialConnectionSessionCopyWith<$Res> get session; +@override +String toString() { + return 'FinancialConnectionSessionResult(session: $session)'; } -/// @nodoc -class _$FinancialConnectionSessionResultCopyWithImpl<$Res, - $Val extends FinancialConnectionSessionResult> - implements $FinancialConnectionSessionResultCopyWith<$Res> { - _$FinancialConnectionSessionResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionSessionResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? session = null, - }) { - return _then(_value.copyWith( - session: null == session - ? _value.session - : session // ignore: cast_nullable_to_non_nullable - as FinancialConnectionSession, - ) as $Val); - } - /// Create a copy of FinancialConnectionSessionResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $FinancialConnectionSessionCopyWith<$Res> get session { - return $FinancialConnectionSessionCopyWith<$Res>(_value.session, (value) { - return _then(_value.copyWith(session: value) as $Val); - }); - } } /// @nodoc -abstract class _$$FinancialConnectionSessionResultImplCopyWith<$Res> +abstract mixin class $FinancialConnectionSessionResultCopyWith<$Res> { + factory $FinancialConnectionSessionResultCopyWith(FinancialConnectionSessionResult value, $Res Function(FinancialConnectionSessionResult) _then) = _$FinancialConnectionSessionResultCopyWithImpl; +@useResult +$Res call({ + FinancialConnectionSession session +}); + + +$FinancialConnectionSessionCopyWith<$Res> get session; + +} +/// @nodoc +class _$FinancialConnectionSessionResultCopyWithImpl<$Res> implements $FinancialConnectionSessionResultCopyWith<$Res> { - factory _$$FinancialConnectionSessionResultImplCopyWith( - _$FinancialConnectionSessionResultImpl value, - $Res Function(_$FinancialConnectionSessionResultImpl) then) = - __$$FinancialConnectionSessionResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({FinancialConnectionSession session}); + _$FinancialConnectionSessionResultCopyWithImpl(this._self, this._then); + + final FinancialConnectionSessionResult _self; + final $Res Function(FinancialConnectionSessionResult) _then; + +/// Create a copy of FinancialConnectionSessionResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? session = null,}) { + return _then(_self.copyWith( +session: null == session ? _self.session : session // ignore: cast_nullable_to_non_nullable +as FinancialConnectionSession, + )); +} +/// Create a copy of FinancialConnectionSessionResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionSessionCopyWith<$Res> get session { + + return $FinancialConnectionSessionCopyWith<$Res>(_self.session, (value) { + return _then(_self.copyWith(session: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionSessionResult]. +extension FinancialConnectionSessionResultPatterns on FinancialConnectionSessionResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionSessionResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionSessionResult() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionSessionResult value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionSessionResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionSessionResult value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionSessionResult() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( FinancialConnectionSession session)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionSessionResult() when $default != null: +return $default(_that.session);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( FinancialConnectionSession session) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionSessionResult(): +return $default(_that.session);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( FinancialConnectionSession session)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionSessionResult() when $default != null: +return $default(_that.session);case _: + return null; - @override - $FinancialConnectionSessionCopyWith<$Res> get session; +} } -/// @nodoc -class __$$FinancialConnectionSessionResultImplCopyWithImpl<$Res> - extends _$FinancialConnectionSessionResultCopyWithImpl<$Res, - _$FinancialConnectionSessionResultImpl> - implements _$$FinancialConnectionSessionResultImplCopyWith<$Res> { - __$$FinancialConnectionSessionResultImplCopyWithImpl( - _$FinancialConnectionSessionResultImpl _value, - $Res Function(_$FinancialConnectionSessionResultImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionSessionResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? session = null, - }) { - return _then(_$FinancialConnectionSessionResultImpl( - session: null == session - ? _value.session - : session // ignore: cast_nullable_to_non_nullable - as FinancialConnectionSession, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FinancialConnectionSessionResultImpl - implements _FinancialConnectionSessionResult { - const _$FinancialConnectionSessionResultImpl({required this.session}); +class _FinancialConnectionSessionResult implements FinancialConnectionSessionResult { + const _FinancialConnectionSessionResult({required this.session}); + factory _FinancialConnectionSessionResult.fromJson(Map json) => _$FinancialConnectionSessionResultFromJson(json); - factory _$FinancialConnectionSessionResultImpl.fromJson( - Map json) => - _$$FinancialConnectionSessionResultImplFromJson(json); +@override final FinancialConnectionSession session; - @override - final FinancialConnectionSession session; +/// Create a copy of FinancialConnectionSessionResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionSessionResultCopyWith<_FinancialConnectionSessionResult> get copyWith => __$FinancialConnectionSessionResultCopyWithImpl<_FinancialConnectionSessionResult>(this, _$identity); - @override - String toString() { - return 'FinancialConnectionSessionResult(session: $session)'; - } +@override +Map toJson() { + return _$FinancialConnectionSessionResultToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionSessionResultImpl && - (identical(other.session, session) || other.session == session)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionSessionResult&&(identical(other.session, session) || other.session == session)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, session); - - /// Create a copy of FinancialConnectionSessionResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionSessionResultImplCopyWith< - _$FinancialConnectionSessionResultImpl> - get copyWith => __$$FinancialConnectionSessionResultImplCopyWithImpl< - _$FinancialConnectionSessionResultImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionSessionResultImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,session); + +@override +String toString() { + return 'FinancialConnectionSessionResult(session: $session)'; } -abstract class _FinancialConnectionSessionResult - implements FinancialConnectionSessionResult { - const factory _FinancialConnectionSessionResult( - {required final FinancialConnectionSession session}) = - _$FinancialConnectionSessionResultImpl; - factory _FinancialConnectionSessionResult.fromJson( - Map json) = - _$FinancialConnectionSessionResultImpl.fromJson; +} - @override - FinancialConnectionSession get session; +/// @nodoc +abstract mixin class _$FinancialConnectionSessionResultCopyWith<$Res> implements $FinancialConnectionSessionResultCopyWith<$Res> { + factory _$FinancialConnectionSessionResultCopyWith(_FinancialConnectionSessionResult value, $Res Function(_FinancialConnectionSessionResult) _then) = __$FinancialConnectionSessionResultCopyWithImpl; +@override @useResult +$Res call({ + FinancialConnectionSession session +}); + + +@override $FinancialConnectionSessionCopyWith<$Res> get session; - /// Create a copy of FinancialConnectionSessionResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionSessionResultImplCopyWith< - _$FinancialConnectionSessionResultImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$FinancialConnectionSessionResultCopyWithImpl<$Res> + implements _$FinancialConnectionSessionResultCopyWith<$Res> { + __$FinancialConnectionSessionResultCopyWithImpl(this._self, this._then); + + final _FinancialConnectionSessionResult _self; + final $Res Function(_FinancialConnectionSessionResult) _then; -FinancialConnectionTokenResult _$FinancialConnectionTokenResultFromJson( - Map json) { - return _FinancialConnectionTokenResult.fromJson(json); +/// Create a copy of FinancialConnectionSessionResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? session = null,}) { + return _then(_FinancialConnectionSessionResult( +session: null == session ? _self.session : session // ignore: cast_nullable_to_non_nullable +as FinancialConnectionSession, + )); } +/// Create a copy of FinancialConnectionSessionResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionSessionCopyWith<$Res> get session { + + return $FinancialConnectionSessionCopyWith<$Res>(_self.session, (value) { + return _then(_self.copyWith(session: value)); + }); +} +} + + /// @nodoc mixin _$FinancialConnectionTokenResult { - FinancialConnectionSession get session => throw _privateConstructorUsedError; - FinancialConnectionBankAccountToken get token => - throw _privateConstructorUsedError; + + FinancialConnectionSession get session; FinancialConnectionBankAccountToken get token; +/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionTokenResultCopyWith get copyWith => _$FinancialConnectionTokenResultCopyWithImpl(this as FinancialConnectionTokenResult, _$identity); /// Serializes this FinancialConnectionTokenResult to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionTokenResultCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionTokenResult&&(identical(other.session, session) || other.session == session)&&(identical(other.token, token) || other.token == token)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,session,token); + +@override +String toString() { + return 'FinancialConnectionTokenResult(session: $session, token: $token)'; } -/// @nodoc -abstract class $FinancialConnectionTokenResultCopyWith<$Res> { - factory $FinancialConnectionTokenResultCopyWith( - FinancialConnectionTokenResult value, - $Res Function(FinancialConnectionTokenResult) then) = - _$FinancialConnectionTokenResultCopyWithImpl<$Res, - FinancialConnectionTokenResult>; - @useResult - $Res call( - {FinancialConnectionSession session, - FinancialConnectionBankAccountToken token}); - $FinancialConnectionSessionCopyWith<$Res> get session; - $FinancialConnectionBankAccountTokenCopyWith<$Res> get token; } /// @nodoc -class _$FinancialConnectionTokenResultCopyWithImpl<$Res, - $Val extends FinancialConnectionTokenResult> - implements $FinancialConnectionTokenResultCopyWith<$Res> { - _$FinancialConnectionTokenResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? session = null, - Object? token = null, - }) { - return _then(_value.copyWith( - session: null == session - ? _value.session - : session // ignore: cast_nullable_to_non_nullable - as FinancialConnectionSession, - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as FinancialConnectionBankAccountToken, - ) as $Val); - } +abstract mixin class $FinancialConnectionTokenResultCopyWith<$Res> { + factory $FinancialConnectionTokenResultCopyWith(FinancialConnectionTokenResult value, $Res Function(FinancialConnectionTokenResult) _then) = _$FinancialConnectionTokenResultCopyWithImpl; +@useResult +$Res call({ + FinancialConnectionSession session, FinancialConnectionBankAccountToken token +}); - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $FinancialConnectionSessionCopyWith<$Res> get session { - return $FinancialConnectionSessionCopyWith<$Res>(_value.session, (value) { - return _then(_value.copyWith(session: value) as $Val); - }); - } - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $FinancialConnectionBankAccountTokenCopyWith<$Res> get token { - return $FinancialConnectionBankAccountTokenCopyWith<$Res>(_value.token, - (value) { - return _then(_value.copyWith(token: value) as $Val); - }); - } -} +$FinancialConnectionSessionCopyWith<$Res> get session;$FinancialConnectionBankAccountTokenCopyWith<$Res> get token; +} /// @nodoc -abstract class _$$FinancialConnectionTokenResultImplCopyWith<$Res> +class _$FinancialConnectionTokenResultCopyWithImpl<$Res> implements $FinancialConnectionTokenResultCopyWith<$Res> { - factory _$$FinancialConnectionTokenResultImplCopyWith( - _$FinancialConnectionTokenResultImpl value, - $Res Function(_$FinancialConnectionTokenResultImpl) then) = - __$$FinancialConnectionTokenResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {FinancialConnectionSession session, - FinancialConnectionBankAccountToken token}); - - @override - $FinancialConnectionSessionCopyWith<$Res> get session; - @override - $FinancialConnectionBankAccountTokenCopyWith<$Res> get token; + _$FinancialConnectionTokenResultCopyWithImpl(this._self, this._then); + + final FinancialConnectionTokenResult _self; + final $Res Function(FinancialConnectionTokenResult) _then; + +/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? session = null,Object? token = null,}) { + return _then(_self.copyWith( +session: null == session ? _self.session : session // ignore: cast_nullable_to_non_nullable +as FinancialConnectionSession,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as FinancialConnectionBankAccountToken, + )); +} +/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionSessionCopyWith<$Res> get session { + + return $FinancialConnectionSessionCopyWith<$Res>(_self.session, (value) { + return _then(_self.copyWith(session: value)); + }); +}/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionBankAccountTokenCopyWith<$Res> get token { + + return $FinancialConnectionBankAccountTokenCopyWith<$Res>(_self.token, (value) { + return _then(_self.copyWith(token: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionTokenResult]. +extension FinancialConnectionTokenResultPatterns on FinancialConnectionTokenResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionTokenResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionTokenResult() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionTokenResult value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionTokenResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionTokenResult value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionTokenResult() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( FinancialConnectionSession session, FinancialConnectionBankAccountToken token)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionTokenResult() when $default != null: +return $default(_that.session,_that.token);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( FinancialConnectionSession session, FinancialConnectionBankAccountToken token) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionTokenResult(): +return $default(_that.session,_that.token);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( FinancialConnectionSession session, FinancialConnectionBankAccountToken token)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionTokenResult() when $default != null: +return $default(_that.session,_that.token);case _: + return null; + +} } -/// @nodoc -class __$$FinancialConnectionTokenResultImplCopyWithImpl<$Res> - extends _$FinancialConnectionTokenResultCopyWithImpl<$Res, - _$FinancialConnectionTokenResultImpl> - implements _$$FinancialConnectionTokenResultImplCopyWith<$Res> { - __$$FinancialConnectionTokenResultImplCopyWithImpl( - _$FinancialConnectionTokenResultImpl _value, - $Res Function(_$FinancialConnectionTokenResultImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? session = null, - Object? token = null, - }) { - return _then(_$FinancialConnectionTokenResultImpl( - session: null == session - ? _value.session - : session // ignore: cast_nullable_to_non_nullable - as FinancialConnectionSession, - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as FinancialConnectionBankAccountToken, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FinancialConnectionTokenResultImpl - implements _FinancialConnectionTokenResult { - const _$FinancialConnectionTokenResultImpl( - {required this.session, required this.token}); - - factory _$FinancialConnectionTokenResultImpl.fromJson( - Map json) => - _$$FinancialConnectionTokenResultImplFromJson(json); - - @override - final FinancialConnectionSession session; - @override - final FinancialConnectionBankAccountToken token; - - @override - String toString() { - return 'FinancialConnectionTokenResult(session: $session, token: $token)'; - } +class _FinancialConnectionTokenResult implements FinancialConnectionTokenResult { + const _FinancialConnectionTokenResult({required this.session, required this.token}); + factory _FinancialConnectionTokenResult.fromJson(Map json) => _$FinancialConnectionTokenResultFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionTokenResultImpl && - (identical(other.session, session) || other.session == session) && - (identical(other.token, token) || other.token == token)); - } +@override final FinancialConnectionSession session; +@override final FinancialConnectionBankAccountToken token; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, session, token); - - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionTokenResultImplCopyWith< - _$FinancialConnectionTokenResultImpl> - get copyWith => __$$FinancialConnectionTokenResultImplCopyWithImpl< - _$FinancialConnectionTokenResultImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionTokenResultImplToJson( - this, - ); - } +/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionTokenResultCopyWith<_FinancialConnectionTokenResult> get copyWith => __$FinancialConnectionTokenResultCopyWithImpl<_FinancialConnectionTokenResult>(this, _$identity); + +@override +Map toJson() { + return _$FinancialConnectionTokenResultToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionTokenResult&&(identical(other.session, session) || other.session == session)&&(identical(other.token, token) || other.token == token)); } -abstract class _FinancialConnectionTokenResult - implements FinancialConnectionTokenResult { - const factory _FinancialConnectionTokenResult( - {required final FinancialConnectionSession session, - required final FinancialConnectionBankAccountToken token}) = - _$FinancialConnectionTokenResultImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,session,token); - factory _FinancialConnectionTokenResult.fromJson(Map json) = - _$FinancialConnectionTokenResultImpl.fromJson; +@override +String toString() { + return 'FinancialConnectionTokenResult(session: $session, token: $token)'; +} - @override - FinancialConnectionSession get session; - @override - FinancialConnectionBankAccountToken get token; - /// Create a copy of FinancialConnectionTokenResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionTokenResultImplCopyWith< - _$FinancialConnectionTokenResultImpl> - get copyWith => throw _privateConstructorUsedError; } -FinancialConnectionSession _$FinancialConnectionSessionFromJson( - Map json) { - return _FinancialConnectionSession.fromJson(json); +/// @nodoc +abstract mixin class _$FinancialConnectionTokenResultCopyWith<$Res> implements $FinancialConnectionTokenResultCopyWith<$Res> { + factory _$FinancialConnectionTokenResultCopyWith(_FinancialConnectionTokenResult value, $Res Function(_FinancialConnectionTokenResult) _then) = __$FinancialConnectionTokenResultCopyWithImpl; +@override @useResult +$Res call({ + FinancialConnectionSession session, FinancialConnectionBankAccountToken token +}); + + +@override $FinancialConnectionSessionCopyWith<$Res> get session;@override $FinancialConnectionBankAccountTokenCopyWith<$Res> get token; + +} +/// @nodoc +class __$FinancialConnectionTokenResultCopyWithImpl<$Res> + implements _$FinancialConnectionTokenResultCopyWith<$Res> { + __$FinancialConnectionTokenResultCopyWithImpl(this._self, this._then); + + final _FinancialConnectionTokenResult _self; + final $Res Function(_FinancialConnectionTokenResult) _then; + +/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? session = null,Object? token = null,}) { + return _then(_FinancialConnectionTokenResult( +session: null == session ? _self.session : session // ignore: cast_nullable_to_non_nullable +as FinancialConnectionSession,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as FinancialConnectionBankAccountToken, + )); +} + +/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionSessionCopyWith<$Res> get session { + + return $FinancialConnectionSessionCopyWith<$Res>(_self.session, (value) { + return _then(_self.copyWith(session: value)); + }); +}/// Create a copy of FinancialConnectionTokenResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionBankAccountTokenCopyWith<$Res> get token { + + return $FinancialConnectionBankAccountTokenCopyWith<$Res>(_self.token, (value) { + return _then(_self.copyWith(token: value)); + }); +} } + /// @nodoc mixin _$FinancialConnectionSession { - /// Unique id for this session - String get id => throw _privateConstructorUsedError; - /// The client secret of the session - String get clientSecret => throw _privateConstructorUsedError; +/// Unique id for this session + String get id;/// The client secret of the session + String get clientSecret;/// When `true` the object exists in livemode and when false the object exists in test mode. + bool get livemode;/// The accounts that were collected as part of this session + List get accounts; +/// Create a copy of FinancialConnectionSession +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionSessionCopyWith get copyWith => _$FinancialConnectionSessionCopyWithImpl(this as FinancialConnectionSession, _$identity); - /// When `true` the object exists in livemode and when false the object exists in test mode. - bool get livemode => throw _privateConstructorUsedError; + /// Serializes this FinancialConnectionSession to a JSON map. + Map toJson(); - /// The accounts that were collected as part of this session - List get accounts => - throw _privateConstructorUsedError; - /// Serializes this FinancialConnectionSession to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionSession&&(identical(other.id, id) || other.id == id)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&const DeepCollectionEquality().equals(other.accounts, accounts)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,clientSecret,livemode,const DeepCollectionEquality().hash(accounts)); - /// Create a copy of FinancialConnectionSession - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionSessionCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'FinancialConnectionSession(id: $id, clientSecret: $clientSecret, livemode: $livemode, accounts: $accounts)'; } -/// @nodoc -abstract class $FinancialConnectionSessionCopyWith<$Res> { - factory $FinancialConnectionSessionCopyWith(FinancialConnectionSession value, - $Res Function(FinancialConnectionSession) then) = - _$FinancialConnectionSessionCopyWithImpl<$Res, - FinancialConnectionSession>; - @useResult - $Res call( - {String id, - String clientSecret, - bool livemode, - List accounts}); + } /// @nodoc -class _$FinancialConnectionSessionCopyWithImpl<$Res, - $Val extends FinancialConnectionSession> - implements $FinancialConnectionSessionCopyWith<$Res> { - _$FinancialConnectionSessionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionSession - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? clientSecret = null, - Object? livemode = null, - Object? accounts = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - accounts: null == accounts - ? _value.accounts - : accounts // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); - } -} +abstract mixin class $FinancialConnectionSessionCopyWith<$Res> { + factory $FinancialConnectionSessionCopyWith(FinancialConnectionSession value, $Res Function(FinancialConnectionSession) _then) = _$FinancialConnectionSessionCopyWithImpl; +@useResult +$Res call({ + String id, String clientSecret, bool livemode, List accounts +}); + + + +} /// @nodoc -abstract class _$$FinancialConnectionSessionImplCopyWith<$Res> +class _$FinancialConnectionSessionCopyWithImpl<$Res> implements $FinancialConnectionSessionCopyWith<$Res> { - factory _$$FinancialConnectionSessionImplCopyWith( - _$FinancialConnectionSessionImpl value, - $Res Function(_$FinancialConnectionSessionImpl) then) = - __$$FinancialConnectionSessionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String clientSecret, - bool livemode, - List accounts}); + _$FinancialConnectionSessionCopyWithImpl(this._self, this._then); + + final FinancialConnectionSession _self; + final $Res Function(FinancialConnectionSession) _then; + +/// Create a copy of FinancialConnectionSession +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? clientSecret = null,Object? livemode = null,Object? accounts = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,accounts: null == accounts ? _self.accounts : accounts // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionSession]. +extension FinancialConnectionSessionPatterns on FinancialConnectionSession { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionSession value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionSession() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionSession value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionSession(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionSession value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionSession() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String clientSecret, bool livemode, List accounts)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionSession() when $default != null: +return $default(_that.id,_that.clientSecret,_that.livemode,_that.accounts);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String clientSecret, bool livemode, List accounts) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionSession(): +return $default(_that.id,_that.clientSecret,_that.livemode,_that.accounts);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String clientSecret, bool livemode, List accounts)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionSession() when $default != null: +return $default(_that.id,_that.clientSecret,_that.livemode,_that.accounts);case _: + return null; + +} } -/// @nodoc -class __$$FinancialConnectionSessionImplCopyWithImpl<$Res> - extends _$FinancialConnectionSessionCopyWithImpl<$Res, - _$FinancialConnectionSessionImpl> - implements _$$FinancialConnectionSessionImplCopyWith<$Res> { - __$$FinancialConnectionSessionImplCopyWithImpl( - _$FinancialConnectionSessionImpl _value, - $Res Function(_$FinancialConnectionSessionImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionSession - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? clientSecret = null, - Object? livemode = null, - Object? accounts = null, - }) { - return _then(_$FinancialConnectionSessionImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - accounts: null == accounts - ? _value._accounts - : accounts // ignore: cast_nullable_to_non_nullable - as List, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FinancialConnectionSessionImpl implements _FinancialConnectionSession { - const _$FinancialConnectionSessionImpl( - {required this.id, - required this.clientSecret, - required this.livemode, - required final List accounts}) - : _accounts = accounts; - - factory _$FinancialConnectionSessionImpl.fromJson( - Map json) => - _$$FinancialConnectionSessionImplFromJson(json); - - /// Unique id for this session - @override - final String id; - - /// The client secret of the session - @override - final String clientSecret; - - /// When `true` the object exists in livemode and when false the object exists in test mode. - @override - final bool livemode; - - /// The accounts that were collected as part of this session - final List _accounts; - - /// The accounts that were collected as part of this session - @override - List get accounts { - if (_accounts is EqualUnmodifiableListView) return _accounts; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_accounts); - } +class _FinancialConnectionSession implements FinancialConnectionSession { + const _FinancialConnectionSession({required this.id, required this.clientSecret, required this.livemode, required final List accounts}): _accounts = accounts; + factory _FinancialConnectionSession.fromJson(Map json) => _$FinancialConnectionSessionFromJson(json); - @override - String toString() { - return 'FinancialConnectionSession(id: $id, clientSecret: $clientSecret, livemode: $livemode, accounts: $accounts)'; - } +/// Unique id for this session +@override final String id; +/// The client secret of the session +@override final String clientSecret; +/// When `true` the object exists in livemode and when false the object exists in test mode. +@override final bool livemode; +/// The accounts that were collected as part of this session + final List _accounts; +/// The accounts that were collected as part of this session +@override List get accounts { + if (_accounts is EqualUnmodifiableListView) return _accounts; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_accounts); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionSessionImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - const DeepCollectionEquality().equals(other._accounts, _accounts)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id, clientSecret, livemode, - const DeepCollectionEquality().hash(_accounts)); - - /// Create a copy of FinancialConnectionSession - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionSessionImplCopyWith<_$FinancialConnectionSessionImpl> - get copyWith => __$$FinancialConnectionSessionImplCopyWithImpl< - _$FinancialConnectionSessionImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionSessionImplToJson( - this, - ); - } +/// Create a copy of FinancialConnectionSession +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionSessionCopyWith<_FinancialConnectionSession> get copyWith => __$FinancialConnectionSessionCopyWithImpl<_FinancialConnectionSession>(this, _$identity); + +@override +Map toJson() { + return _$FinancialConnectionSessionToJson(this, ); } -abstract class _FinancialConnectionSession - implements FinancialConnectionSession { - const factory _FinancialConnectionSession( - {required final String id, - required final String clientSecret, - required final bool livemode, - required final List accounts}) = - _$FinancialConnectionSessionImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionSession&&(identical(other.id, id) || other.id == id)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&const DeepCollectionEquality().equals(other._accounts, _accounts)); +} - factory _FinancialConnectionSession.fromJson(Map json) = - _$FinancialConnectionSessionImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,clientSecret,livemode,const DeepCollectionEquality().hash(_accounts)); - /// Unique id for this session - @override - String get id; +@override +String toString() { + return 'FinancialConnectionSession(id: $id, clientSecret: $clientSecret, livemode: $livemode, accounts: $accounts)'; +} - /// The client secret of the session - @override - String get clientSecret; - /// When `true` the object exists in livemode and when false the object exists in test mode. - @override - bool get livemode; +} + +/// @nodoc +abstract mixin class _$FinancialConnectionSessionCopyWith<$Res> implements $FinancialConnectionSessionCopyWith<$Res> { + factory _$FinancialConnectionSessionCopyWith(_FinancialConnectionSession value, $Res Function(_FinancialConnectionSession) _then) = __$FinancialConnectionSessionCopyWithImpl; +@override @useResult +$Res call({ + String id, String clientSecret, bool livemode, List accounts +}); - /// The accounts that were collected as part of this session - @override - List get accounts; - /// Create a copy of FinancialConnectionSession - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionSessionImplCopyWith<_$FinancialConnectionSessionImpl> - get copyWith => throw _privateConstructorUsedError; + + +} +/// @nodoc +class __$FinancialConnectionSessionCopyWithImpl<$Res> + implements _$FinancialConnectionSessionCopyWith<$Res> { + __$FinancialConnectionSessionCopyWithImpl(this._self, this._then); + + final _FinancialConnectionSession _self; + final $Res Function(_FinancialConnectionSession) _then; + +/// Create a copy of FinancialConnectionSession +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? clientSecret = null,Object? livemode = null,Object? accounts = null,}) { + return _then(_FinancialConnectionSession( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,accounts: null == accounts ? _self._accounts : accounts // ignore: cast_nullable_to_non_nullable +as List, + )); } -FinancialConnectionBankAccountToken - _$FinancialConnectionBankAccountTokenFromJson(Map json) { - return _FinancialConnectionBankAccountToken.fromJson(json); + } + /// @nodoc mixin _$FinancialConnectionBankAccountToken { - /// Bamkaccount details - BankAccount? get bankAccount => throw _privateConstructorUsedError; - /// When `true` the object exists in livemode and when false the object exists in test mode. - bool get livemode => throw _privateConstructorUsedError; +/// Bamkaccount details + BankAccount? get bankAccount;/// When `true` the object exists in livemode and when false the object exists in test mode. + bool get livemode;/// Unique id for this token. + String? get id;/// whether or not this token has been used + bool get used;/// The Unix timestamp (in milliseconds) of the date this token was created + int? get created; +/// Create a copy of FinancialConnectionBankAccountToken +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionBankAccountTokenCopyWith get copyWith => _$FinancialConnectionBankAccountTokenCopyWithImpl(this as FinancialConnectionBankAccountToken, _$identity); + + /// Serializes this FinancialConnectionBankAccountToken to a JSON map. + Map toJson(); + - /// Unique id for this token. - String? get id => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionBankAccountToken&&(identical(other.bankAccount, bankAccount) || other.bankAccount == bankAccount)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.id, id) || other.id == id)&&(identical(other.used, used) || other.used == used)&&(identical(other.created, created) || other.created == created)); +} - /// whether or not this token has been used - bool get used => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankAccount,livemode,id,used,created); - /// The Unix timestamp (in milliseconds) of the date this token was created - int? get created => throw _privateConstructorUsedError; +@override +String toString() { + return 'FinancialConnectionBankAccountToken(bankAccount: $bankAccount, livemode: $livemode, id: $id, used: $used, created: $created)'; +} - /// Serializes this FinancialConnectionBankAccountToken to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of FinancialConnectionBankAccountToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionBankAccountTokenCopyWith< - FinancialConnectionBankAccountToken> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $FinancialConnectionBankAccountTokenCopyWith<$Res> { - factory $FinancialConnectionBankAccountTokenCopyWith( - FinancialConnectionBankAccountToken value, - $Res Function(FinancialConnectionBankAccountToken) then) = - _$FinancialConnectionBankAccountTokenCopyWithImpl<$Res, - FinancialConnectionBankAccountToken>; - @useResult - $Res call( - {BankAccount? bankAccount, - bool livemode, - String? id, - bool used, - int? created}); - - $BankAccountCopyWith<$Res>? get bankAccount; -} +abstract mixin class $FinancialConnectionBankAccountTokenCopyWith<$Res> { + factory $FinancialConnectionBankAccountTokenCopyWith(FinancialConnectionBankAccountToken value, $Res Function(FinancialConnectionBankAccountToken) _then) = _$FinancialConnectionBankAccountTokenCopyWithImpl; +@useResult +$Res call({ + BankAccount? bankAccount, bool livemode, String? id, bool used, int? created +}); + +$BankAccountCopyWith<$Res>? get bankAccount; + +} /// @nodoc -class _$FinancialConnectionBankAccountTokenCopyWithImpl<$Res, - $Val extends FinancialConnectionBankAccountToken> +class _$FinancialConnectionBankAccountTokenCopyWithImpl<$Res> implements $FinancialConnectionBankAccountTokenCopyWith<$Res> { - _$FinancialConnectionBankAccountTokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionBankAccountToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankAccount = freezed, - Object? livemode = null, - Object? id = freezed, - Object? used = null, - Object? created = freezed, - }) { - return _then(_value.copyWith( - bankAccount: freezed == bankAccount - ? _value.bankAccount - : bankAccount // ignore: cast_nullable_to_non_nullable - as BankAccount?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String?, - used: null == used - ? _value.used - : used // ignore: cast_nullable_to_non_nullable - as bool, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); + _$FinancialConnectionBankAccountTokenCopyWithImpl(this._self, this._then); + + final FinancialConnectionBankAccountToken _self; + final $Res Function(FinancialConnectionBankAccountToken) _then; + +/// Create a copy of FinancialConnectionBankAccountToken +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bankAccount = freezed,Object? livemode = null,Object? id = freezed,Object? used = null,Object? created = freezed,}) { + return _then(_self.copyWith( +bankAccount: freezed == bankAccount ? _self.bankAccount : bankAccount // ignore: cast_nullable_to_non_nullable +as BankAccount?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,used: null == used ? _self.used : used // ignore: cast_nullable_to_non_nullable +as bool,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?, + )); +} +/// Create a copy of FinancialConnectionBankAccountToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountCopyWith<$Res>? get bankAccount { + if (_self.bankAccount == null) { + return null; } - /// Create a copy of FinancialConnectionBankAccountToken - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BankAccountCopyWith<$Res>? get bankAccount { - if (_value.bankAccount == null) { - return null; - } - - return $BankAccountCopyWith<$Res>(_value.bankAccount!, (value) { - return _then(_value.copyWith(bankAccount: value) as $Val); - }); - } -} + return $BankAccountCopyWith<$Res>(_self.bankAccount!, (value) { + return _then(_self.copyWith(bankAccount: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionBankAccountToken]. +extension FinancialConnectionBankAccountTokenPatterns on FinancialConnectionBankAccountToken { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionBankAccountToken value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionBankAccountToken() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionBankAccountToken value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionBankAccountToken(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionBankAccountToken value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionBankAccountToken() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BankAccount? bankAccount, bool livemode, String? id, bool used, int? created)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionBankAccountToken() when $default != null: +return $default(_that.bankAccount,_that.livemode,_that.id,_that.used,_that.created);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BankAccount? bankAccount, bool livemode, String? id, bool used, int? created) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionBankAccountToken(): +return $default(_that.bankAccount,_that.livemode,_that.id,_that.used,_that.created);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BankAccount? bankAccount, bool livemode, String? id, bool used, int? created)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionBankAccountToken() when $default != null: +return $default(_that.bankAccount,_that.livemode,_that.id,_that.used,_that.created);case _: + return null; -/// @nodoc -abstract class _$$FinancialConnectionBankAccountTokenImplCopyWith<$Res> - implements $FinancialConnectionBankAccountTokenCopyWith<$Res> { - factory _$$FinancialConnectionBankAccountTokenImplCopyWith( - _$FinancialConnectionBankAccountTokenImpl value, - $Res Function(_$FinancialConnectionBankAccountTokenImpl) then) = - __$$FinancialConnectionBankAccountTokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {BankAccount? bankAccount, - bool livemode, - String? id, - bool used, - int? created}); - - @override - $BankAccountCopyWith<$Res>? get bankAccount; +} } -/// @nodoc -class __$$FinancialConnectionBankAccountTokenImplCopyWithImpl<$Res> - extends _$FinancialConnectionBankAccountTokenCopyWithImpl<$Res, - _$FinancialConnectionBankAccountTokenImpl> - implements _$$FinancialConnectionBankAccountTokenImplCopyWith<$Res> { - __$$FinancialConnectionBankAccountTokenImplCopyWithImpl( - _$FinancialConnectionBankAccountTokenImpl _value, - $Res Function(_$FinancialConnectionBankAccountTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionBankAccountToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankAccount = freezed, - Object? livemode = null, - Object? id = freezed, - Object? used = null, - Object? created = freezed, - }) { - return _then(_$FinancialConnectionBankAccountTokenImpl( - bankAccount: freezed == bankAccount - ? _value.bankAccount - : bankAccount // ignore: cast_nullable_to_non_nullable - as BankAccount?, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String?, - used: null == used - ? _value.used - : used // ignore: cast_nullable_to_non_nullable - as bool, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FinancialConnectionBankAccountTokenImpl - implements _FinancialConnectionBankAccountToken { - const _$FinancialConnectionBankAccountTokenImpl( - {this.bankAccount, - required this.livemode, - this.id, - required this.used, - this.created}); - - factory _$FinancialConnectionBankAccountTokenImpl.fromJson( - Map json) => - _$$FinancialConnectionBankAccountTokenImplFromJson(json); - - /// Bamkaccount details - @override - final BankAccount? bankAccount; - - /// When `true` the object exists in livemode and when false the object exists in test mode. - @override - final bool livemode; - - /// Unique id for this token. - @override - final String? id; - - /// whether or not this token has been used - @override - final bool used; - - /// The Unix timestamp (in milliseconds) of the date this token was created - @override - final int? created; - - @override - String toString() { - return 'FinancialConnectionBankAccountToken(bankAccount: $bankAccount, livemode: $livemode, id: $id, used: $used, created: $created)'; - } +class _FinancialConnectionBankAccountToken implements FinancialConnectionBankAccountToken { + const _FinancialConnectionBankAccountToken({this.bankAccount, required this.livemode, this.id, required this.used, this.created}); + factory _FinancialConnectionBankAccountToken.fromJson(Map json) => _$FinancialConnectionBankAccountTokenFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionBankAccountTokenImpl && - (identical(other.bankAccount, bankAccount) || - other.bankAccount == bankAccount) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.id, id) || other.id == id) && - (identical(other.used, used) || other.used == used) && - (identical(other.created, created) || other.created == created)); - } +/// Bamkaccount details +@override final BankAccount? bankAccount; +/// When `true` the object exists in livemode and when false the object exists in test mode. +@override final bool livemode; +/// Unique id for this token. +@override final String? id; +/// whether or not this token has been used +@override final bool used; +/// The Unix timestamp (in milliseconds) of the date this token was created +@override final int? created; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, bankAccount, livemode, id, used, created); - - /// Create a copy of FinancialConnectionBankAccountToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionBankAccountTokenImplCopyWith< - _$FinancialConnectionBankAccountTokenImpl> - get copyWith => __$$FinancialConnectionBankAccountTokenImplCopyWithImpl< - _$FinancialConnectionBankAccountTokenImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionBankAccountTokenImplToJson( - this, - ); - } +/// Create a copy of FinancialConnectionBankAccountToken +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionBankAccountTokenCopyWith<_FinancialConnectionBankAccountToken> get copyWith => __$FinancialConnectionBankAccountTokenCopyWithImpl<_FinancialConnectionBankAccountToken>(this, _$identity); + +@override +Map toJson() { + return _$FinancialConnectionBankAccountTokenToJson(this, ); } -abstract class _FinancialConnectionBankAccountToken - implements FinancialConnectionBankAccountToken { - const factory _FinancialConnectionBankAccountToken( - {final BankAccount? bankAccount, - required final bool livemode, - final String? id, - required final bool used, - final int? created}) = _$FinancialConnectionBankAccountTokenImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionBankAccountToken&&(identical(other.bankAccount, bankAccount) || other.bankAccount == bankAccount)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.id, id) || other.id == id)&&(identical(other.used, used) || other.used == used)&&(identical(other.created, created) || other.created == created)); +} - factory _FinancialConnectionBankAccountToken.fromJson( - Map json) = - _$FinancialConnectionBankAccountTokenImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankAccount,livemode,id,used,created); - /// Bamkaccount details - @override - BankAccount? get bankAccount; +@override +String toString() { + return 'FinancialConnectionBankAccountToken(bankAccount: $bankAccount, livemode: $livemode, id: $id, used: $used, created: $created)'; +} - /// When `true` the object exists in livemode and when false the object exists in test mode. - @override - bool get livemode; - /// Unique id for this token. - @override - String? get id; +} - /// whether or not this token has been used - @override - bool get used; +/// @nodoc +abstract mixin class _$FinancialConnectionBankAccountTokenCopyWith<$Res> implements $FinancialConnectionBankAccountTokenCopyWith<$Res> { + factory _$FinancialConnectionBankAccountTokenCopyWith(_FinancialConnectionBankAccountToken value, $Res Function(_FinancialConnectionBankAccountToken) _then) = __$FinancialConnectionBankAccountTokenCopyWithImpl; +@override @useResult +$Res call({ + BankAccount? bankAccount, bool livemode, String? id, bool used, int? created +}); - /// The Unix timestamp (in milliseconds) of the date this token was created - @override - int? get created; - /// Create a copy of FinancialConnectionBankAccountToken - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionBankAccountTokenImplCopyWith< - _$FinancialConnectionBankAccountTokenImpl> - get copyWith => throw _privateConstructorUsedError; -} +@override $BankAccountCopyWith<$Res>? get bankAccount; -FinancialConnectionAccount _$FinancialConnectionAccountFromJson( - Map json) { - return _FinancialConnectionAccount.fromJson(json); } - /// @nodoc -mixin _$FinancialConnectionAccount { - /// Unique id for this Financial connection account. - String get id => throw _privateConstructorUsedError; +class __$FinancialConnectionBankAccountTokenCopyWithImpl<$Res> + implements _$FinancialConnectionBankAccountTokenCopyWith<$Res> { + __$FinancialConnectionBankAccountTokenCopyWithImpl(this._self, this._then); + + final _FinancialConnectionBankAccountToken _self; + final $Res Function(_FinancialConnectionBankAccountToken) _then; + +/// Create a copy of FinancialConnectionBankAccountToken +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bankAccount = freezed,Object? livemode = null,Object? id = freezed,Object? used = null,Object? created = freezed,}) { + return _then(_FinancialConnectionBankAccountToken( +bankAccount: freezed == bankAccount ? _self.bankAccount : bankAccount // ignore: cast_nullable_to_non_nullable +as BankAccount?,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String?,used: null == used ? _self.used : used // ignore: cast_nullable_to_non_nullable +as bool,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +/// Create a copy of FinancialConnectionBankAccountToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BankAccountCopyWith<$Res>? get bankAccount { + if (_self.bankAccount == null) { + return null; + } - /// Has the value true if the object exist in livemode. - bool get livemode => throw _privateConstructorUsedError; + return $BankAccountCopyWith<$Res>(_self.bankAccount!, (value) { + return _then(_self.copyWith(bankAccount: value)); + }); +} +} - /// display name of the account. - String? get displayName => throw _privateConstructorUsedError; - /// The current status of the account. - AccountStatus get status => throw _privateConstructorUsedError; +/// @nodoc +mixin _$FinancialConnectionAccount { - /// The name of the financial institution. - String get institutionName => throw _privateConstructorUsedError; +/// Unique id for this Financial connection account. + String get id;/// Has the value true if the object exist in livemode. + bool get livemode;/// display name of the account. + String? get displayName;/// The current status of the account. + AccountStatus get status;/// The name of the financial institution. + String get institutionName;/// Last4 of the account number. + String? get last4;/// Unix timestamp in milliseconds of the date this account was created. + int get created;/// The balance of the account + AccountBalance? get balance;/// The last balance refresh. + BalanceRefresh? get balanceRefresh;/// The category of this account + AccountCategory get category;/// The subcategory of this account, + AccountSubcategory get subcategory;/// Permissions requested for accounts collected during this session. + List? get permissions;/// Support payment method types for this account. + List get supportedPaymentMethodTypes; +/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionAccountCopyWith get copyWith => _$FinancialConnectionAccountCopyWithImpl(this as FinancialConnectionAccount, _$identity); - /// Last4 of the account number. - String? get last4 => throw _privateConstructorUsedError; + /// Serializes this FinancialConnectionAccount to a JSON map. + Map toJson(); - /// Unix timestamp in milliseconds of the date this account was created. - int get created => throw _privateConstructorUsedError; - /// The balance of the account - AccountBalance? get balance => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.displayName, displayName) || other.displayName == displayName)&&(identical(other.status, status) || other.status == status)&&(identical(other.institutionName, institutionName) || other.institutionName == institutionName)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.created, created) || other.created == created)&&(identical(other.balance, balance) || other.balance == balance)&&(identical(other.balanceRefresh, balanceRefresh) || other.balanceRefresh == balanceRefresh)&&(identical(other.category, category) || other.category == category)&&(identical(other.subcategory, subcategory) || other.subcategory == subcategory)&&const DeepCollectionEquality().equals(other.permissions, permissions)&&const DeepCollectionEquality().equals(other.supportedPaymentMethodTypes, supportedPaymentMethodTypes)); +} - /// The last balance refresh. - BalanceRefresh? get balanceRefresh => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,livemode,displayName,status,institutionName,last4,created,balance,balanceRefresh,category,subcategory,const DeepCollectionEquality().hash(permissions),const DeepCollectionEquality().hash(supportedPaymentMethodTypes)); - /// The category of this account - AccountCategory get category => throw _privateConstructorUsedError; +@override +String toString() { + return 'FinancialConnectionAccount(id: $id, livemode: $livemode, displayName: $displayName, status: $status, institutionName: $institutionName, last4: $last4, created: $created, balance: $balance, balanceRefresh: $balanceRefresh, category: $category, subcategory: $subcategory, permissions: $permissions, supportedPaymentMethodTypes: $supportedPaymentMethodTypes)'; +} - /// The subcategory of this account, - AccountSubcategory get subcategory => throw _privateConstructorUsedError; - /// Permissions requested for accounts collected during this session. - List? get permissions => - throw _privateConstructorUsedError; +} - /// Support payment method types for this account. - List get supportedPaymentMethodTypes => - throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $FinancialConnectionAccountCopyWith<$Res> { + factory $FinancialConnectionAccountCopyWith(FinancialConnectionAccount value, $Res Function(FinancialConnectionAccount) _then) = _$FinancialConnectionAccountCopyWithImpl; +@useResult +$Res call({ + String id, bool livemode, String? displayName, AccountStatus status, String institutionName, String? last4, int created, AccountBalance? balance, BalanceRefresh? balanceRefresh, AccountCategory category, AccountSubcategory subcategory, List? permissions, List supportedPaymentMethodTypes +}); - /// Serializes this FinancialConnectionAccount to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionAccountCopyWith - get copyWith => throw _privateConstructorUsedError; -} +$AccountBalanceCopyWith<$Res>? get balance;$BalanceRefreshCopyWith<$Res>? get balanceRefresh; -/// @nodoc -abstract class $FinancialConnectionAccountCopyWith<$Res> { - factory $FinancialConnectionAccountCopyWith(FinancialConnectionAccount value, - $Res Function(FinancialConnectionAccount) then) = - _$FinancialConnectionAccountCopyWithImpl<$Res, - FinancialConnectionAccount>; - @useResult - $Res call( - {String id, - bool livemode, - String? displayName, - AccountStatus status, - String institutionName, - String? last4, - int created, - AccountBalance? balance, - BalanceRefresh? balanceRefresh, - AccountCategory category, - AccountSubcategory subcategory, - List? permissions, - List supportedPaymentMethodTypes}); - - $AccountBalanceCopyWith<$Res>? get balance; - $BalanceRefreshCopyWith<$Res>? get balanceRefresh; } - /// @nodoc -class _$FinancialConnectionAccountCopyWithImpl<$Res, - $Val extends FinancialConnectionAccount> +class _$FinancialConnectionAccountCopyWithImpl<$Res> implements $FinancialConnectionAccountCopyWith<$Res> { - _$FinancialConnectionAccountCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? livemode = null, - Object? displayName = freezed, - Object? status = null, - Object? institutionName = null, - Object? last4 = freezed, - Object? created = null, - Object? balance = freezed, - Object? balanceRefresh = freezed, - Object? category = null, - Object? subcategory = null, - Object? permissions = freezed, - Object? supportedPaymentMethodTypes = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - displayName: freezed == displayName - ? _value.displayName - : displayName // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as AccountStatus, - institutionName: null == institutionName - ? _value.institutionName - : institutionName // ignore: cast_nullable_to_non_nullable - as String, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - created: null == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int, - balance: freezed == balance - ? _value.balance - : balance // ignore: cast_nullable_to_non_nullable - as AccountBalance?, - balanceRefresh: freezed == balanceRefresh - ? _value.balanceRefresh - : balanceRefresh // ignore: cast_nullable_to_non_nullable - as BalanceRefresh?, - category: null == category - ? _value.category - : category // ignore: cast_nullable_to_non_nullable - as AccountCategory, - subcategory: null == subcategory - ? _value.subcategory - : subcategory // ignore: cast_nullable_to_non_nullable - as AccountSubcategory, - permissions: freezed == permissions - ? _value.permissions - : permissions // ignore: cast_nullable_to_non_nullable - as List?, - supportedPaymentMethodTypes: null == supportedPaymentMethodTypes - ? _value.supportedPaymentMethodTypes - : supportedPaymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + _$FinancialConnectionAccountCopyWithImpl(this._self, this._then); + + final FinancialConnectionAccount _self; + final $Res Function(FinancialConnectionAccount) _then; + +/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? livemode = null,Object? displayName = freezed,Object? status = null,Object? institutionName = null,Object? last4 = freezed,Object? created = null,Object? balance = freezed,Object? balanceRefresh = freezed,Object? category = null,Object? subcategory = null,Object? permissions = freezed,Object? supportedPaymentMethodTypes = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable +as String?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as AccountStatus,institutionName: null == institutionName ? _self.institutionName : institutionName // ignore: cast_nullable_to_non_nullable +as String,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,created: null == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int,balance: freezed == balance ? _self.balance : balance // ignore: cast_nullable_to_non_nullable +as AccountBalance?,balanceRefresh: freezed == balanceRefresh ? _self.balanceRefresh : balanceRefresh // ignore: cast_nullable_to_non_nullable +as BalanceRefresh?,category: null == category ? _self.category : category // ignore: cast_nullable_to_non_nullable +as AccountCategory,subcategory: null == subcategory ? _self.subcategory : subcategory // ignore: cast_nullable_to_non_nullable +as AccountSubcategory,permissions: freezed == permissions ? _self.permissions : permissions // ignore: cast_nullable_to_non_nullable +as List?,supportedPaymentMethodTypes: null == supportedPaymentMethodTypes ? _self.supportedPaymentMethodTypes : supportedPaymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List, + )); +} +/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AccountBalanceCopyWith<$Res>? get balance { + if (_self.balance == null) { + return null; } - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AccountBalanceCopyWith<$Res>? get balance { - if (_value.balance == null) { - return null; - } - - return $AccountBalanceCopyWith<$Res>(_value.balance!, (value) { - return _then(_value.copyWith(balance: value) as $Val); - }); + return $AccountBalanceCopyWith<$Res>(_self.balance!, (value) { + return _then(_self.copyWith(balance: value)); + }); +}/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BalanceRefreshCopyWith<$Res>? get balanceRefresh { + if (_self.balanceRefresh == null) { + return null; } - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BalanceRefreshCopyWith<$Res>? get balanceRefresh { - if (_value.balanceRefresh == null) { - return null; - } - - return $BalanceRefreshCopyWith<$Res>(_value.balanceRefresh!, (value) { - return _then(_value.copyWith(balanceRefresh: value) as $Val); - }); - } + return $BalanceRefreshCopyWith<$Res>(_self.balanceRefresh!, (value) { + return _then(_self.copyWith(balanceRefresh: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionAccount]. +extension FinancialConnectionAccountPatterns on FinancialConnectionAccount { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionAccount value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionAccount() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionAccount value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionAccount(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionAccount value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionAccount() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, bool livemode, String? displayName, AccountStatus status, String institutionName, String? last4, int created, AccountBalance? balance, BalanceRefresh? balanceRefresh, AccountCategory category, AccountSubcategory subcategory, List? permissions, List supportedPaymentMethodTypes)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionAccount() when $default != null: +return $default(_that.id,_that.livemode,_that.displayName,_that.status,_that.institutionName,_that.last4,_that.created,_that.balance,_that.balanceRefresh,_that.category,_that.subcategory,_that.permissions,_that.supportedPaymentMethodTypes);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, bool livemode, String? displayName, AccountStatus status, String institutionName, String? last4, int created, AccountBalance? balance, BalanceRefresh? balanceRefresh, AccountCategory category, AccountSubcategory subcategory, List? permissions, List supportedPaymentMethodTypes) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionAccount(): +return $default(_that.id,_that.livemode,_that.displayName,_that.status,_that.institutionName,_that.last4,_that.created,_that.balance,_that.balanceRefresh,_that.category,_that.subcategory,_that.permissions,_that.supportedPaymentMethodTypes);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, bool livemode, String? displayName, AccountStatus status, String institutionName, String? last4, int created, AccountBalance? balance, BalanceRefresh? balanceRefresh, AccountCategory category, AccountSubcategory subcategory, List? permissions, List supportedPaymentMethodTypes)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionAccount() when $default != null: +return $default(_that.id,_that.livemode,_that.displayName,_that.status,_that.institutionName,_that.last4,_that.created,_that.balance,_that.balanceRefresh,_that.category,_that.subcategory,_that.permissions,_that.supportedPaymentMethodTypes);case _: + return null; + +} } -/// @nodoc -abstract class _$$FinancialConnectionAccountImplCopyWith<$Res> - implements $FinancialConnectionAccountCopyWith<$Res> { - factory _$$FinancialConnectionAccountImplCopyWith( - _$FinancialConnectionAccountImpl value, - $Res Function(_$FinancialConnectionAccountImpl) then) = - __$$FinancialConnectionAccountImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - bool livemode, - String? displayName, - AccountStatus status, - String institutionName, - String? last4, - int created, - AccountBalance? balance, - BalanceRefresh? balanceRefresh, - AccountCategory category, - AccountSubcategory subcategory, - List? permissions, - List supportedPaymentMethodTypes}); - - @override - $AccountBalanceCopyWith<$Res>? get balance; - @override - $BalanceRefreshCopyWith<$Res>? get balanceRefresh; } /// @nodoc -class __$$FinancialConnectionAccountImplCopyWithImpl<$Res> - extends _$FinancialConnectionAccountCopyWithImpl<$Res, - _$FinancialConnectionAccountImpl> - implements _$$FinancialConnectionAccountImplCopyWith<$Res> { - __$$FinancialConnectionAccountImplCopyWithImpl( - _$FinancialConnectionAccountImpl _value, - $Res Function(_$FinancialConnectionAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? livemode = null, - Object? displayName = freezed, - Object? status = null, - Object? institutionName = null, - Object? last4 = freezed, - Object? created = null, - Object? balance = freezed, - Object? balanceRefresh = freezed, - Object? category = null, - Object? subcategory = null, - Object? permissions = freezed, - Object? supportedPaymentMethodTypes = null, - }) { - return _then(_$FinancialConnectionAccountImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - displayName: freezed == displayName - ? _value.displayName - : displayName // ignore: cast_nullable_to_non_nullable - as String?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as AccountStatus, - institutionName: null == institutionName - ? _value.institutionName - : institutionName // ignore: cast_nullable_to_non_nullable - as String, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - created: null == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as int, - balance: freezed == balance - ? _value.balance - : balance // ignore: cast_nullable_to_non_nullable - as AccountBalance?, - balanceRefresh: freezed == balanceRefresh - ? _value.balanceRefresh - : balanceRefresh // ignore: cast_nullable_to_non_nullable - as BalanceRefresh?, - category: null == category - ? _value.category - : category // ignore: cast_nullable_to_non_nullable - as AccountCategory, - subcategory: null == subcategory - ? _value.subcategory - : subcategory // ignore: cast_nullable_to_non_nullable - as AccountSubcategory, - permissions: freezed == permissions - ? _value._permissions - : permissions // ignore: cast_nullable_to_non_nullable - as List?, - supportedPaymentMethodTypes: null == supportedPaymentMethodTypes - ? _value._supportedPaymentMethodTypes - : supportedPaymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - )); - } + +@JsonSerializable(explicitToJson: true) +class _FinancialConnectionAccount implements FinancialConnectionAccount { + const _FinancialConnectionAccount({required this.id, required this.livemode, this.displayName, required this.status, required this.institutionName, this.last4, required this.created, this.balance, this.balanceRefresh, required this.category, required this.subcategory, final List? permissions, required final List supportedPaymentMethodTypes}): _permissions = permissions,_supportedPaymentMethodTypes = supportedPaymentMethodTypes; + factory _FinancialConnectionAccount.fromJson(Map json) => _$FinancialConnectionAccountFromJson(json); + +/// Unique id for this Financial connection account. +@override final String id; +/// Has the value true if the object exist in livemode. +@override final bool livemode; +/// display name of the account. +@override final String? displayName; +/// The current status of the account. +@override final AccountStatus status; +/// The name of the financial institution. +@override final String institutionName; +/// Last4 of the account number. +@override final String? last4; +/// Unix timestamp in milliseconds of the date this account was created. +@override final int created; +/// The balance of the account +@override final AccountBalance? balance; +/// The last balance refresh. +@override final BalanceRefresh? balanceRefresh; +/// The category of this account +@override final AccountCategory category; +/// The subcategory of this account, +@override final AccountSubcategory subcategory; +/// Permissions requested for accounts collected during this session. + final List? _permissions; +/// Permissions requested for accounts collected during this session. +@override List? get permissions { + final value = _permissions; + if (value == null) return null; + if (_permissions is EqualUnmodifiableListView) return _permissions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// Support payment method types for this account. + final List _supportedPaymentMethodTypes; +/// Support payment method types for this account. +@override List get supportedPaymentMethodTypes { + if (_supportedPaymentMethodTypes is EqualUnmodifiableListView) return _supportedPaymentMethodTypes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_supportedPaymentMethodTypes); +} + + +/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionAccountCopyWith<_FinancialConnectionAccount> get copyWith => __$FinancialConnectionAccountCopyWithImpl<_FinancialConnectionAccount>(this, _$identity); + +@override +Map toJson() { + return _$FinancialConnectionAccountToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionAccount&&(identical(other.id, id) || other.id == id)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.displayName, displayName) || other.displayName == displayName)&&(identical(other.status, status) || other.status == status)&&(identical(other.institutionName, institutionName) || other.institutionName == institutionName)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.created, created) || other.created == created)&&(identical(other.balance, balance) || other.balance == balance)&&(identical(other.balanceRefresh, balanceRefresh) || other.balanceRefresh == balanceRefresh)&&(identical(other.category, category) || other.category == category)&&(identical(other.subcategory, subcategory) || other.subcategory == subcategory)&&const DeepCollectionEquality().equals(other._permissions, _permissions)&&const DeepCollectionEquality().equals(other._supportedPaymentMethodTypes, _supportedPaymentMethodTypes)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,livemode,displayName,status,institutionName,last4,created,balance,balanceRefresh,category,subcategory,const DeepCollectionEquality().hash(_permissions),const DeepCollectionEquality().hash(_supportedPaymentMethodTypes)); + +@override +String toString() { + return 'FinancialConnectionAccount(id: $id, livemode: $livemode, displayName: $displayName, status: $status, institutionName: $institutionName, last4: $last4, created: $created, balance: $balance, balanceRefresh: $balanceRefresh, category: $category, subcategory: $subcategory, permissions: $permissions, supportedPaymentMethodTypes: $supportedPaymentMethodTypes)'; +} + + } /// @nodoc +abstract mixin class _$FinancialConnectionAccountCopyWith<$Res> implements $FinancialConnectionAccountCopyWith<$Res> { + factory _$FinancialConnectionAccountCopyWith(_FinancialConnectionAccount value, $Res Function(_FinancialConnectionAccount) _then) = __$FinancialConnectionAccountCopyWithImpl; +@override @useResult +$Res call({ + String id, bool livemode, String? displayName, AccountStatus status, String institutionName, String? last4, int created, AccountBalance? balance, BalanceRefresh? balanceRefresh, AccountCategory category, AccountSubcategory subcategory, List? permissions, List supportedPaymentMethodTypes +}); -@JsonSerializable(explicitToJson: true) -class _$FinancialConnectionAccountImpl implements _FinancialConnectionAccount { - const _$FinancialConnectionAccountImpl( - {required this.id, - required this.livemode, - this.displayName, - required this.status, - required this.institutionName, - this.last4, - required this.created, - this.balance, - this.balanceRefresh, - required this.category, - required this.subcategory, - final List? permissions, - required final List - supportedPaymentMethodTypes}) - : _permissions = permissions, - _supportedPaymentMethodTypes = supportedPaymentMethodTypes; - - factory _$FinancialConnectionAccountImpl.fromJson( - Map json) => - _$$FinancialConnectionAccountImplFromJson(json); - - /// Unique id for this Financial connection account. - @override - final String id; - - /// Has the value true if the object exist in livemode. - @override - final bool livemode; - - /// display name of the account. - @override - final String? displayName; - - /// The current status of the account. - @override - final AccountStatus status; - - /// The name of the financial institution. - @override - final String institutionName; - - /// Last4 of the account number. - @override - final String? last4; - - /// Unix timestamp in milliseconds of the date this account was created. - @override - final int created; - - /// The balance of the account - @override - final AccountBalance? balance; - - /// The last balance refresh. - @override - final BalanceRefresh? balanceRefresh; - - /// The category of this account - @override - final AccountCategory category; - - /// The subcategory of this account, - @override - final AccountSubcategory subcategory; - - /// Permissions requested for accounts collected during this session. - final List? _permissions; - - /// Permissions requested for accounts collected during this session. - @override - List? get permissions { - final value = _permissions; - if (value == null) return null; - if (_permissions is EqualUnmodifiableListView) return _permissions; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - /// Support payment method types for this account. - final List - _supportedPaymentMethodTypes; - - /// Support payment method types for this account. - @override - List get supportedPaymentMethodTypes { - if (_supportedPaymentMethodTypes is EqualUnmodifiableListView) - return _supportedPaymentMethodTypes; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_supportedPaymentMethodTypes); - } +@override $AccountBalanceCopyWith<$Res>? get balance;@override $BalanceRefreshCopyWith<$Res>? get balanceRefresh; - @override - String toString() { - return 'FinancialConnectionAccount(id: $id, livemode: $livemode, displayName: $displayName, status: $status, institutionName: $institutionName, last4: $last4, created: $created, balance: $balance, balanceRefresh: $balanceRefresh, category: $category, subcategory: $subcategory, permissions: $permissions, supportedPaymentMethodTypes: $supportedPaymentMethodTypes)'; +} +/// @nodoc +class __$FinancialConnectionAccountCopyWithImpl<$Res> + implements _$FinancialConnectionAccountCopyWith<$Res> { + __$FinancialConnectionAccountCopyWithImpl(this._self, this._then); + + final _FinancialConnectionAccount _self; + final $Res Function(_FinancialConnectionAccount) _then; + +/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? livemode = null,Object? displayName = freezed,Object? status = null,Object? institutionName = null,Object? last4 = freezed,Object? created = null,Object? balance = freezed,Object? balanceRefresh = freezed,Object? category = null,Object? subcategory = null,Object? permissions = freezed,Object? supportedPaymentMethodTypes = null,}) { + return _then(_FinancialConnectionAccount( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable +as String?,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as AccountStatus,institutionName: null == institutionName ? _self.institutionName : institutionName // ignore: cast_nullable_to_non_nullable +as String,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,created: null == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as int,balance: freezed == balance ? _self.balance : balance // ignore: cast_nullable_to_non_nullable +as AccountBalance?,balanceRefresh: freezed == balanceRefresh ? _self.balanceRefresh : balanceRefresh // ignore: cast_nullable_to_non_nullable +as BalanceRefresh?,category: null == category ? _self.category : category // ignore: cast_nullable_to_non_nullable +as AccountCategory,subcategory: null == subcategory ? _self.subcategory : subcategory // ignore: cast_nullable_to_non_nullable +as AccountSubcategory,permissions: freezed == permissions ? _self._permissions : permissions // ignore: cast_nullable_to_non_nullable +as List?,supportedPaymentMethodTypes: null == supportedPaymentMethodTypes ? _self._supportedPaymentMethodTypes : supportedPaymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AccountBalanceCopyWith<$Res>? get balance { + if (_self.balance == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionAccountImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.displayName, displayName) || - other.displayName == displayName) && - (identical(other.status, status) || other.status == status) && - (identical(other.institutionName, institutionName) || - other.institutionName == institutionName) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.created, created) || other.created == created) && - (identical(other.balance, balance) || other.balance == balance) && - (identical(other.balanceRefresh, balanceRefresh) || - other.balanceRefresh == balanceRefresh) && - (identical(other.category, category) || - other.category == category) && - (identical(other.subcategory, subcategory) || - other.subcategory == subcategory) && - const DeepCollectionEquality() - .equals(other._permissions, _permissions) && - const DeepCollectionEquality().equals( - other._supportedPaymentMethodTypes, - _supportedPaymentMethodTypes)); + return $AccountBalanceCopyWith<$Res>(_self.balance!, (value) { + return _then(_self.copyWith(balance: value)); + }); +}/// Create a copy of FinancialConnectionAccount +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BalanceRefreshCopyWith<$Res>? get balanceRefresh { + if (_self.balanceRefresh == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - livemode, - displayName, - status, - institutionName, - last4, - created, - balance, - balanceRefresh, - category, - subcategory, - const DeepCollectionEquality().hash(_permissions), - const DeepCollectionEquality().hash(_supportedPaymentMethodTypes)); - - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionAccountImplCopyWith<_$FinancialConnectionAccountImpl> - get copyWith => __$$FinancialConnectionAccountImplCopyWithImpl< - _$FinancialConnectionAccountImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionAccountImplToJson( - this, - ); - } + return $BalanceRefreshCopyWith<$Res>(_self.balanceRefresh!, (value) { + return _then(_self.copyWith(balanceRefresh: value)); + }); +} } -abstract class _FinancialConnectionAccount - implements FinancialConnectionAccount { - const factory _FinancialConnectionAccount( - {required final String id, - required final bool livemode, - final String? displayName, - required final AccountStatus status, - required final String institutionName, - final String? last4, - required final int created, - final AccountBalance? balance, - final BalanceRefresh? balanceRefresh, - required final AccountCategory category, - required final AccountSubcategory subcategory, - final List? permissions, - required final List - supportedPaymentMethodTypes}) = _$FinancialConnectionAccountImpl; - factory _FinancialConnectionAccount.fromJson(Map json) = - _$FinancialConnectionAccountImpl.fromJson; +/// @nodoc +mixin _$BalanceRefresh { - /// Unique id for this Financial connection account. - @override - String get id; +/// Status of the balance refresh attempt + BalanceRefreshStatus get status;/// Unix timestamp (in milliseconds) of the time of the last refresh attempt. + int get lastAttemptedAt; +/// Create a copy of BalanceRefresh +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BalanceRefreshCopyWith get copyWith => _$BalanceRefreshCopyWithImpl(this as BalanceRefresh, _$identity); - /// Has the value true if the object exist in livemode. - @override - bool get livemode; + /// Serializes this BalanceRefresh to a JSON map. + Map toJson(); - /// display name of the account. - @override - String? get displayName; - /// The current status of the account. - @override - AccountStatus get status; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BalanceRefresh&&(identical(other.status, status) || other.status == status)&&(identical(other.lastAttemptedAt, lastAttemptedAt) || other.lastAttemptedAt == lastAttemptedAt)); +} - /// The name of the financial institution. - @override - String get institutionName; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,status,lastAttemptedAt); - /// Last4 of the account number. - @override - String? get last4; +@override +String toString() { + return 'BalanceRefresh(status: $status, lastAttemptedAt: $lastAttemptedAt)'; +} - /// Unix timestamp in milliseconds of the date this account was created. - @override - int get created; - /// The balance of the account - @override - AccountBalance? get balance; +} - /// The last balance refresh. - @override - BalanceRefresh? get balanceRefresh; +/// @nodoc +abstract mixin class $BalanceRefreshCopyWith<$Res> { + factory $BalanceRefreshCopyWith(BalanceRefresh value, $Res Function(BalanceRefresh) _then) = _$BalanceRefreshCopyWithImpl; +@useResult +$Res call({ + BalanceRefreshStatus status, int lastAttemptedAt +}); - /// The category of this account - @override - AccountCategory get category; - /// The subcategory of this account, - @override - AccountSubcategory get subcategory; - /// Permissions requested for accounts collected during this session. - @override - List? get permissions; - /// Support payment method types for this account. - @override - List get supportedPaymentMethodTypes; +} +/// @nodoc +class _$BalanceRefreshCopyWithImpl<$Res> + implements $BalanceRefreshCopyWith<$Res> { + _$BalanceRefreshCopyWithImpl(this._self, this._then); + + final BalanceRefresh _self; + final $Res Function(BalanceRefresh) _then; + +/// Create a copy of BalanceRefresh +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? status = null,Object? lastAttemptedAt = null,}) { + return _then(_self.copyWith( +status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as BalanceRefreshStatus,lastAttemptedAt: null == lastAttemptedAt ? _self.lastAttemptedAt : lastAttemptedAt // ignore: cast_nullable_to_non_nullable +as int, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BalanceRefresh]. +extension BalanceRefreshPatterns on BalanceRefresh { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BalanceRefresh value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BalanceRefresh() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BalanceRefresh value) $default,){ +final _that = this; +switch (_that) { +case _BalanceRefresh(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BalanceRefresh value)? $default,){ +final _that = this; +switch (_that) { +case _BalanceRefresh() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BalanceRefreshStatus status, int lastAttemptedAt)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BalanceRefresh() when $default != null: +return $default(_that.status,_that.lastAttemptedAt);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BalanceRefreshStatus status, int lastAttemptedAt) $default,) {final _that = this; +switch (_that) { +case _BalanceRefresh(): +return $default(_that.status,_that.lastAttemptedAt);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BalanceRefreshStatus status, int lastAttemptedAt)? $default,) {final _that = this; +switch (_that) { +case _BalanceRefresh() when $default != null: +return $default(_that.status,_that.lastAttemptedAt);case _: + return null; - /// Create a copy of FinancialConnectionAccount - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionAccountImplCopyWith<_$FinancialConnectionAccountImpl> - get copyWith => throw _privateConstructorUsedError; +} } -BalanceRefresh _$BalanceRefreshFromJson(Map json) { - return _BalanceRefresh.fromJson(json); } /// @nodoc -mixin _$BalanceRefresh { - /// Status of the balance refresh attempt - BalanceRefreshStatus get status => throw _privateConstructorUsedError; - /// Unix timestamp (in milliseconds) of the time of the last refresh attempt. - int get lastAttemptedAt => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _BalanceRefresh implements BalanceRefresh { + const _BalanceRefresh({required this.status, required this.lastAttemptedAt}); + factory _BalanceRefresh.fromJson(Map json) => _$BalanceRefreshFromJson(json); - /// Serializes this BalanceRefresh to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Status of the balance refresh attempt +@override final BalanceRefreshStatus status; +/// Unix timestamp (in milliseconds) of the time of the last refresh attempt. +@override final int lastAttemptedAt; - /// Create a copy of BalanceRefresh - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BalanceRefreshCopyWith get copyWith => - throw _privateConstructorUsedError; -} +/// Create a copy of BalanceRefresh +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BalanceRefreshCopyWith<_BalanceRefresh> get copyWith => __$BalanceRefreshCopyWithImpl<_BalanceRefresh>(this, _$identity); -/// @nodoc -abstract class $BalanceRefreshCopyWith<$Res> { - factory $BalanceRefreshCopyWith( - BalanceRefresh value, $Res Function(BalanceRefresh) then) = - _$BalanceRefreshCopyWithImpl<$Res, BalanceRefresh>; - @useResult - $Res call({BalanceRefreshStatus status, int lastAttemptedAt}); +@override +Map toJson() { + return _$BalanceRefreshToJson(this, ); } -/// @nodoc -class _$BalanceRefreshCopyWithImpl<$Res, $Val extends BalanceRefresh> - implements $BalanceRefreshCopyWith<$Res> { - _$BalanceRefreshCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BalanceRefresh - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? status = null, - Object? lastAttemptedAt = null, - }) { - return _then(_value.copyWith( - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as BalanceRefreshStatus, - lastAttemptedAt: null == lastAttemptedAt - ? _value.lastAttemptedAt - : lastAttemptedAt // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BalanceRefresh&&(identical(other.status, status) || other.status == status)&&(identical(other.lastAttemptedAt, lastAttemptedAt) || other.lastAttemptedAt == lastAttemptedAt)); } -/// @nodoc -abstract class _$$BalanceRefreshImplCopyWith<$Res> - implements $BalanceRefreshCopyWith<$Res> { - factory _$$BalanceRefreshImplCopyWith(_$BalanceRefreshImpl value, - $Res Function(_$BalanceRefreshImpl) then) = - __$$BalanceRefreshImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({BalanceRefreshStatus status, int lastAttemptedAt}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,status,lastAttemptedAt); + +@override +String toString() { + return 'BalanceRefresh(status: $status, lastAttemptedAt: $lastAttemptedAt)'; } -/// @nodoc -class __$$BalanceRefreshImplCopyWithImpl<$Res> - extends _$BalanceRefreshCopyWithImpl<$Res, _$BalanceRefreshImpl> - implements _$$BalanceRefreshImplCopyWith<$Res> { - __$$BalanceRefreshImplCopyWithImpl( - _$BalanceRefreshImpl _value, $Res Function(_$BalanceRefreshImpl) _then) - : super(_value, _then); - - /// Create a copy of BalanceRefresh - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? status = null, - Object? lastAttemptedAt = null, - }) { - return _then(_$BalanceRefreshImpl( - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as BalanceRefreshStatus, - lastAttemptedAt: null == lastAttemptedAt - ? _value.lastAttemptedAt - : lastAttemptedAt // ignore: cast_nullable_to_non_nullable - as int, - )); - } + } /// @nodoc +abstract mixin class _$BalanceRefreshCopyWith<$Res> implements $BalanceRefreshCopyWith<$Res> { + factory _$BalanceRefreshCopyWith(_BalanceRefresh value, $Res Function(_BalanceRefresh) _then) = __$BalanceRefreshCopyWithImpl; +@override @useResult +$Res call({ + BalanceRefreshStatus status, int lastAttemptedAt +}); -@JsonSerializable(explicitToJson: true) -class _$BalanceRefreshImpl implements _BalanceRefresh { - const _$BalanceRefreshImpl( - {required this.status, required this.lastAttemptedAt}); - factory _$BalanceRefreshImpl.fromJson(Map json) => - _$$BalanceRefreshImplFromJson(json); - /// Status of the balance refresh attempt - @override - final BalanceRefreshStatus status; - /// Unix timestamp (in milliseconds) of the time of the last refresh attempt. - @override - final int lastAttemptedAt; +} +/// @nodoc +class __$BalanceRefreshCopyWithImpl<$Res> + implements _$BalanceRefreshCopyWith<$Res> { + __$BalanceRefreshCopyWithImpl(this._self, this._then); - @override - String toString() { - return 'BalanceRefresh(status: $status, lastAttemptedAt: $lastAttemptedAt)'; - } + final _BalanceRefresh _self; + final $Res Function(_BalanceRefresh) _then; + +/// Create a copy of BalanceRefresh +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? status = null,Object? lastAttemptedAt = null,}) { + return _then(_BalanceRefresh( +status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as BalanceRefreshStatus,lastAttemptedAt: null == lastAttemptedAt ? _self.lastAttemptedAt : lastAttemptedAt // ignore: cast_nullable_to_non_nullable +as int, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BalanceRefreshImpl && - (identical(other.status, status) || other.status == status) && - (identical(other.lastAttemptedAt, lastAttemptedAt) || - other.lastAttemptedAt == lastAttemptedAt)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, status, lastAttemptedAt); - - /// Create a copy of BalanceRefresh - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BalanceRefreshImplCopyWith<_$BalanceRefreshImpl> get copyWith => - __$$BalanceRefreshImplCopyWithImpl<_$BalanceRefreshImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$BalanceRefreshImplToJson( - this, - ); - } } -abstract class _BalanceRefresh implements BalanceRefresh { - const factory _BalanceRefresh( - {required final BalanceRefreshStatus status, - required final int lastAttemptedAt}) = _$BalanceRefreshImpl; - factory _BalanceRefresh.fromJson(Map json) = - _$BalanceRefreshImpl.fromJson; +/// @nodoc +mixin _$AccountBalance { - /// Status of the balance refresh attempt - @override - BalanceRefreshStatus get status; +/// Unix timestamp in milliseconds of time the external instition calculated this balance. + int get asOf;/// The type of balance. + BalanceType get type;/// The funds available to the account holder. +/// +/// Typically this is the current balance less any holds. +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + Map? get cash;/// The credit that has been used by the account holder. +/// +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + Map? get credit;/// The balances owed to (or by) the account holder. +/// +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + Map? get current; +/// Create a copy of AccountBalance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AccountBalanceCopyWith get copyWith => _$AccountBalanceCopyWithImpl(this as AccountBalance, _$identity); - /// Unix timestamp (in milliseconds) of the time of the last refresh attempt. - @override - int get lastAttemptedAt; + /// Serializes this AccountBalance to a JSON map. + Map toJson(); - /// Create a copy of BalanceRefresh - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BalanceRefreshImplCopyWith<_$BalanceRefreshImpl> get copyWith => - throw _privateConstructorUsedError; -} -AccountBalance _$AccountBalanceFromJson(Map json) { - return _AccountBalance.fromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AccountBalance&&(identical(other.asOf, asOf) || other.asOf == asOf)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.cash, cash)&&const DeepCollectionEquality().equals(other.credit, credit)&&const DeepCollectionEquality().equals(other.current, current)); } -/// @nodoc -mixin _$AccountBalance { - /// Unix timestamp in milliseconds of time the external instition calculated this balance. - int get asOf => throw _privateConstructorUsedError; - - /// The type of balance. - BalanceType get type => throw _privateConstructorUsedError; - - /// The funds available to the account holder. - /// - /// Typically this is the current balance less any holds. - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - Map? get cash => throw _privateConstructorUsedError; - - /// The credit that has been used by the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - Map? get credit => throw _privateConstructorUsedError; - - /// The balances owed to (or by) the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - Map? get current => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,asOf,type,const DeepCollectionEquality().hash(cash),const DeepCollectionEquality().hash(credit),const DeepCollectionEquality().hash(current)); + +@override +String toString() { + return 'AccountBalance(asOf: $asOf, type: $type, cash: $cash, credit: $credit, current: $current)'; +} - /// Serializes this AccountBalance to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of AccountBalance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AccountBalanceCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $AccountBalanceCopyWith<$Res> { - factory $AccountBalanceCopyWith( - AccountBalance value, $Res Function(AccountBalance) then) = - _$AccountBalanceCopyWithImpl<$Res, AccountBalance>; - @useResult - $Res call( - {int asOf, - BalanceType type, - Map? cash, - Map? credit, - Map? current}); -} +abstract mixin class $AccountBalanceCopyWith<$Res> { + factory $AccountBalanceCopyWith(AccountBalance value, $Res Function(AccountBalance) _then) = _$AccountBalanceCopyWithImpl; +@useResult +$Res call({ + int asOf, BalanceType type, Map? cash, Map? credit, Map? current +}); + + + +} /// @nodoc -class _$AccountBalanceCopyWithImpl<$Res, $Val extends AccountBalance> +class _$AccountBalanceCopyWithImpl<$Res> implements $AccountBalanceCopyWith<$Res> { - _$AccountBalanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AccountBalance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? asOf = null, - Object? type = null, - Object? cash = freezed, - Object? credit = freezed, - Object? current = freezed, - }) { - return _then(_value.copyWith( - asOf: null == asOf - ? _value.asOf - : asOf // ignore: cast_nullable_to_non_nullable - as int, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as BalanceType, - cash: freezed == cash - ? _value.cash - : cash // ignore: cast_nullable_to_non_nullable - as Map?, - credit: freezed == credit - ? _value.credit - : credit // ignore: cast_nullable_to_non_nullable - as Map?, - current: freezed == current - ? _value.current - : current // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } + _$AccountBalanceCopyWithImpl(this._self, this._then); + + final AccountBalance _self; + final $Res Function(AccountBalance) _then; + +/// Create a copy of AccountBalance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? asOf = null,Object? type = null,Object? cash = freezed,Object? credit = freezed,Object? current = freezed,}) { + return _then(_self.copyWith( +asOf: null == asOf ? _self.asOf : asOf // ignore: cast_nullable_to_non_nullable +as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as BalanceType,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable +as Map?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable +as Map?,current: freezed == current ? _self.current : current // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AccountBalance]. +extension AccountBalancePatterns on AccountBalance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AccountBalance value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AccountBalance() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AccountBalance value) $default,){ +final _that = this; +switch (_that) { +case _AccountBalance(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AccountBalance value)? $default,){ +final _that = this; +switch (_that) { +case _AccountBalance() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int asOf, BalanceType type, Map? cash, Map? credit, Map? current)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AccountBalance() when $default != null: +return $default(_that.asOf,_that.type,_that.cash,_that.credit,_that.current);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int asOf, BalanceType type, Map? cash, Map? credit, Map? current) $default,) {final _that = this; +switch (_that) { +case _AccountBalance(): +return $default(_that.asOf,_that.type,_that.cash,_that.credit,_that.current);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int asOf, BalanceType type, Map? cash, Map? credit, Map? current)? $default,) {final _that = this; +switch (_that) { +case _AccountBalance() when $default != null: +return $default(_that.asOf,_that.type,_that.cash,_that.credit,_that.current);case _: + return null; + +} } -/// @nodoc -abstract class _$$AccountBalanceImplCopyWith<$Res> - implements $AccountBalanceCopyWith<$Res> { - factory _$$AccountBalanceImplCopyWith(_$AccountBalanceImpl value, - $Res Function(_$AccountBalanceImpl) then) = - __$$AccountBalanceImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {int asOf, - BalanceType type, - Map? cash, - Map? credit, - Map? current}); } /// @nodoc -class __$$AccountBalanceImplCopyWithImpl<$Res> - extends _$AccountBalanceCopyWithImpl<$Res, _$AccountBalanceImpl> - implements _$$AccountBalanceImplCopyWith<$Res> { - __$$AccountBalanceImplCopyWithImpl( - _$AccountBalanceImpl _value, $Res Function(_$AccountBalanceImpl) _then) - : super(_value, _then); - - /// Create a copy of AccountBalance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? asOf = null, - Object? type = null, - Object? cash = freezed, - Object? credit = freezed, - Object? current = freezed, - }) { - return _then(_$AccountBalanceImpl( - asOf: null == asOf - ? _value.asOf - : asOf // ignore: cast_nullable_to_non_nullable - as int, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as BalanceType, - cash: freezed == cash - ? _value._cash - : cash // ignore: cast_nullable_to_non_nullable - as Map?, - credit: freezed == credit - ? _value._credit - : credit // ignore: cast_nullable_to_non_nullable - as Map?, - current: freezed == current - ? _value._current - : current // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } + +@JsonSerializable(explicitToJson: true) +class _AccountBalance implements AccountBalance { + const _AccountBalance({required this.asOf, required this.type, final Map? cash, final Map? credit, final Map? current}): _cash = cash,_credit = credit,_current = current; + factory _AccountBalance.fromJson(Map json) => _$AccountBalanceFromJson(json); + +/// Unix timestamp in milliseconds of time the external instition calculated this balance. +@override final int asOf; +/// The type of balance. +@override final BalanceType type; +/// The funds available to the account holder. +/// +/// Typically this is the current balance less any holds. +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + final Map? _cash; +/// The funds available to the account holder. +/// +/// Typically this is the current balance less any holds. +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. +@override Map? get cash { + final value = _cash; + if (value == null) return null; + if (_cash is EqualUnmodifiableMapView) return _cash; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + +/// The credit that has been used by the account holder. +/// +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + final Map? _credit; +/// The credit that has been used by the account holder. +/// +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. +@override Map? get credit { + final value = _credit; + if (value == null) return null; + if (_credit is EqualUnmodifiableMapView) return _credit; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + +/// The balances owed to (or by) the account holder. +/// +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + final Map? _current; +/// The balances owed to (or by) the account holder. +/// +/// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. +/// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. +@override Map? get current { + final value = _current; + if (value == null) return null; + if (_current is EqualUnmodifiableMapView) return _current; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + + +/// Create a copy of AccountBalance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AccountBalanceCopyWith<_AccountBalance> get copyWith => __$AccountBalanceCopyWithImpl<_AccountBalance>(this, _$identity); + +@override +Map toJson() { + return _$AccountBalanceToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AccountBalance&&(identical(other.asOf, asOf) || other.asOf == asOf)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._cash, _cash)&&const DeepCollectionEquality().equals(other._credit, _credit)&&const DeepCollectionEquality().equals(other._current, _current)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,asOf,type,const DeepCollectionEquality().hash(_cash),const DeepCollectionEquality().hash(_credit),const DeepCollectionEquality().hash(_current)); + +@override +String toString() { + return 'AccountBalance(asOf: $asOf, type: $type, cash: $cash, credit: $credit, current: $current)'; +} + + } /// @nodoc +abstract mixin class _$AccountBalanceCopyWith<$Res> implements $AccountBalanceCopyWith<$Res> { + factory _$AccountBalanceCopyWith(_AccountBalance value, $Res Function(_AccountBalance) _then) = __$AccountBalanceCopyWithImpl; +@override @useResult +$Res call({ + int asOf, BalanceType type, Map? cash, Map? credit, Map? current +}); -@JsonSerializable(explicitToJson: true) -class _$AccountBalanceImpl implements _AccountBalance { - const _$AccountBalanceImpl( - {required this.asOf, - required this.type, - final Map? cash, - final Map? credit, - final Map? current}) - : _cash = cash, - _credit = credit, - _current = current; - - factory _$AccountBalanceImpl.fromJson(Map json) => - _$$AccountBalanceImplFromJson(json); - - /// Unix timestamp in milliseconds of time the external instition calculated this balance. - @override - final int asOf; - - /// The type of balance. - @override - final BalanceType type; - - /// The funds available to the account holder. - /// - /// Typically this is the current balance less any holds. - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - final Map? _cash; - - /// The funds available to the account holder. - /// - /// Typically this is the current balance less any holds. - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - @override - Map? get cash { - final value = _cash; - if (value == null) return null; - if (_cash is EqualUnmodifiableMapView) return _cash; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - /// The credit that has been used by the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - final Map? _credit; - - /// The credit that has been used by the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - @override - Map? get credit { - final value = _credit; - if (value == null) return null; - if (_credit is EqualUnmodifiableMapView) return _credit; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - /// The balances owed to (or by) the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - final Map? _current; - - /// The balances owed to (or by) the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - @override - Map? get current { - final value = _current; - if (value == null) return null; - if (_current is EqualUnmodifiableMapView) return _current; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - @override - String toString() { - return 'AccountBalance(asOf: $asOf, type: $type, cash: $cash, credit: $credit, current: $current)'; - } +} +/// @nodoc +class __$AccountBalanceCopyWithImpl<$Res> + implements _$AccountBalanceCopyWith<$Res> { + __$AccountBalanceCopyWithImpl(this._self, this._then); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AccountBalanceImpl && - (identical(other.asOf, asOf) || other.asOf == asOf) && - (identical(other.type, type) || other.type == type) && - const DeepCollectionEquality().equals(other._cash, _cash) && - const DeepCollectionEquality().equals(other._credit, _credit) && - const DeepCollectionEquality().equals(other._current, _current)); - } + final _AccountBalance _self; + final $Res Function(_AccountBalance) _then; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - asOf, - type, - const DeepCollectionEquality().hash(_cash), - const DeepCollectionEquality().hash(_credit), - const DeepCollectionEquality().hash(_current)); - - /// Create a copy of AccountBalance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AccountBalanceImplCopyWith<_$AccountBalanceImpl> get copyWith => - __$$AccountBalanceImplCopyWithImpl<_$AccountBalanceImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$AccountBalanceImplToJson( - this, - ); - } +/// Create a copy of AccountBalance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? asOf = null,Object? type = null,Object? cash = freezed,Object? credit = freezed,Object? current = freezed,}) { + return _then(_AccountBalance( +asOf: null == asOf ? _self.asOf : asOf // ignore: cast_nullable_to_non_nullable +as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as BalanceType,cash: freezed == cash ? _self._cash : cash // ignore: cast_nullable_to_non_nullable +as Map?,credit: freezed == credit ? _self._credit : credit // ignore: cast_nullable_to_non_nullable +as Map?,current: freezed == current ? _self._current : current // ignore: cast_nullable_to_non_nullable +as Map?, + )); } -abstract class _AccountBalance implements AccountBalance { - const factory _AccountBalance( - {required final int asOf, - required final BalanceType type, - final Map? cash, - final Map? credit, - final Map? current}) = _$AccountBalanceImpl; - - factory _AccountBalance.fromJson(Map json) = - _$AccountBalanceImpl.fromJson; - - /// Unix timestamp in milliseconds of time the external instition calculated this balance. - @override - int get asOf; - - /// The type of balance. - @override - BalanceType get type; - - /// The funds available to the account holder. - /// - /// Typically this is the current balance less any holds. - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - @override - Map? get cash; - - /// The credit that has been used by the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - @override - Map? get credit; - - /// The balances owed to (or by) the account holder. - /// - /// Each key is a three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - /// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. - @override - Map? get current; - - /// Create a copy of AccountBalance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AccountBalanceImplCopyWith<_$AccountBalanceImpl> get copyWith => - throw _privateConstructorUsedError; -} - -CollectFinancialConnectionsAccountsParams - _$CollectFinancialConnectionsAccountsParamsFromJson( - Map json) { - return _CollectFinancialConnectionsAccountsParams.fromJson(json); + } + /// @nodoc mixin _$CollectFinancialConnectionsAccountsParams { - /// iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. - UserInterfaceStyle? get style => throw _privateConstructorUsedError; - /// An optional event listener to receive [FinancialConnectionsEvent] for specific events during the process of a user connecting their financial accounts. - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? get onEvent => - throw _privateConstructorUsedError; +/// iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. + UserInterfaceStyle? get style;/// An optional event listener to receive [FinancialConnectionsEvent] for specific events during the process of a user connecting their financial accounts. +@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? get onEvent; +/// Create a copy of CollectFinancialConnectionsAccountsParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CollectFinancialConnectionsAccountsParamsCopyWith get copyWith => _$CollectFinancialConnectionsAccountsParamsCopyWithImpl(this as CollectFinancialConnectionsAccountsParams, _$identity); /// Serializes this CollectFinancialConnectionsAccountsParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CollectFinancialConnectionsAccountsParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CollectFinancialConnectionsAccountsParamsCopyWith< - CollectFinancialConnectionsAccountsParams> - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CollectFinancialConnectionsAccountsParams&&(identical(other.style, style) || other.style == style)&&(identical(other.onEvent, onEvent) || other.onEvent == onEvent)); } -/// @nodoc -abstract class $CollectFinancialConnectionsAccountsParamsCopyWith<$Res> { - factory $CollectFinancialConnectionsAccountsParamsCopyWith( - CollectFinancialConnectionsAccountsParams value, - $Res Function(CollectFinancialConnectionsAccountsParams) then) = - _$CollectFinancialConnectionsAccountsParamsCopyWithImpl<$Res, - CollectFinancialConnectionsAccountsParams>; - @useResult - $Res call( - {UserInterfaceStyle? style, - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? onEvent}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,style,onEvent); + +@override +String toString() { + return 'CollectFinancialConnectionsAccountsParams(style: $style, onEvent: $onEvent)'; } -/// @nodoc -class _$CollectFinancialConnectionsAccountsParamsCopyWithImpl<$Res, - $Val extends CollectFinancialConnectionsAccountsParams> - implements $CollectFinancialConnectionsAccountsParamsCopyWith<$Res> { - _$CollectFinancialConnectionsAccountsParamsCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CollectFinancialConnectionsAccountsParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? style = freezed, - Object? onEvent = freezed, - }) { - return _then(_value.copyWith( - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as UserInterfaceStyle?, - onEvent: freezed == onEvent - ? _value.onEvent - : onEvent // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventHandler?, - ) as $Val); - } + } /// @nodoc -abstract class _$$CollectFinancialConnectionsAccountsParamsImplCopyWith<$Res> +abstract mixin class $CollectFinancialConnectionsAccountsParamsCopyWith<$Res> { + factory $CollectFinancialConnectionsAccountsParamsCopyWith(CollectFinancialConnectionsAccountsParams value, $Res Function(CollectFinancialConnectionsAccountsParams) _then) = _$CollectFinancialConnectionsAccountsParamsCopyWithImpl; +@useResult +$Res call({ + UserInterfaceStyle? style,@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent +}); + + + + +} +/// @nodoc +class _$CollectFinancialConnectionsAccountsParamsCopyWithImpl<$Res> implements $CollectFinancialConnectionsAccountsParamsCopyWith<$Res> { - factory _$$CollectFinancialConnectionsAccountsParamsImplCopyWith( - _$CollectFinancialConnectionsAccountsParamsImpl value, - $Res Function(_$CollectFinancialConnectionsAccountsParamsImpl) then) = - __$$CollectFinancialConnectionsAccountsParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {UserInterfaceStyle? style, - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? onEvent}); + _$CollectFinancialConnectionsAccountsParamsCopyWithImpl(this._self, this._then); + + final CollectFinancialConnectionsAccountsParams _self; + final $Res Function(CollectFinancialConnectionsAccountsParams) _then; + +/// Create a copy of CollectFinancialConnectionsAccountsParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? style = freezed,Object? onEvent = freezed,}) { + return _then(_self.copyWith( +style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as UserInterfaceStyle?,onEvent: freezed == onEvent ? _self.onEvent : onEvent // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventHandler?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CollectFinancialConnectionsAccountsParams]. +extension CollectFinancialConnectionsAccountsParamsPatterns on CollectFinancialConnectionsAccountsParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CollectFinancialConnectionsAccountsParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CollectFinancialConnectionsAccountsParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CollectFinancialConnectionsAccountsParams value) $default,){ +final _that = this; +switch (_that) { +case _CollectFinancialConnectionsAccountsParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CollectFinancialConnectionsAccountsParams value)? $default,){ +final _that = this; +switch (_that) { +case _CollectFinancialConnectionsAccountsParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( UserInterfaceStyle? style, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CollectFinancialConnectionsAccountsParams() when $default != null: +return $default(_that.style,_that.onEvent);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( UserInterfaceStyle? style, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent) $default,) {final _that = this; +switch (_that) { +case _CollectFinancialConnectionsAccountsParams(): +return $default(_that.style,_that.onEvent);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( UserInterfaceStyle? style, @JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent)? $default,) {final _that = this; +switch (_that) { +case _CollectFinancialConnectionsAccountsParams() when $default != null: +return $default(_that.style,_that.onEvent);case _: + return null; + +} } -/// @nodoc -class __$$CollectFinancialConnectionsAccountsParamsImplCopyWithImpl<$Res> - extends _$CollectFinancialConnectionsAccountsParamsCopyWithImpl<$Res, - _$CollectFinancialConnectionsAccountsParamsImpl> - implements _$$CollectFinancialConnectionsAccountsParamsImplCopyWith<$Res> { - __$$CollectFinancialConnectionsAccountsParamsImplCopyWithImpl( - _$CollectFinancialConnectionsAccountsParamsImpl _value, - $Res Function(_$CollectFinancialConnectionsAccountsParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CollectFinancialConnectionsAccountsParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? style = freezed, - Object? onEvent = freezed, - }) { - return _then(_$CollectFinancialConnectionsAccountsParamsImpl( - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as UserInterfaceStyle?, - onEvent: freezed == onEvent - ? _value.onEvent - : onEvent // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventHandler?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CollectFinancialConnectionsAccountsParamsImpl - implements _CollectFinancialConnectionsAccountsParams { - const _$CollectFinancialConnectionsAccountsParamsImpl( - {this.style, - @JsonKey(includeFromJson: false, includeToJson: false) this.onEvent}); - - factory _$CollectFinancialConnectionsAccountsParamsImpl.fromJson( - Map json) => - _$$CollectFinancialConnectionsAccountsParamsImplFromJson(json); - - /// iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. - @override - final UserInterfaceStyle? style; - - /// An optional event listener to receive [FinancialConnectionsEvent] for specific events during the process of a user connecting their financial accounts. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - final FinancialConnectionsEventHandler? onEvent; - - @override - String toString() { - return 'CollectFinancialConnectionsAccountsParams(style: $style, onEvent: $onEvent)'; - } +class _CollectFinancialConnectionsAccountsParams implements CollectFinancialConnectionsAccountsParams { + const _CollectFinancialConnectionsAccountsParams({this.style, @JsonKey(includeFromJson: false, includeToJson: false) this.onEvent}); + factory _CollectFinancialConnectionsAccountsParams.fromJson(Map json) => _$CollectFinancialConnectionsAccountsParamsFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CollectFinancialConnectionsAccountsParamsImpl && - (identical(other.style, style) || other.style == style) && - (identical(other.onEvent, onEvent) || other.onEvent == onEvent)); - } +/// iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. +@override final UserInterfaceStyle? style; +/// An optional event listener to receive [FinancialConnectionsEvent] for specific events during the process of a user connecting their financial accounts. +@override@JsonKey(includeFromJson: false, includeToJson: false) final FinancialConnectionsEventHandler? onEvent; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, style, onEvent); - - /// Create a copy of CollectFinancialConnectionsAccountsParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CollectFinancialConnectionsAccountsParamsImplCopyWith< - _$CollectFinancialConnectionsAccountsParamsImpl> - get copyWith => - __$$CollectFinancialConnectionsAccountsParamsImplCopyWithImpl< - _$CollectFinancialConnectionsAccountsParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CollectFinancialConnectionsAccountsParamsImplToJson( - this, - ); - } +/// Create a copy of CollectFinancialConnectionsAccountsParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CollectFinancialConnectionsAccountsParamsCopyWith<_CollectFinancialConnectionsAccountsParams> get copyWith => __$CollectFinancialConnectionsAccountsParamsCopyWithImpl<_CollectFinancialConnectionsAccountsParams>(this, _$identity); + +@override +Map toJson() { + return _$CollectFinancialConnectionsAccountsParamsToJson(this, ); } -abstract class _CollectFinancialConnectionsAccountsParams - implements CollectFinancialConnectionsAccountsParams { - const factory _CollectFinancialConnectionsAccountsParams( - {final UserInterfaceStyle? style, - @JsonKey(includeFromJson: false, includeToJson: false) - final FinancialConnectionsEventHandler? onEvent}) = - _$CollectFinancialConnectionsAccountsParamsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CollectFinancialConnectionsAccountsParams&&(identical(other.style, style) || other.style == style)&&(identical(other.onEvent, onEvent) || other.onEvent == onEvent)); +} - factory _CollectFinancialConnectionsAccountsParams.fromJson( - Map json) = - _$CollectFinancialConnectionsAccountsParamsImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,style,onEvent); - /// iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. - @override - UserInterfaceStyle? get style; +@override +String toString() { + return 'CollectFinancialConnectionsAccountsParams(style: $style, onEvent: $onEvent)'; +} - /// An optional event listener to receive [FinancialConnectionsEvent] for specific events during the process of a user connecting their financial accounts. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - FinancialConnectionsEventHandler? get onEvent; - /// Create a copy of CollectFinancialConnectionsAccountsParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CollectFinancialConnectionsAccountsParamsImplCopyWith< - _$CollectFinancialConnectionsAccountsParamsImpl> - get copyWith => throw _privateConstructorUsedError; } -FinancialConnectionsEvent _$FinancialConnectionsEventFromJson( - Map json) { - return _FinancialConnectionsEvent.fromJson(json); +/// @nodoc +abstract mixin class _$CollectFinancialConnectionsAccountsParamsCopyWith<$Res> implements $CollectFinancialConnectionsAccountsParamsCopyWith<$Res> { + factory _$CollectFinancialConnectionsAccountsParamsCopyWith(_CollectFinancialConnectionsAccountsParams value, $Res Function(_CollectFinancialConnectionsAccountsParams) _then) = __$CollectFinancialConnectionsAccountsParamsCopyWithImpl; +@override @useResult +$Res call({ + UserInterfaceStyle? style,@JsonKey(includeFromJson: false, includeToJson: false) FinancialConnectionsEventHandler? onEvent +}); + + + + } +/// @nodoc +class __$CollectFinancialConnectionsAccountsParamsCopyWithImpl<$Res> + implements _$CollectFinancialConnectionsAccountsParamsCopyWith<$Res> { + __$CollectFinancialConnectionsAccountsParamsCopyWithImpl(this._self, this._then); + + final _CollectFinancialConnectionsAccountsParams _self; + final $Res Function(_CollectFinancialConnectionsAccountsParams) _then; + +/// Create a copy of CollectFinancialConnectionsAccountsParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? style = freezed,Object? onEvent = freezed,}) { + return _then(_CollectFinancialConnectionsAccountsParams( +style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as UserInterfaceStyle?,onEvent: freezed == onEvent ? _self.onEvent : onEvent // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventHandler?, + )); +} + + +} + /// @nodoc mixin _$FinancialConnectionsEvent { - /// The event's name. Represents the type of event that has occurred during the Financial Connections process. - FinancialConnectionsEventName get name => throw _privateConstructorUsedError; - /// Event-associated metadata. Provides further detail related to the occurred event. - FinancialConnectionsEventMetadata get metadata => - throw _privateConstructorUsedError; +/// The event's name. Represents the type of event that has occurred during the Financial Connections process. + FinancialConnectionsEventName get name;/// Event-associated metadata. Provides further detail related to the occurred event. + FinancialConnectionsEventMetadata get metadata; +/// Create a copy of FinancialConnectionsEvent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionsEventCopyWith get copyWith => _$FinancialConnectionsEventCopyWithImpl(this as FinancialConnectionsEvent, _$identity); /// Serializes this FinancialConnectionsEvent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of FinancialConnectionsEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionsEventCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionsEvent&&(identical(other.name, name) || other.name == name)&&(identical(other.metadata, metadata) || other.metadata == metadata)); } -/// @nodoc -abstract class $FinancialConnectionsEventCopyWith<$Res> { - factory $FinancialConnectionsEventCopyWith(FinancialConnectionsEvent value, - $Res Function(FinancialConnectionsEvent) then) = - _$FinancialConnectionsEventCopyWithImpl<$Res, FinancialConnectionsEvent>; - @useResult - $Res call( - {FinancialConnectionsEventName name, - FinancialConnectionsEventMetadata metadata}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,metadata); - $FinancialConnectionsEventMetadataCopyWith<$Res> get metadata; +@override +String toString() { + return 'FinancialConnectionsEvent(name: $name, metadata: $metadata)'; } -/// @nodoc -class _$FinancialConnectionsEventCopyWithImpl<$Res, - $Val extends FinancialConnectionsEvent> - implements $FinancialConnectionsEventCopyWith<$Res> { - _$FinancialConnectionsEventCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionsEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = null, - Object? metadata = null, - }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventName, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventMetadata, - ) as $Val); - } - /// Create a copy of FinancialConnectionsEvent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $FinancialConnectionsEventMetadataCopyWith<$Res> get metadata { - return $FinancialConnectionsEventMetadataCopyWith<$Res>(_value.metadata, - (value) { - return _then(_value.copyWith(metadata: value) as $Val); - }); - } } /// @nodoc -abstract class _$$FinancialConnectionsEventImplCopyWith<$Res> +abstract mixin class $FinancialConnectionsEventCopyWith<$Res> { + factory $FinancialConnectionsEventCopyWith(FinancialConnectionsEvent value, $Res Function(FinancialConnectionsEvent) _then) = _$FinancialConnectionsEventCopyWithImpl; +@useResult +$Res call({ + FinancialConnectionsEventName name, FinancialConnectionsEventMetadata metadata +}); + + +$FinancialConnectionsEventMetadataCopyWith<$Res> get metadata; + +} +/// @nodoc +class _$FinancialConnectionsEventCopyWithImpl<$Res> implements $FinancialConnectionsEventCopyWith<$Res> { - factory _$$FinancialConnectionsEventImplCopyWith( - _$FinancialConnectionsEventImpl value, - $Res Function(_$FinancialConnectionsEventImpl) then) = - __$$FinancialConnectionsEventImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {FinancialConnectionsEventName name, - FinancialConnectionsEventMetadata metadata}); + _$FinancialConnectionsEventCopyWithImpl(this._self, this._then); + + final FinancialConnectionsEvent _self; + final $Res Function(FinancialConnectionsEvent) _then; + +/// Create a copy of FinancialConnectionsEvent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? metadata = null,}) { + return _then(_self.copyWith( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventName,metadata: null == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventMetadata, + )); +} +/// Create a copy of FinancialConnectionsEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionsEventMetadataCopyWith<$Res> get metadata { + + return $FinancialConnectionsEventMetadataCopyWith<$Res>(_self.metadata, (value) { + return _then(_self.copyWith(metadata: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionsEvent]. +extension FinancialConnectionsEventPatterns on FinancialConnectionsEvent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionsEvent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionsEvent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionsEvent value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionsEvent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionsEvent value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionsEvent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( FinancialConnectionsEventName name, FinancialConnectionsEventMetadata metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionsEvent() when $default != null: +return $default(_that.name,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( FinancialConnectionsEventName name, FinancialConnectionsEventMetadata metadata) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionsEvent(): +return $default(_that.name,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( FinancialConnectionsEventName name, FinancialConnectionsEventMetadata metadata)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionsEvent() when $default != null: +return $default(_that.name,_that.metadata);case _: + return null; - @override - $FinancialConnectionsEventMetadataCopyWith<$Res> get metadata; +} } -/// @nodoc -class __$$FinancialConnectionsEventImplCopyWithImpl<$Res> - extends _$FinancialConnectionsEventCopyWithImpl<$Res, - _$FinancialConnectionsEventImpl> - implements _$$FinancialConnectionsEventImplCopyWith<$Res> { - __$$FinancialConnectionsEventImplCopyWithImpl( - _$FinancialConnectionsEventImpl _value, - $Res Function(_$FinancialConnectionsEventImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionsEvent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = null, - Object? metadata = null, - }) { - return _then(_$FinancialConnectionsEventImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventName, - metadata: null == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventMetadata, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FinancialConnectionsEventImpl implements _FinancialConnectionsEvent { - const _$FinancialConnectionsEventImpl( - {required this.name, required this.metadata}); +class _FinancialConnectionsEvent implements FinancialConnectionsEvent { + const _FinancialConnectionsEvent({required this.name, required this.metadata}); + factory _FinancialConnectionsEvent.fromJson(Map json) => _$FinancialConnectionsEventFromJson(json); - factory _$FinancialConnectionsEventImpl.fromJson(Map json) => - _$$FinancialConnectionsEventImplFromJson(json); +/// The event's name. Represents the type of event that has occurred during the Financial Connections process. +@override final FinancialConnectionsEventName name; +/// Event-associated metadata. Provides further detail related to the occurred event. +@override final FinancialConnectionsEventMetadata metadata; - /// The event's name. Represents the type of event that has occurred during the Financial Connections process. - @override - final FinancialConnectionsEventName name; +/// Create a copy of FinancialConnectionsEvent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionsEventCopyWith<_FinancialConnectionsEvent> get copyWith => __$FinancialConnectionsEventCopyWithImpl<_FinancialConnectionsEvent>(this, _$identity); - /// Event-associated metadata. Provides further detail related to the occurred event. - @override - final FinancialConnectionsEventMetadata metadata; +@override +Map toJson() { + return _$FinancialConnectionsEventToJson(this, ); +} - @override - String toString() { - return 'FinancialConnectionsEvent(name: $name, metadata: $metadata)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionsEvent&&(identical(other.name, name) || other.name == name)&&(identical(other.metadata, metadata) || other.metadata == metadata)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionsEventImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.metadata, metadata) || - other.metadata == metadata)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,metadata); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, name, metadata); - - /// Create a copy of FinancialConnectionsEvent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionsEventImplCopyWith<_$FinancialConnectionsEventImpl> - get copyWith => __$$FinancialConnectionsEventImplCopyWithImpl< - _$FinancialConnectionsEventImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionsEventImplToJson( - this, - ); - } +@override +String toString() { + return 'FinancialConnectionsEvent(name: $name, metadata: $metadata)'; } -abstract class _FinancialConnectionsEvent implements FinancialConnectionsEvent { - const factory _FinancialConnectionsEvent( - {required final FinancialConnectionsEventName name, - required final FinancialConnectionsEventMetadata metadata}) = - _$FinancialConnectionsEventImpl; - factory _FinancialConnectionsEvent.fromJson(Map json) = - _$FinancialConnectionsEventImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$FinancialConnectionsEventCopyWith<$Res> implements $FinancialConnectionsEventCopyWith<$Res> { + factory _$FinancialConnectionsEventCopyWith(_FinancialConnectionsEvent value, $Res Function(_FinancialConnectionsEvent) _then) = __$FinancialConnectionsEventCopyWithImpl; +@override @useResult +$Res call({ + FinancialConnectionsEventName name, FinancialConnectionsEventMetadata metadata +}); - /// The event's name. Represents the type of event that has occurred during the Financial Connections process. - @override - FinancialConnectionsEventName get name; - /// Event-associated metadata. Provides further detail related to the occurred event. - @override - FinancialConnectionsEventMetadata get metadata; +@override $FinancialConnectionsEventMetadataCopyWith<$Res> get metadata; - /// Create a copy of FinancialConnectionsEvent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionsEventImplCopyWith<_$FinancialConnectionsEventImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$FinancialConnectionsEventCopyWithImpl<$Res> + implements _$FinancialConnectionsEventCopyWith<$Res> { + __$FinancialConnectionsEventCopyWithImpl(this._self, this._then); -FinancialConnectionsEventMetadata _$FinancialConnectionsEventMetadataFromJson( - Map json) { - return _FinancialConnectionsEventMetadata.fromJson(json); + final _FinancialConnectionsEvent _self; + final $Res Function(_FinancialConnectionsEvent) _then; + +/// Create a copy of FinancialConnectionsEvent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? metadata = null,}) { + return _then(_FinancialConnectionsEvent( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventName,metadata: null == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventMetadata, + )); } +/// Create a copy of FinancialConnectionsEvent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FinancialConnectionsEventMetadataCopyWith<$Res> get metadata { + + return $FinancialConnectionsEventMetadataCopyWith<$Res>(_self.metadata, (value) { + return _then(_self.copyWith(metadata: value)); + }); +} +} + + /// @nodoc mixin _$FinancialConnectionsEventMetadata { - /// A Boolean value that indicates if the user completed the process through the manual entry flow. - bool? get manualEntry => throw _privateConstructorUsedError; - /// A String value containing the name of the institution that the user selected. - String? get institutionName => throw _privateConstructorUsedError; - - /// An ErrorCode value representing the type of error that occurred. - FinancialConnectionsEventErrorCode? get errorCode => - throw _privateConstructorUsedError; +/// A Boolean value that indicates if the user completed the process through the manual entry flow. + bool? get manualEntry;/// A String value containing the name of the institution that the user selected. + String? get institutionName;/// An ErrorCode value representing the type of error that occurred. + FinancialConnectionsEventErrorCode? get errorCode; +/// Create a copy of FinancialConnectionsEventMetadata +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FinancialConnectionsEventMetadataCopyWith get copyWith => _$FinancialConnectionsEventMetadataCopyWithImpl(this as FinancialConnectionsEventMetadata, _$identity); /// Serializes this FinancialConnectionsEventMetadata to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of FinancialConnectionsEventMetadata - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FinancialConnectionsEventMetadataCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FinancialConnectionsEventMetadata&&(identical(other.manualEntry, manualEntry) || other.manualEntry == manualEntry)&&(identical(other.institutionName, institutionName) || other.institutionName == institutionName)&&(identical(other.errorCode, errorCode) || other.errorCode == errorCode)); } -/// @nodoc -abstract class $FinancialConnectionsEventMetadataCopyWith<$Res> { - factory $FinancialConnectionsEventMetadataCopyWith( - FinancialConnectionsEventMetadata value, - $Res Function(FinancialConnectionsEventMetadata) then) = - _$FinancialConnectionsEventMetadataCopyWithImpl<$Res, - FinancialConnectionsEventMetadata>; - @useResult - $Res call( - {bool? manualEntry, - String? institutionName, - FinancialConnectionsEventErrorCode? errorCode}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,manualEntry,institutionName,errorCode); + +@override +String toString() { + return 'FinancialConnectionsEventMetadata(manualEntry: $manualEntry, institutionName: $institutionName, errorCode: $errorCode)'; } -/// @nodoc -class _$FinancialConnectionsEventMetadataCopyWithImpl<$Res, - $Val extends FinancialConnectionsEventMetadata> - implements $FinancialConnectionsEventMetadataCopyWith<$Res> { - _$FinancialConnectionsEventMetadataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FinancialConnectionsEventMetadata - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? manualEntry = freezed, - Object? institutionName = freezed, - Object? errorCode = freezed, - }) { - return _then(_value.copyWith( - manualEntry: freezed == manualEntry - ? _value.manualEntry - : manualEntry // ignore: cast_nullable_to_non_nullable - as bool?, - institutionName: freezed == institutionName - ? _value.institutionName - : institutionName // ignore: cast_nullable_to_non_nullable - as String?, - errorCode: freezed == errorCode - ? _value.errorCode - : errorCode // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventErrorCode?, - ) as $Val); - } + } /// @nodoc -abstract class _$$FinancialConnectionsEventMetadataImplCopyWith<$Res> +abstract mixin class $FinancialConnectionsEventMetadataCopyWith<$Res> { + factory $FinancialConnectionsEventMetadataCopyWith(FinancialConnectionsEventMetadata value, $Res Function(FinancialConnectionsEventMetadata) _then) = _$FinancialConnectionsEventMetadataCopyWithImpl; +@useResult +$Res call({ + bool? manualEntry, String? institutionName, FinancialConnectionsEventErrorCode? errorCode +}); + + + + +} +/// @nodoc +class _$FinancialConnectionsEventMetadataCopyWithImpl<$Res> implements $FinancialConnectionsEventMetadataCopyWith<$Res> { - factory _$$FinancialConnectionsEventMetadataImplCopyWith( - _$FinancialConnectionsEventMetadataImpl value, - $Res Function(_$FinancialConnectionsEventMetadataImpl) then) = - __$$FinancialConnectionsEventMetadataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool? manualEntry, - String? institutionName, - FinancialConnectionsEventErrorCode? errorCode}); + _$FinancialConnectionsEventMetadataCopyWithImpl(this._self, this._then); + + final FinancialConnectionsEventMetadata _self; + final $Res Function(FinancialConnectionsEventMetadata) _then; + +/// Create a copy of FinancialConnectionsEventMetadata +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? manualEntry = freezed,Object? institutionName = freezed,Object? errorCode = freezed,}) { + return _then(_self.copyWith( +manualEntry: freezed == manualEntry ? _self.manualEntry : manualEntry // ignore: cast_nullable_to_non_nullable +as bool?,institutionName: freezed == institutionName ? _self.institutionName : institutionName // ignore: cast_nullable_to_non_nullable +as String?,errorCode: freezed == errorCode ? _self.errorCode : errorCode // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventErrorCode?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [FinancialConnectionsEventMetadata]. +extension FinancialConnectionsEventMetadataPatterns on FinancialConnectionsEventMetadata { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FinancialConnectionsEventMetadata value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FinancialConnectionsEventMetadata() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FinancialConnectionsEventMetadata value) $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionsEventMetadata(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FinancialConnectionsEventMetadata value)? $default,){ +final _that = this; +switch (_that) { +case _FinancialConnectionsEventMetadata() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? manualEntry, String? institutionName, FinancialConnectionsEventErrorCode? errorCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FinancialConnectionsEventMetadata() when $default != null: +return $default(_that.manualEntry,_that.institutionName,_that.errorCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? manualEntry, String? institutionName, FinancialConnectionsEventErrorCode? errorCode) $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionsEventMetadata(): +return $default(_that.manualEntry,_that.institutionName,_that.errorCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? manualEntry, String? institutionName, FinancialConnectionsEventErrorCode? errorCode)? $default,) {final _that = this; +switch (_that) { +case _FinancialConnectionsEventMetadata() when $default != null: +return $default(_that.manualEntry,_that.institutionName,_that.errorCode);case _: + return null; + +} } -/// @nodoc -class __$$FinancialConnectionsEventMetadataImplCopyWithImpl<$Res> - extends _$FinancialConnectionsEventMetadataCopyWithImpl<$Res, - _$FinancialConnectionsEventMetadataImpl> - implements _$$FinancialConnectionsEventMetadataImplCopyWith<$Res> { - __$$FinancialConnectionsEventMetadataImplCopyWithImpl( - _$FinancialConnectionsEventMetadataImpl _value, - $Res Function(_$FinancialConnectionsEventMetadataImpl) _then) - : super(_value, _then); - - /// Create a copy of FinancialConnectionsEventMetadata - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? manualEntry = freezed, - Object? institutionName = freezed, - Object? errorCode = freezed, - }) { - return _then(_$FinancialConnectionsEventMetadataImpl( - manualEntry: freezed == manualEntry - ? _value.manualEntry - : manualEntry // ignore: cast_nullable_to_non_nullable - as bool?, - institutionName: freezed == institutionName - ? _value.institutionName - : institutionName // ignore: cast_nullable_to_non_nullable - as String?, - errorCode: freezed == errorCode - ? _value.errorCode - : errorCode // ignore: cast_nullable_to_non_nullable - as FinancialConnectionsEventErrorCode?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$FinancialConnectionsEventMetadataImpl - implements _FinancialConnectionsEventMetadata { - const _$FinancialConnectionsEventMetadataImpl( - {this.manualEntry, this.institutionName, this.errorCode}); - - factory _$FinancialConnectionsEventMetadataImpl.fromJson( - Map json) => - _$$FinancialConnectionsEventMetadataImplFromJson(json); - - /// A Boolean value that indicates if the user completed the process through the manual entry flow. - @override - final bool? manualEntry; - - /// A String value containing the name of the institution that the user selected. - @override - final String? institutionName; - - /// An ErrorCode value representing the type of error that occurred. - @override - final FinancialConnectionsEventErrorCode? errorCode; - - @override - String toString() { - return 'FinancialConnectionsEventMetadata(manualEntry: $manualEntry, institutionName: $institutionName, errorCode: $errorCode)'; - } +class _FinancialConnectionsEventMetadata implements FinancialConnectionsEventMetadata { + const _FinancialConnectionsEventMetadata({this.manualEntry, this.institutionName, this.errorCode}); + factory _FinancialConnectionsEventMetadata.fromJson(Map json) => _$FinancialConnectionsEventMetadataFromJson(json); + +/// A Boolean value that indicates if the user completed the process through the manual entry flow. +@override final bool? manualEntry; +/// A String value containing the name of the institution that the user selected. +@override final String? institutionName; +/// An ErrorCode value representing the type of error that occurred. +@override final FinancialConnectionsEventErrorCode? errorCode; + +/// Create a copy of FinancialConnectionsEventMetadata +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FinancialConnectionsEventMetadataCopyWith<_FinancialConnectionsEventMetadata> get copyWith => __$FinancialConnectionsEventMetadataCopyWithImpl<_FinancialConnectionsEventMetadata>(this, _$identity); + +@override +Map toJson() { + return _$FinancialConnectionsEventMetadataToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FinancialConnectionsEventMetadata&&(identical(other.manualEntry, manualEntry) || other.manualEntry == manualEntry)&&(identical(other.institutionName, institutionName) || other.institutionName == institutionName)&&(identical(other.errorCode, errorCode) || other.errorCode == errorCode)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,manualEntry,institutionName,errorCode); + +@override +String toString() { + return 'FinancialConnectionsEventMetadata(manualEntry: $manualEntry, institutionName: $institutionName, errorCode: $errorCode)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FinancialConnectionsEventMetadataImpl && - (identical(other.manualEntry, manualEntry) || - other.manualEntry == manualEntry) && - (identical(other.institutionName, institutionName) || - other.institutionName == institutionName) && - (identical(other.errorCode, errorCode) || - other.errorCode == errorCode)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, manualEntry, institutionName, errorCode); - - /// Create a copy of FinancialConnectionsEventMetadata - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FinancialConnectionsEventMetadataImplCopyWith< - _$FinancialConnectionsEventMetadataImpl> - get copyWith => __$$FinancialConnectionsEventMetadataImplCopyWithImpl< - _$FinancialConnectionsEventMetadataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FinancialConnectionsEventMetadataImplToJson( - this, - ); - } } -abstract class _FinancialConnectionsEventMetadata - implements FinancialConnectionsEventMetadata { - const factory _FinancialConnectionsEventMetadata( - {final bool? manualEntry, - final String? institutionName, - final FinancialConnectionsEventErrorCode? errorCode}) = - _$FinancialConnectionsEventMetadataImpl; +/// @nodoc +abstract mixin class _$FinancialConnectionsEventMetadataCopyWith<$Res> implements $FinancialConnectionsEventMetadataCopyWith<$Res> { + factory _$FinancialConnectionsEventMetadataCopyWith(_FinancialConnectionsEventMetadata value, $Res Function(_FinancialConnectionsEventMetadata) _then) = __$FinancialConnectionsEventMetadataCopyWithImpl; +@override @useResult +$Res call({ + bool? manualEntry, String? institutionName, FinancialConnectionsEventErrorCode? errorCode +}); + + - factory _FinancialConnectionsEventMetadata.fromJson( - Map json) = - _$FinancialConnectionsEventMetadataImpl.fromJson; - /// A Boolean value that indicates if the user completed the process through the manual entry flow. - @override - bool? get manualEntry; +} +/// @nodoc +class __$FinancialConnectionsEventMetadataCopyWithImpl<$Res> + implements _$FinancialConnectionsEventMetadataCopyWith<$Res> { + __$FinancialConnectionsEventMetadataCopyWithImpl(this._self, this._then); - /// A String value containing the name of the institution that the user selected. - @override - String? get institutionName; + final _FinancialConnectionsEventMetadata _self; + final $Res Function(_FinancialConnectionsEventMetadata) _then; + +/// Create a copy of FinancialConnectionsEventMetadata +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? manualEntry = freezed,Object? institutionName = freezed,Object? errorCode = freezed,}) { + return _then(_FinancialConnectionsEventMetadata( +manualEntry: freezed == manualEntry ? _self.manualEntry : manualEntry // ignore: cast_nullable_to_non_nullable +as bool?,institutionName: freezed == institutionName ? _self.institutionName : institutionName // ignore: cast_nullable_to_non_nullable +as String?,errorCode: freezed == errorCode ? _self.errorCode : errorCode // ignore: cast_nullable_to_non_nullable +as FinancialConnectionsEventErrorCode?, + )); +} - /// An ErrorCode value representing the type of error that occurred. - @override - FinancialConnectionsEventErrorCode? get errorCode; - /// Create a copy of FinancialConnectionsEventMetadata - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FinancialConnectionsEventMetadataImplCopyWith< - _$FinancialConnectionsEventMetadataImpl> - get copyWith => throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/financial_connections.g.dart b/packages/stripe_platform_interface/lib/src/models/financial_connections.g.dart index 483ed8b64..6dd933e8e 100644 --- a/packages/stripe_platform_interface/lib/src/models/financial_connections.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/financial_connections.g.dart @@ -6,132 +6,131 @@ part of 'financial_connections.dart'; // JsonSerializableGenerator // ************************************************************************** -_$FinancialConnectionSessionResultImpl - _$$FinancialConnectionSessionResultImplFromJson( - Map json) => - _$FinancialConnectionSessionResultImpl( - session: FinancialConnectionSession.fromJson( - json['session'] as Map), - ); - -Map _$$FinancialConnectionSessionResultImplToJson( - _$FinancialConnectionSessionResultImpl instance) => - { - 'session': instance.session.toJson(), - }; +_FinancialConnectionSessionResult _$FinancialConnectionSessionResultFromJson( + Map json, +) => _FinancialConnectionSessionResult( + session: FinancialConnectionSession.fromJson( + json['session'] as Map, + ), +); + +Map _$FinancialConnectionSessionResultToJson( + _FinancialConnectionSessionResult instance, +) => {'session': instance.session.toJson()}; + +_FinancialConnectionTokenResult _$FinancialConnectionTokenResultFromJson( + Map json, +) => _FinancialConnectionTokenResult( + session: FinancialConnectionSession.fromJson( + json['session'] as Map, + ), + token: FinancialConnectionBankAccountToken.fromJson( + json['token'] as Map, + ), +); + +Map _$FinancialConnectionTokenResultToJson( + _FinancialConnectionTokenResult instance, +) => { + 'session': instance.session.toJson(), + 'token': instance.token.toJson(), +}; -_$FinancialConnectionTokenResultImpl - _$$FinancialConnectionTokenResultImplFromJson(Map json) => - _$FinancialConnectionTokenResultImpl( - session: FinancialConnectionSession.fromJson( - json['session'] as Map), - token: FinancialConnectionBankAccountToken.fromJson( - json['token'] as Map), - ); - -Map _$$FinancialConnectionTokenResultImplToJson( - _$FinancialConnectionTokenResultImpl instance) => - { - 'session': instance.session.toJson(), - 'token': instance.token.toJson(), - }; +_FinancialConnectionSession _$FinancialConnectionSessionFromJson( + Map json, +) => _FinancialConnectionSession( + id: json['id'] as String, + clientSecret: json['clientSecret'] as String, + livemode: json['livemode'] as bool, + accounts: (json['accounts'] as List) + .map( + (e) => FinancialConnectionAccount.fromJson(e as Map), + ) + .toList(), +); + +Map _$FinancialConnectionSessionToJson( + _FinancialConnectionSession instance, +) => { + 'id': instance.id, + 'clientSecret': instance.clientSecret, + 'livemode': instance.livemode, + 'accounts': instance.accounts.map((e) => e.toJson()).toList(), +}; -_$FinancialConnectionSessionImpl _$$FinancialConnectionSessionImplFromJson( - Map json) => - _$FinancialConnectionSessionImpl( - id: json['id'] as String, - clientSecret: json['clientSecret'] as String, +_FinancialConnectionBankAccountToken +_$FinancialConnectionBankAccountTokenFromJson(Map json) => + _FinancialConnectionBankAccountToken( + bankAccount: json['bankAccount'] == null + ? null + : BankAccount.fromJson(json['bankAccount'] as Map), livemode: json['livemode'] as bool, - accounts: (json['accounts'] as List) - .map((e) => - FinancialConnectionAccount.fromJson(e as Map)) - .toList(), + id: json['id'] as String?, + used: json['used'] as bool, + created: (json['created'] as num?)?.toInt(), ); -Map _$$FinancialConnectionSessionImplToJson( - _$FinancialConnectionSessionImpl instance) => - { - 'id': instance.id, - 'clientSecret': instance.clientSecret, - 'livemode': instance.livemode, - 'accounts': instance.accounts.map((e) => e.toJson()).toList(), - }; - -_$FinancialConnectionBankAccountTokenImpl - _$$FinancialConnectionBankAccountTokenImplFromJson( - Map json) => - _$FinancialConnectionBankAccountTokenImpl( - bankAccount: json['bankAccount'] == null - ? null - : BankAccount.fromJson( - json['bankAccount'] as Map), - livemode: json['livemode'] as bool, - id: json['id'] as String?, - used: json['used'] as bool, - created: (json['created'] as num?)?.toInt(), - ); - -Map _$$FinancialConnectionBankAccountTokenImplToJson( - _$FinancialConnectionBankAccountTokenImpl instance) => - { - 'bankAccount': instance.bankAccount?.toJson(), - 'livemode': instance.livemode, - 'id': instance.id, - 'used': instance.used, - 'created': instance.created, - }; - -_$FinancialConnectionAccountImpl _$$FinancialConnectionAccountImplFromJson( - Map json) => - _$FinancialConnectionAccountImpl( - id: json['id'] as String, - livemode: json['livemode'] as bool, - displayName: json['displayName'] as String?, - status: $enumDecode(_$AccountStatusEnumMap, json['status']), - institutionName: json['institutionName'] as String, - last4: json['last4'] as String?, - created: (json['created'] as num).toInt(), - balance: json['balance'] == null - ? null - : AccountBalance.fromJson(json['balance'] as Map), - balanceRefresh: json['balanceRefresh'] == null - ? null - : BalanceRefresh.fromJson( - json['balanceRefresh'] as Map), - category: $enumDecode(_$AccountCategoryEnumMap, json['category']), - subcategory: - $enumDecode(_$AccountSubcategoryEnumMap, json['subcategory']), - permissions: (json['permissions'] as List?) - ?.map((e) => $enumDecode(_$AccountPermissionEnumMap, e)) - .toList(), - supportedPaymentMethodTypes: (json['supportedPaymentMethodTypes'] - as List) - .map((e) => - $enumDecode(_$FinancialConnectionsPaymentMethodTypeEnumMap, e)) - .toList(), - ); +Map _$FinancialConnectionBankAccountTokenToJson( + _FinancialConnectionBankAccountToken instance, +) => { + 'bankAccount': instance.bankAccount?.toJson(), + 'livemode': instance.livemode, + 'id': instance.id, + 'used': instance.used, + 'created': instance.created, +}; -Map _$$FinancialConnectionAccountImplToJson( - _$FinancialConnectionAccountImpl instance) => - { - 'id': instance.id, - 'livemode': instance.livemode, - 'displayName': instance.displayName, - 'status': _$AccountStatusEnumMap[instance.status]!, - 'institutionName': instance.institutionName, - 'last4': instance.last4, - 'created': instance.created, - 'balance': instance.balance?.toJson(), - 'balanceRefresh': instance.balanceRefresh?.toJson(), - 'category': _$AccountCategoryEnumMap[instance.category]!, - 'subcategory': _$AccountSubcategoryEnumMap[instance.subcategory]!, - 'permissions': instance.permissions - ?.map((e) => _$AccountPermissionEnumMap[e]!) - .toList(), - 'supportedPaymentMethodTypes': instance.supportedPaymentMethodTypes - .map((e) => _$FinancialConnectionsPaymentMethodTypeEnumMap[e]!) +_FinancialConnectionAccount _$FinancialConnectionAccountFromJson( + Map json, +) => _FinancialConnectionAccount( + id: json['id'] as String, + livemode: json['livemode'] as bool, + displayName: json['displayName'] as String?, + status: $enumDecode(_$AccountStatusEnumMap, json['status']), + institutionName: json['institutionName'] as String, + last4: json['last4'] as String?, + created: (json['created'] as num).toInt(), + balance: json['balance'] == null + ? null + : AccountBalance.fromJson(json['balance'] as Map), + balanceRefresh: json['balanceRefresh'] == null + ? null + : BalanceRefresh.fromJson(json['balanceRefresh'] as Map), + category: $enumDecode(_$AccountCategoryEnumMap, json['category']), + subcategory: $enumDecode(_$AccountSubcategoryEnumMap, json['subcategory']), + permissions: (json['permissions'] as List?) + ?.map((e) => $enumDecode(_$AccountPermissionEnumMap, e)) + .toList(), + supportedPaymentMethodTypes: + (json['supportedPaymentMethodTypes'] as List) + .map( + (e) => + $enumDecode(_$FinancialConnectionsPaymentMethodTypeEnumMap, e), + ) .toList(), - }; +); + +Map _$FinancialConnectionAccountToJson( + _FinancialConnectionAccount instance, +) => { + 'id': instance.id, + 'livemode': instance.livemode, + 'displayName': instance.displayName, + 'status': _$AccountStatusEnumMap[instance.status]!, + 'institutionName': instance.institutionName, + 'last4': instance.last4, + 'created': instance.created, + 'balance': instance.balance?.toJson(), + 'balanceRefresh': instance.balanceRefresh?.toJson(), + 'category': _$AccountCategoryEnumMap[instance.category]!, + 'subcategory': _$AccountSubcategoryEnumMap[instance.subcategory]!, + 'permissions': instance.permissions + ?.map((e) => _$AccountPermissionEnumMap[e]!) + .toList(), + 'supportedPaymentMethodTypes': instance.supportedPaymentMethodTypes + .map((e) => _$FinancialConnectionsPaymentMethodTypeEnumMap[e]!) + .toList(), +}; const _$AccountStatusEnumMap = { AccountStatus.active: 'active', @@ -168,14 +167,13 @@ const _$FinancialConnectionsPaymentMethodTypeEnumMap = { FinancialConnectionsPaymentMethodType.link: 'link', }; -_$BalanceRefreshImpl _$$BalanceRefreshImplFromJson(Map json) => - _$BalanceRefreshImpl( +_BalanceRefresh _$BalanceRefreshFromJson(Map json) => + _BalanceRefresh( status: $enumDecode(_$BalanceRefreshStatusEnumMap, json['status']), lastAttemptedAt: (json['lastAttemptedAt'] as num).toInt(), ); -Map _$$BalanceRefreshImplToJson( - _$BalanceRefreshImpl instance) => +Map _$BalanceRefreshToJson(_BalanceRefresh instance) => { 'status': _$BalanceRefreshStatusEnumMap[instance.status]!, 'lastAttemptedAt': instance.lastAttemptedAt, @@ -187,8 +185,8 @@ const _$BalanceRefreshStatusEnumMap = { BalanceRefreshStatus.succeeded: 'succeeded', }; -_$AccountBalanceImpl _$$AccountBalanceImplFromJson(Map json) => - _$AccountBalanceImpl( +_AccountBalance _$AccountBalanceFromJson(Map json) => + _AccountBalance( asOf: (json['asOf'] as num).toInt(), type: $enumDecode(_$BalanceTypeEnumMap, json['type']), cash: (json['cash'] as Map?)?.map( @@ -202,8 +200,7 @@ _$AccountBalanceImpl _$$AccountBalanceImplFromJson(Map json) => ), ); -Map _$$AccountBalanceImplToJson( - _$AccountBalanceImpl instance) => +Map _$AccountBalanceToJson(_AccountBalance instance) => { 'asOf': instance.asOf, 'type': _$BalanceTypeEnumMap[instance.type]!, @@ -217,19 +214,16 @@ const _$BalanceTypeEnumMap = { BalanceType.credit: 'credit', }; -_$CollectFinancialConnectionsAccountsParamsImpl - _$$CollectFinancialConnectionsAccountsParamsImplFromJson( - Map json) => - _$CollectFinancialConnectionsAccountsParamsImpl( - style: - $enumDecodeNullable(_$UserInterfaceStyleEnumMap, json['style']), - ); +_CollectFinancialConnectionsAccountsParams +_$CollectFinancialConnectionsAccountsParamsFromJson( + Map json, +) => _CollectFinancialConnectionsAccountsParams( + style: $enumDecodeNullable(_$UserInterfaceStyleEnumMap, json['style']), +); -Map _$$CollectFinancialConnectionsAccountsParamsImplToJson( - _$CollectFinancialConnectionsAccountsParamsImpl instance) => - { - 'style': _$UserInterfaceStyleEnumMap[instance.style], - }; +Map _$CollectFinancialConnectionsAccountsParamsToJson( + _CollectFinancialConnectionsAccountsParams instance, +) => {'style': _$UserInterfaceStyleEnumMap[instance.style]}; const _$UserInterfaceStyleEnumMap = { UserInterfaceStyle.alwaysLight: 'alwaysLight', @@ -237,20 +231,21 @@ const _$UserInterfaceStyleEnumMap = { UserInterfaceStyle.automatic: 'automatic', }; -_$FinancialConnectionsEventImpl _$$FinancialConnectionsEventImplFromJson( - Map json) => - _$FinancialConnectionsEventImpl( - name: $enumDecode(_$FinancialConnectionsEventNameEnumMap, json['name']), - metadata: FinancialConnectionsEventMetadata.fromJson( - json['metadata'] as Map), - ); - -Map _$$FinancialConnectionsEventImplToJson( - _$FinancialConnectionsEventImpl instance) => - { - 'name': _$FinancialConnectionsEventNameEnumMap[instance.name]!, - 'metadata': instance.metadata.toJson(), - }; +_FinancialConnectionsEvent _$FinancialConnectionsEventFromJson( + Map json, +) => _FinancialConnectionsEvent( + name: $enumDecode(_$FinancialConnectionsEventNameEnumMap, json['name']), + metadata: FinancialConnectionsEventMetadata.fromJson( + json['metadata'] as Map, + ), +); + +Map _$FinancialConnectionsEventToJson( + _FinancialConnectionsEvent instance, +) => { + 'name': _$FinancialConnectionsEventNameEnumMap[instance.name]!, + 'metadata': instance.metadata.toJson(), +}; const _$FinancialConnectionsEventNameEnumMap = { FinancialConnectionsEventName.open: 'open', @@ -269,24 +264,24 @@ const _$FinancialConnectionsEventNameEnumMap = { 'flow_launched_in_browser', }; -_$FinancialConnectionsEventMetadataImpl - _$$FinancialConnectionsEventMetadataImplFromJson( - Map json) => - _$FinancialConnectionsEventMetadataImpl( - manualEntry: json['manualEntry'] as bool?, - institutionName: json['institutionName'] as String?, - errorCode: $enumDecodeNullable( - _$FinancialConnectionsEventErrorCodeEnumMap, json['errorCode']), - ); - -Map _$$FinancialConnectionsEventMetadataImplToJson( - _$FinancialConnectionsEventMetadataImpl instance) => - { - 'manualEntry': instance.manualEntry, - 'institutionName': instance.institutionName, - 'errorCode': - _$FinancialConnectionsEventErrorCodeEnumMap[instance.errorCode], - }; +_FinancialConnectionsEventMetadata _$FinancialConnectionsEventMetadataFromJson( + Map json, +) => _FinancialConnectionsEventMetadata( + manualEntry: json['manualEntry'] as bool?, + institutionName: json['institutionName'] as String?, + errorCode: $enumDecodeNullable( + _$FinancialConnectionsEventErrorCodeEnumMap, + json['errorCode'], + ), +); + +Map _$FinancialConnectionsEventMetadataToJson( + _FinancialConnectionsEventMetadata instance, +) => { + 'manualEntry': instance.manualEntry, + 'institutionName': instance.institutionName, + 'errorCode': _$FinancialConnectionsEventErrorCodeEnumMap[instance.errorCode], +}; const _$FinancialConnectionsEventErrorCodeEnumMap = { FinancialConnectionsEventErrorCode.account_numbers_unavailable: diff --git a/packages/stripe_platform_interface/lib/src/models/google_pay.dart b/packages/stripe_platform_interface/lib/src/models/google_pay.dart index d97cca217..37738d33c 100644 --- a/packages/stripe_platform_interface/lib/src/models/google_pay.dart +++ b/packages/stripe_platform_interface/lib/src/models/google_pay.dart @@ -6,9 +6,8 @@ part 'google_pay.freezed.dart'; part 'google_pay.g.dart'; @freezed - /// Parameters needed for presenting Google Pay. -class PresentGooglePayParams with _$PresentGooglePayParams { +abstract class PresentGooglePayParams with _$PresentGooglePayParams { @JsonSerializable(explicitToJson: true) const factory PresentGooglePayParams({ /// The client is secret is used for handling the payment from the Client side. @@ -29,9 +28,8 @@ class PresentGooglePayParams with _$PresentGooglePayParams { } @freezed - /// Config parameters used to intialize google pay. -class GooglePayInitParams with _$GooglePayInitParams { +abstract class GooglePayInitParams with _$GooglePayInitParams { @JsonSerializable(explicitToJson: true) const factory GooglePayInitParams({ /// Merchant name @@ -65,9 +63,8 @@ class GooglePayInitParams with _$GooglePayInitParams { } @freezed - /// Billing address collection config for Google Pay. -class BillingAddressConfig with _$BillingAddressConfig { +abstract class BillingAddressConfig with _$BillingAddressConfig { @JsonSerializable(explicitToJson: true) const factory BillingAddressConfig({ /// If `true` Google pay requires a Billing address in order to process the @@ -79,7 +76,6 @@ class BillingAddressConfig with _$BillingAddressConfig { /// If `true` customer needs to provide a phonenummer in order to process /// the transaction. - bool? isPhoneNumberRequired, }) = _BillingAddressConfig; @@ -88,9 +84,9 @@ class BillingAddressConfig with _$BillingAddressConfig { } @freezed - /// Parameters to create a google pay payment. -class CreateGooglePayPaymentParams with _$CreateGooglePayPaymentParams { +abstract class CreateGooglePayPaymentParams + with _$CreateGooglePayPaymentParams { @JsonSerializable(explicitToJson: true) const factory CreateGooglePayPaymentParams({ /// ISO 4217 alphabetic currency code. @@ -110,7 +106,7 @@ class CreateGooglePayPaymentParams with _$CreateGooglePayPaymentParams { } @freezed -class IsGooglePaySupportedParams with _$IsGooglePaySupportedParams { +abstract class IsGooglePaySupportedParams with _$IsGooglePaySupportedParams { @JsonSerializable(explicitToJson: true) const factory IsGooglePaySupportedParams({ /// Flag to use test environment or live environment. @@ -139,5 +135,5 @@ enum BillingAddressFormat { FULL, /// Collect name, country code, and postal code (default). - MIN + MIN, } diff --git a/packages/stripe_platform_interface/lib/src/models/google_pay.freezed.dart b/packages/stripe_platform_interface/lib/src/models/google_pay.freezed.dart index a7c8abed7..5a2724594 100644 --- a/packages/stripe_platform_interface/lib/src/models/google_pay.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/google_pay.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1283 +9,1461 @@ part of 'google_pay.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PresentGooglePayParams _$PresentGooglePayParamsFromJson( - Map json) { - return _PresentGooglePayParams.fromJson(json); -} - /// @nodoc mixin _$PresentGooglePayParams { - /// The client is secret is used for handling the payment from the Client side. - String get clientSecret => throw _privateConstructorUsedError; - /// Determines whether to present Google Pay in order to confirm a [SetupIntent] - /// or a [PaymentIntent]. - bool get forSetupIntent => throw _privateConstructorUsedError; - - /// When forSetupIntent is `true` it is required to provide a currencyCode. - /// - /// For more details see: https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo . - String? get currencyCode => throw _privateConstructorUsedError; +/// The client is secret is used for handling the payment from the Client side. + String get clientSecret;/// Determines whether to present Google Pay in order to confirm a [SetupIntent] +/// or a [PaymentIntent]. + bool get forSetupIntent;/// When forSetupIntent is `true` it is required to provide a currencyCode. +/// +/// For more details see: https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo . + String? get currencyCode; +/// Create a copy of PresentGooglePayParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PresentGooglePayParamsCopyWith get copyWith => _$PresentGooglePayParamsCopyWithImpl(this as PresentGooglePayParams, _$identity); /// Serializes this PresentGooglePayParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PresentGooglePayParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PresentGooglePayParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PresentGooglePayParams&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.forSetupIntent, forSetupIntent) || other.forSetupIntent == forSetupIntent)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)); } -/// @nodoc -abstract class $PresentGooglePayParamsCopyWith<$Res> { - factory $PresentGooglePayParamsCopyWith(PresentGooglePayParams value, - $Res Function(PresentGooglePayParams) then) = - _$PresentGooglePayParamsCopyWithImpl<$Res, PresentGooglePayParams>; - @useResult - $Res call({String clientSecret, bool forSetupIntent, String? currencyCode}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,clientSecret,forSetupIntent,currencyCode); + +@override +String toString() { + return 'PresentGooglePayParams(clientSecret: $clientSecret, forSetupIntent: $forSetupIntent, currencyCode: $currencyCode)'; } -/// @nodoc -class _$PresentGooglePayParamsCopyWithImpl<$Res, - $Val extends PresentGooglePayParams> - implements $PresentGooglePayParamsCopyWith<$Res> { - _$PresentGooglePayParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PresentGooglePayParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? clientSecret = null, - Object? forSetupIntent = null, - Object? currencyCode = freezed, - }) { - return _then(_value.copyWith( - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - forSetupIntent: null == forSetupIntent - ? _value.forSetupIntent - : forSetupIntent // ignore: cast_nullable_to_non_nullable - as bool, - currencyCode: freezed == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$PresentGooglePayParamsImplCopyWith<$Res> +abstract mixin class $PresentGooglePayParamsCopyWith<$Res> { + factory $PresentGooglePayParamsCopyWith(PresentGooglePayParams value, $Res Function(PresentGooglePayParams) _then) = _$PresentGooglePayParamsCopyWithImpl; +@useResult +$Res call({ + String clientSecret, bool forSetupIntent, String? currencyCode +}); + + + + +} +/// @nodoc +class _$PresentGooglePayParamsCopyWithImpl<$Res> implements $PresentGooglePayParamsCopyWith<$Res> { - factory _$$PresentGooglePayParamsImplCopyWith( - _$PresentGooglePayParamsImpl value, - $Res Function(_$PresentGooglePayParamsImpl) then) = - __$$PresentGooglePayParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String clientSecret, bool forSetupIntent, String? currencyCode}); + _$PresentGooglePayParamsCopyWithImpl(this._self, this._then); + + final PresentGooglePayParams _self; + final $Res Function(PresentGooglePayParams) _then; + +/// Create a copy of PresentGooglePayParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? clientSecret = null,Object? forSetupIntent = null,Object? currencyCode = freezed,}) { + return _then(_self.copyWith( +clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,forSetupIntent: null == forSetupIntent ? _self.forSetupIntent : forSetupIntent // ignore: cast_nullable_to_non_nullable +as bool,currencyCode: freezed == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PresentGooglePayParams]. +extension PresentGooglePayParamsPatterns on PresentGooglePayParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PresentGooglePayParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PresentGooglePayParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PresentGooglePayParams value) $default,){ +final _that = this; +switch (_that) { +case _PresentGooglePayParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PresentGooglePayParams value)? $default,){ +final _that = this; +switch (_that) { +case _PresentGooglePayParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String clientSecret, bool forSetupIntent, String? currencyCode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PresentGooglePayParams() when $default != null: +return $default(_that.clientSecret,_that.forSetupIntent,_that.currencyCode);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String clientSecret, bool forSetupIntent, String? currencyCode) $default,) {final _that = this; +switch (_that) { +case _PresentGooglePayParams(): +return $default(_that.clientSecret,_that.forSetupIntent,_that.currencyCode);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String clientSecret, bool forSetupIntent, String? currencyCode)? $default,) {final _that = this; +switch (_that) { +case _PresentGooglePayParams() when $default != null: +return $default(_that.clientSecret,_that.forSetupIntent,_that.currencyCode);case _: + return null; + +} } -/// @nodoc -class __$$PresentGooglePayParamsImplCopyWithImpl<$Res> - extends _$PresentGooglePayParamsCopyWithImpl<$Res, - _$PresentGooglePayParamsImpl> - implements _$$PresentGooglePayParamsImplCopyWith<$Res> { - __$$PresentGooglePayParamsImplCopyWithImpl( - _$PresentGooglePayParamsImpl _value, - $Res Function(_$PresentGooglePayParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of PresentGooglePayParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? clientSecret = null, - Object? forSetupIntent = null, - Object? currencyCode = freezed, - }) { - return _then(_$PresentGooglePayParamsImpl( - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - forSetupIntent: null == forSetupIntent - ? _value.forSetupIntent - : forSetupIntent // ignore: cast_nullable_to_non_nullable - as bool, - currencyCode: freezed == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PresentGooglePayParamsImpl implements _PresentGooglePayParams { - const _$PresentGooglePayParamsImpl( - {required this.clientSecret, - this.forSetupIntent = false, - this.currencyCode}); - - factory _$PresentGooglePayParamsImpl.fromJson(Map json) => - _$$PresentGooglePayParamsImplFromJson(json); - - /// The client is secret is used for handling the payment from the Client side. - @override - final String clientSecret; - - /// Determines whether to present Google Pay in order to confirm a [SetupIntent] - /// or a [PaymentIntent]. - @override - @JsonKey() - final bool forSetupIntent; - - /// When forSetupIntent is `true` it is required to provide a currencyCode. - /// - /// For more details see: https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo . - @override - final String? currencyCode; - - @override - String toString() { - return 'PresentGooglePayParams(clientSecret: $clientSecret, forSetupIntent: $forSetupIntent, currencyCode: $currencyCode)'; - } +class _PresentGooglePayParams implements PresentGooglePayParams { + const _PresentGooglePayParams({required this.clientSecret, this.forSetupIntent = false, this.currencyCode}); + factory _PresentGooglePayParams.fromJson(Map json) => _$PresentGooglePayParamsFromJson(json); + +/// The client is secret is used for handling the payment from the Client side. +@override final String clientSecret; +/// Determines whether to present Google Pay in order to confirm a [SetupIntent] +/// or a [PaymentIntent]. +@override@JsonKey() final bool forSetupIntent; +/// When forSetupIntent is `true` it is required to provide a currencyCode. +/// +/// For more details see: https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo . +@override final String? currencyCode; + +/// Create a copy of PresentGooglePayParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PresentGooglePayParamsCopyWith<_PresentGooglePayParams> get copyWith => __$PresentGooglePayParamsCopyWithImpl<_PresentGooglePayParams>(this, _$identity); + +@override +Map toJson() { + return _$PresentGooglePayParamsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PresentGooglePayParamsImpl && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.forSetupIntent, forSetupIntent) || - other.forSetupIntent == forSetupIntent) && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PresentGooglePayParams&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.forSetupIntent, forSetupIntent) || other.forSetupIntent == forSetupIntent)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, clientSecret, forSetupIntent, currencyCode); - - /// Create a copy of PresentGooglePayParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PresentGooglePayParamsImplCopyWith<_$PresentGooglePayParamsImpl> - get copyWith => __$$PresentGooglePayParamsImplCopyWithImpl< - _$PresentGooglePayParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PresentGooglePayParamsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,clientSecret,forSetupIntent,currencyCode); + +@override +String toString() { + return 'PresentGooglePayParams(clientSecret: $clientSecret, forSetupIntent: $forSetupIntent, currencyCode: $currencyCode)'; } -abstract class _PresentGooglePayParams implements PresentGooglePayParams { - const factory _PresentGooglePayParams( - {required final String clientSecret, - final bool forSetupIntent, - final String? currencyCode}) = _$PresentGooglePayParamsImpl; - factory _PresentGooglePayParams.fromJson(Map json) = - _$PresentGooglePayParamsImpl.fromJson; +} - /// The client is secret is used for handling the payment from the Client side. - @override - String get clientSecret; +/// @nodoc +abstract mixin class _$PresentGooglePayParamsCopyWith<$Res> implements $PresentGooglePayParamsCopyWith<$Res> { + factory _$PresentGooglePayParamsCopyWith(_PresentGooglePayParams value, $Res Function(_PresentGooglePayParams) _then) = __$PresentGooglePayParamsCopyWithImpl; +@override @useResult +$Res call({ + String clientSecret, bool forSetupIntent, String? currencyCode +}); - /// Determines whether to present Google Pay in order to confirm a [SetupIntent] - /// or a [PaymentIntent]. - @override - bool get forSetupIntent; - /// When forSetupIntent is `true` it is required to provide a currencyCode. - /// - /// For more details see: https://developers.google.com/pay/api/android/reference/request-objects#TransactionInfo . - @override - String? get currencyCode; - /// Create a copy of PresentGooglePayParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PresentGooglePayParamsImplCopyWith<_$PresentGooglePayParamsImpl> - get copyWith => throw _privateConstructorUsedError; + +} +/// @nodoc +class __$PresentGooglePayParamsCopyWithImpl<$Res> + implements _$PresentGooglePayParamsCopyWith<$Res> { + __$PresentGooglePayParamsCopyWithImpl(this._self, this._then); + + final _PresentGooglePayParams _self; + final $Res Function(_PresentGooglePayParams) _then; + +/// Create a copy of PresentGooglePayParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? clientSecret = null,Object? forSetupIntent = null,Object? currencyCode = freezed,}) { + return _then(_PresentGooglePayParams( +clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,forSetupIntent: null == forSetupIntent ? _self.forSetupIntent : forSetupIntent // ignore: cast_nullable_to_non_nullable +as bool,currencyCode: freezed == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String?, + )); } -GooglePayInitParams _$GooglePayInitParamsFromJson(Map json) { - return _GooglePayInitParams.fromJson(json); + } + /// @nodoc mixin _$GooglePayInitParams { - /// Merchant name - String get merchantName => throw _privateConstructorUsedError; - - /// ISO country code of the merchant - String get countryCode => throw _privateConstructorUsedError; - /// Flag to use test environment or live environment. - bool get testEnv => throw _privateConstructorUsedError; +/// Merchant name + String get merchantName;/// ISO country code of the merchant + String get countryCode;/// Flag to use test environment or live environment. + bool get testEnv;/// Configuration regarding collection of billing address, + BillingAddressConfig? get billingAddressConfig;/// Flag to indicate wheter Google Pay should collect email of the customer. + bool get isEmailRequired;/// When `true` Google Pay is considered ready if the customers's Google Pay +/// wallet has existing payment methods. + bool get existingPaymentMethodRequired;/// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. + String? get label;/// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. + double? get amount; +/// Create a copy of GooglePayInitParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GooglePayInitParamsCopyWith get copyWith => _$GooglePayInitParamsCopyWithImpl(this as GooglePayInitParams, _$identity); - /// Configuration regarding collection of billing address, - BillingAddressConfig? get billingAddressConfig => - throw _privateConstructorUsedError; + /// Serializes this GooglePayInitParams to a JSON map. + Map toJson(); - /// Flag to indicate wheter Google Pay should collect email of the customer. - bool get isEmailRequired => throw _privateConstructorUsedError; - /// When `true` Google Pay is considered ready if the customers's Google Pay - /// wallet has existing payment methods. - bool get existingPaymentMethodRequired => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GooglePayInitParams&&(identical(other.merchantName, merchantName) || other.merchantName == merchantName)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.billingAddressConfig, billingAddressConfig) || other.billingAddressConfig == billingAddressConfig)&&(identical(other.isEmailRequired, isEmailRequired) || other.isEmailRequired == isEmailRequired)&&(identical(other.existingPaymentMethodRequired, existingPaymentMethodRequired) || other.existingPaymentMethodRequired == existingPaymentMethodRequired)&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)); +} - /// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. - String? get label => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantName,countryCode,testEnv,billingAddressConfig,isEmailRequired,existingPaymentMethodRequired,label,amount); - /// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. - double? get amount => throw _privateConstructorUsedError; +@override +String toString() { + return 'GooglePayInitParams(merchantName: $merchantName, countryCode: $countryCode, testEnv: $testEnv, billingAddressConfig: $billingAddressConfig, isEmailRequired: $isEmailRequired, existingPaymentMethodRequired: $existingPaymentMethodRequired, label: $label, amount: $amount)'; +} - /// Serializes this GooglePayInitParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of GooglePayInitParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $GooglePayInitParamsCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $GooglePayInitParamsCopyWith<$Res> { - factory $GooglePayInitParamsCopyWith( - GooglePayInitParams value, $Res Function(GooglePayInitParams) then) = - _$GooglePayInitParamsCopyWithImpl<$Res, GooglePayInitParams>; - @useResult - $Res call( - {String merchantName, - String countryCode, - bool testEnv, - BillingAddressConfig? billingAddressConfig, - bool isEmailRequired, - bool existingPaymentMethodRequired, - String? label, - double? amount}); - - $BillingAddressConfigCopyWith<$Res>? get billingAddressConfig; -} +abstract mixin class $GooglePayInitParamsCopyWith<$Res> { + factory $GooglePayInitParamsCopyWith(GooglePayInitParams value, $Res Function(GooglePayInitParams) _then) = _$GooglePayInitParamsCopyWithImpl; +@useResult +$Res call({ + String merchantName, String countryCode, bool testEnv, BillingAddressConfig? billingAddressConfig, bool isEmailRequired, bool existingPaymentMethodRequired, String? label, double? amount +}); + +$BillingAddressConfigCopyWith<$Res>? get billingAddressConfig; + +} /// @nodoc -class _$GooglePayInitParamsCopyWithImpl<$Res, $Val extends GooglePayInitParams> +class _$GooglePayInitParamsCopyWithImpl<$Res> implements $GooglePayInitParamsCopyWith<$Res> { - _$GooglePayInitParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of GooglePayInitParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantName = null, - Object? countryCode = null, - Object? testEnv = null, - Object? billingAddressConfig = freezed, - Object? isEmailRequired = null, - Object? existingPaymentMethodRequired = null, - Object? label = freezed, - Object? amount = freezed, - }) { - return _then(_value.copyWith( - merchantName: null == merchantName - ? _value.merchantName - : merchantName // ignore: cast_nullable_to_non_nullable - as String, - countryCode: null == countryCode - ? _value.countryCode - : countryCode // ignore: cast_nullable_to_non_nullable - as String, - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - billingAddressConfig: freezed == billingAddressConfig - ? _value.billingAddressConfig - : billingAddressConfig // ignore: cast_nullable_to_non_nullable - as BillingAddressConfig?, - isEmailRequired: null == isEmailRequired - ? _value.isEmailRequired - : isEmailRequired // ignore: cast_nullable_to_non_nullable - as bool, - existingPaymentMethodRequired: null == existingPaymentMethodRequired - ? _value.existingPaymentMethodRequired - : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable - as bool, - label: freezed == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String?, - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); + _$GooglePayInitParamsCopyWithImpl(this._self, this._then); + + final GooglePayInitParams _self; + final $Res Function(GooglePayInitParams) _then; + +/// Create a copy of GooglePayInitParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? merchantName = null,Object? countryCode = null,Object? testEnv = null,Object? billingAddressConfig = freezed,Object? isEmailRequired = null,Object? existingPaymentMethodRequired = null,Object? label = freezed,Object? amount = freezed,}) { + return _then(_self.copyWith( +merchantName: null == merchantName ? _self.merchantName : merchantName // ignore: cast_nullable_to_non_nullable +as String,countryCode: null == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable +as String,testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,billingAddressConfig: freezed == billingAddressConfig ? _self.billingAddressConfig : billingAddressConfig // ignore: cast_nullable_to_non_nullable +as BillingAddressConfig?,isEmailRequired: null == isEmailRequired ? _self.isEmailRequired : isEmailRequired // ignore: cast_nullable_to_non_nullable +as bool,existingPaymentMethodRequired: null == existingPaymentMethodRequired ? _self.existingPaymentMethodRequired : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable +as bool,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double?, + )); +} +/// Create a copy of GooglePayInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingAddressConfigCopyWith<$Res>? get billingAddressConfig { + if (_self.billingAddressConfig == null) { + return null; } - /// Create a copy of GooglePayInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingAddressConfigCopyWith<$Res>? get billingAddressConfig { - if (_value.billingAddressConfig == null) { - return null; - } - - return $BillingAddressConfigCopyWith<$Res>(_value.billingAddressConfig!, - (value) { - return _then(_value.copyWith(billingAddressConfig: value) as $Val); - }); - } + return $BillingAddressConfigCopyWith<$Res>(_self.billingAddressConfig!, (value) { + return _then(_self.copyWith(billingAddressConfig: value)); + }); +} } -/// @nodoc -abstract class _$$GooglePayInitParamsImplCopyWith<$Res> - implements $GooglePayInitParamsCopyWith<$Res> { - factory _$$GooglePayInitParamsImplCopyWith(_$GooglePayInitParamsImpl value, - $Res Function(_$GooglePayInitParamsImpl) then) = - __$$GooglePayInitParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String merchantName, - String countryCode, - bool testEnv, - BillingAddressConfig? billingAddressConfig, - bool isEmailRequired, - bool existingPaymentMethodRequired, - String? label, - double? amount}); - - @override - $BillingAddressConfigCopyWith<$Res>? get billingAddressConfig; + +/// Adds pattern-matching-related methods to [GooglePayInitParams]. +extension GooglePayInitParamsPatterns on GooglePayInitParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GooglePayInitParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GooglePayInitParams() when $default != null: +return $default(_that);case _: + return orElse(); + } +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GooglePayInitParams value) $default,){ +final _that = this; +switch (_that) { +case _GooglePayInitParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -class __$$GooglePayInitParamsImplCopyWithImpl<$Res> - extends _$GooglePayInitParamsCopyWithImpl<$Res, _$GooglePayInitParamsImpl> - implements _$$GooglePayInitParamsImplCopyWith<$Res> { - __$$GooglePayInitParamsImplCopyWithImpl(_$GooglePayInitParamsImpl _value, - $Res Function(_$GooglePayInitParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of GooglePayInitParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantName = null, - Object? countryCode = null, - Object? testEnv = null, - Object? billingAddressConfig = freezed, - Object? isEmailRequired = null, - Object? existingPaymentMethodRequired = null, - Object? label = freezed, - Object? amount = freezed, - }) { - return _then(_$GooglePayInitParamsImpl( - merchantName: null == merchantName - ? _value.merchantName - : merchantName // ignore: cast_nullable_to_non_nullable - as String, - countryCode: null == countryCode - ? _value.countryCode - : countryCode // ignore: cast_nullable_to_non_nullable - as String, - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - billingAddressConfig: freezed == billingAddressConfig - ? _value.billingAddressConfig - : billingAddressConfig // ignore: cast_nullable_to_non_nullable - as BillingAddressConfig?, - isEmailRequired: null == isEmailRequired - ? _value.isEmailRequired - : isEmailRequired // ignore: cast_nullable_to_non_nullable - as bool, - existingPaymentMethodRequired: null == existingPaymentMethodRequired - ? _value.existingPaymentMethodRequired - : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable - as bool, - label: freezed == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String?, - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as double?, - )); - } } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GooglePayInitParams value)? $default,){ +final _that = this; +switch (_that) { +case _GooglePayInitParams() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String merchantName, String countryCode, bool testEnv, BillingAddressConfig? billingAddressConfig, bool isEmailRequired, bool existingPaymentMethodRequired, String? label, double? amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GooglePayInitParams() when $default != null: +return $default(_that.merchantName,_that.countryCode,_that.testEnv,_that.billingAddressConfig,_that.isEmailRequired,_that.existingPaymentMethodRequired,_that.label,_that.amount);case _: + return orElse(); -@JsonSerializable(explicitToJson: true) -class _$GooglePayInitParamsImpl implements _GooglePayInitParams { - const _$GooglePayInitParamsImpl( - {required this.merchantName, - required this.countryCode, - this.testEnv = false, - this.billingAddressConfig, - this.isEmailRequired = false, - this.existingPaymentMethodRequired = true, - this.label, - this.amount}); - - factory _$GooglePayInitParamsImpl.fromJson(Map json) => - _$$GooglePayInitParamsImplFromJson(json); - - /// Merchant name - @override - final String merchantName; - - /// ISO country code of the merchant - @override - final String countryCode; - - /// Flag to use test environment or live environment. - @override - @JsonKey() - final bool testEnv; - - /// Configuration regarding collection of billing address, - @override - final BillingAddressConfig? billingAddressConfig; - - /// Flag to indicate wheter Google Pay should collect email of the customer. - @override - @JsonKey() - final bool isEmailRequired; - - /// When `true` Google Pay is considered ready if the customers's Google Pay - /// wallet has existing payment methods. - @override - @JsonKey() - final bool existingPaymentMethodRequired; - - /// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. - @override - final String? label; - - /// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. - @override - final double? amount; - - @override - String toString() { - return 'GooglePayInitParams(merchantName: $merchantName, countryCode: $countryCode, testEnv: $testEnv, billingAddressConfig: $billingAddressConfig, isEmailRequired: $isEmailRequired, existingPaymentMethodRequired: $existingPaymentMethodRequired, label: $label, amount: $amount)'; - } +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String merchantName, String countryCode, bool testEnv, BillingAddressConfig? billingAddressConfig, bool isEmailRequired, bool existingPaymentMethodRequired, String? label, double? amount) $default,) {final _that = this; +switch (_that) { +case _GooglePayInitParams(): +return $default(_that.merchantName,_that.countryCode,_that.testEnv,_that.billingAddressConfig,_that.isEmailRequired,_that.existingPaymentMethodRequired,_that.label,_that.amount);case _: + throw StateError('Unexpected subclass'); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GooglePayInitParamsImpl && - (identical(other.merchantName, merchantName) || - other.merchantName == merchantName) && - (identical(other.countryCode, countryCode) || - other.countryCode == countryCode) && - (identical(other.testEnv, testEnv) || other.testEnv == testEnv) && - (identical(other.billingAddressConfig, billingAddressConfig) || - other.billingAddressConfig == billingAddressConfig) && - (identical(other.isEmailRequired, isEmailRequired) || - other.isEmailRequired == isEmailRequired) && - (identical(other.existingPaymentMethodRequired, - existingPaymentMethodRequired) || - other.existingPaymentMethodRequired == - existingPaymentMethodRequired) && - (identical(other.label, label) || other.label == label) && - (identical(other.amount, amount) || other.amount == amount)); - } +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String merchantName, String countryCode, bool testEnv, BillingAddressConfig? billingAddressConfig, bool isEmailRequired, bool existingPaymentMethodRequired, String? label, double? amount)? $default,) {final _that = this; +switch (_that) { +case _GooglePayInitParams() when $default != null: +return $default(_that.merchantName,_that.countryCode,_that.testEnv,_that.billingAddressConfig,_that.isEmailRequired,_that.existingPaymentMethodRequired,_that.label,_that.amount);case _: + return null; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - merchantName, - countryCode, - testEnv, - billingAddressConfig, - isEmailRequired, - existingPaymentMethodRequired, - label, - amount); - - /// Create a copy of GooglePayInitParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$GooglePayInitParamsImplCopyWith<_$GooglePayInitParamsImpl> get copyWith => - __$$GooglePayInitParamsImplCopyWithImpl<_$GooglePayInitParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$GooglePayInitParamsImplToJson( - this, - ); - } +} } -abstract class _GooglePayInitParams implements GooglePayInitParams { - const factory _GooglePayInitParams( - {required final String merchantName, - required final String countryCode, - final bool testEnv, - final BillingAddressConfig? billingAddressConfig, - final bool isEmailRequired, - final bool existingPaymentMethodRequired, - final String? label, - final double? amount}) = _$GooglePayInitParamsImpl; +} + +/// @nodoc - factory _GooglePayInitParams.fromJson(Map json) = - _$GooglePayInitParamsImpl.fromJson; +@JsonSerializable(explicitToJson: true) +class _GooglePayInitParams implements GooglePayInitParams { + const _GooglePayInitParams({required this.merchantName, required this.countryCode, this.testEnv = false, this.billingAddressConfig, this.isEmailRequired = false, this.existingPaymentMethodRequired = true, this.label, this.amount}); + factory _GooglePayInitParams.fromJson(Map json) => _$GooglePayInitParamsFromJson(json); + +/// Merchant name +@override final String merchantName; +/// ISO country code of the merchant +@override final String countryCode; +/// Flag to use test environment or live environment. +@override@JsonKey() final bool testEnv; +/// Configuration regarding collection of billing address, +@override final BillingAddressConfig? billingAddressConfig; +/// Flag to indicate wheter Google Pay should collect email of the customer. +@override@JsonKey() final bool isEmailRequired; +/// When `true` Google Pay is considered ready if the customers's Google Pay +/// wallet has existing payment methods. +@override@JsonKey() final bool existingPaymentMethodRequired; +/// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. +@override final String? label; +/// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. +@override final double? amount; + +/// Create a copy of GooglePayInitParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GooglePayInitParamsCopyWith<_GooglePayInitParams> get copyWith => __$GooglePayInitParamsCopyWithImpl<_GooglePayInitParams>(this, _$identity); + +@override +Map toJson() { + return _$GooglePayInitParamsToJson(this, ); +} - /// Merchant name - @override - String get merchantName; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GooglePayInitParams&&(identical(other.merchantName, merchantName) || other.merchantName == merchantName)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.billingAddressConfig, billingAddressConfig) || other.billingAddressConfig == billingAddressConfig)&&(identical(other.isEmailRequired, isEmailRequired) || other.isEmailRequired == isEmailRequired)&&(identical(other.existingPaymentMethodRequired, existingPaymentMethodRequired) || other.existingPaymentMethodRequired == existingPaymentMethodRequired)&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)); +} - /// ISO country code of the merchant - @override - String get countryCode; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantName,countryCode,testEnv,billingAddressConfig,isEmailRequired,existingPaymentMethodRequired,label,amount); - /// Flag to use test environment or live environment. - @override - bool get testEnv; +@override +String toString() { + return 'GooglePayInitParams(merchantName: $merchantName, countryCode: $countryCode, testEnv: $testEnv, billingAddressConfig: $billingAddressConfig, isEmailRequired: $isEmailRequired, existingPaymentMethodRequired: $existingPaymentMethodRequired, label: $label, amount: $amount)'; +} - /// Configuration regarding collection of billing address, - @override - BillingAddressConfig? get billingAddressConfig; - /// Flag to indicate wheter Google Pay should collect email of the customer. - @override - bool get isEmailRequired; +} - /// When `true` Google Pay is considered ready if the customers's Google Pay - /// wallet has existing payment methods. - @override - bool get existingPaymentMethodRequired; +/// @nodoc +abstract mixin class _$GooglePayInitParamsCopyWith<$Res> implements $GooglePayInitParamsCopyWith<$Res> { + factory _$GooglePayInitParamsCopyWith(_GooglePayInitParams value, $Res Function(_GooglePayInitParams) _then) = __$GooglePayInitParamsCopyWithImpl; +@override @useResult +$Res call({ + String merchantName, String countryCode, bool testEnv, BillingAddressConfig? billingAddressConfig, bool isEmailRequired, bool existingPaymentMethodRequired, String? label, double? amount +}); - /// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. - @override - String? get label; - /// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. - @override - double? get amount; +@override $BillingAddressConfigCopyWith<$Res>? get billingAddressConfig; - /// Create a copy of GooglePayInitParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$GooglePayInitParamsImplCopyWith<_$GooglePayInitParamsImpl> get copyWith => - throw _privateConstructorUsedError; } +/// @nodoc +class __$GooglePayInitParamsCopyWithImpl<$Res> + implements _$GooglePayInitParamsCopyWith<$Res> { + __$GooglePayInitParamsCopyWithImpl(this._self, this._then); + + final _GooglePayInitParams _self; + final $Res Function(_GooglePayInitParams) _then; + +/// Create a copy of GooglePayInitParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? merchantName = null,Object? countryCode = null,Object? testEnv = null,Object? billingAddressConfig = freezed,Object? isEmailRequired = null,Object? existingPaymentMethodRequired = null,Object? label = freezed,Object? amount = freezed,}) { + return _then(_GooglePayInitParams( +merchantName: null == merchantName ? _self.merchantName : merchantName // ignore: cast_nullable_to_non_nullable +as String,countryCode: null == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable +as String,testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,billingAddressConfig: freezed == billingAddressConfig ? _self.billingAddressConfig : billingAddressConfig // ignore: cast_nullable_to_non_nullable +as BillingAddressConfig?,isEmailRequired: null == isEmailRequired ? _self.isEmailRequired : isEmailRequired // ignore: cast_nullable_to_non_nullable +as bool,existingPaymentMethodRequired: null == existingPaymentMethodRequired ? _self.existingPaymentMethodRequired : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable +as bool,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +/// Create a copy of GooglePayInitParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingAddressConfigCopyWith<$Res>? get billingAddressConfig { + if (_self.billingAddressConfig == null) { + return null; + } -BillingAddressConfig _$BillingAddressConfigFromJson(Map json) { - return _BillingAddressConfig.fromJson(json); + return $BillingAddressConfigCopyWith<$Res>(_self.billingAddressConfig!, (value) { + return _then(_self.copyWith(billingAddressConfig: value)); + }); +} } + /// @nodoc mixin _$BillingAddressConfig { - /// If `true` Google pay requires a Billing address in order to process the - /// payment. - bool? get isRequired => throw _privateConstructorUsedError; - /// Desired format - BillingAddressFormat? get format => throw _privateConstructorUsedError; - - /// If `true` customer needs to provide a phonenummer in order to process - /// the transaction. - bool? get isPhoneNumberRequired => throw _privateConstructorUsedError; +/// If `true` Google pay requires a Billing address in order to process the +/// payment. + bool? get isRequired;/// Desired format + BillingAddressFormat? get format;/// If `true` customer needs to provide a phonenummer in order to process +/// the transaction. + bool? get isPhoneNumberRequired; +/// Create a copy of BillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BillingAddressConfigCopyWith get copyWith => _$BillingAddressConfigCopyWithImpl(this as BillingAddressConfig, _$identity); /// Serializes this BillingAddressConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of BillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BillingAddressConfigCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BillingAddressConfig&&(identical(other.isRequired, isRequired) || other.isRequired == isRequired)&&(identical(other.format, format) || other.format == format)&&(identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || other.isPhoneNumberRequired == isPhoneNumberRequired)); } -/// @nodoc -abstract class $BillingAddressConfigCopyWith<$Res> { - factory $BillingAddressConfigCopyWith(BillingAddressConfig value, - $Res Function(BillingAddressConfig) then) = - _$BillingAddressConfigCopyWithImpl<$Res, BillingAddressConfig>; - @useResult - $Res call( - {bool? isRequired, - BillingAddressFormat? format, - bool? isPhoneNumberRequired}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isRequired,format,isPhoneNumberRequired); + +@override +String toString() { + return 'BillingAddressConfig(isRequired: $isRequired, format: $format, isPhoneNumberRequired: $isPhoneNumberRequired)'; } -/// @nodoc -class _$BillingAddressConfigCopyWithImpl<$Res, - $Val extends BillingAddressConfig> - implements $BillingAddressConfigCopyWith<$Res> { - _$BillingAddressConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isRequired = freezed, - Object? format = freezed, - Object? isPhoneNumberRequired = freezed, - }) { - return _then(_value.copyWith( - isRequired: freezed == isRequired - ? _value.isRequired - : isRequired // ignore: cast_nullable_to_non_nullable - as bool?, - format: freezed == format - ? _value.format - : format // ignore: cast_nullable_to_non_nullable - as BillingAddressFormat?, - isPhoneNumberRequired: freezed == isPhoneNumberRequired - ? _value.isPhoneNumberRequired - : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } + } /// @nodoc -abstract class _$$BillingAddressConfigImplCopyWith<$Res> +abstract mixin class $BillingAddressConfigCopyWith<$Res> { + factory $BillingAddressConfigCopyWith(BillingAddressConfig value, $Res Function(BillingAddressConfig) _then) = _$BillingAddressConfigCopyWithImpl; +@useResult +$Res call({ + bool? isRequired, BillingAddressFormat? format, bool? isPhoneNumberRequired +}); + + + + +} +/// @nodoc +class _$BillingAddressConfigCopyWithImpl<$Res> implements $BillingAddressConfigCopyWith<$Res> { - factory _$$BillingAddressConfigImplCopyWith(_$BillingAddressConfigImpl value, - $Res Function(_$BillingAddressConfigImpl) then) = - __$$BillingAddressConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool? isRequired, - BillingAddressFormat? format, - bool? isPhoneNumberRequired}); + _$BillingAddressConfigCopyWithImpl(this._self, this._then); + + final BillingAddressConfig _self; + final $Res Function(BillingAddressConfig) _then; + +/// Create a copy of BillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isRequired = freezed,Object? format = freezed,Object? isPhoneNumberRequired = freezed,}) { + return _then(_self.copyWith( +isRequired: freezed == isRequired ? _self.isRequired : isRequired // ignore: cast_nullable_to_non_nullable +as bool?,format: freezed == format ? _self.format : format // ignore: cast_nullable_to_non_nullable +as BillingAddressFormat?,isPhoneNumberRequired: freezed == isPhoneNumberRequired ? _self.isPhoneNumberRequired : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BillingAddressConfig]. +extension BillingAddressConfigPatterns on BillingAddressConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BillingAddressConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BillingAddressConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BillingAddressConfig value) $default,){ +final _that = this; +switch (_that) { +case _BillingAddressConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BillingAddressConfig value)? $default,){ +final _that = this; +switch (_that) { +case _BillingAddressConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? isRequired, BillingAddressFormat? format, bool? isPhoneNumberRequired)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BillingAddressConfig() when $default != null: +return $default(_that.isRequired,_that.format,_that.isPhoneNumberRequired);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? isRequired, BillingAddressFormat? format, bool? isPhoneNumberRequired) $default,) {final _that = this; +switch (_that) { +case _BillingAddressConfig(): +return $default(_that.isRequired,_that.format,_that.isPhoneNumberRequired);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? isRequired, BillingAddressFormat? format, bool? isPhoneNumberRequired)? $default,) {final _that = this; +switch (_that) { +case _BillingAddressConfig() when $default != null: +return $default(_that.isRequired,_that.format,_that.isPhoneNumberRequired);case _: + return null; + +} } -/// @nodoc -class __$$BillingAddressConfigImplCopyWithImpl<$Res> - extends _$BillingAddressConfigCopyWithImpl<$Res, _$BillingAddressConfigImpl> - implements _$$BillingAddressConfigImplCopyWith<$Res> { - __$$BillingAddressConfigImplCopyWithImpl(_$BillingAddressConfigImpl _value, - $Res Function(_$BillingAddressConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of BillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isRequired = freezed, - Object? format = freezed, - Object? isPhoneNumberRequired = freezed, - }) { - return _then(_$BillingAddressConfigImpl( - isRequired: freezed == isRequired - ? _value.isRequired - : isRequired // ignore: cast_nullable_to_non_nullable - as bool?, - format: freezed == format - ? _value.format - : format // ignore: cast_nullable_to_non_nullable - as BillingAddressFormat?, - isPhoneNumberRequired: freezed == isPhoneNumberRequired - ? _value.isPhoneNumberRequired - : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$BillingAddressConfigImpl implements _BillingAddressConfig { - const _$BillingAddressConfigImpl( - {this.isRequired, this.format, this.isPhoneNumberRequired}); - - factory _$BillingAddressConfigImpl.fromJson(Map json) => - _$$BillingAddressConfigImplFromJson(json); - - /// If `true` Google pay requires a Billing address in order to process the - /// payment. - @override - final bool? isRequired; - - /// Desired format - @override - final BillingAddressFormat? format; - - /// If `true` customer needs to provide a phonenummer in order to process - /// the transaction. - @override - final bool? isPhoneNumberRequired; - - @override - String toString() { - return 'BillingAddressConfig(isRequired: $isRequired, format: $format, isPhoneNumberRequired: $isPhoneNumberRequired)'; - } +class _BillingAddressConfig implements BillingAddressConfig { + const _BillingAddressConfig({this.isRequired, this.format, this.isPhoneNumberRequired}); + factory _BillingAddressConfig.fromJson(Map json) => _$BillingAddressConfigFromJson(json); + +/// If `true` Google pay requires a Billing address in order to process the +/// payment. +@override final bool? isRequired; +/// Desired format +@override final BillingAddressFormat? format; +/// If `true` customer needs to provide a phonenummer in order to process +/// the transaction. +@override final bool? isPhoneNumberRequired; + +/// Create a copy of BillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BillingAddressConfigCopyWith<_BillingAddressConfig> get copyWith => __$BillingAddressConfigCopyWithImpl<_BillingAddressConfig>(this, _$identity); + +@override +Map toJson() { + return _$BillingAddressConfigToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BillingAddressConfigImpl && - (identical(other.isRequired, isRequired) || - other.isRequired == isRequired) && - (identical(other.format, format) || other.format == format) && - (identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || - other.isPhoneNumberRequired == isPhoneNumberRequired)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BillingAddressConfig&&(identical(other.isRequired, isRequired) || other.isRequired == isRequired)&&(identical(other.format, format) || other.format == format)&&(identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || other.isPhoneNumberRequired == isPhoneNumberRequired)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, isRequired, format, isPhoneNumberRequired); - - /// Create a copy of BillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BillingAddressConfigImplCopyWith<_$BillingAddressConfigImpl> - get copyWith => - __$$BillingAddressConfigImplCopyWithImpl<_$BillingAddressConfigImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$BillingAddressConfigImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isRequired,format,isPhoneNumberRequired); + +@override +String toString() { + return 'BillingAddressConfig(isRequired: $isRequired, format: $format, isPhoneNumberRequired: $isPhoneNumberRequired)'; } -abstract class _BillingAddressConfig implements BillingAddressConfig { - const factory _BillingAddressConfig( - {final bool? isRequired, - final BillingAddressFormat? format, - final bool? isPhoneNumberRequired}) = _$BillingAddressConfigImpl; - factory _BillingAddressConfig.fromJson(Map json) = - _$BillingAddressConfigImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$BillingAddressConfigCopyWith<$Res> implements $BillingAddressConfigCopyWith<$Res> { + factory _$BillingAddressConfigCopyWith(_BillingAddressConfig value, $Res Function(_BillingAddressConfig) _then) = __$BillingAddressConfigCopyWithImpl; +@override @useResult +$Res call({ + bool? isRequired, BillingAddressFormat? format, bool? isPhoneNumberRequired +}); - /// If `true` Google pay requires a Billing address in order to process the - /// payment. - @override - bool? get isRequired; - /// Desired format - @override - BillingAddressFormat? get format; - /// If `true` customer needs to provide a phonenummer in order to process - /// the transaction. - @override - bool? get isPhoneNumberRequired; - /// Create a copy of BillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BillingAddressConfigImplCopyWith<_$BillingAddressConfigImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$BillingAddressConfigCopyWithImpl<$Res> + implements _$BillingAddressConfigCopyWith<$Res> { + __$BillingAddressConfigCopyWithImpl(this._self, this._then); + + final _BillingAddressConfig _self; + final $Res Function(_BillingAddressConfig) _then; + +/// Create a copy of BillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isRequired = freezed,Object? format = freezed,Object? isPhoneNumberRequired = freezed,}) { + return _then(_BillingAddressConfig( +isRequired: freezed == isRequired ? _self.isRequired : isRequired // ignore: cast_nullable_to_non_nullable +as bool?,format: freezed == format ? _self.format : format // ignore: cast_nullable_to_non_nullable +as BillingAddressFormat?,isPhoneNumberRequired: freezed == isPhoneNumberRequired ? _self.isPhoneNumberRequired : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable +as bool?, + )); } -CreateGooglePayPaymentParams _$CreateGooglePayPaymentParamsFromJson( - Map json) { - return _CreateGooglePayPaymentParams.fromJson(json); + } + /// @nodoc mixin _$CreateGooglePayPaymentParams { - /// ISO 4217 alphabetic currency code. - /// - /// For example: `USD` - String get currencyCode => throw _privateConstructorUsedError; - /// Amount intended to be collected. - /// - /// The amount has to be a positive zero-digit integer representing the charge - /// in the smallest currency unit (e.g. cents for US dollar). - int get amount => throw _privateConstructorUsedError; +/// ISO 4217 alphabetic currency code. +/// +/// For example: `USD` + String get currencyCode;/// Amount intended to be collected. +/// +/// The amount has to be a positive zero-digit integer representing the charge +/// in the smallest currency unit (e.g. cents for US dollar). + int get amount; +/// Create a copy of CreateGooglePayPaymentParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CreateGooglePayPaymentParamsCopyWith get copyWith => _$CreateGooglePayPaymentParamsCopyWithImpl(this as CreateGooglePayPaymentParams, _$identity); /// Serializes this CreateGooglePayPaymentParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of CreateGooglePayPaymentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CreateGooglePayPaymentParamsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateGooglePayPaymentParams&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.amount, amount) || other.amount == amount)); } -/// @nodoc -abstract class $CreateGooglePayPaymentParamsCopyWith<$Res> { - factory $CreateGooglePayPaymentParamsCopyWith( - CreateGooglePayPaymentParams value, - $Res Function(CreateGooglePayPaymentParams) then) = - _$CreateGooglePayPaymentParamsCopyWithImpl<$Res, - CreateGooglePayPaymentParams>; - @useResult - $Res call({String currencyCode, int amount}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,currencyCode,amount); + +@override +String toString() { + return 'CreateGooglePayPaymentParams(currencyCode: $currencyCode, amount: $amount)'; } -/// @nodoc -class _$CreateGooglePayPaymentParamsCopyWithImpl<$Res, - $Val extends CreateGooglePayPaymentParams> - implements $CreateGooglePayPaymentParamsCopyWith<$Res> { - _$CreateGooglePayPaymentParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CreateGooglePayPaymentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currencyCode = null, - Object? amount = null, - }) { - return _then(_value.copyWith( - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } + } /// @nodoc -abstract class _$$CreateGooglePayPaymentParamsImplCopyWith<$Res> +abstract mixin class $CreateGooglePayPaymentParamsCopyWith<$Res> { + factory $CreateGooglePayPaymentParamsCopyWith(CreateGooglePayPaymentParams value, $Res Function(CreateGooglePayPaymentParams) _then) = _$CreateGooglePayPaymentParamsCopyWithImpl; +@useResult +$Res call({ + String currencyCode, int amount +}); + + + + +} +/// @nodoc +class _$CreateGooglePayPaymentParamsCopyWithImpl<$Res> implements $CreateGooglePayPaymentParamsCopyWith<$Res> { - factory _$$CreateGooglePayPaymentParamsImplCopyWith( - _$CreateGooglePayPaymentParamsImpl value, - $Res Function(_$CreateGooglePayPaymentParamsImpl) then) = - __$$CreateGooglePayPaymentParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String currencyCode, int amount}); + _$CreateGooglePayPaymentParamsCopyWithImpl(this._self, this._then); + + final CreateGooglePayPaymentParams _self; + final $Res Function(CreateGooglePayPaymentParams) _then; + +/// Create a copy of CreateGooglePayPaymentParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? currencyCode = null,Object? amount = null,}) { + return _then(_self.copyWith( +currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CreateGooglePayPaymentParams]. +extension CreateGooglePayPaymentParamsPatterns on CreateGooglePayPaymentParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CreateGooglePayPaymentParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CreateGooglePayPaymentParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CreateGooglePayPaymentParams value) $default,){ +final _that = this; +switch (_that) { +case _CreateGooglePayPaymentParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CreateGooglePayPaymentParams value)? $default,){ +final _that = this; +switch (_that) { +case _CreateGooglePayPaymentParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String currencyCode, int amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CreateGooglePayPaymentParams() when $default != null: +return $default(_that.currencyCode,_that.amount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String currencyCode, int amount) $default,) {final _that = this; +switch (_that) { +case _CreateGooglePayPaymentParams(): +return $default(_that.currencyCode,_that.amount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String currencyCode, int amount)? $default,) {final _that = this; +switch (_that) { +case _CreateGooglePayPaymentParams() when $default != null: +return $default(_that.currencyCode,_that.amount);case _: + return null; + +} } -/// @nodoc -class __$$CreateGooglePayPaymentParamsImplCopyWithImpl<$Res> - extends _$CreateGooglePayPaymentParamsCopyWithImpl<$Res, - _$CreateGooglePayPaymentParamsImpl> - implements _$$CreateGooglePayPaymentParamsImplCopyWith<$Res> { - __$$CreateGooglePayPaymentParamsImplCopyWithImpl( - _$CreateGooglePayPaymentParamsImpl _value, - $Res Function(_$CreateGooglePayPaymentParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CreateGooglePayPaymentParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currencyCode = null, - Object? amount = null, - }) { - return _then(_$CreateGooglePayPaymentParamsImpl( - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CreateGooglePayPaymentParamsImpl - implements _CreateGooglePayPaymentParams { - const _$CreateGooglePayPaymentParamsImpl( - {required this.currencyCode, required this.amount}); - - factory _$CreateGooglePayPaymentParamsImpl.fromJson( - Map json) => - _$$CreateGooglePayPaymentParamsImplFromJson(json); - - /// ISO 4217 alphabetic currency code. - /// - /// For example: `USD` - @override - final String currencyCode; - - /// Amount intended to be collected. - /// - /// The amount has to be a positive zero-digit integer representing the charge - /// in the smallest currency unit (e.g. cents for US dollar). - @override - final int amount; - - @override - String toString() { - return 'CreateGooglePayPaymentParams(currencyCode: $currencyCode, amount: $amount)'; - } +class _CreateGooglePayPaymentParams implements CreateGooglePayPaymentParams { + const _CreateGooglePayPaymentParams({required this.currencyCode, required this.amount}); + factory _CreateGooglePayPaymentParams.fromJson(Map json) => _$CreateGooglePayPaymentParamsFromJson(json); + +/// ISO 4217 alphabetic currency code. +/// +/// For example: `USD` +@override final String currencyCode; +/// Amount intended to be collected. +/// +/// The amount has to be a positive zero-digit integer representing the charge +/// in the smallest currency unit (e.g. cents for US dollar). +@override final int amount; + +/// Create a copy of CreateGooglePayPaymentParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CreateGooglePayPaymentParamsCopyWith<_CreateGooglePayPaymentParams> get copyWith => __$CreateGooglePayPaymentParamsCopyWithImpl<_CreateGooglePayPaymentParams>(this, _$identity); + +@override +Map toJson() { + return _$CreateGooglePayPaymentParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateGooglePayPaymentParams&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.amount, amount) || other.amount == amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,currencyCode,amount); + +@override +String toString() { + return 'CreateGooglePayPaymentParams(currencyCode: $currencyCode, amount: $amount)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CreateGooglePayPaymentParamsImpl && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode) && - (identical(other.amount, amount) || other.amount == amount)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, currencyCode, amount); - - /// Create a copy of CreateGooglePayPaymentParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CreateGooglePayPaymentParamsImplCopyWith< - _$CreateGooglePayPaymentParamsImpl> - get copyWith => __$$CreateGooglePayPaymentParamsImplCopyWithImpl< - _$CreateGooglePayPaymentParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CreateGooglePayPaymentParamsImplToJson( - this, - ); - } } -abstract class _CreateGooglePayPaymentParams - implements CreateGooglePayPaymentParams { - const factory _CreateGooglePayPaymentParams( - {required final String currencyCode, - required final int amount}) = _$CreateGooglePayPaymentParamsImpl; +/// @nodoc +abstract mixin class _$CreateGooglePayPaymentParamsCopyWith<$Res> implements $CreateGooglePayPaymentParamsCopyWith<$Res> { + factory _$CreateGooglePayPaymentParamsCopyWith(_CreateGooglePayPaymentParams value, $Res Function(_CreateGooglePayPaymentParams) _then) = __$CreateGooglePayPaymentParamsCopyWithImpl; +@override @useResult +$Res call({ + String currencyCode, int amount +}); - factory _CreateGooglePayPaymentParams.fromJson(Map json) = - _$CreateGooglePayPaymentParamsImpl.fromJson; - /// ISO 4217 alphabetic currency code. - /// - /// For example: `USD` - @override - String get currencyCode; - /// Amount intended to be collected. - /// - /// The amount has to be a positive zero-digit integer representing the charge - /// in the smallest currency unit (e.g. cents for US dollar). - @override - int get amount; - /// Create a copy of CreateGooglePayPaymentParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CreateGooglePayPaymentParamsImplCopyWith< - _$CreateGooglePayPaymentParamsImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$CreateGooglePayPaymentParamsCopyWithImpl<$Res> + implements _$CreateGooglePayPaymentParamsCopyWith<$Res> { + __$CreateGooglePayPaymentParamsCopyWithImpl(this._self, this._then); + + final _CreateGooglePayPaymentParams _self; + final $Res Function(_CreateGooglePayPaymentParams) _then; + +/// Create a copy of CreateGooglePayPaymentParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? currencyCode = null,Object? amount = null,}) { + return _then(_CreateGooglePayPaymentParams( +currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int, + )); +} + -IsGooglePaySupportedParams _$IsGooglePaySupportedParamsFromJson( - Map json) { - return _IsGooglePaySupportedParams.fromJson(json); } + /// @nodoc mixin _$IsGooglePaySupportedParams { - /// Flag to use test environment or live environment. - /// - /// Defaults to `false`. - bool get testEnv => throw _privateConstructorUsedError; - - /// When set to true Google pay is only considered ready in case the - /// customers google Pay wallet has an existing payment method configured. - /// - /// Defaults to `false`. - bool get existingPaymentMethodRequired => - throw _privateConstructorUsedError; // When set to true it allow users without NFC-enabled devices to add cards to the wallet. + +/// Flag to use test environment or live environment. +/// +/// Defaults to `false`. + bool get testEnv;/// When set to true Google pay is only considered ready in case the +/// customers google Pay wallet has an existing payment method configured. +/// +/// Defaults to `false`. + bool get existingPaymentMethodRequired;// When set to true it allow users without NFC-enabled devices to add cards to the wallet. // //NFC is required for paying in stores. Defaults to `true`. Set this to `false` - bool get supportsTapToPay => throw _privateConstructorUsedError; + bool get supportsTapToPay; +/// Create a copy of IsGooglePaySupportedParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IsGooglePaySupportedParamsCopyWith get copyWith => _$IsGooglePaySupportedParamsCopyWithImpl(this as IsGooglePaySupportedParams, _$identity); /// Serializes this IsGooglePaySupportedParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of IsGooglePaySupportedParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IsGooglePaySupportedParamsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IsGooglePaySupportedParams&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.existingPaymentMethodRequired, existingPaymentMethodRequired) || other.existingPaymentMethodRequired == existingPaymentMethodRequired)&&(identical(other.supportsTapToPay, supportsTapToPay) || other.supportsTapToPay == supportsTapToPay)); } -/// @nodoc -abstract class $IsGooglePaySupportedParamsCopyWith<$Res> { - factory $IsGooglePaySupportedParamsCopyWith(IsGooglePaySupportedParams value, - $Res Function(IsGooglePaySupportedParams) then) = - _$IsGooglePaySupportedParamsCopyWithImpl<$Res, - IsGooglePaySupportedParams>; - @useResult - $Res call( - {bool testEnv, - bool existingPaymentMethodRequired, - bool supportsTapToPay}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testEnv,existingPaymentMethodRequired,supportsTapToPay); + +@override +String toString() { + return 'IsGooglePaySupportedParams(testEnv: $testEnv, existingPaymentMethodRequired: $existingPaymentMethodRequired, supportsTapToPay: $supportsTapToPay)'; } -/// @nodoc -class _$IsGooglePaySupportedParamsCopyWithImpl<$Res, - $Val extends IsGooglePaySupportedParams> - implements $IsGooglePaySupportedParamsCopyWith<$Res> { - _$IsGooglePaySupportedParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of IsGooglePaySupportedParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testEnv = null, - Object? existingPaymentMethodRequired = null, - Object? supportsTapToPay = null, - }) { - return _then(_value.copyWith( - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - existingPaymentMethodRequired: null == existingPaymentMethodRequired - ? _value.existingPaymentMethodRequired - : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable - as bool, - supportsTapToPay: null == supportsTapToPay - ? _value.supportsTapToPay - : supportsTapToPay // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } + } /// @nodoc -abstract class _$$IsGooglePaySupportedParamsImplCopyWith<$Res> +abstract mixin class $IsGooglePaySupportedParamsCopyWith<$Res> { + factory $IsGooglePaySupportedParamsCopyWith(IsGooglePaySupportedParams value, $Res Function(IsGooglePaySupportedParams) _then) = _$IsGooglePaySupportedParamsCopyWithImpl; +@useResult +$Res call({ + bool testEnv, bool existingPaymentMethodRequired, bool supportsTapToPay +}); + + + + +} +/// @nodoc +class _$IsGooglePaySupportedParamsCopyWithImpl<$Res> implements $IsGooglePaySupportedParamsCopyWith<$Res> { - factory _$$IsGooglePaySupportedParamsImplCopyWith( - _$IsGooglePaySupportedParamsImpl value, - $Res Function(_$IsGooglePaySupportedParamsImpl) then) = - __$$IsGooglePaySupportedParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool testEnv, - bool existingPaymentMethodRequired, - bool supportsTapToPay}); + _$IsGooglePaySupportedParamsCopyWithImpl(this._self, this._then); + + final IsGooglePaySupportedParams _self; + final $Res Function(IsGooglePaySupportedParams) _then; + +/// Create a copy of IsGooglePaySupportedParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? testEnv = null,Object? existingPaymentMethodRequired = null,Object? supportsTapToPay = null,}) { + return _then(_self.copyWith( +testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,existingPaymentMethodRequired: null == existingPaymentMethodRequired ? _self.existingPaymentMethodRequired : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable +as bool,supportsTapToPay: null == supportsTapToPay ? _self.supportsTapToPay : supportsTapToPay // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [IsGooglePaySupportedParams]. +extension IsGooglePaySupportedParamsPatterns on IsGooglePaySupportedParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IsGooglePaySupportedParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IsGooglePaySupportedParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IsGooglePaySupportedParams value) $default,){ +final _that = this; +switch (_that) { +case _IsGooglePaySupportedParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IsGooglePaySupportedParams value)? $default,){ +final _that = this; +switch (_that) { +case _IsGooglePaySupportedParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool testEnv, bool existingPaymentMethodRequired, bool supportsTapToPay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IsGooglePaySupportedParams() when $default != null: +return $default(_that.testEnv,_that.existingPaymentMethodRequired,_that.supportsTapToPay);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool testEnv, bool existingPaymentMethodRequired, bool supportsTapToPay) $default,) {final _that = this; +switch (_that) { +case _IsGooglePaySupportedParams(): +return $default(_that.testEnv,_that.existingPaymentMethodRequired,_that.supportsTapToPay);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool testEnv, bool existingPaymentMethodRequired, bool supportsTapToPay)? $default,) {final _that = this; +switch (_that) { +case _IsGooglePaySupportedParams() when $default != null: +return $default(_that.testEnv,_that.existingPaymentMethodRequired,_that.supportsTapToPay);case _: + return null; + +} } -/// @nodoc -class __$$IsGooglePaySupportedParamsImplCopyWithImpl<$Res> - extends _$IsGooglePaySupportedParamsCopyWithImpl<$Res, - _$IsGooglePaySupportedParamsImpl> - implements _$$IsGooglePaySupportedParamsImplCopyWith<$Res> { - __$$IsGooglePaySupportedParamsImplCopyWithImpl( - _$IsGooglePaySupportedParamsImpl _value, - $Res Function(_$IsGooglePaySupportedParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of IsGooglePaySupportedParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testEnv = null, - Object? existingPaymentMethodRequired = null, - Object? supportsTapToPay = null, - }) { - return _then(_$IsGooglePaySupportedParamsImpl( - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - existingPaymentMethodRequired: null == existingPaymentMethodRequired - ? _value.existingPaymentMethodRequired - : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable - as bool, - supportsTapToPay: null == supportsTapToPay - ? _value.supportsTapToPay - : supportsTapToPay // ignore: cast_nullable_to_non_nullable - as bool, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$IsGooglePaySupportedParamsImpl implements _IsGooglePaySupportedParams { - const _$IsGooglePaySupportedParamsImpl( - {this.testEnv = false, - this.existingPaymentMethodRequired = false, - this.supportsTapToPay = true}); - - factory _$IsGooglePaySupportedParamsImpl.fromJson( - Map json) => - _$$IsGooglePaySupportedParamsImplFromJson(json); - - /// Flag to use test environment or live environment. - /// - /// Defaults to `false`. - @override - @JsonKey() - final bool testEnv; - - /// When set to true Google pay is only considered ready in case the - /// customers google Pay wallet has an existing payment method configured. - /// - /// Defaults to `false`. - @override - @JsonKey() - final bool existingPaymentMethodRequired; +class _IsGooglePaySupportedParams implements IsGooglePaySupportedParams { + const _IsGooglePaySupportedParams({this.testEnv = false, this.existingPaymentMethodRequired = false, this.supportsTapToPay = true}); + factory _IsGooglePaySupportedParams.fromJson(Map json) => _$IsGooglePaySupportedParamsFromJson(json); + +/// Flag to use test environment or live environment. +/// +/// Defaults to `false`. +@override@JsonKey() final bool testEnv; +/// When set to true Google pay is only considered ready in case the +/// customers google Pay wallet has an existing payment method configured. +/// +/// Defaults to `false`. +@override@JsonKey() final bool existingPaymentMethodRequired; // When set to true it allow users without NFC-enabled devices to add cards to the wallet. // //NFC is required for paying in stores. Defaults to `true`. Set this to `false` - @override - @JsonKey() - final bool supportsTapToPay; +@override@JsonKey() final bool supportsTapToPay; - @override - String toString() { - return 'IsGooglePaySupportedParams(testEnv: $testEnv, existingPaymentMethodRequired: $existingPaymentMethodRequired, supportsTapToPay: $supportsTapToPay)'; - } +/// Create a copy of IsGooglePaySupportedParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IsGooglePaySupportedParamsCopyWith<_IsGooglePaySupportedParams> get copyWith => __$IsGooglePaySupportedParamsCopyWithImpl<_IsGooglePaySupportedParams>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IsGooglePaySupportedParamsImpl && - (identical(other.testEnv, testEnv) || other.testEnv == testEnv) && - (identical(other.existingPaymentMethodRequired, - existingPaymentMethodRequired) || - other.existingPaymentMethodRequired == - existingPaymentMethodRequired) && - (identical(other.supportsTapToPay, supportsTapToPay) || - other.supportsTapToPay == supportsTapToPay)); - } +@override +Map toJson() { + return _$IsGooglePaySupportedParamsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, testEnv, existingPaymentMethodRequired, supportsTapToPay); - - /// Create a copy of IsGooglePaySupportedParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IsGooglePaySupportedParamsImplCopyWith<_$IsGooglePaySupportedParamsImpl> - get copyWith => __$$IsGooglePaySupportedParamsImplCopyWithImpl< - _$IsGooglePaySupportedParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$IsGooglePaySupportedParamsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IsGooglePaySupportedParams&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.existingPaymentMethodRequired, existingPaymentMethodRequired) || other.existingPaymentMethodRequired == existingPaymentMethodRequired)&&(identical(other.supportsTapToPay, supportsTapToPay) || other.supportsTapToPay == supportsTapToPay)); } -abstract class _IsGooglePaySupportedParams - implements IsGooglePaySupportedParams { - const factory _IsGooglePaySupportedParams( - {final bool testEnv, - final bool existingPaymentMethodRequired, - final bool supportsTapToPay}) = _$IsGooglePaySupportedParamsImpl; - - factory _IsGooglePaySupportedParams.fromJson(Map json) = - _$IsGooglePaySupportedParamsImpl.fromJson; - - /// Flag to use test environment or live environment. - /// - /// Defaults to `false`. - @override - bool get testEnv; - - /// When set to true Google pay is only considered ready in case the - /// customers google Pay wallet has an existing payment method configured. - /// - /// Defaults to `false`. - @override - bool - get existingPaymentMethodRequired; // When set to true it allow users without NFC-enabled devices to add cards to the wallet. -// -//NFC is required for paying in stores. Defaults to `true`. Set this to `false` - @override - bool get supportsTapToPay; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testEnv,existingPaymentMethodRequired,supportsTapToPay); - /// Create a copy of IsGooglePaySupportedParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IsGooglePaySupportedParamsImplCopyWith<_$IsGooglePaySupportedParamsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'IsGooglePaySupportedParams(testEnv: $testEnv, existingPaymentMethodRequired: $existingPaymentMethodRequired, supportsTapToPay: $supportsTapToPay)'; } + + +} + +/// @nodoc +abstract mixin class _$IsGooglePaySupportedParamsCopyWith<$Res> implements $IsGooglePaySupportedParamsCopyWith<$Res> { + factory _$IsGooglePaySupportedParamsCopyWith(_IsGooglePaySupportedParams value, $Res Function(_IsGooglePaySupportedParams) _then) = __$IsGooglePaySupportedParamsCopyWithImpl; +@override @useResult +$Res call({ + bool testEnv, bool existingPaymentMethodRequired, bool supportsTapToPay +}); + + + + +} +/// @nodoc +class __$IsGooglePaySupportedParamsCopyWithImpl<$Res> + implements _$IsGooglePaySupportedParamsCopyWith<$Res> { + __$IsGooglePaySupportedParamsCopyWithImpl(this._self, this._then); + + final _IsGooglePaySupportedParams _self; + final $Res Function(_IsGooglePaySupportedParams) _then; + +/// Create a copy of IsGooglePaySupportedParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? testEnv = null,Object? existingPaymentMethodRequired = null,Object? supportsTapToPay = null,}) { + return _then(_IsGooglePaySupportedParams( +testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,existingPaymentMethodRequired: null == existingPaymentMethodRequired ? _self.existingPaymentMethodRequired : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable +as bool,supportsTapToPay: null == supportsTapToPay ? _self.supportsTapToPay : supportsTapToPay // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/google_pay.g.dart b/packages/stripe_platform_interface/lib/src/models/google_pay.g.dart index cd0417868..81a01a700 100644 --- a/packages/stripe_platform_interface/lib/src/models/google_pay.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/google_pay.g.dart @@ -6,32 +6,32 @@ part of 'google_pay.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PresentGooglePayParamsImpl _$$PresentGooglePayParamsImplFromJson( - Map json) => - _$PresentGooglePayParamsImpl( - clientSecret: json['clientSecret'] as String, - forSetupIntent: json['forSetupIntent'] as bool? ?? false, - currencyCode: json['currencyCode'] as String?, - ); +_PresentGooglePayParams _$PresentGooglePayParamsFromJson( + Map json, +) => _PresentGooglePayParams( + clientSecret: json['clientSecret'] as String, + forSetupIntent: json['forSetupIntent'] as bool? ?? false, + currencyCode: json['currencyCode'] as String?, +); -Map _$$PresentGooglePayParamsImplToJson( - _$PresentGooglePayParamsImpl instance) => - { - 'clientSecret': instance.clientSecret, - 'forSetupIntent': instance.forSetupIntent, - 'currencyCode': instance.currencyCode, - }; +Map _$PresentGooglePayParamsToJson( + _PresentGooglePayParams instance, +) => { + 'clientSecret': instance.clientSecret, + 'forSetupIntent': instance.forSetupIntent, + 'currencyCode': instance.currencyCode, +}; -_$GooglePayInitParamsImpl _$$GooglePayInitParamsImplFromJson( - Map json) => - _$GooglePayInitParamsImpl( +_GooglePayInitParams _$GooglePayInitParamsFromJson(Map json) => + _GooglePayInitParams( merchantName: json['merchantName'] as String, countryCode: json['countryCode'] as String, testEnv: json['testEnv'] as bool? ?? false, billingAddressConfig: json['billingAddressConfig'] == null ? null : BillingAddressConfig.fromJson( - json['billingAddressConfig'] as Map), + json['billingAddressConfig'] as Map, + ), isEmailRequired: json['isEmailRequired'] as bool? ?? false, existingPaymentMethodRequired: json['existingPaymentMethodRequired'] as bool? ?? true, @@ -39,68 +39,67 @@ _$GooglePayInitParamsImpl _$$GooglePayInitParamsImplFromJson( amount: (json['amount'] as num?)?.toDouble(), ); -Map _$$GooglePayInitParamsImplToJson( - _$GooglePayInitParamsImpl instance) => - { - 'merchantName': instance.merchantName, - 'countryCode': instance.countryCode, - 'testEnv': instance.testEnv, - 'billingAddressConfig': instance.billingAddressConfig?.toJson(), - 'isEmailRequired': instance.isEmailRequired, - 'existingPaymentMethodRequired': instance.existingPaymentMethodRequired, - 'label': instance.label, - 'amount': instance.amount, - }; +Map _$GooglePayInitParamsToJson( + _GooglePayInitParams instance, +) => { + 'merchantName': instance.merchantName, + 'countryCode': instance.countryCode, + 'testEnv': instance.testEnv, + 'billingAddressConfig': instance.billingAddressConfig?.toJson(), + 'isEmailRequired': instance.isEmailRequired, + 'existingPaymentMethodRequired': instance.existingPaymentMethodRequired, + 'label': instance.label, + 'amount': instance.amount, +}; -_$BillingAddressConfigImpl _$$BillingAddressConfigImplFromJson( - Map json) => - _$BillingAddressConfigImpl( - isRequired: json['isRequired'] as bool?, - format: - $enumDecodeNullable(_$BillingAddressFormatEnumMap, json['format']), - isPhoneNumberRequired: json['isPhoneNumberRequired'] as bool?, - ); +_BillingAddressConfig _$BillingAddressConfigFromJson( + Map json, +) => _BillingAddressConfig( + isRequired: json['isRequired'] as bool?, + format: $enumDecodeNullable(_$BillingAddressFormatEnumMap, json['format']), + isPhoneNumberRequired: json['isPhoneNumberRequired'] as bool?, +); -Map _$$BillingAddressConfigImplToJson( - _$BillingAddressConfigImpl instance) => - { - 'isRequired': instance.isRequired, - 'format': _$BillingAddressFormatEnumMap[instance.format], - 'isPhoneNumberRequired': instance.isPhoneNumberRequired, - }; +Map _$BillingAddressConfigToJson( + _BillingAddressConfig instance, +) => { + 'isRequired': instance.isRequired, + 'format': _$BillingAddressFormatEnumMap[instance.format], + 'isPhoneNumberRequired': instance.isPhoneNumberRequired, +}; const _$BillingAddressFormatEnumMap = { BillingAddressFormat.FULL: 'FULL', BillingAddressFormat.MIN: 'MIN', }; -_$CreateGooglePayPaymentParamsImpl _$$CreateGooglePayPaymentParamsImplFromJson( - Map json) => - _$CreateGooglePayPaymentParamsImpl( - currencyCode: json['currencyCode'] as String, - amount: (json['amount'] as num).toInt(), - ); +_CreateGooglePayPaymentParams _$CreateGooglePayPaymentParamsFromJson( + Map json, +) => _CreateGooglePayPaymentParams( + currencyCode: json['currencyCode'] as String, + amount: (json['amount'] as num).toInt(), +); -Map _$$CreateGooglePayPaymentParamsImplToJson( - _$CreateGooglePayPaymentParamsImpl instance) => - { - 'currencyCode': instance.currencyCode, - 'amount': instance.amount, - }; +Map _$CreateGooglePayPaymentParamsToJson( + _CreateGooglePayPaymentParams instance, +) => { + 'currencyCode': instance.currencyCode, + 'amount': instance.amount, +}; -_$IsGooglePaySupportedParamsImpl _$$IsGooglePaySupportedParamsImplFromJson( - Map json) => - _$IsGooglePaySupportedParamsImpl( - testEnv: json['testEnv'] as bool? ?? false, - existingPaymentMethodRequired: - json['existingPaymentMethodRequired'] as bool? ?? false, - supportsTapToPay: json['supportsTapToPay'] as bool? ?? true, - ); +_IsGooglePaySupportedParams _$IsGooglePaySupportedParamsFromJson( + Map json, +) => _IsGooglePaySupportedParams( + testEnv: json['testEnv'] as bool? ?? false, + existingPaymentMethodRequired: + json['existingPaymentMethodRequired'] as bool? ?? false, + supportsTapToPay: json['supportsTapToPay'] as bool? ?? true, +); -Map _$$IsGooglePaySupportedParamsImplToJson( - _$IsGooglePaySupportedParamsImpl instance) => - { - 'testEnv': instance.testEnv, - 'existingPaymentMethodRequired': instance.existingPaymentMethodRequired, - 'supportsTapToPay': instance.supportsTapToPay, - }; +Map _$IsGooglePaySupportedParamsToJson( + _IsGooglePaySupportedParams instance, +) => { + 'testEnv': instance.testEnv, + 'existingPaymentMethodRequired': instance.existingPaymentMethodRequired, + 'supportsTapToPay': instance.supportsTapToPay, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.dart b/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.dart index 5c1036a96..7353aa1b5 100644 --- a/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.dart +++ b/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.dart @@ -5,7 +5,8 @@ part 'intent_creation_callback_params.freezed.dart'; part 'intent_creation_callback_params.g.dart'; @freezed -class IntentCreationCallbackParams with _$IntentCreationCallbackParams { +abstract class IntentCreationCallbackParams + with _$IntentCreationCallbackParams { @JsonSerializable(explicitToJson: true) const factory IntentCreationCallbackParams({ /// Client secret of the payment intent or setup intent. diff --git a/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.freezed.dart b/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.freezed.dart index d8b3c8c13..864d8c18b 100644 --- a/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,217 +9,300 @@ part of 'intent_creation_callback_params.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -IntentCreationCallbackParams _$IntentCreationCallbackParamsFromJson( - Map json) { - return _IntentCreationCallbackParams.fromJson(json); -} - /// @nodoc mixin _$IntentCreationCallbackParams { - /// Client secret of the payment intent or setup intent. - String? get clientSecret => throw _privateConstructorUsedError; - /// Error that occurred during the creation of the payment intent or setup intent. - StripeException? get error => throw _privateConstructorUsedError; +/// Client secret of the payment intent or setup intent. + String? get clientSecret;/// Error that occurred during the creation of the payment intent or setup intent. + StripeException? get error; +/// Create a copy of IntentCreationCallbackParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IntentCreationCallbackParamsCopyWith get copyWith => _$IntentCreationCallbackParamsCopyWithImpl(this as IntentCreationCallbackParams, _$identity); /// Serializes this IntentCreationCallbackParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of IntentCreationCallbackParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IntentCreationCallbackParamsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IntentCreationCallbackParams&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.error, error) || other.error == error)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,clientSecret,error); + +@override +String toString() { + return 'IntentCreationCallbackParams(clientSecret: $clientSecret, error: $error)'; } -/// @nodoc -abstract class $IntentCreationCallbackParamsCopyWith<$Res> { - factory $IntentCreationCallbackParamsCopyWith( - IntentCreationCallbackParams value, - $Res Function(IntentCreationCallbackParams) then) = - _$IntentCreationCallbackParamsCopyWithImpl<$Res, - IntentCreationCallbackParams>; - @useResult - $Res call({String? clientSecret, StripeException? error}); - $StripeExceptionCopyWith<$Res>? get error; } /// @nodoc -class _$IntentCreationCallbackParamsCopyWithImpl<$Res, - $Val extends IntentCreationCallbackParams> +abstract mixin class $IntentCreationCallbackParamsCopyWith<$Res> { + factory $IntentCreationCallbackParamsCopyWith(IntentCreationCallbackParams value, $Res Function(IntentCreationCallbackParams) _then) = _$IntentCreationCallbackParamsCopyWithImpl; +@useResult +$Res call({ + String? clientSecret, StripeException? error +}); + + +$StripeExceptionCopyWith<$Res>? get error; + +} +/// @nodoc +class _$IntentCreationCallbackParamsCopyWithImpl<$Res> implements $IntentCreationCallbackParamsCopyWith<$Res> { - _$IntentCreationCallbackParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of IntentCreationCallbackParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? clientSecret = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - clientSecret: freezed == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeException?, - ) as $Val); + _$IntentCreationCallbackParamsCopyWithImpl(this._self, this._then); + + final IntentCreationCallbackParams _self; + final $Res Function(IntentCreationCallbackParams) _then; + +/// Create a copy of IntentCreationCallbackParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? clientSecret = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +clientSecret: freezed == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeException?, + )); +} +/// Create a copy of IntentCreationCallbackParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeExceptionCopyWith<$Res>? get error { + if (_self.error == null) { + return null; } - /// Create a copy of IntentCreationCallbackParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $StripeExceptionCopyWith<$Res>? get error { - if (_value.error == null) { - return null; - } - - return $StripeExceptionCopyWith<$Res>(_value.error!, (value) { - return _then(_value.copyWith(error: value) as $Val); - }); - } + return $StripeExceptionCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } -/// @nodoc -abstract class _$$IntentCreationCallbackParamsImplCopyWith<$Res> - implements $IntentCreationCallbackParamsCopyWith<$Res> { - factory _$$IntentCreationCallbackParamsImplCopyWith( - _$IntentCreationCallbackParamsImpl value, - $Res Function(_$IntentCreationCallbackParamsImpl) then) = - __$$IntentCreationCallbackParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? clientSecret, StripeException? error}); - @override - $StripeExceptionCopyWith<$Res>? get error; +/// Adds pattern-matching-related methods to [IntentCreationCallbackParams]. +extension IntentCreationCallbackParamsPatterns on IntentCreationCallbackParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IntentCreationCallbackParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IntentCreationCallbackParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IntentCreationCallbackParams value) $default,){ +final _that = this; +switch (_that) { +case _IntentCreationCallbackParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IntentCreationCallbackParams value)? $default,){ +final _that = this; +switch (_that) { +case _IntentCreationCallbackParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? clientSecret, StripeException? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IntentCreationCallbackParams() when $default != null: +return $default(_that.clientSecret,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? clientSecret, StripeException? error) $default,) {final _that = this; +switch (_that) { +case _IntentCreationCallbackParams(): +return $default(_that.clientSecret,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? clientSecret, StripeException? error)? $default,) {final _that = this; +switch (_that) { +case _IntentCreationCallbackParams() when $default != null: +return $default(_that.clientSecret,_that.error);case _: + return null; + +} } -/// @nodoc -class __$$IntentCreationCallbackParamsImplCopyWithImpl<$Res> - extends _$IntentCreationCallbackParamsCopyWithImpl<$Res, - _$IntentCreationCallbackParamsImpl> - implements _$$IntentCreationCallbackParamsImplCopyWith<$Res> { - __$$IntentCreationCallbackParamsImplCopyWithImpl( - _$IntentCreationCallbackParamsImpl _value, - $Res Function(_$IntentCreationCallbackParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of IntentCreationCallbackParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? clientSecret = freezed, - Object? error = freezed, - }) { - return _then(_$IntentCreationCallbackParamsImpl( - clientSecret: freezed == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as StripeException?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$IntentCreationCallbackParamsImpl - implements _IntentCreationCallbackParams { - const _$IntentCreationCallbackParamsImpl({this.clientSecret, this.error}); - - factory _$IntentCreationCallbackParamsImpl.fromJson( - Map json) => - _$$IntentCreationCallbackParamsImplFromJson(json); +class _IntentCreationCallbackParams implements IntentCreationCallbackParams { + const _IntentCreationCallbackParams({this.clientSecret, this.error}); + factory _IntentCreationCallbackParams.fromJson(Map json) => _$IntentCreationCallbackParamsFromJson(json); + +/// Client secret of the payment intent or setup intent. +@override final String? clientSecret; +/// Error that occurred during the creation of the payment intent or setup intent. +@override final StripeException? error; + +/// Create a copy of IntentCreationCallbackParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IntentCreationCallbackParamsCopyWith<_IntentCreationCallbackParams> get copyWith => __$IntentCreationCallbackParamsCopyWithImpl<_IntentCreationCallbackParams>(this, _$identity); + +@override +Map toJson() { + return _$IntentCreationCallbackParamsToJson(this, ); +} - /// Client secret of the payment intent or setup intent. - @override - final String? clientSecret; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IntentCreationCallbackParams&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.error, error) || other.error == error)); +} - /// Error that occurred during the creation of the payment intent or setup intent. - @override - final StripeException? error; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,clientSecret,error); - @override - String toString() { - return 'IntentCreationCallbackParams(clientSecret: $clientSecret, error: $error)'; - } +@override +String toString() { + return 'IntentCreationCallbackParams(clientSecret: $clientSecret, error: $error)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IntentCreationCallbackParamsImpl && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.error, error) || other.error == error)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, clientSecret, error); - - /// Create a copy of IntentCreationCallbackParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IntentCreationCallbackParamsImplCopyWith< - _$IntentCreationCallbackParamsImpl> - get copyWith => __$$IntentCreationCallbackParamsImplCopyWithImpl< - _$IntentCreationCallbackParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$IntentCreationCallbackParamsImplToJson( - this, - ); - } } -abstract class _IntentCreationCallbackParams - implements IntentCreationCallbackParams { - const factory _IntentCreationCallbackParams( - {final String? clientSecret, - final StripeException? error}) = _$IntentCreationCallbackParamsImpl; +/// @nodoc +abstract mixin class _$IntentCreationCallbackParamsCopyWith<$Res> implements $IntentCreationCallbackParamsCopyWith<$Res> { + factory _$IntentCreationCallbackParamsCopyWith(_IntentCreationCallbackParams value, $Res Function(_IntentCreationCallbackParams) _then) = __$IntentCreationCallbackParamsCopyWithImpl; +@override @useResult +$Res call({ + String? clientSecret, StripeException? error +}); - factory _IntentCreationCallbackParams.fromJson(Map json) = - _$IntentCreationCallbackParamsImpl.fromJson; - /// Client secret of the payment intent or setup intent. - @override - String? get clientSecret; +@override $StripeExceptionCopyWith<$Res>? get error; - /// Error that occurred during the creation of the payment intent or setup intent. - @override - StripeException? get error; +} +/// @nodoc +class __$IntentCreationCallbackParamsCopyWithImpl<$Res> + implements _$IntentCreationCallbackParamsCopyWith<$Res> { + __$IntentCreationCallbackParamsCopyWithImpl(this._self, this._then); + + final _IntentCreationCallbackParams _self; + final $Res Function(_IntentCreationCallbackParams) _then; + +/// Create a copy of IntentCreationCallbackParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? clientSecret = freezed,Object? error = freezed,}) { + return _then(_IntentCreationCallbackParams( +clientSecret: freezed == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as StripeException?, + )); +} + +/// Create a copy of IntentCreationCallbackParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$StripeExceptionCopyWith<$Res>? get error { + if (_self.error == null) { + return null; + } - /// Create a copy of IntentCreationCallbackParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IntentCreationCallbackParamsImplCopyWith< - _$IntentCreationCallbackParamsImpl> - get copyWith => throw _privateConstructorUsedError; + return $StripeExceptionCopyWith<$Res>(_self.error!, (value) { + return _then(_self.copyWith(error: value)); + }); +} } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.g.dart b/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.g.dart index df65559ad..d76116882 100644 --- a/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/intent_creation_callback_params.g.dart @@ -6,18 +6,18 @@ part of 'intent_creation_callback_params.dart'; // JsonSerializableGenerator // ************************************************************************** -_$IntentCreationCallbackParamsImpl _$$IntentCreationCallbackParamsImplFromJson( - Map json) => - _$IntentCreationCallbackParamsImpl( - clientSecret: json['clientSecret'] as String?, - error: json['error'] == null - ? null - : StripeException.fromJson(json['error'] as Map), - ); +_IntentCreationCallbackParams _$IntentCreationCallbackParamsFromJson( + Map json, +) => _IntentCreationCallbackParams( + clientSecret: json['clientSecret'] as String?, + error: json['error'] == null + ? null + : StripeException.fromJson(json['error'] as Map), +); -Map _$$IntentCreationCallbackParamsImplToJson( - _$IntentCreationCallbackParamsImpl instance) => - { - 'clientSecret': instance.clientSecret, - 'error': instance.error?.toJson(), - }; +Map _$IntentCreationCallbackParamsToJson( + _IntentCreationCallbackParams instance, +) => { + 'clientSecret': instance.clientSecret, + 'error': instance.error?.toJson(), +}; diff --git a/packages/stripe_platform_interface/lib/src/models/next_action.dart b/packages/stripe_platform_interface/lib/src/models/next_action.dart index f3fedbb3d..e45300b3f 100644 --- a/packages/stripe_platform_interface/lib/src/models/next_action.dart +++ b/packages/stripe_platform_interface/lib/src/models/next_action.dart @@ -4,13 +4,12 @@ part 'next_action.freezed.dart'; part 'next_action.g.dart'; @Freezed(unionKey: 'type') - /// Description of the possible next action that must be handled to complete /// the [PaymentIntent]. /// /// See: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-next_action-type /// for more details. -class NextAction with _$NextAction { +abstract class NextAction with _$NextAction { /// Contains instructions for redirecting the customer to a certain url /// in order to authorise the payment. @JsonSerializable(explicitToJson: true) diff --git a/packages/stripe_platform_interface/lib/src/models/next_action.freezed.dart b/packages/stripe_platform_interface/lib/src/models/next_action.freezed.dart index af8fca23b..55fb9b4dc 100644 --- a/packages/stripe_platform_interface/lib/src/models/next_action.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/next_action.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1182 +9,610 @@ part of 'next_action.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -NextAction _$NextActionFromJson(Map json) { - switch (json['type']) { - case 'urlRedirect': - return _NextActionRedirect.fromJson(json); - case 'oxxoVoucher': - return _NextActionOxxo.fromJson(json); - case 'weChatRedirect': - return _NextActionWeChatRedirect.fromJson(json); - case 'verifyWithMicrodeposits': - return _NextActionMicroDeposits.fromJson(json); - case 'multibanco': - return _NextActionMultiBanco.fromJson(json); - - default: - throw CheckedFromJsonException( - json, 'type', 'NextAction', 'Invalid union type "${json['type']}"!'); - } +NextAction _$NextActionFromJson( + Map json +) { + switch (json['type']) { + case 'urlRedirect': + return _NextActionRedirect.fromJson( + json + ); + case 'oxxoVoucher': + return _NextActionOxxo.fromJson( + json + ); + case 'weChatRedirect': + return _NextActionWeChatRedirect.fromJson( + json + ); + case 'verifyWithMicrodeposits': + return _NextActionMicroDeposits.fromJson( + json + ); + case 'multibanco': + return _NextActionMultiBanco.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'type', + 'NextAction', + 'Invalid union type "${json['type']}"!' +); + } + } /// @nodoc mixin _$NextAction { - @optionalTypeArgs - TResult when({ - required TResult Function(String? redirectUrl) redirectToUrl, - required TResult Function( - int? expiration, String? voucherURL, String? voucherNumber) - displayOxxoDetails, - required TResult Function(String? redirectUrl) wechatPayRedirect, - required TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType) - verifyWithMicroDeposits, - required TResult Function(String? voucherURL) multibanco, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String? redirectUrl)? redirectToUrl, - TResult? Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult? Function(String? redirectUrl)? wechatPayRedirect, - TResult? Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult? Function(String? voucherURL)? multibanco, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String? redirectUrl)? redirectToUrl, - TResult Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult Function(String? redirectUrl)? wechatPayRedirect, - TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult Function(String? voucherURL)? multibanco, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_NextActionRedirect value) redirectToUrl, - required TResult Function(_NextActionOxxo value) displayOxxoDetails, - required TResult Function(_NextActionWeChatRedirect value) - wechatPayRedirect, - required TResult Function(_NextActionMicroDeposits value) - verifyWithMicroDeposits, - required TResult Function(_NextActionMultiBanco value) multibanco, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_NextActionRedirect value)? redirectToUrl, - TResult? Function(_NextActionOxxo value)? displayOxxoDetails, - TResult? Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult? Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult? Function(_NextActionMultiBanco value)? multibanco, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_NextActionRedirect value)? redirectToUrl, - TResult Function(_NextActionOxxo value)? displayOxxoDetails, - TResult Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult Function(_NextActionMultiBanco value)? multibanco, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + /// Serializes this NextAction to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is NextAction); } -/// @nodoc -abstract class $NextActionCopyWith<$Res> { - factory $NextActionCopyWith( - NextAction value, $Res Function(NextAction) then) = - _$NextActionCopyWithImpl<$Res, NextAction>; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'NextAction()'; +} + + } /// @nodoc -class _$NextActionCopyWithImpl<$Res, $Val extends NextAction> - implements $NextActionCopyWith<$Res> { - _$NextActionCopyWithImpl(this._value, this._then); +class $NextActionCopyWith<$Res> { +$NextActionCopyWith(NextAction _, $Res Function(NextAction) __); +} + - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +/// Adds pattern-matching-related methods to [NextAction]. +extension NextActionPatterns on NextAction { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _NextActionRedirect value)? redirectToUrl,TResult Function( _NextActionOxxo value)? displayOxxoDetails,TResult Function( _NextActionWeChatRedirect value)? wechatPayRedirect,TResult Function( _NextActionMicroDeposits value)? verifyWithMicroDeposits,TResult Function( _NextActionMultiBanco value)? multibanco,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _NextActionRedirect() when redirectToUrl != null: +return redirectToUrl(_that);case _NextActionOxxo() when displayOxxoDetails != null: +return displayOxxoDetails(_that);case _NextActionWeChatRedirect() when wechatPayRedirect != null: +return wechatPayRedirect(_that);case _NextActionMicroDeposits() when verifyWithMicroDeposits != null: +return verifyWithMicroDeposits(_that);case _NextActionMultiBanco() when multibanco != null: +return multibanco(_that);case _: + return orElse(); - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. } +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _NextActionRedirect value) redirectToUrl,required TResult Function( _NextActionOxxo value) displayOxxoDetails,required TResult Function( _NextActionWeChatRedirect value) wechatPayRedirect,required TResult Function( _NextActionMicroDeposits value) verifyWithMicroDeposits,required TResult Function( _NextActionMultiBanco value) multibanco,}){ +final _that = this; +switch (_that) { +case _NextActionRedirect(): +return redirectToUrl(_that);case _NextActionOxxo(): +return displayOxxoDetails(_that);case _NextActionWeChatRedirect(): +return wechatPayRedirect(_that);case _NextActionMicroDeposits(): +return verifyWithMicroDeposits(_that);case _NextActionMultiBanco(): +return multibanco(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class _$$NextActionRedirectImplCopyWith<$Res> { - factory _$$NextActionRedirectImplCopyWith(_$NextActionRedirectImpl value, - $Res Function(_$NextActionRedirectImpl) then) = - __$$NextActionRedirectImplCopyWithImpl<$Res>; - @useResult - $Res call({String? redirectUrl}); +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _NextActionRedirect value)? redirectToUrl,TResult? Function( _NextActionOxxo value)? displayOxxoDetails,TResult? Function( _NextActionWeChatRedirect value)? wechatPayRedirect,TResult? Function( _NextActionMicroDeposits value)? verifyWithMicroDeposits,TResult? Function( _NextActionMultiBanco value)? multibanco,}){ +final _that = this; +switch (_that) { +case _NextActionRedirect() when redirectToUrl != null: +return redirectToUrl(_that);case _NextActionOxxo() when displayOxxoDetails != null: +return displayOxxoDetails(_that);case _NextActionWeChatRedirect() when wechatPayRedirect != null: +return wechatPayRedirect(_that);case _NextActionMicroDeposits() when verifyWithMicroDeposits != null: +return verifyWithMicroDeposits(_that);case _NextActionMultiBanco() when multibanco != null: +return multibanco(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( String? redirectUrl)? redirectToUrl,TResult Function( int? expiration, String? voucherURL, String? voucherNumber)? displayOxxoDetails,TResult Function( String? redirectUrl)? wechatPayRedirect,TResult Function( String? arrivalDate, String? redirectUrl, String? microdepositType)? verifyWithMicroDeposits,TResult Function( String? voucherURL)? multibanco,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _NextActionRedirect() when redirectToUrl != null: +return redirectToUrl(_that.redirectUrl);case _NextActionOxxo() when displayOxxoDetails != null: +return displayOxxoDetails(_that.expiration,_that.voucherURL,_that.voucherNumber);case _NextActionWeChatRedirect() when wechatPayRedirect != null: +return wechatPayRedirect(_that.redirectUrl);case _NextActionMicroDeposits() when verifyWithMicroDeposits != null: +return verifyWithMicroDeposits(_that.arrivalDate,_that.redirectUrl,_that.microdepositType);case _NextActionMultiBanco() when multibanco != null: +return multibanco(_that.voucherURL);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( String? redirectUrl) redirectToUrl,required TResult Function( int? expiration, String? voucherURL, String? voucherNumber) displayOxxoDetails,required TResult Function( String? redirectUrl) wechatPayRedirect,required TResult Function( String? arrivalDate, String? redirectUrl, String? microdepositType) verifyWithMicroDeposits,required TResult Function( String? voucherURL) multibanco,}) {final _that = this; +switch (_that) { +case _NextActionRedirect(): +return redirectToUrl(_that.redirectUrl);case _NextActionOxxo(): +return displayOxxoDetails(_that.expiration,_that.voucherURL,_that.voucherNumber);case _NextActionWeChatRedirect(): +return wechatPayRedirect(_that.redirectUrl);case _NextActionMicroDeposits(): +return verifyWithMicroDeposits(_that.arrivalDate,_that.redirectUrl,_that.microdepositType);case _NextActionMultiBanco(): +return multibanco(_that.voucherURL);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( String? redirectUrl)? redirectToUrl,TResult? Function( int? expiration, String? voucherURL, String? voucherNumber)? displayOxxoDetails,TResult? Function( String? redirectUrl)? wechatPayRedirect,TResult? Function( String? arrivalDate, String? redirectUrl, String? microdepositType)? verifyWithMicroDeposits,TResult? Function( String? voucherURL)? multibanco,}) {final _that = this; +switch (_that) { +case _NextActionRedirect() when redirectToUrl != null: +return redirectToUrl(_that.redirectUrl);case _NextActionOxxo() when displayOxxoDetails != null: +return displayOxxoDetails(_that.expiration,_that.voucherURL,_that.voucherNumber);case _NextActionWeChatRedirect() when wechatPayRedirect != null: +return wechatPayRedirect(_that.redirectUrl);case _NextActionMicroDeposits() when verifyWithMicroDeposits != null: +return verifyWithMicroDeposits(_that.arrivalDate,_that.redirectUrl,_that.microdepositType);case _NextActionMultiBanco() when multibanco != null: +return multibanco(_that.voucherURL);case _: + return null; + +} } -/// @nodoc -class __$$NextActionRedirectImplCopyWithImpl<$Res> - extends _$NextActionCopyWithImpl<$Res, _$NextActionRedirectImpl> - implements _$$NextActionRedirectImplCopyWith<$Res> { - __$$NextActionRedirectImplCopyWithImpl(_$NextActionRedirectImpl _value, - $Res Function(_$NextActionRedirectImpl) _then) - : super(_value, _then); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? redirectUrl = freezed, - }) { - return _then(_$NextActionRedirectImpl( - redirectUrl: freezed == redirectUrl - ? _value.redirectUrl - : redirectUrl // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$NextActionRedirectImpl implements _NextActionRedirect { - const _$NextActionRedirectImpl({this.redirectUrl, final String? $type}) - : $type = $type ?? 'urlRedirect'; - - factory _$NextActionRedirectImpl.fromJson(Map json) => - _$$NextActionRedirectImplFromJson(json); - - /// Url to redirect to - @override - final String? redirectUrl; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'NextAction.redirectToUrl(redirectUrl: $redirectUrl)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NextActionRedirectImpl && - (identical(other.redirectUrl, redirectUrl) || - other.redirectUrl == redirectUrl)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, redirectUrl); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$NextActionRedirectImplCopyWith<_$NextActionRedirectImpl> get copyWith => - __$$NextActionRedirectImplCopyWithImpl<_$NextActionRedirectImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String? redirectUrl) redirectToUrl, - required TResult Function( - int? expiration, String? voucherURL, String? voucherNumber) - displayOxxoDetails, - required TResult Function(String? redirectUrl) wechatPayRedirect, - required TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType) - verifyWithMicroDeposits, - required TResult Function(String? voucherURL) multibanco, - }) { - return redirectToUrl(redirectUrl); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String? redirectUrl)? redirectToUrl, - TResult? Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult? Function(String? redirectUrl)? wechatPayRedirect, - TResult? Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult? Function(String? voucherURL)? multibanco, - }) { - return redirectToUrl?.call(redirectUrl); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String? redirectUrl)? redirectToUrl, - TResult Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult Function(String? redirectUrl)? wechatPayRedirect, - TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult Function(String? voucherURL)? multibanco, - required TResult orElse(), - }) { - if (redirectToUrl != null) { - return redirectToUrl(redirectUrl); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_NextActionRedirect value) redirectToUrl, - required TResult Function(_NextActionOxxo value) displayOxxoDetails, - required TResult Function(_NextActionWeChatRedirect value) - wechatPayRedirect, - required TResult Function(_NextActionMicroDeposits value) - verifyWithMicroDeposits, - required TResult Function(_NextActionMultiBanco value) multibanco, - }) { - return redirectToUrl(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_NextActionRedirect value)? redirectToUrl, - TResult? Function(_NextActionOxxo value)? displayOxxoDetails, - TResult? Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult? Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult? Function(_NextActionMultiBanco value)? multibanco, - }) { - return redirectToUrl?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_NextActionRedirect value)? redirectToUrl, - TResult Function(_NextActionOxxo value)? displayOxxoDetails, - TResult Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult Function(_NextActionMultiBanco value)? multibanco, - required TResult orElse(), - }) { - if (redirectToUrl != null) { - return redirectToUrl(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$NextActionRedirectImplToJson( - this, - ); - } +class _NextActionRedirect implements NextAction { + const _NextActionRedirect({this.redirectUrl, final String? $type}): $type = $type ?? 'urlRedirect'; + factory _NextActionRedirect.fromJson(Map json) => _$NextActionRedirectFromJson(json); + +/// Url to redirect to + final String? redirectUrl; + +@JsonKey(name: 'type') +final String $type; + + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$NextActionRedirectCopyWith<_NextActionRedirect> get copyWith => __$NextActionRedirectCopyWithImpl<_NextActionRedirect>(this, _$identity); + +@override +Map toJson() { + return _$NextActionRedirectToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _NextActionRedirect&&(identical(other.redirectUrl, redirectUrl) || other.redirectUrl == redirectUrl)); } -abstract class _NextActionRedirect implements NextAction { - const factory _NextActionRedirect({final String? redirectUrl}) = - _$NextActionRedirectImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,redirectUrl); - factory _NextActionRedirect.fromJson(Map json) = - _$NextActionRedirectImpl.fromJson; +@override +String toString() { + return 'NextAction.redirectToUrl(redirectUrl: $redirectUrl)'; +} - /// Url to redirect to - String? get redirectUrl; - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$NextActionRedirectImplCopyWith<_$NextActionRedirectImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$NextActionOxxoImplCopyWith<$Res> { - factory _$$NextActionOxxoImplCopyWith(_$NextActionOxxoImpl value, - $Res Function(_$NextActionOxxoImpl) then) = - __$$NextActionOxxoImplCopyWithImpl<$Res>; - @useResult - $Res call({int? expiration, String? voucherURL, String? voucherNumber}); -} +abstract mixin class _$NextActionRedirectCopyWith<$Res> implements $NextActionCopyWith<$Res> { + factory _$NextActionRedirectCopyWith(_NextActionRedirect value, $Res Function(_NextActionRedirect) _then) = __$NextActionRedirectCopyWithImpl; +@useResult +$Res call({ + String? redirectUrl +}); + + + +} /// @nodoc -class __$$NextActionOxxoImplCopyWithImpl<$Res> - extends _$NextActionCopyWithImpl<$Res, _$NextActionOxxoImpl> - implements _$$NextActionOxxoImplCopyWith<$Res> { - __$$NextActionOxxoImplCopyWithImpl( - _$NextActionOxxoImpl _value, $Res Function(_$NextActionOxxoImpl) _then) - : super(_value, _then); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? expiration = freezed, - Object? voucherURL = freezed, - Object? voucherNumber = freezed, - }) { - return _then(_$NextActionOxxoImpl( - expiration: freezed == expiration - ? _value.expiration - : expiration // ignore: cast_nullable_to_non_nullable - as int?, - voucherURL: freezed == voucherURL - ? _value.voucherURL - : voucherURL // ignore: cast_nullable_to_non_nullable - as String?, - voucherNumber: freezed == voucherNumber - ? _value.voucherNumber - : voucherNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class __$NextActionRedirectCopyWithImpl<$Res> + implements _$NextActionRedirectCopyWith<$Res> { + __$NextActionRedirectCopyWithImpl(this._self, this._then); + + final _NextActionRedirect _self; + final $Res Function(_NextActionRedirect) _then; + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? redirectUrl = freezed,}) { + return _then(_NextActionRedirect( +redirectUrl: freezed == redirectUrl ? _self.redirectUrl : redirectUrl // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$NextActionOxxoImpl implements _NextActionOxxo { - const _$NextActionOxxoImpl( - {this.expiration, - this.voucherURL, - this.voucherNumber, - final String? $type}) - : $type = $type ?? 'oxxoVoucher'; - - factory _$NextActionOxxoImpl.fromJson(Map json) => - _$$NextActionOxxoImplFromJson(json); - - /// expiration date of the voucher in UTC - @override - final int? expiration; - - /// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. - @override - final String? voucherURL; - - /// Oxxo reference number - @override - final String? voucherNumber; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'NextAction.displayOxxoDetails(expiration: $expiration, voucherURL: $voucherURL, voucherNumber: $voucherNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NextActionOxxoImpl && - (identical(other.expiration, expiration) || - other.expiration == expiration) && - (identical(other.voucherURL, voucherURL) || - other.voucherURL == voucherURL) && - (identical(other.voucherNumber, voucherNumber) || - other.voucherNumber == voucherNumber)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, expiration, voucherURL, voucherNumber); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$NextActionOxxoImplCopyWith<_$NextActionOxxoImpl> get copyWith => - __$$NextActionOxxoImplCopyWithImpl<_$NextActionOxxoImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String? redirectUrl) redirectToUrl, - required TResult Function( - int? expiration, String? voucherURL, String? voucherNumber) - displayOxxoDetails, - required TResult Function(String? redirectUrl) wechatPayRedirect, - required TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType) - verifyWithMicroDeposits, - required TResult Function(String? voucherURL) multibanco, - }) { - return displayOxxoDetails(expiration, voucherURL, voucherNumber); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String? redirectUrl)? redirectToUrl, - TResult? Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult? Function(String? redirectUrl)? wechatPayRedirect, - TResult? Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult? Function(String? voucherURL)? multibanco, - }) { - return displayOxxoDetails?.call(expiration, voucherURL, voucherNumber); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String? redirectUrl)? redirectToUrl, - TResult Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult Function(String? redirectUrl)? wechatPayRedirect, - TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult Function(String? voucherURL)? multibanco, - required TResult orElse(), - }) { - if (displayOxxoDetails != null) { - return displayOxxoDetails(expiration, voucherURL, voucherNumber); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_NextActionRedirect value) redirectToUrl, - required TResult Function(_NextActionOxxo value) displayOxxoDetails, - required TResult Function(_NextActionWeChatRedirect value) - wechatPayRedirect, - required TResult Function(_NextActionMicroDeposits value) - verifyWithMicroDeposits, - required TResult Function(_NextActionMultiBanco value) multibanco, - }) { - return displayOxxoDetails(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_NextActionRedirect value)? redirectToUrl, - TResult? Function(_NextActionOxxo value)? displayOxxoDetails, - TResult? Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult? Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult? Function(_NextActionMultiBanco value)? multibanco, - }) { - return displayOxxoDetails?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_NextActionRedirect value)? redirectToUrl, - TResult Function(_NextActionOxxo value)? displayOxxoDetails, - TResult Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult Function(_NextActionMultiBanco value)? multibanco, - required TResult orElse(), - }) { - if (displayOxxoDetails != null) { - return displayOxxoDetails(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$NextActionOxxoImplToJson( - this, - ); - } +class _NextActionOxxo implements NextAction { + const _NextActionOxxo({this.expiration, this.voucherURL, this.voucherNumber, final String? $type}): $type = $type ?? 'oxxoVoucher'; + factory _NextActionOxxo.fromJson(Map json) => _$NextActionOxxoFromJson(json); + +/// expiration date of the voucher in UTC + final int? expiration; +/// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. + final String? voucherURL; +/// Oxxo reference number + final String? voucherNumber; + +@JsonKey(name: 'type') +final String $type; + + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$NextActionOxxoCopyWith<_NextActionOxxo> get copyWith => __$NextActionOxxoCopyWithImpl<_NextActionOxxo>(this, _$identity); + +@override +Map toJson() { + return _$NextActionOxxoToJson(this, ); } -abstract class _NextActionOxxo implements NextAction { - const factory _NextActionOxxo( - {final int? expiration, - final String? voucherURL, - final String? voucherNumber}) = _$NextActionOxxoImpl; - - factory _NextActionOxxo.fromJson(Map json) = - _$NextActionOxxoImpl.fromJson; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _NextActionOxxo&&(identical(other.expiration, expiration) || other.expiration == expiration)&&(identical(other.voucherURL, voucherURL) || other.voucherURL == voucherURL)&&(identical(other.voucherNumber, voucherNumber) || other.voucherNumber == voucherNumber)); +} - /// expiration date of the voucher in UTC - int? get expiration; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,expiration,voucherURL,voucherNumber); - /// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. - String? get voucherURL; +@override +String toString() { + return 'NextAction.displayOxxoDetails(expiration: $expiration, voucherURL: $voucherURL, voucherNumber: $voucherNumber)'; +} - /// Oxxo reference number - String? get voucherNumber; - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$NextActionOxxoImplCopyWith<_$NextActionOxxoImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$NextActionWeChatRedirectImplCopyWith<$Res> { - factory _$$NextActionWeChatRedirectImplCopyWith( - _$NextActionWeChatRedirectImpl value, - $Res Function(_$NextActionWeChatRedirectImpl) then) = - __$$NextActionWeChatRedirectImplCopyWithImpl<$Res>; - @useResult - $Res call({String? redirectUrl}); -} +abstract mixin class _$NextActionOxxoCopyWith<$Res> implements $NextActionCopyWith<$Res> { + factory _$NextActionOxxoCopyWith(_NextActionOxxo value, $Res Function(_NextActionOxxo) _then) = __$NextActionOxxoCopyWithImpl; +@useResult +$Res call({ + int? expiration, String? voucherURL, String? voucherNumber +}); + + + +} /// @nodoc -class __$$NextActionWeChatRedirectImplCopyWithImpl<$Res> - extends _$NextActionCopyWithImpl<$Res, _$NextActionWeChatRedirectImpl> - implements _$$NextActionWeChatRedirectImplCopyWith<$Res> { - __$$NextActionWeChatRedirectImplCopyWithImpl( - _$NextActionWeChatRedirectImpl _value, - $Res Function(_$NextActionWeChatRedirectImpl) _then) - : super(_value, _then); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? redirectUrl = freezed, - }) { - return _then(_$NextActionWeChatRedirectImpl( - redirectUrl: freezed == redirectUrl - ? _value.redirectUrl - : redirectUrl // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class __$NextActionOxxoCopyWithImpl<$Res> + implements _$NextActionOxxoCopyWith<$Res> { + __$NextActionOxxoCopyWithImpl(this._self, this._then); + + final _NextActionOxxo _self; + final $Res Function(_NextActionOxxo) _then; + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? expiration = freezed,Object? voucherURL = freezed,Object? voucherNumber = freezed,}) { + return _then(_NextActionOxxo( +expiration: freezed == expiration ? _self.expiration : expiration // ignore: cast_nullable_to_non_nullable +as int?,voucherURL: freezed == voucherURL ? _self.voucherURL : voucherURL // ignore: cast_nullable_to_non_nullable +as String?,voucherNumber: freezed == voucherNumber ? _self.voucherNumber : voucherNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$NextActionWeChatRedirectImpl implements _NextActionWeChatRedirect { - const _$NextActionWeChatRedirectImpl({this.redirectUrl, final String? $type}) - : $type = $type ?? 'weChatRedirect'; - - factory _$NextActionWeChatRedirectImpl.fromJson(Map json) => - _$$NextActionWeChatRedirectImplFromJson(json); - - /// Url to the Qr code. - @override - final String? redirectUrl; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'NextAction.wechatPayRedirect(redirectUrl: $redirectUrl)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NextActionWeChatRedirectImpl && - (identical(other.redirectUrl, redirectUrl) || - other.redirectUrl == redirectUrl)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, redirectUrl); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$NextActionWeChatRedirectImplCopyWith<_$NextActionWeChatRedirectImpl> - get copyWith => __$$NextActionWeChatRedirectImplCopyWithImpl< - _$NextActionWeChatRedirectImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String? redirectUrl) redirectToUrl, - required TResult Function( - int? expiration, String? voucherURL, String? voucherNumber) - displayOxxoDetails, - required TResult Function(String? redirectUrl) wechatPayRedirect, - required TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType) - verifyWithMicroDeposits, - required TResult Function(String? voucherURL) multibanco, - }) { - return wechatPayRedirect(redirectUrl); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String? redirectUrl)? redirectToUrl, - TResult? Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult? Function(String? redirectUrl)? wechatPayRedirect, - TResult? Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult? Function(String? voucherURL)? multibanco, - }) { - return wechatPayRedirect?.call(redirectUrl); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String? redirectUrl)? redirectToUrl, - TResult Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult Function(String? redirectUrl)? wechatPayRedirect, - TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult Function(String? voucherURL)? multibanco, - required TResult orElse(), - }) { - if (wechatPayRedirect != null) { - return wechatPayRedirect(redirectUrl); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_NextActionRedirect value) redirectToUrl, - required TResult Function(_NextActionOxxo value) displayOxxoDetails, - required TResult Function(_NextActionWeChatRedirect value) - wechatPayRedirect, - required TResult Function(_NextActionMicroDeposits value) - verifyWithMicroDeposits, - required TResult Function(_NextActionMultiBanco value) multibanco, - }) { - return wechatPayRedirect(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_NextActionRedirect value)? redirectToUrl, - TResult? Function(_NextActionOxxo value)? displayOxxoDetails, - TResult? Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult? Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult? Function(_NextActionMultiBanco value)? multibanco, - }) { - return wechatPayRedirect?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_NextActionRedirect value)? redirectToUrl, - TResult Function(_NextActionOxxo value)? displayOxxoDetails, - TResult Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult Function(_NextActionMultiBanco value)? multibanco, - required TResult orElse(), - }) { - if (wechatPayRedirect != null) { - return wechatPayRedirect(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$NextActionWeChatRedirectImplToJson( - this, - ); - } +class _NextActionWeChatRedirect implements NextAction { + const _NextActionWeChatRedirect({this.redirectUrl, final String? $type}): $type = $type ?? 'weChatRedirect'; + factory _NextActionWeChatRedirect.fromJson(Map json) => _$NextActionWeChatRedirectFromJson(json); + +/// Url to the Qr code. + final String? redirectUrl; + +@JsonKey(name: 'type') +final String $type; + + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$NextActionWeChatRedirectCopyWith<_NextActionWeChatRedirect> get copyWith => __$NextActionWeChatRedirectCopyWithImpl<_NextActionWeChatRedirect>(this, _$identity); + +@override +Map toJson() { + return _$NextActionWeChatRedirectToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _NextActionWeChatRedirect&&(identical(other.redirectUrl, redirectUrl) || other.redirectUrl == redirectUrl)); } -abstract class _NextActionWeChatRedirect implements NextAction { - const factory _NextActionWeChatRedirect({final String? redirectUrl}) = - _$NextActionWeChatRedirectImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,redirectUrl); - factory _NextActionWeChatRedirect.fromJson(Map json) = - _$NextActionWeChatRedirectImpl.fromJson; +@override +String toString() { + return 'NextAction.wechatPayRedirect(redirectUrl: $redirectUrl)'; +} - /// Url to the Qr code. - String? get redirectUrl; - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$NextActionWeChatRedirectImplCopyWith<_$NextActionWeChatRedirectImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$NextActionMicroDepositsImplCopyWith<$Res> { - factory _$$NextActionMicroDepositsImplCopyWith( - _$NextActionMicroDepositsImpl value, - $Res Function(_$NextActionMicroDepositsImpl) then) = - __$$NextActionMicroDepositsImplCopyWithImpl<$Res>; - @useResult - $Res call( - {String? arrivalDate, String? redirectUrl, String? microdepositType}); -} +abstract mixin class _$NextActionWeChatRedirectCopyWith<$Res> implements $NextActionCopyWith<$Res> { + factory _$NextActionWeChatRedirectCopyWith(_NextActionWeChatRedirect value, $Res Function(_NextActionWeChatRedirect) _then) = __$NextActionWeChatRedirectCopyWithImpl; +@useResult +$Res call({ + String? redirectUrl +}); + + + +} /// @nodoc -class __$$NextActionMicroDepositsImplCopyWithImpl<$Res> - extends _$NextActionCopyWithImpl<$Res, _$NextActionMicroDepositsImpl> - implements _$$NextActionMicroDepositsImplCopyWith<$Res> { - __$$NextActionMicroDepositsImplCopyWithImpl( - _$NextActionMicroDepositsImpl _value, - $Res Function(_$NextActionMicroDepositsImpl) _then) - : super(_value, _then); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? arrivalDate = freezed, - Object? redirectUrl = freezed, - Object? microdepositType = freezed, - }) { - return _then(_$NextActionMicroDepositsImpl( - arrivalDate: freezed == arrivalDate - ? _value.arrivalDate - : arrivalDate // ignore: cast_nullable_to_non_nullable - as String?, - redirectUrl: freezed == redirectUrl - ? _value.redirectUrl - : redirectUrl // ignore: cast_nullable_to_non_nullable - as String?, - microdepositType: freezed == microdepositType - ? _value.microdepositType - : microdepositType // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class __$NextActionWeChatRedirectCopyWithImpl<$Res> + implements _$NextActionWeChatRedirectCopyWith<$Res> { + __$NextActionWeChatRedirectCopyWithImpl(this._self, this._then); + + final _NextActionWeChatRedirect _self; + final $Res Function(_NextActionWeChatRedirect) _then; + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? redirectUrl = freezed,}) { + return _then(_NextActionWeChatRedirect( +redirectUrl: freezed == redirectUrl ? _self.redirectUrl : redirectUrl // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$NextActionMicroDepositsImpl implements _NextActionMicroDeposits { - const _$NextActionMicroDepositsImpl( - {this.arrivalDate, - this.redirectUrl, - this.microdepositType, - final String? $type}) - : $type = $type ?? 'verifyWithMicrodeposits'; - - factory _$NextActionMicroDepositsImpl.fromJson(Map json) => - _$$NextActionMicroDepositsImplFromJson(json); - - /// The timestamp of when the microdeposits are expended to land - @override - final String? arrivalDate; - - /// The URL for the hosted verification page. - @override - final String? redirectUrl; - - /// The type of the microdeposit sent to the customer. - @override - final String? microdepositType; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'NextAction.verifyWithMicroDeposits(arrivalDate: $arrivalDate, redirectUrl: $redirectUrl, microdepositType: $microdepositType)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NextActionMicroDepositsImpl && - (identical(other.arrivalDate, arrivalDate) || - other.arrivalDate == arrivalDate) && - (identical(other.redirectUrl, redirectUrl) || - other.redirectUrl == redirectUrl) && - (identical(other.microdepositType, microdepositType) || - other.microdepositType == microdepositType)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, arrivalDate, redirectUrl, microdepositType); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$NextActionMicroDepositsImplCopyWith<_$NextActionMicroDepositsImpl> - get copyWith => __$$NextActionMicroDepositsImplCopyWithImpl< - _$NextActionMicroDepositsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String? redirectUrl) redirectToUrl, - required TResult Function( - int? expiration, String? voucherURL, String? voucherNumber) - displayOxxoDetails, - required TResult Function(String? redirectUrl) wechatPayRedirect, - required TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType) - verifyWithMicroDeposits, - required TResult Function(String? voucherURL) multibanco, - }) { - return verifyWithMicroDeposits(arrivalDate, redirectUrl, microdepositType); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String? redirectUrl)? redirectToUrl, - TResult? Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult? Function(String? redirectUrl)? wechatPayRedirect, - TResult? Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult? Function(String? voucherURL)? multibanco, - }) { - return verifyWithMicroDeposits?.call( - arrivalDate, redirectUrl, microdepositType); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String? redirectUrl)? redirectToUrl, - TResult Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult Function(String? redirectUrl)? wechatPayRedirect, - TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult Function(String? voucherURL)? multibanco, - required TResult orElse(), - }) { - if (verifyWithMicroDeposits != null) { - return verifyWithMicroDeposits( - arrivalDate, redirectUrl, microdepositType); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_NextActionRedirect value) redirectToUrl, - required TResult Function(_NextActionOxxo value) displayOxxoDetails, - required TResult Function(_NextActionWeChatRedirect value) - wechatPayRedirect, - required TResult Function(_NextActionMicroDeposits value) - verifyWithMicroDeposits, - required TResult Function(_NextActionMultiBanco value) multibanco, - }) { - return verifyWithMicroDeposits(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_NextActionRedirect value)? redirectToUrl, - TResult? Function(_NextActionOxxo value)? displayOxxoDetails, - TResult? Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult? Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult? Function(_NextActionMultiBanco value)? multibanco, - }) { - return verifyWithMicroDeposits?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_NextActionRedirect value)? redirectToUrl, - TResult Function(_NextActionOxxo value)? displayOxxoDetails, - TResult Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult Function(_NextActionMultiBanco value)? multibanco, - required TResult orElse(), - }) { - if (verifyWithMicroDeposits != null) { - return verifyWithMicroDeposits(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$NextActionMicroDepositsImplToJson( - this, - ); - } +class _NextActionMicroDeposits implements NextAction { + const _NextActionMicroDeposits({this.arrivalDate, this.redirectUrl, this.microdepositType, final String? $type}): $type = $type ?? 'verifyWithMicrodeposits'; + factory _NextActionMicroDeposits.fromJson(Map json) => _$NextActionMicroDepositsFromJson(json); + +/// The timestamp of when the microdeposits are expended to land + final String? arrivalDate; +/// The URL for the hosted verification page. + final String? redirectUrl; +/// The type of the microdeposit sent to the customer. + final String? microdepositType; + +@JsonKey(name: 'type') +final String $type; + + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$NextActionMicroDepositsCopyWith<_NextActionMicroDeposits> get copyWith => __$NextActionMicroDepositsCopyWithImpl<_NextActionMicroDeposits>(this, _$identity); + +@override +Map toJson() { + return _$NextActionMicroDepositsToJson(this, ); } -abstract class _NextActionMicroDeposits implements NextAction { - const factory _NextActionMicroDeposits( - {final String? arrivalDate, - final String? redirectUrl, - final String? microdepositType}) = _$NextActionMicroDepositsImpl; - - factory _NextActionMicroDeposits.fromJson(Map json) = - _$NextActionMicroDepositsImpl.fromJson; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _NextActionMicroDeposits&&(identical(other.arrivalDate, arrivalDate) || other.arrivalDate == arrivalDate)&&(identical(other.redirectUrl, redirectUrl) || other.redirectUrl == redirectUrl)&&(identical(other.microdepositType, microdepositType) || other.microdepositType == microdepositType)); +} - /// The timestamp of when the microdeposits are expended to land - String? get arrivalDate; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,arrivalDate,redirectUrl,microdepositType); - /// The URL for the hosted verification page. - String? get redirectUrl; +@override +String toString() { + return 'NextAction.verifyWithMicroDeposits(arrivalDate: $arrivalDate, redirectUrl: $redirectUrl, microdepositType: $microdepositType)'; +} - /// The type of the microdeposit sent to the customer. - String? get microdepositType; - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$NextActionMicroDepositsImplCopyWith<_$NextActionMicroDepositsImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$NextActionMultiBancoImplCopyWith<$Res> { - factory _$$NextActionMultiBancoImplCopyWith(_$NextActionMultiBancoImpl value, - $Res Function(_$NextActionMultiBancoImpl) then) = - __$$NextActionMultiBancoImplCopyWithImpl<$Res>; - @useResult - $Res call({String? voucherURL}); -} +abstract mixin class _$NextActionMicroDepositsCopyWith<$Res> implements $NextActionCopyWith<$Res> { + factory _$NextActionMicroDepositsCopyWith(_NextActionMicroDeposits value, $Res Function(_NextActionMicroDeposits) _then) = __$NextActionMicroDepositsCopyWithImpl; +@useResult +$Res call({ + String? arrivalDate, String? redirectUrl, String? microdepositType +}); + + + +} /// @nodoc -class __$$NextActionMultiBancoImplCopyWithImpl<$Res> - extends _$NextActionCopyWithImpl<$Res, _$NextActionMultiBancoImpl> - implements _$$NextActionMultiBancoImplCopyWith<$Res> { - __$$NextActionMultiBancoImplCopyWithImpl(_$NextActionMultiBancoImpl _value, - $Res Function(_$NextActionMultiBancoImpl) _then) - : super(_value, _then); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? voucherURL = freezed, - }) { - return _then(_$NextActionMultiBancoImpl( - voucherURL: freezed == voucherURL - ? _value.voucherURL - : voucherURL // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +class __$NextActionMicroDepositsCopyWithImpl<$Res> + implements _$NextActionMicroDepositsCopyWith<$Res> { + __$NextActionMicroDepositsCopyWithImpl(this._self, this._then); + + final _NextActionMicroDeposits _self; + final $Res Function(_NextActionMicroDeposits) _then; + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? arrivalDate = freezed,Object? redirectUrl = freezed,Object? microdepositType = freezed,}) { + return _then(_NextActionMicroDeposits( +arrivalDate: freezed == arrivalDate ? _self.arrivalDate : arrivalDate // ignore: cast_nullable_to_non_nullable +as String?,redirectUrl: freezed == redirectUrl ? _self.redirectUrl : redirectUrl // ignore: cast_nullable_to_non_nullable +as String?,microdepositType: freezed == microdepositType ? _self.microdepositType : microdepositType // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$NextActionMultiBancoImpl implements _NextActionMultiBanco { - const _$NextActionMultiBancoImpl({this.voucherURL, final String? $type}) - : $type = $type ?? 'multibanco'; - - factory _$NextActionMultiBancoImpl.fromJson(Map json) => - _$$NextActionMultiBancoImplFromJson(json); - - /// The URL for the hosted multibanco voucher page, which allows customers to view and print an multibanco voucher. - @override - final String? voucherURL; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'NextAction.multibanco(voucherURL: $voucherURL)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$NextActionMultiBancoImpl && - (identical(other.voucherURL, voucherURL) || - other.voucherURL == voucherURL)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, voucherURL); - - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$NextActionMultiBancoImplCopyWith<_$NextActionMultiBancoImpl> - get copyWith => - __$$NextActionMultiBancoImplCopyWithImpl<_$NextActionMultiBancoImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String? redirectUrl) redirectToUrl, - required TResult Function( - int? expiration, String? voucherURL, String? voucherNumber) - displayOxxoDetails, - required TResult Function(String? redirectUrl) wechatPayRedirect, - required TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType) - verifyWithMicroDeposits, - required TResult Function(String? voucherURL) multibanco, - }) { - return multibanco(voucherURL); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String? redirectUrl)? redirectToUrl, - TResult? Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult? Function(String? redirectUrl)? wechatPayRedirect, - TResult? Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult? Function(String? voucherURL)? multibanco, - }) { - return multibanco?.call(voucherURL); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String? redirectUrl)? redirectToUrl, - TResult Function( - int? expiration, String? voucherURL, String? voucherNumber)? - displayOxxoDetails, - TResult Function(String? redirectUrl)? wechatPayRedirect, - TResult Function( - String? arrivalDate, String? redirectUrl, String? microdepositType)? - verifyWithMicroDeposits, - TResult Function(String? voucherURL)? multibanco, - required TResult orElse(), - }) { - if (multibanco != null) { - return multibanco(voucherURL); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_NextActionRedirect value) redirectToUrl, - required TResult Function(_NextActionOxxo value) displayOxxoDetails, - required TResult Function(_NextActionWeChatRedirect value) - wechatPayRedirect, - required TResult Function(_NextActionMicroDeposits value) - verifyWithMicroDeposits, - required TResult Function(_NextActionMultiBanco value) multibanco, - }) { - return multibanco(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_NextActionRedirect value)? redirectToUrl, - TResult? Function(_NextActionOxxo value)? displayOxxoDetails, - TResult? Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult? Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult? Function(_NextActionMultiBanco value)? multibanco, - }) { - return multibanco?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_NextActionRedirect value)? redirectToUrl, - TResult Function(_NextActionOxxo value)? displayOxxoDetails, - TResult Function(_NextActionWeChatRedirect value)? wechatPayRedirect, - TResult Function(_NextActionMicroDeposits value)? verifyWithMicroDeposits, - TResult Function(_NextActionMultiBanco value)? multibanco, - required TResult orElse(), - }) { - if (multibanco != null) { - return multibanco(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$NextActionMultiBancoImplToJson( - this, - ); - } +class _NextActionMultiBanco implements NextAction { + const _NextActionMultiBanco({this.voucherURL, final String? $type}): $type = $type ?? 'multibanco'; + factory _NextActionMultiBanco.fromJson(Map json) => _$NextActionMultiBancoFromJson(json); + +/// The URL for the hosted multibanco voucher page, which allows customers to view and print an multibanco voucher. + final String? voucherURL; + +@JsonKey(name: 'type') +final String $type; + + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$NextActionMultiBancoCopyWith<_NextActionMultiBanco> get copyWith => __$NextActionMultiBancoCopyWithImpl<_NextActionMultiBanco>(this, _$identity); + +@override +Map toJson() { + return _$NextActionMultiBancoToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _NextActionMultiBanco&&(identical(other.voucherURL, voucherURL) || other.voucherURL == voucherURL)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,voucherURL); + +@override +String toString() { + return 'NextAction.multibanco(voucherURL: $voucherURL)'; } -abstract class _NextActionMultiBanco implements NextAction { - const factory _NextActionMultiBanco({final String? voucherURL}) = - _$NextActionMultiBancoImpl; - factory _NextActionMultiBanco.fromJson(Map json) = - _$NextActionMultiBancoImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$NextActionMultiBancoCopyWith<$Res> implements $NextActionCopyWith<$Res> { + factory _$NextActionMultiBancoCopyWith(_NextActionMultiBanco value, $Res Function(_NextActionMultiBanco) _then) = __$NextActionMultiBancoCopyWithImpl; +@useResult +$Res call({ + String? voucherURL +}); + + - /// The URL for the hosted multibanco voucher page, which allows customers to view and print an multibanco voucher. - String? get voucherURL; - /// Create a copy of NextAction - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$NextActionMultiBancoImplCopyWith<_$NextActionMultiBancoImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$NextActionMultiBancoCopyWithImpl<$Res> + implements _$NextActionMultiBancoCopyWith<$Res> { + __$NextActionMultiBancoCopyWithImpl(this._self, this._then); + + final _NextActionMultiBanco _self; + final $Res Function(_NextActionMultiBanco) _then; + +/// Create a copy of NextAction +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? voucherURL = freezed,}) { + return _then(_NextActionMultiBanco( +voucherURL: freezed == voucherURL ? _self.voucherURL : voucherURL // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/next_action.g.dart b/packages/stripe_platform_interface/lib/src/models/next_action.g.dart index 0580b7f19..f63dc9cbf 100644 --- a/packages/stripe_platform_interface/lib/src/models/next_action.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/next_action.g.dart @@ -6,30 +6,27 @@ part of 'next_action.dart'; // JsonSerializableGenerator // ************************************************************************** -_$NextActionRedirectImpl _$$NextActionRedirectImplFromJson( - Map json) => - _$NextActionRedirectImpl( +_NextActionRedirect _$NextActionRedirectFromJson(Map json) => + _NextActionRedirect( redirectUrl: json['redirectUrl'] as String?, $type: json['type'] as String?, ); -Map _$$NextActionRedirectImplToJson( - _$NextActionRedirectImpl instance) => +Map _$NextActionRedirectToJson(_NextActionRedirect instance) => { 'redirectUrl': instance.redirectUrl, 'type': instance.$type, }; -_$NextActionOxxoImpl _$$NextActionOxxoImplFromJson(Map json) => - _$NextActionOxxoImpl( +_NextActionOxxo _$NextActionOxxoFromJson(Map json) => + _NextActionOxxo( expiration: (json['expiration'] as num?)?.toInt(), voucherURL: json['voucherURL'] as String?, voucherNumber: json['voucherNumber'] as String?, $type: json['type'] as String?, ); -Map _$$NextActionOxxoImplToJson( - _$NextActionOxxoImpl instance) => +Map _$NextActionOxxoToJson(_NextActionOxxo instance) => { 'expiration': instance.expiration, 'voucherURL': instance.voucherURL, @@ -37,48 +34,48 @@ Map _$$NextActionOxxoImplToJson( 'type': instance.$type, }; -_$NextActionWeChatRedirectImpl _$$NextActionWeChatRedirectImplFromJson( - Map json) => - _$NextActionWeChatRedirectImpl( - redirectUrl: json['redirectUrl'] as String?, - $type: json['type'] as String?, - ); +_NextActionWeChatRedirect _$NextActionWeChatRedirectFromJson( + Map json, +) => _NextActionWeChatRedirect( + redirectUrl: json['redirectUrl'] as String?, + $type: json['type'] as String?, +); -Map _$$NextActionWeChatRedirectImplToJson( - _$NextActionWeChatRedirectImpl instance) => - { - 'redirectUrl': instance.redirectUrl, - 'type': instance.$type, - }; +Map _$NextActionWeChatRedirectToJson( + _NextActionWeChatRedirect instance, +) => { + 'redirectUrl': instance.redirectUrl, + 'type': instance.$type, +}; -_$NextActionMicroDepositsImpl _$$NextActionMicroDepositsImplFromJson( - Map json) => - _$NextActionMicroDepositsImpl( - arrivalDate: json['arrivalDate'] as String?, - redirectUrl: json['redirectUrl'] as String?, - microdepositType: json['microdepositType'] as String?, - $type: json['type'] as String?, - ); +_NextActionMicroDeposits _$NextActionMicroDepositsFromJson( + Map json, +) => _NextActionMicroDeposits( + arrivalDate: json['arrivalDate'] as String?, + redirectUrl: json['redirectUrl'] as String?, + microdepositType: json['microdepositType'] as String?, + $type: json['type'] as String?, +); -Map _$$NextActionMicroDepositsImplToJson( - _$NextActionMicroDepositsImpl instance) => - { - 'arrivalDate': instance.arrivalDate, - 'redirectUrl': instance.redirectUrl, - 'microdepositType': instance.microdepositType, - 'type': instance.$type, - }; +Map _$NextActionMicroDepositsToJson( + _NextActionMicroDeposits instance, +) => { + 'arrivalDate': instance.arrivalDate, + 'redirectUrl': instance.redirectUrl, + 'microdepositType': instance.microdepositType, + 'type': instance.$type, +}; -_$NextActionMultiBancoImpl _$$NextActionMultiBancoImplFromJson( - Map json) => - _$NextActionMultiBancoImpl( - voucherURL: json['voucherURL'] as String?, - $type: json['type'] as String?, - ); +_NextActionMultiBanco _$NextActionMultiBancoFromJson( + Map json, +) => _NextActionMultiBanco( + voucherURL: json['voucherURL'] as String?, + $type: json['type'] as String?, +); -Map _$$NextActionMultiBancoImplToJson( - _$NextActionMultiBancoImpl instance) => - { - 'voucherURL': instance.voucherURL, - 'type': instance.$type, - }; +Map _$NextActionMultiBancoToJson( + _NextActionMultiBanco instance, +) => { + 'voucherURL': instance.voucherURL, + 'type': instance.$type, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/payment_intents.dart b/packages/stripe_platform_interface/lib/src/models/payment_intents.dart index 0bd8d9e06..61cc74fa1 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_intents.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_intents.dart @@ -11,11 +11,10 @@ part 'payment_intents.g.dart'; // ignore_for_file: constant_identifier_names @freezed - /// A payment intent represents the interaction between the user and the payment form. /// /// For more detailed info see: https://stripe.com/docs/payments/payment-intents. -class PaymentIntent with _$PaymentIntent { +abstract class PaymentIntent with _$PaymentIntent { @JsonSerializable(explicitToJson: true) const factory PaymentIntent({ /// Unique identifier. @@ -92,9 +91,8 @@ enum ConfirmationMethod { //nextActionMap.putString("type", "urlRedirect") // nextActionMap.putString("redirectUrl", it.url.toString()) @freezed - /// Shipping information -class ShippingDetails with _$ShippingDetails { +abstract class ShippingDetails with _$ShippingDetails { @JsonSerializable(explicitToJson: true) const factory ShippingDetails({ /// Recipient address. diff --git a/packages/stripe_platform_interface/lib/src/models/payment_intents.freezed.dart b/packages/stripe_platform_interface/lib/src/models/payment_intents.freezed.dart index 112b6bdea..a1cb5db63 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_intents.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_intents.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,956 +9,734 @@ part of 'payment_intents.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$PaymentIntent { + +/// Unique identifier. + String get id;/// Amount that will be collected in the payment intent. + num get amount;/// Timestamp since epoch that represents the time the intent is created. + String get created;/// The three letter ISO 4217 code for the currency. + String get currency;/// Current status of the intent. + PaymentIntentsStatus get status;/// The client is secret is used for handling the payment from the Client side. + String get clientSecret;/// Determines whether the intent is in live mode or in test mode. + bool get livemode;/// How the funds will be caputure from the customer's account. + CaptureMethod get captureMethod;/// Method of how the payment will be confirmed. + ConfirmationMethod get confirmationMethod;/// Id of the payment method used in this intent. + String? get paymentMethodId;/// Localized description that provides additional context to users. + String? get description;/// Email address where the receipt will be send to. + String? get receiptEmail;/// Timestamp since epoch when the intent is cancelled. + String? get canceledAt;/// Additional action that needs to be taken in order to complete a payment +/// using the provided resource. + NextAction? get nextAction;/// Shipping information of the payment intent. + ShippingDetails? get shipping;/// Mandata data for this paymentintent. + MandateData? get mandateData;/// The latest charge created by this payment intent. +/// +/// This field is only available on stripe web. + String? get latestCharge; +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentIntentCopyWith get copyWith => _$PaymentIntentCopyWithImpl(this as PaymentIntent, _$identity); + + /// Serializes this PaymentIntent to a JSON map. + Map toJson(); + -PaymentIntent _$PaymentIntentFromJson(Map json) { - return _PaymentIntent.fromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.created, created) || other.created == created)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.status, status) || other.status == status)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.captureMethod, captureMethod) || other.captureMethod == captureMethod)&&(identical(other.confirmationMethod, confirmationMethod) || other.confirmationMethod == confirmationMethod)&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.description, description) || other.description == description)&&(identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail)&&(identical(other.canceledAt, canceledAt) || other.canceledAt == canceledAt)&&(identical(other.nextAction, nextAction) || other.nextAction == nextAction)&&(identical(other.shipping, shipping) || other.shipping == shipping)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&(identical(other.latestCharge, latestCharge) || other.latestCharge == latestCharge)); } -/// @nodoc -mixin _$PaymentIntent { - /// Unique identifier. - String get id => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,amount,created,currency,status,clientSecret,livemode,captureMethod,confirmationMethod,paymentMethodId,description,receiptEmail,canceledAt,nextAction,shipping,mandateData,latestCharge); - /// Amount that will be collected in the payment intent. - num get amount => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentIntent(id: $id, amount: $amount, created: $created, currency: $currency, status: $status, clientSecret: $clientSecret, livemode: $livemode, captureMethod: $captureMethod, confirmationMethod: $confirmationMethod, paymentMethodId: $paymentMethodId, description: $description, receiptEmail: $receiptEmail, canceledAt: $canceledAt, nextAction: $nextAction, shipping: $shipping, mandateData: $mandateData, latestCharge: $latestCharge)'; +} - /// Timestamp since epoch that represents the time the intent is created. - String get created => throw _privateConstructorUsedError; - /// The three letter ISO 4217 code for the currency. - String get currency => throw _privateConstructorUsedError; +} - /// Current status of the intent. - PaymentIntentsStatus get status => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $PaymentIntentCopyWith<$Res> { + factory $PaymentIntentCopyWith(PaymentIntent value, $Res Function(PaymentIntent) _then) = _$PaymentIntentCopyWithImpl; +@useResult +$Res call({ + String id, num amount, String created, String currency, PaymentIntentsStatus status, String clientSecret, bool livemode, CaptureMethod captureMethod, ConfirmationMethod confirmationMethod, String? paymentMethodId, String? description, String? receiptEmail, String? canceledAt, NextAction? nextAction, ShippingDetails? shipping, MandateData? mandateData, String? latestCharge +}); - /// The client is secret is used for handling the payment from the Client side. - String get clientSecret => throw _privateConstructorUsedError; - /// Determines whether the intent is in live mode or in test mode. - bool get livemode => throw _privateConstructorUsedError; +$NextActionCopyWith<$Res>? get nextAction;$ShippingDetailsCopyWith<$Res>? get shipping;$MandateDataCopyWith<$Res>? get mandateData; - /// How the funds will be caputure from the customer's account. - CaptureMethod get captureMethod => throw _privateConstructorUsedError; +} +/// @nodoc +class _$PaymentIntentCopyWithImpl<$Res> + implements $PaymentIntentCopyWith<$Res> { + _$PaymentIntentCopyWithImpl(this._self, this._then); + + final PaymentIntent _self; + final $Res Function(PaymentIntent) _then; + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? amount = null,Object? created = null,Object? currency = null,Object? status = null,Object? clientSecret = null,Object? livemode = null,Object? captureMethod = null,Object? confirmationMethod = null,Object? paymentMethodId = freezed,Object? description = freezed,Object? receiptEmail = freezed,Object? canceledAt = freezed,Object? nextAction = freezed,Object? shipping = freezed,Object? mandateData = freezed,Object? latestCharge = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as num,created: null == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as PaymentIntentsStatus,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,captureMethod: null == captureMethod ? _self.captureMethod : captureMethod // ignore: cast_nullable_to_non_nullable +as CaptureMethod,confirmationMethod: null == confirmationMethod ? _self.confirmationMethod : confirmationMethod // ignore: cast_nullable_to_non_nullable +as ConfirmationMethod,paymentMethodId: freezed == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,receiptEmail: freezed == receiptEmail ? _self.receiptEmail : receiptEmail // ignore: cast_nullable_to_non_nullable +as String?,canceledAt: freezed == canceledAt ? _self.canceledAt : canceledAt // ignore: cast_nullable_to_non_nullable +as String?,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as NextAction?,shipping: freezed == shipping ? _self.shipping : shipping // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,latestCharge: freezed == latestCharge ? _self.latestCharge : latestCharge // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$NextActionCopyWith<$Res>? get nextAction { + if (_self.nextAction == null) { + return null; + } - /// Method of how the payment will be confirmed. - ConfirmationMethod get confirmationMethod => - throw _privateConstructorUsedError; + return $NextActionCopyWith<$Res>(_self.nextAction!, (value) { + return _then(_self.copyWith(nextAction: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shipping { + if (_self.shipping == null) { + return null; + } - /// Id of the payment method used in this intent. - String? get paymentMethodId => throw _privateConstructorUsedError; + return $ShippingDetailsCopyWith<$Res>(_self.shipping!, (value) { + return _then(_self.copyWith(shipping: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } - /// Localized description that provides additional context to users. - String? get description => throw _privateConstructorUsedError; + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} - /// Email address where the receipt will be send to. - String? get receiptEmail => throw _privateConstructorUsedError; - /// Timestamp since epoch when the intent is cancelled. - String? get canceledAt => throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [PaymentIntent]. +extension PaymentIntentPatterns on PaymentIntent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentIntent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that);case _: + return orElse(); - /// Additional action that needs to be taken in order to complete a payment - /// using the provided resource. - NextAction? get nextAction => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentIntent value) $default,){ +final _that = this; +switch (_that) { +case _PaymentIntent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// Shipping information of the payment intent. - ShippingDetails? get shipping => throw _privateConstructorUsedError; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentIntent value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that);case _: + return null; - /// Mandata data for this paymentintent. - MandateData? get mandateData => throw _privateConstructorUsedError; +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, num amount, String created, String currency, PaymentIntentsStatus status, String clientSecret, bool livemode, CaptureMethod captureMethod, ConfirmationMethod confirmationMethod, String? paymentMethodId, String? description, String? receiptEmail, String? canceledAt, NextAction? nextAction, ShippingDetails? shipping, MandateData? mandateData, String? latestCharge)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that.id,_that.amount,_that.created,_that.currency,_that.status,_that.clientSecret,_that.livemode,_that.captureMethod,_that.confirmationMethod,_that.paymentMethodId,_that.description,_that.receiptEmail,_that.canceledAt,_that.nextAction,_that.shipping,_that.mandateData,_that.latestCharge);case _: + return orElse(); - /// The latest charge created by this payment intent. - /// - /// This field is only available on stripe web. - String? get latestCharge => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, num amount, String created, String currency, PaymentIntentsStatus status, String clientSecret, bool livemode, CaptureMethod captureMethod, ConfirmationMethod confirmationMethod, String? paymentMethodId, String? description, String? receiptEmail, String? canceledAt, NextAction? nextAction, ShippingDetails? shipping, MandateData? mandateData, String? latestCharge) $default,) {final _that = this; +switch (_that) { +case _PaymentIntent(): +return $default(_that.id,_that.amount,_that.created,_that.currency,_that.status,_that.clientSecret,_that.livemode,_that.captureMethod,_that.confirmationMethod,_that.paymentMethodId,_that.description,_that.receiptEmail,_that.canceledAt,_that.nextAction,_that.shipping,_that.mandateData,_that.latestCharge);case _: + throw StateError('Unexpected subclass'); - /// Serializes this PaymentIntent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, num amount, String created, String currency, PaymentIntentsStatus status, String clientSecret, bool livemode, CaptureMethod captureMethod, ConfirmationMethod confirmationMethod, String? paymentMethodId, String? description, String? receiptEmail, String? canceledAt, NextAction? nextAction, ShippingDetails? shipping, MandateData? mandateData, String? latestCharge)? $default,) {final _that = this; +switch (_that) { +case _PaymentIntent() when $default != null: +return $default(_that.id,_that.amount,_that.created,_that.currency,_that.status,_that.clientSecret,_that.livemode,_that.captureMethod,_that.confirmationMethod,_that.paymentMethodId,_that.description,_that.receiptEmail,_that.canceledAt,_that.nextAction,_that.shipping,_that.mandateData,_that.latestCharge);case _: + return null; - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentIntentCopyWith get copyWith => - throw _privateConstructorUsedError; +} } -/// @nodoc -abstract class $PaymentIntentCopyWith<$Res> { - factory $PaymentIntentCopyWith( - PaymentIntent value, $Res Function(PaymentIntent) then) = - _$PaymentIntentCopyWithImpl<$Res, PaymentIntent>; - @useResult - $Res call( - {String id, - num amount, - String created, - String currency, - PaymentIntentsStatus status, - String clientSecret, - bool livemode, - CaptureMethod captureMethod, - ConfirmationMethod confirmationMethod, - String? paymentMethodId, - String? description, - String? receiptEmail, - String? canceledAt, - NextAction? nextAction, - ShippingDetails? shipping, - MandateData? mandateData, - String? latestCharge}); - - $NextActionCopyWith<$Res>? get nextAction; - $ShippingDetailsCopyWith<$Res>? get shipping; - $MandateDataCopyWith<$Res>? get mandateData; } /// @nodoc -class _$PaymentIntentCopyWithImpl<$Res, $Val extends PaymentIntent> - implements $PaymentIntentCopyWith<$Res> { - _$PaymentIntentCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? amount = null, - Object? created = null, - Object? currency = null, - Object? status = null, - Object? clientSecret = null, - Object? livemode = null, - Object? captureMethod = null, - Object? confirmationMethod = null, - Object? paymentMethodId = freezed, - Object? description = freezed, - Object? receiptEmail = freezed, - Object? canceledAt = freezed, - Object? nextAction = freezed, - Object? shipping = freezed, - Object? mandateData = freezed, - Object? latestCharge = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as num, - created: null == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as PaymentIntentsStatus, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - captureMethod: null == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as CaptureMethod, - confirmationMethod: null == confirmationMethod - ? _value.confirmationMethod - : confirmationMethod // ignore: cast_nullable_to_non_nullable - as ConfirmationMethod, - paymentMethodId: freezed == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - canceledAt: freezed == canceledAt - ? _value.canceledAt - : canceledAt // ignore: cast_nullable_to_non_nullable - as String?, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as NextAction?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - latestCharge: freezed == latestCharge - ? _value.latestCharge - : latestCharge // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $NextActionCopyWith<$Res>? get nextAction { - if (_value.nextAction == null) { - return null; - } - - return $NextActionCopyWith<$Res>(_value.nextAction!, (value) { - return _then(_value.copyWith(nextAction: value) as $Val); - }); - } +@JsonSerializable(explicitToJson: true) +class _PaymentIntent implements PaymentIntent { + const _PaymentIntent({required this.id, required this.amount, required this.created, required this.currency, required this.status, required this.clientSecret, required this.livemode, required this.captureMethod, required this.confirmationMethod, this.paymentMethodId, this.description, this.receiptEmail, this.canceledAt, this.nextAction, this.shipping, this.mandateData, this.latestCharge}); + factory _PaymentIntent.fromJson(Map json) => _$PaymentIntentFromJson(json); + +/// Unique identifier. +@override final String id; +/// Amount that will be collected in the payment intent. +@override final num amount; +/// Timestamp since epoch that represents the time the intent is created. +@override final String created; +/// The three letter ISO 4217 code for the currency. +@override final String currency; +/// Current status of the intent. +@override final PaymentIntentsStatus status; +/// The client is secret is used for handling the payment from the Client side. +@override final String clientSecret; +/// Determines whether the intent is in live mode or in test mode. +@override final bool livemode; +/// How the funds will be caputure from the customer's account. +@override final CaptureMethod captureMethod; +/// Method of how the payment will be confirmed. +@override final ConfirmationMethod confirmationMethod; +/// Id of the payment method used in this intent. +@override final String? paymentMethodId; +/// Localized description that provides additional context to users. +@override final String? description; +/// Email address where the receipt will be send to. +@override final String? receiptEmail; +/// Timestamp since epoch when the intent is cancelled. +@override final String? canceledAt; +/// Additional action that needs to be taken in order to complete a payment +/// using the provided resource. +@override final NextAction? nextAction; +/// Shipping information of the payment intent. +@override final ShippingDetails? shipping; +/// Mandata data for this paymentintent. +@override final MandateData? mandateData; +/// The latest charge created by this payment intent. +/// +/// This field is only available on stripe web. +@override final String? latestCharge; + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentIntentCopyWith<_PaymentIntent> get copyWith => __$PaymentIntentCopyWithImpl<_PaymentIntent>(this, _$identity); + +@override +Map toJson() { + return _$PaymentIntentToJson(this, ); +} - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shipping { - if (_value.shipping == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shipping!, (value) { - return _then(_value.copyWith(shipping: value) as $Val); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.created, created) || other.created == created)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.status, status) || other.status == status)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.captureMethod, captureMethod) || other.captureMethod == captureMethod)&&(identical(other.confirmationMethod, confirmationMethod) || other.confirmationMethod == confirmationMethod)&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.description, description) || other.description == description)&&(identical(other.receiptEmail, receiptEmail) || other.receiptEmail == receiptEmail)&&(identical(other.canceledAt, canceledAt) || other.canceledAt == canceledAt)&&(identical(other.nextAction, nextAction) || other.nextAction == nextAction)&&(identical(other.shipping, shipping) || other.shipping == shipping)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&(identical(other.latestCharge, latestCharge) || other.latestCharge == latestCharge)); +} - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,amount,created,currency,status,clientSecret,livemode,captureMethod,confirmationMethod,paymentMethodId,description,receiptEmail,canceledAt,nextAction,shipping,mandateData,latestCharge); + +@override +String toString() { + return 'PaymentIntent(id: $id, amount: $amount, created: $created, currency: $currency, status: $status, clientSecret: $clientSecret, livemode: $livemode, captureMethod: $captureMethod, confirmationMethod: $confirmationMethod, paymentMethodId: $paymentMethodId, description: $description, receiptEmail: $receiptEmail, canceledAt: $canceledAt, nextAction: $nextAction, shipping: $shipping, mandateData: $mandateData, latestCharge: $latestCharge)'; } -/// @nodoc -abstract class _$$PaymentIntentImplCopyWith<$Res> - implements $PaymentIntentCopyWith<$Res> { - factory _$$PaymentIntentImplCopyWith( - _$PaymentIntentImpl value, $Res Function(_$PaymentIntentImpl) then) = - __$$PaymentIntentImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - num amount, - String created, - String currency, - PaymentIntentsStatus status, - String clientSecret, - bool livemode, - CaptureMethod captureMethod, - ConfirmationMethod confirmationMethod, - String? paymentMethodId, - String? description, - String? receiptEmail, - String? canceledAt, - NextAction? nextAction, - ShippingDetails? shipping, - MandateData? mandateData, - String? latestCharge}); - - @override - $NextActionCopyWith<$Res>? get nextAction; - @override - $ShippingDetailsCopyWith<$Res>? get shipping; - @override - $MandateDataCopyWith<$Res>? get mandateData; + } /// @nodoc -class __$$PaymentIntentImplCopyWithImpl<$Res> - extends _$PaymentIntentCopyWithImpl<$Res, _$PaymentIntentImpl> - implements _$$PaymentIntentImplCopyWith<$Res> { - __$$PaymentIntentImplCopyWithImpl( - _$PaymentIntentImpl _value, $Res Function(_$PaymentIntentImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? amount = null, - Object? created = null, - Object? currency = null, - Object? status = null, - Object? clientSecret = null, - Object? livemode = null, - Object? captureMethod = null, - Object? confirmationMethod = null, - Object? paymentMethodId = freezed, - Object? description = freezed, - Object? receiptEmail = freezed, - Object? canceledAt = freezed, - Object? nextAction = freezed, - Object? shipping = freezed, - Object? mandateData = freezed, - Object? latestCharge = freezed, - }) { - return _then(_$PaymentIntentImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as num, - created: null == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as PaymentIntentsStatus, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - captureMethod: null == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as CaptureMethod, - confirmationMethod: null == confirmationMethod - ? _value.confirmationMethod - : confirmationMethod // ignore: cast_nullable_to_non_nullable - as ConfirmationMethod, - paymentMethodId: freezed == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String?, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - receiptEmail: freezed == receiptEmail - ? _value.receiptEmail - : receiptEmail // ignore: cast_nullable_to_non_nullable - as String?, - canceledAt: freezed == canceledAt - ? _value.canceledAt - : canceledAt // ignore: cast_nullable_to_non_nullable - as String?, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as NextAction?, - shipping: freezed == shipping - ? _value.shipping - : shipping // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - latestCharge: freezed == latestCharge - ? _value.latestCharge - : latestCharge // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} +abstract mixin class _$PaymentIntentCopyWith<$Res> implements $PaymentIntentCopyWith<$Res> { + factory _$PaymentIntentCopyWith(_PaymentIntent value, $Res Function(_PaymentIntent) _then) = __$PaymentIntentCopyWithImpl; +@override @useResult +$Res call({ + String id, num amount, String created, String currency, PaymentIntentsStatus status, String clientSecret, bool livemode, CaptureMethod captureMethod, ConfirmationMethod confirmationMethod, String? paymentMethodId, String? description, String? receiptEmail, String? canceledAt, NextAction? nextAction, ShippingDetails? shipping, MandateData? mandateData, String? latestCharge +}); + +@override $NextActionCopyWith<$Res>? get nextAction;@override $ShippingDetailsCopyWith<$Res>? get shipping;@override $MandateDataCopyWith<$Res>? get mandateData; + +} /// @nodoc +class __$PaymentIntentCopyWithImpl<$Res> + implements _$PaymentIntentCopyWith<$Res> { + __$PaymentIntentCopyWithImpl(this._self, this._then); + + final _PaymentIntent _self; + final $Res Function(_PaymentIntent) _then; + +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? amount = null,Object? created = null,Object? currency = null,Object? status = null,Object? clientSecret = null,Object? livemode = null,Object? captureMethod = null,Object? confirmationMethod = null,Object? paymentMethodId = freezed,Object? description = freezed,Object? receiptEmail = freezed,Object? canceledAt = freezed,Object? nextAction = freezed,Object? shipping = freezed,Object? mandateData = freezed,Object? latestCharge = freezed,}) { + return _then(_PaymentIntent( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as num,created: null == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as PaymentIntentsStatus,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,captureMethod: null == captureMethod ? _self.captureMethod : captureMethod // ignore: cast_nullable_to_non_nullable +as CaptureMethod,confirmationMethod: null == confirmationMethod ? _self.confirmationMethod : confirmationMethod // ignore: cast_nullable_to_non_nullable +as ConfirmationMethod,paymentMethodId: freezed == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,receiptEmail: freezed == receiptEmail ? _self.receiptEmail : receiptEmail // ignore: cast_nullable_to_non_nullable +as String?,canceledAt: freezed == canceledAt ? _self.canceledAt : canceledAt // ignore: cast_nullable_to_non_nullable +as String?,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as NextAction?,shipping: freezed == shipping ? _self.shipping : shipping // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,latestCharge: freezed == latestCharge ? _self.latestCharge : latestCharge // ignore: cast_nullable_to_non_nullable +as String?, + )); +} -@JsonSerializable(explicitToJson: true) -class _$PaymentIntentImpl implements _PaymentIntent { - const _$PaymentIntentImpl( - {required this.id, - required this.amount, - required this.created, - required this.currency, - required this.status, - required this.clientSecret, - required this.livemode, - required this.captureMethod, - required this.confirmationMethod, - this.paymentMethodId, - this.description, - this.receiptEmail, - this.canceledAt, - this.nextAction, - this.shipping, - this.mandateData, - this.latestCharge}); - - factory _$PaymentIntentImpl.fromJson(Map json) => - _$$PaymentIntentImplFromJson(json); - - /// Unique identifier. - @override - final String id; - - /// Amount that will be collected in the payment intent. - @override - final num amount; - - /// Timestamp since epoch that represents the time the intent is created. - @override - final String created; - - /// The three letter ISO 4217 code for the currency. - @override - final String currency; - - /// Current status of the intent. - @override - final PaymentIntentsStatus status; - - /// The client is secret is used for handling the payment from the Client side. - @override - final String clientSecret; - - /// Determines whether the intent is in live mode or in test mode. - @override - final bool livemode; - - /// How the funds will be caputure from the customer's account. - @override - final CaptureMethod captureMethod; - - /// Method of how the payment will be confirmed. - @override - final ConfirmationMethod confirmationMethod; - - /// Id of the payment method used in this intent. - @override - final String? paymentMethodId; - - /// Localized description that provides additional context to users. - @override - final String? description; - - /// Email address where the receipt will be send to. - @override - final String? receiptEmail; - - /// Timestamp since epoch when the intent is cancelled. - @override - final String? canceledAt; - - /// Additional action that needs to be taken in order to complete a payment - /// using the provided resource. - @override - final NextAction? nextAction; - - /// Shipping information of the payment intent. - @override - final ShippingDetails? shipping; - - /// Mandata data for this paymentintent. - @override - final MandateData? mandateData; - - /// The latest charge created by this payment intent. - /// - /// This field is only available on stripe web. - @override - final String? latestCharge; - - @override - String toString() { - return 'PaymentIntent(id: $id, amount: $amount, created: $created, currency: $currency, status: $status, clientSecret: $clientSecret, livemode: $livemode, captureMethod: $captureMethod, confirmationMethod: $confirmationMethod, paymentMethodId: $paymentMethodId, description: $description, receiptEmail: $receiptEmail, canceledAt: $canceledAt, nextAction: $nextAction, shipping: $shipping, mandateData: $mandateData, latestCharge: $latestCharge)'; +/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$NextActionCopyWith<$Res>? get nextAction { + if (_self.nextAction == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentIntentImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.created, created) || other.created == created) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.status, status) || other.status == status) && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.captureMethod, captureMethod) || - other.captureMethod == captureMethod) && - (identical(other.confirmationMethod, confirmationMethod) || - other.confirmationMethod == confirmationMethod) && - (identical(other.paymentMethodId, paymentMethodId) || - other.paymentMethodId == paymentMethodId) && - (identical(other.description, description) || - other.description == description) && - (identical(other.receiptEmail, receiptEmail) || - other.receiptEmail == receiptEmail) && - (identical(other.canceledAt, canceledAt) || - other.canceledAt == canceledAt) && - (identical(other.nextAction, nextAction) || - other.nextAction == nextAction) && - (identical(other.shipping, shipping) || - other.shipping == shipping) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - (identical(other.latestCharge, latestCharge) || - other.latestCharge == latestCharge)); + return $NextActionCopyWith<$Res>(_self.nextAction!, (value) { + return _then(_self.copyWith(nextAction: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shipping { + if (_self.shipping == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - amount, - created, - currency, - status, - clientSecret, - livemode, - captureMethod, - confirmationMethod, - paymentMethodId, - description, - receiptEmail, - canceledAt, - nextAction, - shipping, - mandateData, - latestCharge); - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentIntentImplCopyWith<_$PaymentIntentImpl> get copyWith => - __$$PaymentIntentImplCopyWithImpl<_$PaymentIntentImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentIntentImplToJson( - this, - ); + return $ShippingDetailsCopyWith<$Res>(_self.shipping!, (value) { + return _then(_self.copyWith(shipping: value)); + }); +}/// Create a copy of PaymentIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } -} -abstract class _PaymentIntent implements PaymentIntent { - const factory _PaymentIntent( - {required final String id, - required final num amount, - required final String created, - required final String currency, - required final PaymentIntentsStatus status, - required final String clientSecret, - required final bool livemode, - required final CaptureMethod captureMethod, - required final ConfirmationMethod confirmationMethod, - final String? paymentMethodId, - final String? description, - final String? receiptEmail, - final String? canceledAt, - final NextAction? nextAction, - final ShippingDetails? shipping, - final MandateData? mandateData, - final String? latestCharge}) = _$PaymentIntentImpl; - - factory _PaymentIntent.fromJson(Map json) = - _$PaymentIntentImpl.fromJson; - - /// Unique identifier. - @override - String get id; - - /// Amount that will be collected in the payment intent. - @override - num get amount; - - /// Timestamp since epoch that represents the time the intent is created. - @override - String get created; - - /// The three letter ISO 4217 code for the currency. - @override - String get currency; - - /// Current status of the intent. - @override - PaymentIntentsStatus get status; - - /// The client is secret is used for handling the payment from the Client side. - @override - String get clientSecret; - - /// Determines whether the intent is in live mode or in test mode. - @override - bool get livemode; - - /// How the funds will be caputure from the customer's account. - @override - CaptureMethod get captureMethod; - - /// Method of how the payment will be confirmed. - @override - ConfirmationMethod get confirmationMethod; - - /// Id of the payment method used in this intent. - @override - String? get paymentMethodId; - - /// Localized description that provides additional context to users. - @override - String? get description; - - /// Email address where the receipt will be send to. - @override - String? get receiptEmail; - - /// Timestamp since epoch when the intent is cancelled. - @override - String? get canceledAt; - - /// Additional action that needs to be taken in order to complete a payment - /// using the provided resource. - @override - NextAction? get nextAction; - - /// Shipping information of the payment intent. - @override - ShippingDetails? get shipping; - - /// Mandata data for this paymentintent. - @override - MandateData? get mandateData; - - /// The latest charge created by this payment intent. - /// - /// This field is only available on stripe web. - @override - String? get latestCharge; - - /// Create a copy of PaymentIntent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentIntentImplCopyWith<_$PaymentIntentImpl> get copyWith => - throw _privateConstructorUsedError; -} - -ShippingDetails _$ShippingDetailsFromJson(Map json) { - return _ShippingDetails.fromJson(json); + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); } +} + /// @nodoc mixin _$ShippingDetails { - /// Recipient address. - Address get address => throw _privateConstructorUsedError; - /// Recipient name. - String? get name => throw _privateConstructorUsedError; +/// Recipient address. + Address get address;/// Recipient name. + String? get name;/// Deliver service that will ship the product + String? get carrier;/// Recipient phone number. + String? get phone;/// Tracking number of the shipment. If multiple tracking numbers separate them +/// with commas. + String? get trackingNumber; +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith get copyWith => _$ShippingDetailsCopyWithImpl(this as ShippingDetails, _$identity); - /// Deliver service that will ship the product - String? get carrier => throw _privateConstructorUsedError; + /// Serializes this ShippingDetails to a JSON map. + Map toJson(); - /// Recipient phone number. - String? get phone => throw _privateConstructorUsedError; - /// Tracking number of the shipment. If multiple tracking numbers separate them - /// with commas. - String? get trackingNumber => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ShippingDetails&&(identical(other.address, address) || other.address == address)&&(identical(other.name, name) || other.name == name)&&(identical(other.carrier, carrier) || other.carrier == carrier)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.trackingNumber, trackingNumber) || other.trackingNumber == trackingNumber)); +} - /// Serializes this ShippingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,address,name,carrier,phone,trackingNumber); - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ShippingDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'ShippingDetails(address: $address, name: $name, carrier: $carrier, phone: $phone, trackingNumber: $trackingNumber)'; } -/// @nodoc -abstract class $ShippingDetailsCopyWith<$Res> { - factory $ShippingDetailsCopyWith( - ShippingDetails value, $Res Function(ShippingDetails) then) = - _$ShippingDetailsCopyWithImpl<$Res, ShippingDetails>; - @useResult - $Res call( - {Address address, - String? name, - String? carrier, - String? phone, - String? trackingNumber}); - $AddressCopyWith<$Res> get address; } /// @nodoc -class _$ShippingDetailsCopyWithImpl<$Res, $Val extends ShippingDetails> - implements $ShippingDetailsCopyWith<$Res> { - _$ShippingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? address = null, - Object? name = freezed, - Object? carrier = freezed, - Object? phone = freezed, - Object? trackingNumber = freezed, - }) { - return _then(_value.copyWith( - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - carrier: freezed == carrier - ? _value.carrier - : carrier // ignore: cast_nullable_to_non_nullable - as String?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - trackingNumber: freezed == trackingNumber - ? _value.trackingNumber - : trackingNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +abstract mixin class $ShippingDetailsCopyWith<$Res> { + factory $ShippingDetailsCopyWith(ShippingDetails value, $Res Function(ShippingDetails) _then) = _$ShippingDetailsCopyWithImpl; +@useResult +$Res call({ + Address address, String? name, String? carrier, String? phone, String? trackingNumber +}); - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res> get address { - return $AddressCopyWith<$Res>(_value.address, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } -} +$AddressCopyWith<$Res> get address; + +} /// @nodoc -abstract class _$$ShippingDetailsImplCopyWith<$Res> +class _$ShippingDetailsCopyWithImpl<$Res> implements $ShippingDetailsCopyWith<$Res> { - factory _$$ShippingDetailsImplCopyWith(_$ShippingDetailsImpl value, - $Res Function(_$ShippingDetailsImpl) then) = - __$$ShippingDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {Address address, - String? name, - String? carrier, - String? phone, - String? trackingNumber}); - - @override - $AddressCopyWith<$Res> get address; + _$ShippingDetailsCopyWithImpl(this._self, this._then); + + final ShippingDetails _self; + final $Res Function(ShippingDetails) _then; + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? address = null,Object? name = freezed,Object? carrier = freezed,Object? phone = freezed,Object? trackingNumber = freezed,}) { + return _then(_self.copyWith( +address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,carrier: freezed == carrier ? _self.carrier : carrier // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,trackingNumber: freezed == trackingNumber ? _self.trackingNumber : trackingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res> get address { + + return $AddressCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ShippingDetails]. +extension ShippingDetailsPatterns on ShippingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ShippingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ShippingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ShippingDetails value) $default,){ +final _that = this; +switch (_that) { +case _ShippingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ShippingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _ShippingDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( Address address, String? name, String? carrier, String? phone, String? trackingNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ShippingDetails() when $default != null: +return $default(_that.address,_that.name,_that.carrier,_that.phone,_that.trackingNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( Address address, String? name, String? carrier, String? phone, String? trackingNumber) $default,) {final _that = this; +switch (_that) { +case _ShippingDetails(): +return $default(_that.address,_that.name,_that.carrier,_that.phone,_that.trackingNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( Address address, String? name, String? carrier, String? phone, String? trackingNumber)? $default,) {final _that = this; +switch (_that) { +case _ShippingDetails() when $default != null: +return $default(_that.address,_that.name,_that.carrier,_that.phone,_that.trackingNumber);case _: + return null; + +} } -/// @nodoc -class __$$ShippingDetailsImplCopyWithImpl<$Res> - extends _$ShippingDetailsCopyWithImpl<$Res, _$ShippingDetailsImpl> - implements _$$ShippingDetailsImplCopyWith<$Res> { - __$$ShippingDetailsImplCopyWithImpl( - _$ShippingDetailsImpl _value, $Res Function(_$ShippingDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? address = null, - Object? name = freezed, - Object? carrier = freezed, - Object? phone = freezed, - Object? trackingNumber = freezed, - }) { - return _then(_$ShippingDetailsImpl( - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - carrier: freezed == carrier - ? _value.carrier - : carrier // ignore: cast_nullable_to_non_nullable - as String?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - trackingNumber: freezed == trackingNumber - ? _value.trackingNumber - : trackingNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ShippingDetailsImpl implements _ShippingDetails { - const _$ShippingDetailsImpl( - {required this.address, - this.name, - this.carrier, - this.phone, - this.trackingNumber}); - - factory _$ShippingDetailsImpl.fromJson(Map json) => - _$$ShippingDetailsImplFromJson(json); - - /// Recipient address. - @override - final Address address; - - /// Recipient name. - @override - final String? name; - - /// Deliver service that will ship the product - @override - final String? carrier; - - /// Recipient phone number. - @override - final String? phone; - - /// Tracking number of the shipment. If multiple tracking numbers separate them - /// with commas. - @override - final String? trackingNumber; - - @override - String toString() { - return 'ShippingDetails(address: $address, name: $name, carrier: $carrier, phone: $phone, trackingNumber: $trackingNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ShippingDetailsImpl && - (identical(other.address, address) || other.address == address) && - (identical(other.name, name) || other.name == name) && - (identical(other.carrier, carrier) || other.carrier == carrier) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.trackingNumber, trackingNumber) || - other.trackingNumber == trackingNumber)); - } +class _ShippingDetails implements ShippingDetails { + const _ShippingDetails({required this.address, this.name, this.carrier, this.phone, this.trackingNumber}); + factory _ShippingDetails.fromJson(Map json) => _$ShippingDetailsFromJson(json); + +/// Recipient address. +@override final Address address; +/// Recipient name. +@override final String? name; +/// Deliver service that will ship the product +@override final String? carrier; +/// Recipient phone number. +@override final String? phone; +/// Tracking number of the shipment. If multiple tracking numbers separate them +/// with commas. +@override final String? trackingNumber; + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ShippingDetailsCopyWith<_ShippingDetails> get copyWith => __$ShippingDetailsCopyWithImpl<_ShippingDetails>(this, _$identity); + +@override +Map toJson() { + return _$ShippingDetailsToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, address, name, carrier, phone, trackingNumber); - - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ShippingDetailsImplCopyWith<_$ShippingDetailsImpl> get copyWith => - __$$ShippingDetailsImplCopyWithImpl<_$ShippingDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ShippingDetailsImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ShippingDetails&&(identical(other.address, address) || other.address == address)&&(identical(other.name, name) || other.name == name)&&(identical(other.carrier, carrier) || other.carrier == carrier)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.trackingNumber, trackingNumber) || other.trackingNumber == trackingNumber)); } -abstract class _ShippingDetails implements ShippingDetails { - const factory _ShippingDetails( - {required final Address address, - final String? name, - final String? carrier, - final String? phone, - final String? trackingNumber}) = _$ShippingDetailsImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,address,name,carrier,phone,trackingNumber); - factory _ShippingDetails.fromJson(Map json) = - _$ShippingDetailsImpl.fromJson; +@override +String toString() { + return 'ShippingDetails(address: $address, name: $name, carrier: $carrier, phone: $phone, trackingNumber: $trackingNumber)'; +} - /// Recipient address. - @override - Address get address; - /// Recipient name. - @override - String? get name; +} - /// Deliver service that will ship the product - @override - String? get carrier; +/// @nodoc +abstract mixin class _$ShippingDetailsCopyWith<$Res> implements $ShippingDetailsCopyWith<$Res> { + factory _$ShippingDetailsCopyWith(_ShippingDetails value, $Res Function(_ShippingDetails) _then) = __$ShippingDetailsCopyWithImpl; +@override @useResult +$Res call({ + Address address, String? name, String? carrier, String? phone, String? trackingNumber +}); - /// Recipient phone number. - @override - String? get phone; - /// Tracking number of the shipment. If multiple tracking numbers separate them - /// with commas. - @override - String? get trackingNumber; +@override $AddressCopyWith<$Res> get address; - /// Create a copy of ShippingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ShippingDetailsImplCopyWith<_$ShippingDetailsImpl> get copyWith => - throw _privateConstructorUsedError; } +/// @nodoc +class __$ShippingDetailsCopyWithImpl<$Res> + implements _$ShippingDetailsCopyWith<$Res> { + __$ShippingDetailsCopyWithImpl(this._self, this._then); + + final _ShippingDetails _self; + final $Res Function(_ShippingDetails) _then; + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? address = null,Object? name = freezed,Object? carrier = freezed,Object? phone = freezed,Object? trackingNumber = freezed,}) { + return _then(_ShippingDetails( +address: null == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,carrier: freezed == carrier ? _self.carrier : carrier // ignore: cast_nullable_to_non_nullable +as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,trackingNumber: freezed == trackingNumber ? _self.trackingNumber : trackingNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of ShippingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res> get address { + + return $AddressCopyWith<$Res>(_self.address, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/payment_intents.g.dart b/packages/stripe_platform_interface/lib/src/models/payment_intents.g.dart index 337720762..1db3670c9 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_intents.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_intents.g.dart @@ -6,8 +6,8 @@ part of 'payment_intents.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentIntentImpl _$$PaymentIntentImplFromJson(Map json) => - _$PaymentIntentImpl( +_PaymentIntent _$PaymentIntentFromJson(Map json) => + _PaymentIntent( id: json['id'] as String, amount: json['amount'] as num, created: json['created'] as String, @@ -16,8 +16,10 @@ _$PaymentIntentImpl _$$PaymentIntentImplFromJson(Map json) => clientSecret: json['clientSecret'] as String, livemode: json['livemode'] as bool, captureMethod: $enumDecode(_$CaptureMethodEnumMap, json['captureMethod']), - confirmationMethod: - $enumDecode(_$ConfirmationMethodEnumMap, json['confirmationMethod']), + confirmationMethod: $enumDecode( + _$ConfirmationMethodEnumMap, + json['confirmationMethod'], + ), paymentMethodId: json['paymentMethodId'] as String?, description: json['description'] as String?, receiptEmail: json['receiptEmail'] as String?, @@ -34,7 +36,7 @@ _$PaymentIntentImpl _$$PaymentIntentImplFromJson(Map json) => latestCharge: json['latestCharge'] as String?, ); -Map _$$PaymentIntentImplToJson(_$PaymentIntentImpl instance) => +Map _$PaymentIntentToJson(_PaymentIntent instance) => { 'id': instance.id, 'amount': instance.amount, @@ -80,9 +82,8 @@ const _$ConfirmationMethodEnumMap = { ConfirmationMethod.Unknown: 'Unknown', }; -_$ShippingDetailsImpl _$$ShippingDetailsImplFromJson( - Map json) => - _$ShippingDetailsImpl( +_ShippingDetails _$ShippingDetailsFromJson(Map json) => + _ShippingDetails( address: Address.fromJson(json['address'] as Map), name: json['name'] as String?, carrier: json['carrier'] as String?, @@ -90,8 +91,7 @@ _$ShippingDetailsImpl _$$ShippingDetailsImplFromJson( trackingNumber: json['trackingNumber'] as String?, ); -Map _$$ShippingDetailsImplToJson( - _$ShippingDetailsImpl instance) => +Map _$ShippingDetailsToJson(_ShippingDetails instance) => { 'address': instance.address.toJson(), 'name': instance.name, diff --git a/packages/stripe_platform_interface/lib/src/models/payment_methods.dart b/packages/stripe_platform_interface/lib/src/models/payment_methods.dart index 2757a2631..deb64a1f1 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.dart @@ -9,7 +9,7 @@ part 'payment_methods.g.dart'; /// Representation of the payment instruments. See /// https://stripe.com/docs/payments/payment-methods for more info. @freezed -class PaymentMethod with _$PaymentMethod { +abstract class PaymentMethod with _$PaymentMethod { @JsonSerializable(explicitToJson: true) const factory PaymentMethod({ /// Unique identifier. @@ -28,31 +28,21 @@ class PaymentMethod with _$PaymentMethod { @JsonKey(name: 'Card') required Card card, /// Containing additional data in case paymentmethod type is sepa. - @JsonKey(name: 'SepaDebit') required SepaDebit sepaDebit, /// Containing additional data in case paymentmethod type is Bacs debit. - @JsonKey(name: 'BacsDebit') required BacsDebit bacsDebit, /// Containing additional data in case paymentmethod type is Aubecs debit. - @JsonKey(name: 'AuBecsDebit') required AuBecsDebit auBecsDebit, - /// Containing additional data in case paymentmethod type is sofort. - - @JsonKey(name: 'Sofort') required Sofort sofort, - /// Containing additional data in case paymentmethod type is Ideal. - @JsonKey(name: 'Ideal') required Ideal ideal, /// Containing additional data in case paymentmethod type is FPX. - @JsonKey(name: 'Fpx') required Fpx fpx, /// Containing additional data in case paymentmethod type is UPI. - @JsonKey(name: 'Upi') required Upi upi, /// Containing additional data in case paymentmethod type is Us bank account. @@ -68,7 +58,7 @@ class PaymentMethod with _$PaymentMethod { /// Billing information associated with the payment method. @freezed -class BillingDetails with _$BillingDetails { +abstract class BillingDetails with _$BillingDetails { @JsonSerializable() const factory BillingDetails({ /// Email address. @@ -89,10 +79,8 @@ class BillingDetails with _$BillingDetails { } @freezed - /// AubecsDebit data associated with the payment method - -class AuBecsDebit with _$AuBecsDebit { +abstract class AuBecsDebit with _$AuBecsDebit { @JsonSerializable(explicitToJson: true) const factory AuBecsDebit({ /// Unique identifier for the bankaccount. @@ -110,16 +98,14 @@ class AuBecsDebit with _$AuBecsDebit { } @freezed - /// BacsDebit data associated with the payment method -class BacsDebit with _$BacsDebit { +abstract class BacsDebit with _$BacsDebit { @JsonSerializable(explicitToJson: true) const factory BacsDebit({ /// Sort code of the bankaccount. String? sortCode, /// Unique identifier for the bankaccount. - String? fingerprint, /// Last 4 digits of the bank account. @@ -130,9 +116,8 @@ class BacsDebit with _$BacsDebit { } @freezed - /// Card data associated with the payment method -class Card with _$Card { +abstract class Card with _$Card { @JsonSerializable(explicitToJson: true) const factory Card({ /// The brand associated to the card e.g. (visa, amex). @@ -167,7 +152,7 @@ class Card with _$Card { } @freezed -class Fpx with _$Fpx { +abstract class Fpx with _$Fpx { /// Fpx data associated with the payment method @JsonSerializable(explicitToJson: true) @@ -183,9 +168,8 @@ class Fpx with _$Fpx { } @freezed - /// Ideal data associated with the payment method -class Ideal with _$Ideal { +abstract class Ideal with _$Ideal { @JsonSerializable(explicitToJson: true) const factory Ideal({ /// The BIC code of the bank @@ -198,10 +182,8 @@ class Ideal with _$Ideal { } @freezed - /// SepaDebit data associated with the payment method - -class SepaDebit with _$SepaDebit { +abstract class SepaDebit with _$SepaDebit { @JsonSerializable(explicitToJson: true) const factory SepaDebit({ /// Two letter ISO code representing the country of the bank account. @@ -222,24 +204,8 @@ class SepaDebit with _$SepaDebit { } @freezed - -/// Sofort data associated with the payment method - -class Sofort with _$Sofort { - @JsonSerializable(explicitToJson: true) - const factory Sofort({ - /// Two letter ISO code representing the country of the bank account. - String? country, - }) = _Sofort; - - factory Sofort.fromJson(Map json) => _$SofortFromJson(json); -} - -@freezed - /// Upi data associated with the payment method. - -class Upi with _$Upi { +abstract class Upi with _$Upi { @JsonSerializable(explicitToJson: true) const factory Upi({ /// The customer's vpa. @@ -251,7 +217,7 @@ class Upi with _$Upi { /// Data associated with the payment method Us bank account. @freezed -class UsBankAccount with _$UsBankAccount { +abstract class UsBankAccount with _$UsBankAccount { @JsonSerializable(explicitToJson: true) const factory UsBankAccount({ /// Routing number of the bank account @@ -286,11 +252,7 @@ class UsBankAccount with _$UsBankAccount { _$UsBankAccountFromJson(json); } -enum UsBankAccountType { - Savings, - Checking, - Unknown, -} +enum UsBankAccountType { Savings, Checking, Unknown } /// Enum that specifies the payment type. enum PaymentMethodType { @@ -311,22 +273,19 @@ enum PaymentMethodType { Bancontact, Oxxo, PayPal, - Sofort, Upi, USBankAccount, RevolutPay, Klarna, // WeChatPay, - Unknown + Unknown, } @Freezed(unionKey: 'paymentMethodType') - /// Parameters that specify the desired configuration of a specific payment method. -class PaymentMethodParams with _$PaymentMethodParams { +abstract class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Card') - /// Config parameters for card payment method. const factory PaymentMethodParams.card({ /// Paymentmethod data for this paymentmethod. @@ -335,7 +294,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Card') - /// Config parameters for card with token payment method. const factory PaymentMethodParams.cardFromToken({ /// Paymentmethod data for this paymentmethod. @@ -344,7 +302,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Card') - /// Config parameters for card from method id payment method. const factory PaymentMethodParams.cardFromMethodId({ /// Payment method data object for card from payment method. @@ -353,7 +310,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Alipay') - /// Config parameters for Alipay card payment method. const factory PaymentMethodParams.alipay({ /// Paymentmethod data for this paymentmethod. @@ -362,7 +318,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('CashApp') - /// Config parameters for cashapp payment method. const factory PaymentMethodParams.cashAppPay({ /// Paymentmethod data for this paymentmethod. @@ -371,9 +326,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Ideal') - /// Config parameters for ideal payment method. - const factory PaymentMethodParams.ideal({ /// Paymentmethod data for this paymentmethod. required PaymentMethodDataIdeal paymentMethodData, @@ -381,7 +334,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('AuBecsDebit') - /// Config parameters for aubecs debit payment method. const factory PaymentMethodParams.aubecs({ /// Paymentmethod data for this paymentmethod. @@ -390,9 +342,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Bancontact') - /// Config parameters for bankcontact payment method. - const factory PaymentMethodParams.bancontact({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -400,9 +350,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Giropay') - /// Config parameters for giropay payment method. - const factory PaymentMethodParams.giroPay({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -410,9 +358,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Eps') - /// Config parameters for eps payment method. - const factory PaymentMethodParams.eps({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -420,7 +366,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Affirm') - /// Config parameters for affirm payment method. /// Shipping details are required most of the time. const factory PaymentMethodParams.affirm({ @@ -430,9 +375,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('GrabPay') - /// Config parameters for GrabPay payment method. - const factory PaymentMethodParams.grabPay({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -440,9 +383,7 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('P24') - /// Config parameters for P24 payment method. - const factory PaymentMethodParams.p24({ /// Paymentmethod data for this paymentmethod. required PaymentMethodData paymentMethodData, @@ -462,12 +403,6 @@ class PaymentMethodParams with _$PaymentMethodParams { required PaymentMethodDataSepa paymentMethodData, }) = _PaymentMethodParamsSepaDebit; - @JsonSerializable(explicitToJson: true) - @FreezedUnionValue('Sofort') - const factory PaymentMethodParams.sofort({ - required PaymentMethodDataSofort paymentMethodData, - }) = _PaymentMethodParamsSofort; - @JsonSerializable(explicitToJson: true) @FreezedUnionValue('AfterpayClearpay') const factory PaymentMethodParams.afterpayClearpay({ @@ -493,7 +428,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('PayPal') - /// Paypal is in private beta make sure to request access at Stripe to try it out. const factory PaymentMethodParams.payPal({ /// Paymentmethod data for this paymentmethod. @@ -502,7 +436,6 @@ class PaymentMethodParams with _$PaymentMethodParams { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('RevolutPay') - /// Paypal is in private beta make sure to request access at Stripe to try it out. const factory PaymentMethodParams.revolutPay({ /// Paymentmethod data for this paymentmethod. @@ -528,9 +461,8 @@ class PaymentMethodParams with _$PaymentMethodParams { } @freezed - /// Generic payment method data object that holds the billingdetails. -class PaymentMethodData with _$PaymentMethodData { +abstract class PaymentMethodData with _$PaymentMethodData { @JsonSerializable(explicitToJson: true) const factory PaymentMethodData({ /// Billing information. @@ -551,9 +483,9 @@ class PaymentMethodData with _$PaymentMethodData { } @freezed - /// Payment method data object for card with token payment method. -class PaymentMethodDataCardFromToken with _$PaymentMethodDataCardFromToken { +abstract class PaymentMethodDataCardFromToken + with _$PaymentMethodDataCardFromToken { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataCardFromToken({ /// Token. @@ -577,9 +509,9 @@ class PaymentMethodDataCardFromToken with _$PaymentMethodDataCardFromToken { } @freezed - /// Payment method data object for card from payment method. -class PaymentMethodDataCardFromMethod with _$PaymentMethodDataCardFromMethod { +abstract class PaymentMethodDataCardFromMethod + with _$PaymentMethodDataCardFromMethod { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataCardFromMethod({ /// Payment method id. @@ -606,9 +538,8 @@ class PaymentMethodDataCardFromMethod with _$PaymentMethodDataCardFromMethod { } @freezed - /// Payment method data object for ideal payment method. -class PaymentMethodDataIdeal with _$PaymentMethodDataIdeal { +abstract class PaymentMethodDataIdeal with _$PaymentMethodDataIdeal { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataIdeal({ /// The bank identifier code of the bank. @@ -635,9 +566,8 @@ class PaymentMethodDataIdeal with _$PaymentMethodDataIdeal { } @freezed - /// Payment method data object for Aubecs payment method. -class PaymentMethodDataAubecs with _$PaymentMethodDataAubecs { +abstract class PaymentMethodDataAubecs with _$PaymentMethodDataAubecs { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataAubecs({ /// form input details @@ -661,9 +591,8 @@ class PaymentMethodDataAubecs with _$PaymentMethodDataAubecs { } @freezed - /// Payment method data object for Fpx payment method. -class PaymentMethodDataFpx with _$PaymentMethodDataFpx { +abstract class PaymentMethodDataFpx with _$PaymentMethodDataFpx { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataFpx({ /// When set to true you can test offline payment. @@ -687,9 +616,8 @@ class PaymentMethodDataFpx with _$PaymentMethodDataFpx { } @freezed - /// Payment method data object for Sofort payment method. -class PaymentMethodDataSofort with _$PaymentMethodDataSofort { +abstract class PaymentMethodDataSofort with _$PaymentMethodDataSofort { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataSofort({ /// Country of the accountholder @@ -713,9 +641,8 @@ class PaymentMethodDataSofort with _$PaymentMethodDataSofort { } @freezed - /// Payment method data object for Sepa debit payment method. -class PaymentMethodDataSepa with _$PaymentMethodDataSepa { +abstract class PaymentMethodDataSepa with _$PaymentMethodDataSepa { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataSepa({ /// Iban number of the accountholder @@ -739,9 +666,8 @@ class PaymentMethodDataSepa with _$PaymentMethodDataSepa { } @freezed - /// Payment method data object for Afterpay / clearpay payment method. -class PaymentMethodDataAfterPay with _$PaymentMethodDataAfterPay { +abstract class PaymentMethodDataAfterPay with _$PaymentMethodDataAfterPay { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataAfterPay({ /// Billing information. @@ -763,7 +689,7 @@ class PaymentMethodDataAfterPay with _$PaymentMethodDataAfterPay { /// Payment method data object forUsbankaccount payment method. @freezed -class PaymentMethodDataUsBank with _$PaymentMethodDataUsBank { +abstract class PaymentMethodDataUsBank with _$PaymentMethodDataUsBank { @JsonSerializable(explicitToJson: true) const factory PaymentMethodDataUsBank({ /// The account number of the bank account. @@ -797,13 +723,17 @@ class PaymentMethodDataUsBank with _$PaymentMethodDataUsBank { } @freezed - /// Data object that holds the payment options for a payment method. -class PaymentMethodOptions with _$PaymentMethodOptions { +abstract class PaymentMethodOptions with _$PaymentMethodOptions { @JsonSerializable(explicitToJson: true) const factory PaymentMethodOptions({ /// Indicates whether or not you want to reuse this method for future payments. PaymentIntentsFutureUsage? setupFutureUsage, + + /// This is an experimental feature that may be removed at any time + /// A map of payment method types to setup_future_usage value. (e.g. card: 'OffSession') + @JsonKey(name: 'setup_future_usage_values') + Map? setupFutureUsageValues, }) = _PaymentMethodOptions; factory PaymentMethodOptions.fromJson(Map json) => @@ -811,9 +741,8 @@ class PaymentMethodOptions with _$PaymentMethodOptions { } @freezed - ///A Mandate is a record of the permission a customer has given you to debit their payment method. -class MandateData with _$MandateData { +abstract class MandateData with _$MandateData { @JsonSerializable(explicitToJson: true) const factory MandateData({ /// The type of mandate to create. @@ -825,9 +754,9 @@ class MandateData with _$MandateData { } @freezed - ///Information about the online mandate -class MandateDataCustomerAcceptance with _$MandateDataCustomerAcceptance { +abstract class MandateDataCustomerAcceptance + with _$MandateDataCustomerAcceptance { const factory MandateDataCustomerAcceptance({ /// Online data regarding the mandate. MandateDataOnlineData? ipAddress, @@ -854,17 +783,13 @@ class MandateDataCustomerAcceptance with _$MandateDataCustomerAcceptance { } Map toJson() { - return { - 'type': 'online', - 'online': ipAddress?.toJson(), - }; + return {'type': 'online', 'online': ipAddress?.toJson()}; } } @freezed - ///Information about the online mandate -class MandateDataOnlineData with _$MandateDataOnlineData { +abstract class MandateDataOnlineData with _$MandateDataOnlineData { @JsonSerializable(explicitToJson: true) const factory MandateDataOnlineData({ /// The ip address of the user. @@ -879,7 +804,7 @@ class MandateDataOnlineData with _$MandateDataOnlineData { } @freezed -class ThreeDSecureUsage with _$ThreeDSecureUsage { +abstract class ThreeDSecureUsage with _$ThreeDSecureUsage { /// Data associated with the 3ds usage. @JsonSerializable(explicitToJson: true) diff --git a/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart b/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart index bbd0bd213..5396cdbb6 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,14707 +9,10290 @@ part of 'payment_methods.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PaymentMethod _$PaymentMethodFromJson(Map json) { - return _PaymentMethod.fromJson(json); -} - /// @nodoc mixin _$PaymentMethod { - /// Unique identifier. - String get id => throw _privateConstructorUsedError; - /// Whether or not the object exists in livemode. - bool get livemode => throw _privateConstructorUsedError; +/// Unique identifier. + String get id;/// Whether or not the object exists in livemode. + bool get livemode;/// The type of the paymentmethod. + String get paymentMethodType;/// Billing information related to the payment method. + BillingDetails get billingDetails;/// Containing additional data in case paymentmethod type is card. +@JsonKey(name: 'Card') Card get card;/// Containing additional data in case paymentmethod type is sepa. +@JsonKey(name: 'SepaDebit') SepaDebit get sepaDebit;/// Containing additional data in case paymentmethod type is Bacs debit. +@JsonKey(name: 'BacsDebit') BacsDebit get bacsDebit;/// Containing additional data in case paymentmethod type is Aubecs debit. +@JsonKey(name: 'AuBecsDebit') AuBecsDebit get auBecsDebit;/// Containing additional data in case paymentmethod type is Ideal. +@JsonKey(name: 'Ideal') Ideal get ideal;/// Containing additional data in case paymentmethod type is FPX. +@JsonKey(name: 'Fpx') Fpx get fpx;/// Containing additional data in case paymentmethod type is UPI. +@JsonKey(name: 'Upi') Upi get upi;/// Containing additional data in case paymentmethod type is Us bank account. +@JsonKey(name: 'USBankAccount') UsBankAccount get usBankAccount;/// Id related to the customer to which this paymentmethod has been saved. + String? get customerId; +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith get copyWith => _$PaymentMethodCopyWithImpl(this as PaymentMethod, _$identity); - /// The type of the paymentmethod. - String get paymentMethodType => throw _privateConstructorUsedError; + /// Serializes this PaymentMethod to a JSON map. + Map toJson(); - /// Billing information related to the payment method. - BillingDetails get billingDetails => throw _privateConstructorUsedError; - /// Containing additional data in case paymentmethod type is card. - @JsonKey(name: 'Card') - Card get card => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethod&&(identical(other.id, id) || other.id == id)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.paymentMethodType, paymentMethodType) || other.paymentMethodType == paymentMethodType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.card, card) || other.card == card)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.bacsDebit, bacsDebit) || other.bacsDebit == bacsDebit)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.fpx, fpx) || other.fpx == fpx)&&(identical(other.upi, upi) || other.upi == upi)&&(identical(other.usBankAccount, usBankAccount) || other.usBankAccount == usBankAccount)&&(identical(other.customerId, customerId) || other.customerId == customerId)); +} - /// Containing additional data in case paymentmethod type is sepa. - @JsonKey(name: 'SepaDebit') - SepaDebit get sepaDebit => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,livemode,paymentMethodType,billingDetails,card,sepaDebit,bacsDebit,auBecsDebit,ideal,fpx,upi,usBankAccount,customerId); - /// Containing additional data in case paymentmethod type is Bacs debit. - @JsonKey(name: 'BacsDebit') - BacsDebit get bacsDebit => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethod(id: $id, livemode: $livemode, paymentMethodType: $paymentMethodType, billingDetails: $billingDetails, card: $card, sepaDebit: $sepaDebit, bacsDebit: $bacsDebit, auBecsDebit: $auBecsDebit, ideal: $ideal, fpx: $fpx, upi: $upi, usBankAccount: $usBankAccount, customerId: $customerId)'; +} - /// Containing additional data in case paymentmethod type is Aubecs debit. - @JsonKey(name: 'AuBecsDebit') - AuBecsDebit get auBecsDebit => throw _privateConstructorUsedError; - /// Containing additional data in case paymentmethod type is sofort. - @JsonKey(name: 'Sofort') - Sofort get sofort => throw _privateConstructorUsedError; +} - /// Containing additional data in case paymentmethod type is Ideal. - @JsonKey(name: 'Ideal') - Ideal get ideal => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $PaymentMethodCopyWith<$Res> { + factory $PaymentMethodCopyWith(PaymentMethod value, $Res Function(PaymentMethod) _then) = _$PaymentMethodCopyWithImpl; +@useResult +$Res call({ + String id, bool livemode, String paymentMethodType, BillingDetails billingDetails,@JsonKey(name: 'Card') Card card,@JsonKey(name: 'SepaDebit') SepaDebit sepaDebit,@JsonKey(name: 'BacsDebit') BacsDebit bacsDebit,@JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit,@JsonKey(name: 'Ideal') Ideal ideal,@JsonKey(name: 'Fpx') Fpx fpx,@JsonKey(name: 'Upi') Upi upi,@JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, String? customerId +}); - /// Containing additional data in case paymentmethod type is FPX. - @JsonKey(name: 'Fpx') - Fpx get fpx => throw _privateConstructorUsedError; - /// Containing additional data in case paymentmethod type is UPI. - @JsonKey(name: 'Upi') - Upi get upi => throw _privateConstructorUsedError; +$BillingDetailsCopyWith<$Res> get billingDetails;$CardCopyWith<$Res> get card;$SepaDebitCopyWith<$Res> get sepaDebit;$BacsDebitCopyWith<$Res> get bacsDebit;$AuBecsDebitCopyWith<$Res> get auBecsDebit;$IdealCopyWith<$Res> get ideal;$FpxCopyWith<$Res> get fpx;$UpiCopyWith<$Res> get upi;$UsBankAccountCopyWith<$Res> get usBankAccount; - /// Containing additional data in case paymentmethod type is Us bank account. - @JsonKey(name: 'USBankAccount') - UsBankAccount get usBankAccount => throw _privateConstructorUsedError; +} +/// @nodoc +class _$PaymentMethodCopyWithImpl<$Res> + implements $PaymentMethodCopyWith<$Res> { + _$PaymentMethodCopyWithImpl(this._self, this._then); + + final PaymentMethod _self; + final $Res Function(PaymentMethod) _then; + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? livemode = null,Object? paymentMethodType = null,Object? billingDetails = null,Object? card = null,Object? sepaDebit = null,Object? bacsDebit = null,Object? auBecsDebit = null,Object? ideal = null,Object? fpx = null,Object? upi = null,Object? usBankAccount = null,Object? customerId = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,paymentMethodType: null == paymentMethodType ? _self.paymentMethodType : paymentMethodType // ignore: cast_nullable_to_non_nullable +as String,billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails,card: null == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as Card,sepaDebit: null == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as SepaDebit,bacsDebit: null == bacsDebit ? _self.bacsDebit : bacsDebit // ignore: cast_nullable_to_non_nullable +as BacsDebit,auBecsDebit: null == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as AuBecsDebit,ideal: null == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Ideal,fpx: null == fpx ? _self.fpx : fpx // ignore: cast_nullable_to_non_nullable +as Fpx,upi: null == upi ? _self.upi : upi // ignore: cast_nullable_to_non_nullable +as Upi,usBankAccount: null == usBankAccount ? _self.usBankAccount : usBankAccount // ignore: cast_nullable_to_non_nullable +as UsBankAccount,customerId: freezed == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardCopyWith<$Res> get card { + + return $CardCopyWith<$Res>(_self.card, (value) { + return _then(_self.copyWith(card: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitCopyWith<$Res> get sepaDebit { + + return $SepaDebitCopyWith<$Res>(_self.sepaDebit, (value) { + return _then(_self.copyWith(sepaDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BacsDebitCopyWith<$Res> get bacsDebit { + + return $BacsDebitCopyWith<$Res>(_self.bacsDebit, (value) { + return _then(_self.copyWith(bacsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AuBecsDebitCopyWith<$Res> get auBecsDebit { + + return $AuBecsDebitCopyWith<$Res>(_self.auBecsDebit, (value) { + return _then(_self.copyWith(auBecsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealCopyWith<$Res> get ideal { + + return $IdealCopyWith<$Res>(_self.ideal, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FpxCopyWith<$Res> get fpx { + + return $FpxCopyWith<$Res>(_self.fpx, (value) { + return _then(_self.copyWith(fpx: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UpiCopyWith<$Res> get upi { + + return $UpiCopyWith<$Res>(_self.upi, (value) { + return _then(_self.copyWith(upi: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UsBankAccountCopyWith<$Res> get usBankAccount { + + return $UsBankAccountCopyWith<$Res>(_self.usBankAccount, (value) { + return _then(_self.copyWith(usBankAccount: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethod]. +extension PaymentMethodPatterns on PaymentMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethod value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethod value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, bool livemode, String paymentMethodType, BillingDetails billingDetails, @JsonKey(name: 'Card') Card card, @JsonKey(name: 'SepaDebit') SepaDebit sepaDebit, @JsonKey(name: 'BacsDebit') BacsDebit bacsDebit, @JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit, @JsonKey(name: 'Ideal') Ideal ideal, @JsonKey(name: 'Fpx') Fpx fpx, @JsonKey(name: 'Upi') Upi upi, @JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, String? customerId)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that.id,_that.livemode,_that.paymentMethodType,_that.billingDetails,_that.card,_that.sepaDebit,_that.bacsDebit,_that.auBecsDebit,_that.ideal,_that.fpx,_that.upi,_that.usBankAccount,_that.customerId);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, bool livemode, String paymentMethodType, BillingDetails billingDetails, @JsonKey(name: 'Card') Card card, @JsonKey(name: 'SepaDebit') SepaDebit sepaDebit, @JsonKey(name: 'BacsDebit') BacsDebit bacsDebit, @JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit, @JsonKey(name: 'Ideal') Ideal ideal, @JsonKey(name: 'Fpx') Fpx fpx, @JsonKey(name: 'Upi') Upi upi, @JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, String? customerId) $default,) {final _that = this; +switch (_that) { +case _PaymentMethod(): +return $default(_that.id,_that.livemode,_that.paymentMethodType,_that.billingDetails,_that.card,_that.sepaDebit,_that.bacsDebit,_that.auBecsDebit,_that.ideal,_that.fpx,_that.upi,_that.usBankAccount,_that.customerId);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Id related to the customer to which this paymentmethod has been saved. - String? get customerId => throw _privateConstructorUsedError; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, bool livemode, String paymentMethodType, BillingDetails billingDetails, @JsonKey(name: 'Card') Card card, @JsonKey(name: 'SepaDebit') SepaDebit sepaDebit, @JsonKey(name: 'BacsDebit') BacsDebit bacsDebit, @JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit, @JsonKey(name: 'Ideal') Ideal ideal, @JsonKey(name: 'Fpx') Fpx fpx, @JsonKey(name: 'Upi') Upi upi, @JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, String? customerId)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethod() when $default != null: +return $default(_that.id,_that.livemode,_that.paymentMethodType,_that.billingDetails,_that.card,_that.sepaDebit,_that.bacsDebit,_that.auBecsDebit,_that.ideal,_that.fpx,_that.upi,_that.usBankAccount,_that.customerId);case _: + return null; - /// Serializes this PaymentMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PaymentMethodCopyWith<$Res> { - factory $PaymentMethodCopyWith( - PaymentMethod value, $Res Function(PaymentMethod) then) = - _$PaymentMethodCopyWithImpl<$Res, PaymentMethod>; - @useResult - $Res call( - {String id, - bool livemode, - String paymentMethodType, - BillingDetails billingDetails, - @JsonKey(name: 'Card') Card card, - @JsonKey(name: 'SepaDebit') SepaDebit sepaDebit, - @JsonKey(name: 'BacsDebit') BacsDebit bacsDebit, - @JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit, - @JsonKey(name: 'Sofort') Sofort sofort, - @JsonKey(name: 'Ideal') Ideal ideal, - @JsonKey(name: 'Fpx') Fpx fpx, - @JsonKey(name: 'Upi') Upi upi, - @JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, - String? customerId}); - - $BillingDetailsCopyWith<$Res> get billingDetails; - $CardCopyWith<$Res> get card; - $SepaDebitCopyWith<$Res> get sepaDebit; - $BacsDebitCopyWith<$Res> get bacsDebit; - $AuBecsDebitCopyWith<$Res> get auBecsDebit; - $SofortCopyWith<$Res> get sofort; - $IdealCopyWith<$Res> get ideal; - $FpxCopyWith<$Res> get fpx; - $UpiCopyWith<$Res> get upi; - $UsBankAccountCopyWith<$Res> get usBankAccount; -} - -/// @nodoc -class _$PaymentMethodCopyWithImpl<$Res, $Val extends PaymentMethod> - implements $PaymentMethodCopyWith<$Res> { - _$PaymentMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? livemode = null, - Object? paymentMethodType = null, - Object? billingDetails = null, - Object? card = null, - Object? sepaDebit = null, - Object? bacsDebit = null, - Object? auBecsDebit = null, - Object? sofort = null, - Object? ideal = null, - Object? fpx = null, - Object? upi = null, - Object? usBankAccount = null, - Object? customerId = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - paymentMethodType: null == paymentMethodType - ? _value.paymentMethodType - : paymentMethodType // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - card: null == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as Card, - sepaDebit: null == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as SepaDebit, - bacsDebit: null == bacsDebit - ? _value.bacsDebit - : bacsDebit // ignore: cast_nullable_to_non_nullable - as BacsDebit, - auBecsDebit: null == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as AuBecsDebit, - sofort: null == sofort - ? _value.sofort - : sofort // ignore: cast_nullable_to_non_nullable - as Sofort, - ideal: null == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Ideal, - fpx: null == fpx - ? _value.fpx - : fpx // ignore: cast_nullable_to_non_nullable - as Fpx, - upi: null == upi - ? _value.upi - : upi // ignore: cast_nullable_to_non_nullable - as Upi, - usBankAccount: null == usBankAccount - ? _value.usBankAccount - : usBankAccount // ignore: cast_nullable_to_non_nullable - as UsBankAccount, - customerId: freezed == customerId - ? _value.customerId - : customerId // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +} +} - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res> get billingDetails { - return $BillingDetailsCopyWith<$Res>(_value.billingDetails, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +} - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardCopyWith<$Res> get card { - return $CardCopyWith<$Res>(_value.card, (value) { - return _then(_value.copyWith(card: value) as $Val); - }); - } +/// @nodoc - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SepaDebitCopyWith<$Res> get sepaDebit { - return $SepaDebitCopyWith<$Res>(_value.sepaDebit, (value) { - return _then(_value.copyWith(sepaDebit: value) as $Val); - }); - } +@JsonSerializable(explicitToJson: true) +class _PaymentMethod implements PaymentMethod { + const _PaymentMethod({required this.id, required this.livemode, required this.paymentMethodType, required this.billingDetails, @JsonKey(name: 'Card') required this.card, @JsonKey(name: 'SepaDebit') required this.sepaDebit, @JsonKey(name: 'BacsDebit') required this.bacsDebit, @JsonKey(name: 'AuBecsDebit') required this.auBecsDebit, @JsonKey(name: 'Ideal') required this.ideal, @JsonKey(name: 'Fpx') required this.fpx, @JsonKey(name: 'Upi') required this.upi, @JsonKey(name: 'USBankAccount') required this.usBankAccount, this.customerId}); + factory _PaymentMethod.fromJson(Map json) => _$PaymentMethodFromJson(json); + +/// Unique identifier. +@override final String id; +/// Whether or not the object exists in livemode. +@override final bool livemode; +/// The type of the paymentmethod. +@override final String paymentMethodType; +/// Billing information related to the payment method. +@override final BillingDetails billingDetails; +/// Containing additional data in case paymentmethod type is card. +@override@JsonKey(name: 'Card') final Card card; +/// Containing additional data in case paymentmethod type is sepa. +@override@JsonKey(name: 'SepaDebit') final SepaDebit sepaDebit; +/// Containing additional data in case paymentmethod type is Bacs debit. +@override@JsonKey(name: 'BacsDebit') final BacsDebit bacsDebit; +/// Containing additional data in case paymentmethod type is Aubecs debit. +@override@JsonKey(name: 'AuBecsDebit') final AuBecsDebit auBecsDebit; +/// Containing additional data in case paymentmethod type is Ideal. +@override@JsonKey(name: 'Ideal') final Ideal ideal; +/// Containing additional data in case paymentmethod type is FPX. +@override@JsonKey(name: 'Fpx') final Fpx fpx; +/// Containing additional data in case paymentmethod type is UPI. +@override@JsonKey(name: 'Upi') final Upi upi; +/// Containing additional data in case paymentmethod type is Us bank account. +@override@JsonKey(name: 'USBankAccount') final UsBankAccount usBankAccount; +/// Id related to the customer to which this paymentmethod has been saved. +@override final String? customerId; + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodCopyWith<_PaymentMethod> get copyWith => __$PaymentMethodCopyWithImpl<_PaymentMethod>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethod&&(identical(other.id, id) || other.id == id)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.paymentMethodType, paymentMethodType) || other.paymentMethodType == paymentMethodType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.card, card) || other.card == card)&&(identical(other.sepaDebit, sepaDebit) || other.sepaDebit == sepaDebit)&&(identical(other.bacsDebit, bacsDebit) || other.bacsDebit == bacsDebit)&&(identical(other.auBecsDebit, auBecsDebit) || other.auBecsDebit == auBecsDebit)&&(identical(other.ideal, ideal) || other.ideal == ideal)&&(identical(other.fpx, fpx) || other.fpx == fpx)&&(identical(other.upi, upi) || other.upi == upi)&&(identical(other.usBankAccount, usBankAccount) || other.usBankAccount == usBankAccount)&&(identical(other.customerId, customerId) || other.customerId == customerId)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,livemode,paymentMethodType,billingDetails,card,sepaDebit,bacsDebit,auBecsDebit,ideal,fpx,upi,usBankAccount,customerId); + +@override +String toString() { + return 'PaymentMethod(id: $id, livemode: $livemode, paymentMethodType: $paymentMethodType, billingDetails: $billingDetails, card: $card, sepaDebit: $sepaDebit, bacsDebit: $bacsDebit, auBecsDebit: $auBecsDebit, ideal: $ideal, fpx: $fpx, upi: $upi, usBankAccount: $usBankAccount, customerId: $customerId)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodCopyWith<$Res> implements $PaymentMethodCopyWith<$Res> { + factory _$PaymentMethodCopyWith(_PaymentMethod value, $Res Function(_PaymentMethod) _then) = __$PaymentMethodCopyWithImpl; +@override @useResult +$Res call({ + String id, bool livemode, String paymentMethodType, BillingDetails billingDetails,@JsonKey(name: 'Card') Card card,@JsonKey(name: 'SepaDebit') SepaDebit sepaDebit,@JsonKey(name: 'BacsDebit') BacsDebit bacsDebit,@JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit,@JsonKey(name: 'Ideal') Ideal ideal,@JsonKey(name: 'Fpx') Fpx fpx,@JsonKey(name: 'Upi') Upi upi,@JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, String? customerId +}); + + +@override $BillingDetailsCopyWith<$Res> get billingDetails;@override $CardCopyWith<$Res> get card;@override $SepaDebitCopyWith<$Res> get sepaDebit;@override $BacsDebitCopyWith<$Res> get bacsDebit;@override $AuBecsDebitCopyWith<$Res> get auBecsDebit;@override $IdealCopyWith<$Res> get ideal;@override $FpxCopyWith<$Res> get fpx;@override $UpiCopyWith<$Res> get upi;@override $UsBankAccountCopyWith<$Res> get usBankAccount; + +} +/// @nodoc +class __$PaymentMethodCopyWithImpl<$Res> + implements _$PaymentMethodCopyWith<$Res> { + __$PaymentMethodCopyWithImpl(this._self, this._then); + + final _PaymentMethod _self; + final $Res Function(_PaymentMethod) _then; + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? livemode = null,Object? paymentMethodType = null,Object? billingDetails = null,Object? card = null,Object? sepaDebit = null,Object? bacsDebit = null,Object? auBecsDebit = null,Object? ideal = null,Object? fpx = null,Object? upi = null,Object? usBankAccount = null,Object? customerId = freezed,}) { + return _then(_PaymentMethod( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,paymentMethodType: null == paymentMethodType ? _self.paymentMethodType : paymentMethodType // ignore: cast_nullable_to_non_nullable +as String,billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails,card: null == card ? _self.card : card // ignore: cast_nullable_to_non_nullable +as Card,sepaDebit: null == sepaDebit ? _self.sepaDebit : sepaDebit // ignore: cast_nullable_to_non_nullable +as SepaDebit,bacsDebit: null == bacsDebit ? _self.bacsDebit : bacsDebit // ignore: cast_nullable_to_non_nullable +as BacsDebit,auBecsDebit: null == auBecsDebit ? _self.auBecsDebit : auBecsDebit // ignore: cast_nullable_to_non_nullable +as AuBecsDebit,ideal: null == ideal ? _self.ideal : ideal // ignore: cast_nullable_to_non_nullable +as Ideal,fpx: null == fpx ? _self.fpx : fpx // ignore: cast_nullable_to_non_nullable +as Fpx,upi: null == upi ? _self.upi : upi // ignore: cast_nullable_to_non_nullable +as Upi,usBankAccount: null == usBankAccount ? _self.usBankAccount : usBankAccount // ignore: cast_nullable_to_non_nullable +as UsBankAccount,customerId: freezed == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardCopyWith<$Res> get card { + + return $CardCopyWith<$Res>(_self.card, (value) { + return _then(_self.copyWith(card: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SepaDebitCopyWith<$Res> get sepaDebit { + + return $SepaDebitCopyWith<$Res>(_self.sepaDebit, (value) { + return _then(_self.copyWith(sepaDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BacsDebitCopyWith<$Res> get bacsDebit { + + return $BacsDebitCopyWith<$Res>(_self.bacsDebit, (value) { + return _then(_self.copyWith(bacsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AuBecsDebitCopyWith<$Res> get auBecsDebit { + + return $AuBecsDebitCopyWith<$Res>(_self.auBecsDebit, (value) { + return _then(_self.copyWith(auBecsDebit: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IdealCopyWith<$Res> get ideal { + + return $IdealCopyWith<$Res>(_self.ideal, (value) { + return _then(_self.copyWith(ideal: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FpxCopyWith<$Res> get fpx { + + return $FpxCopyWith<$Res>(_self.fpx, (value) { + return _then(_self.copyWith(fpx: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UpiCopyWith<$Res> get upi { + + return $UpiCopyWith<$Res>(_self.upi, (value) { + return _then(_self.copyWith(upi: value)); + }); +}/// Create a copy of PaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UsBankAccountCopyWith<$Res> get usBankAccount { + + return $UsBankAccountCopyWith<$Res>(_self.usBankAccount, (value) { + return _then(_self.copyWith(usBankAccount: value)); + }); +} +} - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BacsDebitCopyWith<$Res> get bacsDebit { - return $BacsDebitCopyWith<$Res>(_value.bacsDebit, (value) { - return _then(_value.copyWith(bacsDebit: value) as $Val); - }); - } - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AuBecsDebitCopyWith<$Res> get auBecsDebit { - return $AuBecsDebitCopyWith<$Res>(_value.auBecsDebit, (value) { - return _then(_value.copyWith(auBecsDebit: value) as $Val); - }); - } +/// @nodoc +mixin _$BillingDetails { - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $SofortCopyWith<$Res> get sofort { - return $SofortCopyWith<$Res>(_value.sofort, (value) { - return _then(_value.copyWith(sofort: value) as $Val); - }); - } +/// Email address. + String? get email;/// Billing address. + Address? get address;/// Billing phone number. + String? get phone;/// Full name. + String? get name; +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith get copyWith => _$BillingDetailsCopyWithImpl(this as BillingDetails, _$identity); - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $IdealCopyWith<$Res> get ideal { - return $IdealCopyWith<$Res>(_value.ideal, (value) { - return _then(_value.copyWith(ideal: value) as $Val); - }); - } + /// Serializes this BillingDetails to a JSON map. + Map toJson(); - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $FpxCopyWith<$Res> get fpx { - return $FpxCopyWith<$Res>(_value.fpx, (value) { - return _then(_value.copyWith(fpx: value) as $Val); - }); - } - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $UpiCopyWith<$Res> get upi { - return $UpiCopyWith<$Res>(_value.upi, (value) { - return _then(_value.copyWith(upi: value) as $Val); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BillingDetails&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.name, name) || other.name == name)); +} - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $UsBankAccountCopyWith<$Res> get usBankAccount { - return $UsBankAccountCopyWith<$Res>(_value.usBankAccount, (value) { - return _then(_value.copyWith(usBankAccount: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,email,address,phone,name); + +@override +String toString() { + return 'BillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; } -/// @nodoc -abstract class _$$PaymentMethodImplCopyWith<$Res> - implements $PaymentMethodCopyWith<$Res> { - factory _$$PaymentMethodImplCopyWith( - _$PaymentMethodImpl value, $Res Function(_$PaymentMethodImpl) then) = - __$$PaymentMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - bool livemode, - String paymentMethodType, - BillingDetails billingDetails, - @JsonKey(name: 'Card') Card card, - @JsonKey(name: 'SepaDebit') SepaDebit sepaDebit, - @JsonKey(name: 'BacsDebit') BacsDebit bacsDebit, - @JsonKey(name: 'AuBecsDebit') AuBecsDebit auBecsDebit, - @JsonKey(name: 'Sofort') Sofort sofort, - @JsonKey(name: 'Ideal') Ideal ideal, - @JsonKey(name: 'Fpx') Fpx fpx, - @JsonKey(name: 'Upi') Upi upi, - @JsonKey(name: 'USBankAccount') UsBankAccount usBankAccount, - String? customerId}); - - @override - $BillingDetailsCopyWith<$Res> get billingDetails; - @override - $CardCopyWith<$Res> get card; - @override - $SepaDebitCopyWith<$Res> get sepaDebit; - @override - $BacsDebitCopyWith<$Res> get bacsDebit; - @override - $AuBecsDebitCopyWith<$Res> get auBecsDebit; - @override - $SofortCopyWith<$Res> get sofort; - @override - $IdealCopyWith<$Res> get ideal; - @override - $FpxCopyWith<$Res> get fpx; - @override - $UpiCopyWith<$Res> get upi; - @override - $UsBankAccountCopyWith<$Res> get usBankAccount; -} - -/// @nodoc -class __$$PaymentMethodImplCopyWithImpl<$Res> - extends _$PaymentMethodCopyWithImpl<$Res, _$PaymentMethodImpl> - implements _$$PaymentMethodImplCopyWith<$Res> { - __$$PaymentMethodImplCopyWithImpl( - _$PaymentMethodImpl _value, $Res Function(_$PaymentMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? livemode = null, - Object? paymentMethodType = null, - Object? billingDetails = null, - Object? card = null, - Object? sepaDebit = null, - Object? bacsDebit = null, - Object? auBecsDebit = null, - Object? sofort = null, - Object? ideal = null, - Object? fpx = null, - Object? upi = null, - Object? usBankAccount = null, - Object? customerId = freezed, - }) { - return _then(_$PaymentMethodImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - paymentMethodType: null == paymentMethodType - ? _value.paymentMethodType - : paymentMethodType // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - card: null == card - ? _value.card - : card // ignore: cast_nullable_to_non_nullable - as Card, - sepaDebit: null == sepaDebit - ? _value.sepaDebit - : sepaDebit // ignore: cast_nullable_to_non_nullable - as SepaDebit, - bacsDebit: null == bacsDebit - ? _value.bacsDebit - : bacsDebit // ignore: cast_nullable_to_non_nullable - as BacsDebit, - auBecsDebit: null == auBecsDebit - ? _value.auBecsDebit - : auBecsDebit // ignore: cast_nullable_to_non_nullable - as AuBecsDebit, - sofort: null == sofort - ? _value.sofort - : sofort // ignore: cast_nullable_to_non_nullable - as Sofort, - ideal: null == ideal - ? _value.ideal - : ideal // ignore: cast_nullable_to_non_nullable - as Ideal, - fpx: null == fpx - ? _value.fpx - : fpx // ignore: cast_nullable_to_non_nullable - as Fpx, - upi: null == upi - ? _value.upi - : upi // ignore: cast_nullable_to_non_nullable - as Upi, - usBankAccount: null == usBankAccount - ? _value.usBankAccount - : usBankAccount // ignore: cast_nullable_to_non_nullable - as UsBankAccount, - customerId: freezed == customerId - ? _value.customerId - : customerId // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc +abstract mixin class $BillingDetailsCopyWith<$Res> { + factory $BillingDetailsCopyWith(BillingDetails value, $Res Function(BillingDetails) _then) = _$BillingDetailsCopyWithImpl; +@useResult +$Res call({ + String? email, Address? address, String? phone, String? name +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodImpl implements _PaymentMethod { - const _$PaymentMethodImpl( - {required this.id, - required this.livemode, - required this.paymentMethodType, - required this.billingDetails, - @JsonKey(name: 'Card') required this.card, - @JsonKey(name: 'SepaDebit') required this.sepaDebit, - @JsonKey(name: 'BacsDebit') required this.bacsDebit, - @JsonKey(name: 'AuBecsDebit') required this.auBecsDebit, - @JsonKey(name: 'Sofort') required this.sofort, - @JsonKey(name: 'Ideal') required this.ideal, - @JsonKey(name: 'Fpx') required this.fpx, - @JsonKey(name: 'Upi') required this.upi, - @JsonKey(name: 'USBankAccount') required this.usBankAccount, - this.customerId}); - - factory _$PaymentMethodImpl.fromJson(Map json) => - _$$PaymentMethodImplFromJson(json); - - /// Unique identifier. - @override - final String id; - - /// Whether or not the object exists in livemode. - @override - final bool livemode; - - /// The type of the paymentmethod. - @override - final String paymentMethodType; - - /// Billing information related to the payment method. - @override - final BillingDetails billingDetails; - - /// Containing additional data in case paymentmethod type is card. - @override - @JsonKey(name: 'Card') - final Card card; - - /// Containing additional data in case paymentmethod type is sepa. - @override - @JsonKey(name: 'SepaDebit') - final SepaDebit sepaDebit; - - /// Containing additional data in case paymentmethod type is Bacs debit. - @override - @JsonKey(name: 'BacsDebit') - final BacsDebit bacsDebit; - - /// Containing additional data in case paymentmethod type is Aubecs debit. - @override - @JsonKey(name: 'AuBecsDebit') - final AuBecsDebit auBecsDebit; - - /// Containing additional data in case paymentmethod type is sofort. - @override - @JsonKey(name: 'Sofort') - final Sofort sofort; - - /// Containing additional data in case paymentmethod type is Ideal. - @override - @JsonKey(name: 'Ideal') - final Ideal ideal; - - /// Containing additional data in case paymentmethod type is FPX. - @override - @JsonKey(name: 'Fpx') - final Fpx fpx; - - /// Containing additional data in case paymentmethod type is UPI. - @override - @JsonKey(name: 'Upi') - final Upi upi; - - /// Containing additional data in case paymentmethod type is Us bank account. - @override - @JsonKey(name: 'USBankAccount') - final UsBankAccount usBankAccount; - - /// Id related to the customer to which this paymentmethod has been saved. - @override - final String? customerId; - - @override - String toString() { - return 'PaymentMethod(id: $id, livemode: $livemode, paymentMethodType: $paymentMethodType, billingDetails: $billingDetails, card: $card, sepaDebit: $sepaDebit, bacsDebit: $bacsDebit, auBecsDebit: $auBecsDebit, sofort: $sofort, ideal: $ideal, fpx: $fpx, upi: $upi, usBankAccount: $usBankAccount, customerId: $customerId)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.paymentMethodType, paymentMethodType) || - other.paymentMethodType == paymentMethodType) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.card, card) || other.card == card) && - (identical(other.sepaDebit, sepaDebit) || - other.sepaDebit == sepaDebit) && - (identical(other.bacsDebit, bacsDebit) || - other.bacsDebit == bacsDebit) && - (identical(other.auBecsDebit, auBecsDebit) || - other.auBecsDebit == auBecsDebit) && - (identical(other.sofort, sofort) || other.sofort == sofort) && - (identical(other.ideal, ideal) || other.ideal == ideal) && - (identical(other.fpx, fpx) || other.fpx == fpx) && - (identical(other.upi, upi) || other.upi == upi) && - (identical(other.usBankAccount, usBankAccount) || - other.usBankAccount == usBankAccount) && - (identical(other.customerId, customerId) || - other.customerId == customerId)); - } +$AddressCopyWith<$Res>? get address; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - livemode, - paymentMethodType, - billingDetails, - card, - sepaDebit, - bacsDebit, - auBecsDebit, - sofort, - ideal, - fpx, - upi, - usBankAccount, - customerId); - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodImplCopyWith<_$PaymentMethodImpl> get copyWith => - __$$PaymentMethodImplCopyWithImpl<_$PaymentMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodImplToJson( - this, - ); - } +} +/// @nodoc +class _$BillingDetailsCopyWithImpl<$Res> + implements $BillingDetailsCopyWith<$Res> { + _$BillingDetailsCopyWithImpl(this._self, this._then); + + final BillingDetails _self; + final $Res Function(BillingDetails) _then; + +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? email = freezed,Object? address = freezed,Object? phone = freezed,Object? name = freezed,}) { + return _then(_self.copyWith( +email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; + } + + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [BillingDetails]. +extension BillingDetailsPatterns on BillingDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BillingDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BillingDetails value) $default,){ +final _that = this; +switch (_that) { +case _BillingDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BillingDetails value)? $default,){ +final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? email, Address? address, String? phone, String? name)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? email, Address? address, String? phone, String? name) $default,) {final _that = this; +switch (_that) { +case _BillingDetails(): +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? email, Address? address, String? phone, String? name)? $default,) {final _that = this; +switch (_that) { +case _BillingDetails() when $default != null: +return $default(_that.email,_that.address,_that.phone,_that.name);case _: + return null; + +} } -abstract class _PaymentMethod implements PaymentMethod { - const factory _PaymentMethod( - {required final String id, - required final bool livemode, - required final String paymentMethodType, - required final BillingDetails billingDetails, - @JsonKey(name: 'Card') required final Card card, - @JsonKey(name: 'SepaDebit') required final SepaDebit sepaDebit, - @JsonKey(name: 'BacsDebit') required final BacsDebit bacsDebit, - @JsonKey(name: 'AuBecsDebit') required final AuBecsDebit auBecsDebit, - @JsonKey(name: 'Sofort') required final Sofort sofort, - @JsonKey(name: 'Ideal') required final Ideal ideal, - @JsonKey(name: 'Fpx') required final Fpx fpx, - @JsonKey(name: 'Upi') required final Upi upi, - @JsonKey(name: 'USBankAccount') - required final UsBankAccount usBankAccount, - final String? customerId}) = _$PaymentMethodImpl; - - factory _PaymentMethod.fromJson(Map json) = - _$PaymentMethodImpl.fromJson; - - /// Unique identifier. - @override - String get id; - - /// Whether or not the object exists in livemode. - @override - bool get livemode; - - /// The type of the paymentmethod. - @override - String get paymentMethodType; - - /// Billing information related to the payment method. - @override - BillingDetails get billingDetails; - - /// Containing additional data in case paymentmethod type is card. - @override - @JsonKey(name: 'Card') - Card get card; - - /// Containing additional data in case paymentmethod type is sepa. - @override - @JsonKey(name: 'SepaDebit') - SepaDebit get sepaDebit; - - /// Containing additional data in case paymentmethod type is Bacs debit. - @override - @JsonKey(name: 'BacsDebit') - BacsDebit get bacsDebit; - - /// Containing additional data in case paymentmethod type is Aubecs debit. - @override - @JsonKey(name: 'AuBecsDebit') - AuBecsDebit get auBecsDebit; - - /// Containing additional data in case paymentmethod type is sofort. - @override - @JsonKey(name: 'Sofort') - Sofort get sofort; - - /// Containing additional data in case paymentmethod type is Ideal. - @override - @JsonKey(name: 'Ideal') - Ideal get ideal; - - /// Containing additional data in case paymentmethod type is FPX. - @override - @JsonKey(name: 'Fpx') - Fpx get fpx; - - /// Containing additional data in case paymentmethod type is UPI. - @override - @JsonKey(name: 'Upi') - Upi get upi; - - /// Containing additional data in case paymentmethod type is Us bank account. - @override - @JsonKey(name: 'USBankAccount') - UsBankAccount get usBankAccount; - - /// Id related to the customer to which this paymentmethod has been saved. - @override - String? get customerId; - - /// Create a copy of PaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodImplCopyWith<_$PaymentMethodImpl> get copyWith => - throw _privateConstructorUsedError; -} - -BillingDetails _$BillingDetailsFromJson(Map json) { - return _BillingDetails.fromJson(json); } /// @nodoc -mixin _$BillingDetails { - /// Email address. - String? get email => throw _privateConstructorUsedError; - - /// Billing address. - Address? get address => throw _privateConstructorUsedError; - /// Billing phone number. - String? get phone => throw _privateConstructorUsedError; +@JsonSerializable() +class _BillingDetails implements BillingDetails { + const _BillingDetails({this.email, this.address, this.phone, this.name}); + factory _BillingDetails.fromJson(Map json) => _$BillingDetailsFromJson(json); - /// Full name. - String? get name => throw _privateConstructorUsedError; +/// Email address. +@override final String? email; +/// Billing address. +@override final Address? address; +/// Billing phone number. +@override final String? phone; +/// Full name. +@override final String? name; - /// Serializes this BillingDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BillingDetailsCopyWith<_BillingDetails> get copyWith => __$BillingDetailsCopyWithImpl<_BillingDetails>(this, _$identity); - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BillingDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +Map toJson() { + return _$BillingDetailsToJson(this, ); } -/// @nodoc -abstract class $BillingDetailsCopyWith<$Res> { - factory $BillingDetailsCopyWith( - BillingDetails value, $Res Function(BillingDetails) then) = - _$BillingDetailsCopyWithImpl<$Res, BillingDetails>; - @useResult - $Res call({String? email, Address? address, String? phone, String? name}); - - $AddressCopyWith<$Res>? get address; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BillingDetails&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.name, name) || other.name == name)); } -/// @nodoc -class _$BillingDetailsCopyWithImpl<$Res, $Val extends BillingDetails> - implements $BillingDetailsCopyWith<$Res> { - _$BillingDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? email = freezed, - Object? address = freezed, - Object? phone = freezed, - Object? name = freezed, - }) { - return _then(_value.copyWith( - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,email,address,phone,name); - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddressCopyWith<$Res>? get address { - if (_value.address == null) { - return null; - } - - return $AddressCopyWith<$Res>(_value.address!, (value) { - return _then(_value.copyWith(address: value) as $Val); - }); - } +@override +String toString() { + return 'BillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; } -/// @nodoc -abstract class _$$BillingDetailsImplCopyWith<$Res> - implements $BillingDetailsCopyWith<$Res> { - factory _$$BillingDetailsImplCopyWith(_$BillingDetailsImpl value, - $Res Function(_$BillingDetailsImpl) then) = - __$$BillingDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? email, Address? address, String? phone, String? name}); - - @override - $AddressCopyWith<$Res>? get address; -} - -/// @nodoc -class __$$BillingDetailsImplCopyWithImpl<$Res> - extends _$BillingDetailsCopyWithImpl<$Res, _$BillingDetailsImpl> - implements _$$BillingDetailsImplCopyWith<$Res> { - __$$BillingDetailsImplCopyWithImpl( - _$BillingDetailsImpl _value, $Res Function(_$BillingDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? email = freezed, - Object? address = freezed, - Object? phone = freezed, - Object? name = freezed, - }) { - return _then(_$BillingDetailsImpl( - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as String?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as Address?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc +abstract mixin class _$BillingDetailsCopyWith<$Res> implements $BillingDetailsCopyWith<$Res> { + factory _$BillingDetailsCopyWith(_BillingDetails value, $Res Function(_BillingDetails) _then) = __$BillingDetailsCopyWithImpl; +@override @useResult +$Res call({ + String? email, Address? address, String? phone, String? name +}); -@JsonSerializable() -class _$BillingDetailsImpl implements _BillingDetails { - const _$BillingDetailsImpl({this.email, this.address, this.phone, this.name}); - - factory _$BillingDetailsImpl.fromJson(Map json) => - _$$BillingDetailsImplFromJson(json); - /// Email address. - @override - final String? email; +@override $AddressCopyWith<$Res>? get address; - /// Billing address. - @override - final Address? address; - - /// Billing phone number. - @override - final String? phone; +} +/// @nodoc +class __$BillingDetailsCopyWithImpl<$Res> + implements _$BillingDetailsCopyWith<$Res> { + __$BillingDetailsCopyWithImpl(this._self, this._then); - /// Full name. - @override - final String? name; + final _BillingDetails _self; + final $Res Function(_BillingDetails) _then; - @override - String toString() { - return 'BillingDetails(email: $email, address: $address, phone: $phone, name: $name)'; - } +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? email = freezed,Object? address = freezed,Object? phone = freezed,Object? name = freezed,}) { + return _then(_BillingDetails( +email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as String?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as Address?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BillingDetailsImpl && - (identical(other.email, email) || other.email == email) && - (identical(other.address, address) || other.address == address) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.name, name) || other.name == name)); +/// Create a copy of BillingDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddressCopyWith<$Res>? get address { + if (_self.address == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, email, address, phone, name); - - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BillingDetailsImplCopyWith<_$BillingDetailsImpl> get copyWith => - __$$BillingDetailsImplCopyWithImpl<_$BillingDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$BillingDetailsImplToJson( - this, - ); - } + return $AddressCopyWith<$Res>(_self.address!, (value) { + return _then(_self.copyWith(address: value)); + }); } +} + -abstract class _BillingDetails implements BillingDetails { - const factory _BillingDetails( - {final String? email, - final Address? address, - final String? phone, - final String? name}) = _$BillingDetailsImpl; +/// @nodoc +mixin _$AuBecsDebit { - factory _BillingDetails.fromJson(Map json) = - _$BillingDetailsImpl.fromJson; +/// Unique identifier for the bankaccount. + String? get fingerprint;/// Last 4 digits of the bankaccount number. + String? get last4;/// Six digit number identifying the bank or branch for this account. + String? get bsbNumber; +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AuBecsDebitCopyWith get copyWith => _$AuBecsDebitCopyWithImpl(this as AuBecsDebit, _$identity); - /// Email address. - @override - String? get email; + /// Serializes this AuBecsDebit to a JSON map. + Map toJson(); - /// Billing address. - @override - Address? get address; - /// Billing phone number. - @override - String? get phone; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AuBecsDebit&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.bsbNumber, bsbNumber) || other.bsbNumber == bsbNumber)); +} - /// Full name. - @override - String? get name; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fingerprint,last4,bsbNumber); - /// Create a copy of BillingDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BillingDetailsImplCopyWith<_$BillingDetailsImpl> get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'AuBecsDebit(fingerprint: $fingerprint, last4: $last4, bsbNumber: $bsbNumber)'; } -AuBecsDebit _$AuBecsDebitFromJson(Map json) { - return _AuBecsDebit.fromJson(json); + } /// @nodoc -mixin _$AuBecsDebit { - /// Unique identifier for the bankaccount. - String? get fingerprint => throw _privateConstructorUsedError; +abstract mixin class $AuBecsDebitCopyWith<$Res> { + factory $AuBecsDebitCopyWith(AuBecsDebit value, $Res Function(AuBecsDebit) _then) = _$AuBecsDebitCopyWithImpl; +@useResult +$Res call({ + String? fingerprint, String? last4, String? bsbNumber +}); - /// Last 4 digits of the bankaccount number. - String? get last4 => throw _privateConstructorUsedError; - /// Six digit number identifying the bank or branch for this account. - String? get bsbNumber => throw _privateConstructorUsedError; - - /// Serializes this AuBecsDebit to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AuBecsDebitCopyWith get copyWith => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $AuBecsDebitCopyWith<$Res> { - factory $AuBecsDebitCopyWith( - AuBecsDebit value, $Res Function(AuBecsDebit) then) = - _$AuBecsDebitCopyWithImpl<$Res, AuBecsDebit>; - @useResult - $Res call({String? fingerprint, String? last4, String? bsbNumber}); } - /// @nodoc -class _$AuBecsDebitCopyWithImpl<$Res, $Val extends AuBecsDebit> +class _$AuBecsDebitCopyWithImpl<$Res> implements $AuBecsDebitCopyWith<$Res> { - _$AuBecsDebitCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? fingerprint = freezed, - Object? last4 = freezed, - Object? bsbNumber = freezed, - }) { - return _then(_value.copyWith( - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - bsbNumber: freezed == bsbNumber - ? _value.bsbNumber - : bsbNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + _$AuBecsDebitCopyWithImpl(this._self, this._then); + + final AuBecsDebit _self; + final $Res Function(AuBecsDebit) _then; + +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fingerprint = freezed,Object? last4 = freezed,Object? bsbNumber = freezed,}) { + return _then(_self.copyWith( +fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,bsbNumber: freezed == bsbNumber ? _self.bsbNumber : bsbNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AuBecsDebit]. +extension AuBecsDebitPatterns on AuBecsDebit { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AuBecsDebit value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AuBecsDebit value) $default,){ +final _that = this; +switch (_that) { +case _AuBecsDebit(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AuBecsDebit value)? $default,){ +final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? fingerprint, String? last4, String? bsbNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that.fingerprint,_that.last4,_that.bsbNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? fingerprint, String? last4, String? bsbNumber) $default,) {final _that = this; +switch (_that) { +case _AuBecsDebit(): +return $default(_that.fingerprint,_that.last4,_that.bsbNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? fingerprint, String? last4, String? bsbNumber)? $default,) {final _that = this; +switch (_that) { +case _AuBecsDebit() when $default != null: +return $default(_that.fingerprint,_that.last4,_that.bsbNumber);case _: + return null; + +} } -/// @nodoc -abstract class _$$AuBecsDebitImplCopyWith<$Res> - implements $AuBecsDebitCopyWith<$Res> { - factory _$$AuBecsDebitImplCopyWith( - _$AuBecsDebitImpl value, $Res Function(_$AuBecsDebitImpl) then) = - __$$AuBecsDebitImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? fingerprint, String? last4, String? bsbNumber}); -} - -/// @nodoc -class __$$AuBecsDebitImplCopyWithImpl<$Res> - extends _$AuBecsDebitCopyWithImpl<$Res, _$AuBecsDebitImpl> - implements _$$AuBecsDebitImplCopyWith<$Res> { - __$$AuBecsDebitImplCopyWithImpl( - _$AuBecsDebitImpl _value, $Res Function(_$AuBecsDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? fingerprint = freezed, - Object? last4 = freezed, - Object? bsbNumber = freezed, - }) { - return _then(_$AuBecsDebitImpl( - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - bsbNumber: freezed == bsbNumber - ? _value.bsbNumber - : bsbNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$AuBecsDebitImpl implements _AuBecsDebit { - const _$AuBecsDebitImpl({this.fingerprint, this.last4, this.bsbNumber}); +class _AuBecsDebit implements AuBecsDebit { + const _AuBecsDebit({this.fingerprint, this.last4, this.bsbNumber}); + factory _AuBecsDebit.fromJson(Map json) => _$AuBecsDebitFromJson(json); - factory _$AuBecsDebitImpl.fromJson(Map json) => - _$$AuBecsDebitImplFromJson(json); +/// Unique identifier for the bankaccount. +@override final String? fingerprint; +/// Last 4 digits of the bankaccount number. +@override final String? last4; +/// Six digit number identifying the bank or branch for this account. +@override final String? bsbNumber; - /// Unique identifier for the bankaccount. - @override - final String? fingerprint; +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AuBecsDebitCopyWith<_AuBecsDebit> get copyWith => __$AuBecsDebitCopyWithImpl<_AuBecsDebit>(this, _$identity); + +@override +Map toJson() { + return _$AuBecsDebitToJson(this, ); +} - /// Last 4 digits of the bankaccount number. - @override - final String? last4; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuBecsDebit&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.bsbNumber, bsbNumber) || other.bsbNumber == bsbNumber)); +} - /// Six digit number identifying the bank or branch for this account. - @override - final String? bsbNumber; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fingerprint,last4,bsbNumber); - @override - String toString() { - return 'AuBecsDebit(fingerprint: $fingerprint, last4: $last4, bsbNumber: $bsbNumber)'; - } +@override +String toString() { + return 'AuBecsDebit(fingerprint: $fingerprint, last4: $last4, bsbNumber: $bsbNumber)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AuBecsDebitImpl && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.bsbNumber, bsbNumber) || - other.bsbNumber == bsbNumber)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, fingerprint, last4, bsbNumber); - - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AuBecsDebitImplCopyWith<_$AuBecsDebitImpl> get copyWith => - __$$AuBecsDebitImplCopyWithImpl<_$AuBecsDebitImpl>(this, _$identity); - - @override - Map toJson() { - return _$$AuBecsDebitImplToJson( - this, - ); - } } -abstract class _AuBecsDebit implements AuBecsDebit { - const factory _AuBecsDebit( - {final String? fingerprint, - final String? last4, - final String? bsbNumber}) = _$AuBecsDebitImpl; +/// @nodoc +abstract mixin class _$AuBecsDebitCopyWith<$Res> implements $AuBecsDebitCopyWith<$Res> { + factory _$AuBecsDebitCopyWith(_AuBecsDebit value, $Res Function(_AuBecsDebit) _then) = __$AuBecsDebitCopyWithImpl; +@override @useResult +$Res call({ + String? fingerprint, String? last4, String? bsbNumber +}); + - factory _AuBecsDebit.fromJson(Map json) = - _$AuBecsDebitImpl.fromJson; - /// Unique identifier for the bankaccount. - @override - String? get fingerprint; - /// Last 4 digits of the bankaccount number. - @override - String? get last4; +} +/// @nodoc +class __$AuBecsDebitCopyWithImpl<$Res> + implements _$AuBecsDebitCopyWith<$Res> { + __$AuBecsDebitCopyWithImpl(this._self, this._then); - /// Six digit number identifying the bank or branch for this account. - @override - String? get bsbNumber; + final _AuBecsDebit _self; + final $Res Function(_AuBecsDebit) _then; - /// Create a copy of AuBecsDebit - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AuBecsDebitImplCopyWith<_$AuBecsDebitImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of AuBecsDebit +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fingerprint = freezed,Object? last4 = freezed,Object? bsbNumber = freezed,}) { + return _then(_AuBecsDebit( +fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,bsbNumber: freezed == bsbNumber ? _self.bsbNumber : bsbNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); } -BacsDebit _$BacsDebitFromJson(Map json) { - return _BacsDebit.fromJson(json); + } + /// @nodoc mixin _$BacsDebit { - /// Sort code of the bankaccount. - String? get sortCode => throw _privateConstructorUsedError; - - /// Unique identifier for the bankaccount. - String? get fingerprint => throw _privateConstructorUsedError; - /// Last 4 digits of the bank account. - String? get last4 => throw _privateConstructorUsedError; +/// Sort code of the bankaccount. + String? get sortCode;/// Unique identifier for the bankaccount. + String? get fingerprint;/// Last 4 digits of the bank account. + String? get last4; +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BacsDebitCopyWith get copyWith => _$BacsDebitCopyWithImpl(this as BacsDebit, _$identity); /// Serializes this BacsDebit to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BacsDebitCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BacsDebit&&(identical(other.sortCode, sortCode) || other.sortCode == sortCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); } -/// @nodoc -abstract class $BacsDebitCopyWith<$Res> { - factory $BacsDebitCopyWith(BacsDebit value, $Res Function(BacsDebit) then) = - _$BacsDebitCopyWithImpl<$Res, BacsDebit>; - @useResult - $Res call({String? sortCode, String? fingerprint, String? last4}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sortCode,fingerprint,last4); + +@override +String toString() { + return 'BacsDebit(sortCode: $sortCode, fingerprint: $fingerprint, last4: $last4)'; } -/// @nodoc -class _$BacsDebitCopyWithImpl<$Res, $Val extends BacsDebit> - implements $BacsDebitCopyWith<$Res> { - _$BacsDebitCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sortCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_value.copyWith( - sortCode: freezed == sortCode - ? _value.sortCode - : sortCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$BacsDebitImplCopyWith<$Res> +abstract mixin class $BacsDebitCopyWith<$Res> { + factory $BacsDebitCopyWith(BacsDebit value, $Res Function(BacsDebit) _then) = _$BacsDebitCopyWithImpl; +@useResult +$Res call({ + String? sortCode, String? fingerprint, String? last4 +}); + + + + +} +/// @nodoc +class _$BacsDebitCopyWithImpl<$Res> implements $BacsDebitCopyWith<$Res> { - factory _$$BacsDebitImplCopyWith( - _$BacsDebitImpl value, $Res Function(_$BacsDebitImpl) then) = - __$$BacsDebitImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? sortCode, String? fingerprint, String? last4}); -} - -/// @nodoc -class __$$BacsDebitImplCopyWithImpl<$Res> - extends _$BacsDebitCopyWithImpl<$Res, _$BacsDebitImpl> - implements _$$BacsDebitImplCopyWith<$Res> { - __$$BacsDebitImplCopyWithImpl( - _$BacsDebitImpl _value, $Res Function(_$BacsDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? sortCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_$BacsDebitImpl( - sortCode: freezed == sortCode - ? _value.sortCode - : sortCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + _$BacsDebitCopyWithImpl(this._self, this._then); + + final BacsDebit _self; + final $Res Function(BacsDebit) _then; + +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? sortCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_self.copyWith( +sortCode: freezed == sortCode ? _self.sortCode : sortCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BacsDebit]. +extension BacsDebitPatterns on BacsDebit { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BacsDebit value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BacsDebit value) $default,){ +final _that = this; +switch (_that) { +case _BacsDebit(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BacsDebit value)? $default,){ +final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? sortCode, String? fingerprint, String? last4)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that.sortCode,_that.fingerprint,_that.last4);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? sortCode, String? fingerprint, String? last4) $default,) {final _that = this; +switch (_that) { +case _BacsDebit(): +return $default(_that.sortCode,_that.fingerprint,_that.last4);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? sortCode, String? fingerprint, String? last4)? $default,) {final _that = this; +switch (_that) { +case _BacsDebit() when $default != null: +return $default(_that.sortCode,_that.fingerprint,_that.last4);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$BacsDebitImpl implements _BacsDebit { - const _$BacsDebitImpl({this.sortCode, this.fingerprint, this.last4}); +class _BacsDebit implements BacsDebit { + const _BacsDebit({this.sortCode, this.fingerprint, this.last4}); + factory _BacsDebit.fromJson(Map json) => _$BacsDebitFromJson(json); + +/// Sort code of the bankaccount. +@override final String? sortCode; +/// Unique identifier for the bankaccount. +@override final String? fingerprint; +/// Last 4 digits of the bank account. +@override final String? last4; - factory _$BacsDebitImpl.fromJson(Map json) => - _$$BacsDebitImplFromJson(json); +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BacsDebitCopyWith<_BacsDebit> get copyWith => __$BacsDebitCopyWithImpl<_BacsDebit>(this, _$identity); - /// Sort code of the bankaccount. - @override - final String? sortCode; +@override +Map toJson() { + return _$BacsDebitToJson(this, ); +} - /// Unique identifier for the bankaccount. - @override - final String? fingerprint; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BacsDebit&&(identical(other.sortCode, sortCode) || other.sortCode == sortCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} - /// Last 4 digits of the bank account. - @override - final String? last4; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,sortCode,fingerprint,last4); - @override - String toString() { - return 'BacsDebit(sortCode: $sortCode, fingerprint: $fingerprint, last4: $last4)'; - } +@override +String toString() { + return 'BacsDebit(sortCode: $sortCode, fingerprint: $fingerprint, last4: $last4)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BacsDebitImpl && - (identical(other.sortCode, sortCode) || - other.sortCode == sortCode) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, sortCode, fingerprint, last4); - - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BacsDebitImplCopyWith<_$BacsDebitImpl> get copyWith => - __$$BacsDebitImplCopyWithImpl<_$BacsDebitImpl>(this, _$identity); - - @override - Map toJson() { - return _$$BacsDebitImplToJson( - this, - ); - } } -abstract class _BacsDebit implements BacsDebit { - const factory _BacsDebit( - {final String? sortCode, - final String? fingerprint, - final String? last4}) = _$BacsDebitImpl; +/// @nodoc +abstract mixin class _$BacsDebitCopyWith<$Res> implements $BacsDebitCopyWith<$Res> { + factory _$BacsDebitCopyWith(_BacsDebit value, $Res Function(_BacsDebit) _then) = __$BacsDebitCopyWithImpl; +@override @useResult +$Res call({ + String? sortCode, String? fingerprint, String? last4 +}); + - factory _BacsDebit.fromJson(Map json) = - _$BacsDebitImpl.fromJson; - /// Sort code of the bankaccount. - @override - String? get sortCode; - /// Unique identifier for the bankaccount. - @override - String? get fingerprint; +} +/// @nodoc +class __$BacsDebitCopyWithImpl<$Res> + implements _$BacsDebitCopyWith<$Res> { + __$BacsDebitCopyWithImpl(this._self, this._then); - /// Last 4 digits of the bank account. - @override - String? get last4; + final _BacsDebit _self; + final $Res Function(_BacsDebit) _then; - /// Create a copy of BacsDebit - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BacsDebitImplCopyWith<_$BacsDebitImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of BacsDebit +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? sortCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_BacsDebit( +sortCode: freezed == sortCode ? _self.sortCode : sortCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); } -Card _$CardFromJson(Map json) { - return _Card.fromJson(json); + } + /// @nodoc mixin _$Card { - /// The brand associated to the card e.g. (visa, amex). - String? get brand => throw _privateConstructorUsedError; - /// Two letter iso code. - String? get country => throw _privateConstructorUsedError; +/// The brand associated to the card e.g. (visa, amex). + String? get brand;/// Two letter iso code. + String? get country;/// four digit number representing the year of expiry of the card. + int? get expYear;/// two digit number representing the month of expire of the card. + int? get expMonth;/// card funding type e.g. (credit, debit). + String? get funding;/// last four digits of the card. + String? get last4;/// The preffered card brand for payment + String? get preferredNetwork;/// The available networks the card can run. + List? get availableNetworks;/// Three 3ds usage data. + ThreeDSecureUsage? get threeDSecureUsage; +/// Create a copy of Card +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardCopyWith get copyWith => _$CardCopyWithImpl(this as Card, _$identity); - /// four digit number representing the year of expiry of the card. - int? get expYear => throw _privateConstructorUsedError; - - /// two digit number representing the month of expire of the card. - int? get expMonth => throw _privateConstructorUsedError; - - /// card funding type e.g. (credit, debit). - String? get funding => throw _privateConstructorUsedError; + /// Serializes this Card to a JSON map. + Map toJson(); - /// last four digits of the card. - String? get last4 => throw _privateConstructorUsedError; - /// The preffered card brand for payment - String? get preferredNetwork => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Card&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork)&&const DeepCollectionEquality().equals(other.availableNetworks, availableNetworks)&&(identical(other.threeDSecureUsage, threeDSecureUsage) || other.threeDSecureUsage == threeDSecureUsage)); +} - /// The available networks the card can run. - List? get availableNetworks => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,brand,country,expYear,expMonth,funding,last4,preferredNetwork,const DeepCollectionEquality().hash(availableNetworks),threeDSecureUsage); - /// Three 3ds usage data. - ThreeDSecureUsage? get threeDSecureUsage => - throw _privateConstructorUsedError; +@override +String toString() { + return 'Card(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks, threeDSecureUsage: $threeDSecureUsage)'; +} - /// Serializes this Card to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of Card - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $CardCopyWith<$Res> { - factory $CardCopyWith(Card value, $Res Function(Card) then) = - _$CardCopyWithImpl<$Res, Card>; - @useResult - $Res call( - {String? brand, - String? country, - int? expYear, - int? expMonth, - String? funding, - String? last4, - String? preferredNetwork, - List? availableNetworks, - ThreeDSecureUsage? threeDSecureUsage}); +abstract mixin class $CardCopyWith<$Res> { + factory $CardCopyWith(Card value, $Res Function(Card) _then) = _$CardCopyWithImpl; +@useResult +$Res call({ + String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage +}); - $ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage; -} +$ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage; + +} /// @nodoc -class _$CardCopyWithImpl<$Res, $Val extends Card> +class _$CardCopyWithImpl<$Res> implements $CardCopyWith<$Res> { - _$CardCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Card - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? brand = freezed, - Object? country = freezed, - Object? expYear = freezed, - Object? expMonth = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? preferredNetwork = freezed, - Object? availableNetworks = freezed, - Object? threeDSecureUsage = freezed, - }) { - return _then(_value.copyWith( - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetwork: freezed == preferredNetwork - ? _value.preferredNetwork - : preferredNetwork // ignore: cast_nullable_to_non_nullable - as String?, - availableNetworks: freezed == availableNetworks - ? _value.availableNetworks - : availableNetworks // ignore: cast_nullable_to_non_nullable - as List?, - threeDSecureUsage: freezed == threeDSecureUsage - ? _value.threeDSecureUsage - : threeDSecureUsage // ignore: cast_nullable_to_non_nullable - as ThreeDSecureUsage?, - ) as $Val); - } + _$CardCopyWithImpl(this._self, this._then); + + final Card _self; + final $Res Function(Card) _then; + +/// Create a copy of Card +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? brand = freezed,Object? country = freezed,Object? expYear = freezed,Object? expMonth = freezed,Object? funding = freezed,Object? last4 = freezed,Object? preferredNetwork = freezed,Object? availableNetworks = freezed,Object? threeDSecureUsage = freezed,}) { + return _then(_self.copyWith( +brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,preferredNetwork: freezed == preferredNetwork ? _self.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable +as String?,availableNetworks: freezed == availableNetworks ? _self.availableNetworks : availableNetworks // ignore: cast_nullable_to_non_nullable +as List?,threeDSecureUsage: freezed == threeDSecureUsage ? _self.threeDSecureUsage : threeDSecureUsage // ignore: cast_nullable_to_non_nullable +as ThreeDSecureUsage?, + )); +} +/// Create a copy of Card +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage { + if (_self.threeDSecureUsage == null) { + return null; + } + + return $ThreeDSecureUsageCopyWith<$Res>(_self.threeDSecureUsage!, (value) { + return _then(_self.copyWith(threeDSecureUsage: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [Card]. +extension CardPatterns on Card { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Card value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Card() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Card value) $default,){ +final _that = this; +switch (_that) { +case _Card(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Card value)? $default,){ +final _that = this; +switch (_that) { +case _Card() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Card() when $default != null: +return $default(_that.brand,_that.country,_that.expYear,_that.expMonth,_that.funding,_that.last4,_that.preferredNetwork,_that.availableNetworks,_that.threeDSecureUsage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage) $default,) {final _that = this; +switch (_that) { +case _Card(): +return $default(_that.brand,_that.country,_that.expYear,_that.expMonth,_that.funding,_that.last4,_that.preferredNetwork,_that.availableNetworks,_that.threeDSecureUsage);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage)? $default,) {final _that = this; +switch (_that) { +case _Card() when $default != null: +return $default(_that.brand,_that.country,_that.expYear,_that.expMonth,_that.funding,_that.last4,_that.preferredNetwork,_that.availableNetworks,_that.threeDSecureUsage);case _: + return null; - /// Create a copy of Card - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage { - if (_value.threeDSecureUsage == null) { - return null; - } - - return $ThreeDSecureUsageCopyWith<$Res>(_value.threeDSecureUsage!, (value) { - return _then(_value.copyWith(threeDSecureUsage: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$CardImplCopyWith<$Res> implements $CardCopyWith<$Res> { - factory _$$CardImplCopyWith( - _$CardImpl value, $Res Function(_$CardImpl) then) = - __$$CardImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? brand, - String? country, - int? expYear, - int? expMonth, - String? funding, - String? last4, - String? preferredNetwork, - List? availableNetworks, - ThreeDSecureUsage? threeDSecureUsage}); - - @override - $ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage; -} - -/// @nodoc -class __$$CardImplCopyWithImpl<$Res> - extends _$CardCopyWithImpl<$Res, _$CardImpl> - implements _$$CardImplCopyWith<$Res> { - __$$CardImplCopyWithImpl(_$CardImpl _value, $Res Function(_$CardImpl) _then) - : super(_value, _then); - - /// Create a copy of Card - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? brand = freezed, - Object? country = freezed, - Object? expYear = freezed, - Object? expMonth = freezed, - Object? funding = freezed, - Object? last4 = freezed, - Object? preferredNetwork = freezed, - Object? availableNetworks = freezed, - Object? threeDSecureUsage = freezed, - }) { - return _then(_$CardImpl( - brand: freezed == brand - ? _value.brand - : brand // ignore: cast_nullable_to_non_nullable - as String?, - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - expYear: freezed == expYear - ? _value.expYear - : expYear // ignore: cast_nullable_to_non_nullable - as int?, - expMonth: freezed == expMonth - ? _value.expMonth - : expMonth // ignore: cast_nullable_to_non_nullable - as int?, - funding: freezed == funding - ? _value.funding - : funding // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetwork: freezed == preferredNetwork - ? _value.preferredNetwork - : preferredNetwork // ignore: cast_nullable_to_non_nullable - as String?, - availableNetworks: freezed == availableNetworks - ? _value._availableNetworks - : availableNetworks // ignore: cast_nullable_to_non_nullable - as List?, - threeDSecureUsage: freezed == threeDSecureUsage - ? _value.threeDSecureUsage - : threeDSecureUsage // ignore: cast_nullable_to_non_nullable - as ThreeDSecureUsage?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CardImpl implements _Card { - const _$CardImpl( - {this.brand, - this.country, - this.expYear, - this.expMonth, - this.funding, - this.last4, - this.preferredNetwork, - final List? availableNetworks, - this.threeDSecureUsage}) - : _availableNetworks = availableNetworks; - - factory _$CardImpl.fromJson(Map json) => - _$$CardImplFromJson(json); - - /// The brand associated to the card e.g. (visa, amex). - @override - final String? brand; - - /// Two letter iso code. - @override - final String? country; - - /// four digit number representing the year of expiry of the card. - @override - final int? expYear; - - /// two digit number representing the month of expire of the card. - @override - final int? expMonth; - - /// card funding type e.g. (credit, debit). - @override - final String? funding; - - /// last four digits of the card. - @override - final String? last4; - - /// The preffered card brand for payment - @override - final String? preferredNetwork; - - /// The available networks the card can run. - final List? _availableNetworks; - - /// The available networks the card can run. - @override - List? get availableNetworks { - final value = _availableNetworks; - if (value == null) return null; - if (_availableNetworks is EqualUnmodifiableListView) - return _availableNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _Card implements Card { + const _Card({this.brand, this.country, this.expYear, this.expMonth, this.funding, this.last4, this.preferredNetwork, final List? availableNetworks, this.threeDSecureUsage}): _availableNetworks = availableNetworks; + factory _Card.fromJson(Map json) => _$CardFromJson(json); + +/// The brand associated to the card e.g. (visa, amex). +@override final String? brand; +/// Two letter iso code. +@override final String? country; +/// four digit number representing the year of expiry of the card. +@override final int? expYear; +/// two digit number representing the month of expire of the card. +@override final int? expMonth; +/// card funding type e.g. (credit, debit). +@override final String? funding; +/// last four digits of the card. +@override final String? last4; +/// The preffered card brand for payment +@override final String? preferredNetwork; +/// The available networks the card can run. + final List? _availableNetworks; +/// The available networks the card can run. +@override List? get availableNetworks { + final value = _availableNetworks; + if (value == null) return null; + if (_availableNetworks is EqualUnmodifiableListView) return _availableNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - /// Three 3ds usage data. - @override - final ThreeDSecureUsage? threeDSecureUsage; +/// Three 3ds usage data. +@override final ThreeDSecureUsage? threeDSecureUsage; - @override - String toString() { - return 'Card(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks, threeDSecureUsage: $threeDSecureUsage)'; - } +/// Create a copy of Card +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardCopyWith<_Card> get copyWith => __$CardCopyWithImpl<_Card>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardImpl && - (identical(other.brand, brand) || other.brand == brand) && - (identical(other.country, country) || other.country == country) && - (identical(other.expYear, expYear) || other.expYear == expYear) && - (identical(other.expMonth, expMonth) || - other.expMonth == expMonth) && - (identical(other.funding, funding) || other.funding == funding) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.preferredNetwork, preferredNetwork) || - other.preferredNetwork == preferredNetwork) && - const DeepCollectionEquality() - .equals(other._availableNetworks, _availableNetworks) && - (identical(other.threeDSecureUsage, threeDSecureUsage) || - other.threeDSecureUsage == threeDSecureUsage)); - } +@override +Map toJson() { + return _$CardToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - brand, - country, - expYear, - expMonth, - funding, - last4, - preferredNetwork, - const DeepCollectionEquality().hash(_availableNetworks), - threeDSecureUsage); - - /// Create a copy of Card - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardImplCopyWith<_$CardImpl> get copyWith => - __$$CardImplCopyWithImpl<_$CardImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CardImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Card&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.country, country) || other.country == country)&&(identical(other.expYear, expYear) || other.expYear == expYear)&&(identical(other.expMonth, expMonth) || other.expMonth == expMonth)&&(identical(other.funding, funding) || other.funding == funding)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork)&&const DeepCollectionEquality().equals(other._availableNetworks, _availableNetworks)&&(identical(other.threeDSecureUsage, threeDSecureUsage) || other.threeDSecureUsage == threeDSecureUsage)); } -abstract class _Card implements Card { - const factory _Card( - {final String? brand, - final String? country, - final int? expYear, - final int? expMonth, - final String? funding, - final String? last4, - final String? preferredNetwork, - final List? availableNetworks, - final ThreeDSecureUsage? threeDSecureUsage}) = _$CardImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,brand,country,expYear,expMonth,funding,last4,preferredNetwork,const DeepCollectionEquality().hash(_availableNetworks),threeDSecureUsage); - factory _Card.fromJson(Map json) = _$CardImpl.fromJson; +@override +String toString() { + return 'Card(brand: $brand, country: $country, expYear: $expYear, expMonth: $expMonth, funding: $funding, last4: $last4, preferredNetwork: $preferredNetwork, availableNetworks: $availableNetworks, threeDSecureUsage: $threeDSecureUsage)'; +} - /// The brand associated to the card e.g. (visa, amex). - @override - String? get brand; - /// Two letter iso code. - @override - String? get country; +} - /// four digit number representing the year of expiry of the card. - @override - int? get expYear; +/// @nodoc +abstract mixin class _$CardCopyWith<$Res> implements $CardCopyWith<$Res> { + factory _$CardCopyWith(_Card value, $Res Function(_Card) _then) = __$CardCopyWithImpl; +@override @useResult +$Res call({ + String? brand, String? country, int? expYear, int? expMonth, String? funding, String? last4, String? preferredNetwork, List? availableNetworks, ThreeDSecureUsage? threeDSecureUsage +}); - /// two digit number representing the month of expire of the card. - @override - int? get expMonth; - /// card funding type e.g. (credit, debit). - @override - String? get funding; +@override $ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage; - /// last four digits of the card. - @override - String? get last4; +} +/// @nodoc +class __$CardCopyWithImpl<$Res> + implements _$CardCopyWith<$Res> { + __$CardCopyWithImpl(this._self, this._then); - /// The preffered card brand for payment - @override - String? get preferredNetwork; + final _Card _self; + final $Res Function(_Card) _then; - /// The available networks the card can run. - @override - List? get availableNetworks; +/// Create a copy of Card +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? brand = freezed,Object? country = freezed,Object? expYear = freezed,Object? expMonth = freezed,Object? funding = freezed,Object? last4 = freezed,Object? preferredNetwork = freezed,Object? availableNetworks = freezed,Object? threeDSecureUsage = freezed,}) { + return _then(_Card( +brand: freezed == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable +as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,expYear: freezed == expYear ? _self.expYear : expYear // ignore: cast_nullable_to_non_nullable +as int?,expMonth: freezed == expMonth ? _self.expMonth : expMonth // ignore: cast_nullable_to_non_nullable +as int?,funding: freezed == funding ? _self.funding : funding // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,preferredNetwork: freezed == preferredNetwork ? _self.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable +as String?,availableNetworks: freezed == availableNetworks ? _self._availableNetworks : availableNetworks // ignore: cast_nullable_to_non_nullable +as List?,threeDSecureUsage: freezed == threeDSecureUsage ? _self.threeDSecureUsage : threeDSecureUsage // ignore: cast_nullable_to_non_nullable +as ThreeDSecureUsage?, + )); +} - /// Three 3ds usage data. - @override - ThreeDSecureUsage? get threeDSecureUsage; +/// Create a copy of Card +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureUsageCopyWith<$Res>? get threeDSecureUsage { + if (_self.threeDSecureUsage == null) { + return null; + } - /// Create a copy of Card - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardImplCopyWith<_$CardImpl> get copyWith => - throw _privateConstructorUsedError; + return $ThreeDSecureUsageCopyWith<$Res>(_self.threeDSecureUsage!, (value) { + return _then(_self.copyWith(threeDSecureUsage: value)); + }); } - -Fpx _$FpxFromJson(Map json) { - return _Fpx.fromJson(json); } + /// @nodoc mixin _$Fpx { - /// the customer bank - String? get bank => throw _privateConstructorUsedError; - /// accountholder type - String? get accountHolderType => throw _privateConstructorUsedError; +/// the customer bank + String? get bank;/// accountholder type + String? get accountHolderType; +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FpxCopyWith get copyWith => _$FpxCopyWithImpl(this as Fpx, _$identity); /// Serializes this Fpx to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FpxCopyWith get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $FpxCopyWith<$Res> { - factory $FpxCopyWith(Fpx value, $Res Function(Fpx) then) = - _$FpxCopyWithImpl<$Res, Fpx>; - @useResult - $Res call({String? bank, String? accountHolderType}); -} - -/// @nodoc -class _$FpxCopyWithImpl<$Res, $Val extends Fpx> implements $FpxCopyWith<$Res> { - _$FpxCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - Object? accountHolderType = freezed, - }) { - return _then(_value.copyWith( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Fpx&&(identical(other.bank, bank) || other.bank == bank)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)); } -/// @nodoc -abstract class _$$FpxImplCopyWith<$Res> implements $FpxCopyWith<$Res> { - factory _$$FpxImplCopyWith(_$FpxImpl value, $Res Function(_$FpxImpl) then) = - __$$FpxImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? bank, String? accountHolderType}); -} - -/// @nodoc -class __$$FpxImplCopyWithImpl<$Res> extends _$FpxCopyWithImpl<$Res, _$FpxImpl> - implements _$$FpxImplCopyWith<$Res> { - __$$FpxImplCopyWithImpl(_$FpxImpl _value, $Res Function(_$FpxImpl) _then) - : super(_value, _then); - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bank = freezed, - Object? accountHolderType = freezed, - }) { - return _then(_$FpxImpl( - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as String?, - )); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank,accountHolderType); + +@override +String toString() { + return 'Fpx(bank: $bank, accountHolderType: $accountHolderType)'; } -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$FpxImpl implements _Fpx { - const _$FpxImpl({this.bank, this.accountHolderType}); +} - factory _$FpxImpl.fromJson(Map json) => - _$$FpxImplFromJson(json); +/// @nodoc +abstract mixin class $FpxCopyWith<$Res> { + factory $FpxCopyWith(Fpx value, $Res Function(Fpx) _then) = _$FpxCopyWithImpl; +@useResult +$Res call({ + String? bank, String? accountHolderType +}); - /// the customer bank - @override - final String? bank; - /// accountholder type - @override - final String? accountHolderType; - @override - String toString() { - return 'Fpx(bank: $bank, accountHolderType: $accountHolderType)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FpxImpl && - (identical(other.bank, bank) || other.bank == bank) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType)); - } +} +/// @nodoc +class _$FpxCopyWithImpl<$Res> + implements $FpxCopyWith<$Res> { + _$FpxCopyWithImpl(this._self, this._then); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, bank, accountHolderType); - - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FpxImplCopyWith<_$FpxImpl> get copyWith => - __$$FpxImplCopyWithImpl<_$FpxImpl>(this, _$identity); - - @override - Map toJson() { - return _$$FpxImplToJson( - this, - ); - } + final Fpx _self; + final $Res Function(Fpx) _then; + +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bank = freezed,Object? accountHolderType = freezed,}) { + return _then(_self.copyWith( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as String?, + )); } -abstract class _Fpx implements Fpx { - const factory _Fpx({final String? bank, final String? accountHolderType}) = - _$FpxImpl; +} - factory _Fpx.fromJson(Map json) = _$FpxImpl.fromJson; - /// the customer bank - @override - String? get bank; +/// Adds pattern-matching-related methods to [Fpx]. +extension FpxPatterns on Fpx { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` - /// accountholder type - @override - String? get accountHolderType; +@optionalTypeArgs TResult maybeMap(TResult Function( _Fpx value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that);case _: + return orElse(); - /// Create a copy of Fpx - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FpxImplCopyWith<_$FpxImpl> get copyWith => - throw _privateConstructorUsedError; } - -Ideal _$IdealFromJson(Map json) { - return _Ideal.fromJson(json); } +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` -/// @nodoc -mixin _$Ideal { - /// The BIC code of the bank - String? get bankIdentifierCode => throw _privateConstructorUsedError; +@optionalTypeArgs TResult map(TResult Function( _Fpx value) $default,){ +final _that = this; +switch (_that) { +case _Fpx(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// The bank of the customer - String? get bank => throw _privateConstructorUsedError; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Serializes this Ideal to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Fpx value)? $default,){ +final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that);case _: + return null; - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IdealCopyWith get copyWith => throw _privateConstructorUsedError; } - -/// @nodoc -abstract class $IdealCopyWith<$Res> { - factory $IdealCopyWith(Ideal value, $Res Function(Ideal) then) = - _$IdealCopyWithImpl<$Res, Ideal>; - @useResult - $Res call({String? bankIdentifierCode, String? bank}); } +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bank, String? accountHolderType)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that.bank,_that.accountHolderType);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bank, String? accountHolderType) $default,) {final _that = this; +switch (_that) { +case _Fpx(): +return $default(_that.bank,_that.accountHolderType);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bank, String? accountHolderType)? $default,) {final _that = this; +switch (_that) { +case _Fpx() when $default != null: +return $default(_that.bank,_that.accountHolderType);case _: + return null; -/// @nodoc -class _$IdealCopyWithImpl<$Res, $Val extends Ideal> - implements $IdealCopyWith<$Res> { - _$IdealCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankIdentifierCode = freezed, - Object? bank = freezed, - }) { - return _then(_value.copyWith( - bankIdentifierCode: freezed == bankIdentifierCode - ? _value.bankIdentifierCode - : bankIdentifierCode // ignore: cast_nullable_to_non_nullable - as String?, - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +} } -/// @nodoc -abstract class _$$IdealImplCopyWith<$Res> implements $IdealCopyWith<$Res> { - factory _$$IdealImplCopyWith( - _$IdealImpl value, $Res Function(_$IdealImpl) then) = - __$$IdealImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? bankIdentifierCode, String? bank}); -} - -/// @nodoc -class __$$IdealImplCopyWithImpl<$Res> - extends _$IdealCopyWithImpl<$Res, _$IdealImpl> - implements _$$IdealImplCopyWith<$Res> { - __$$IdealImplCopyWithImpl( - _$IdealImpl _value, $Res Function(_$IdealImpl) _then) - : super(_value, _then); - - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankIdentifierCode = freezed, - Object? bank = freezed, - }) { - return _then(_$IdealImpl( - bankIdentifierCode: freezed == bankIdentifierCode - ? _value.bankIdentifierCode - : bankIdentifierCode // ignore: cast_nullable_to_non_nullable - as String?, - bank: freezed == bank - ? _value.bank - : bank // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$IdealImpl implements _Ideal { - const _$IdealImpl({this.bankIdentifierCode, this.bank}); - - factory _$IdealImpl.fromJson(Map json) => - _$$IdealImplFromJson(json); +class _Fpx implements Fpx { + const _Fpx({this.bank, this.accountHolderType}); + factory _Fpx.fromJson(Map json) => _$FpxFromJson(json); - /// The BIC code of the bank - @override - final String? bankIdentifierCode; +/// the customer bank +@override final String? bank; +/// accountholder type +@override final String? accountHolderType; - /// The bank of the customer - @override - final String? bank; - - @override - String toString() { - return 'Ideal(bankIdentifierCode: $bankIdentifierCode, bank: $bank)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IdealImpl && - (identical(other.bankIdentifierCode, bankIdentifierCode) || - other.bankIdentifierCode == bankIdentifierCode) && - (identical(other.bank, bank) || other.bank == bank)); - } +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FpxCopyWith<_Fpx> get copyWith => __$FpxCopyWithImpl<_Fpx>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, bankIdentifierCode, bank); - - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IdealImplCopyWith<_$IdealImpl> get copyWith => - __$$IdealImplCopyWithImpl<_$IdealImpl>(this, _$identity); - - @override - Map toJson() { - return _$$IdealImplToJson( - this, - ); - } +@override +Map toJson() { + return _$FpxToJson(this, ); } -abstract class _Ideal implements Ideal { - const factory _Ideal({final String? bankIdentifierCode, final String? bank}) = - _$IdealImpl; - - factory _Ideal.fromJson(Map json) = _$IdealImpl.fromJson; - - /// The BIC code of the bank - @override - String? get bankIdentifierCode; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Fpx&&(identical(other.bank, bank) || other.bank == bank)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)); +} - /// The bank of the customer - @override - String? get bank; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bank,accountHolderType); - /// Create a copy of Ideal - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IdealImplCopyWith<_$IdealImpl> get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'Fpx(bank: $bank, accountHolderType: $accountHolderType)'; } -SepaDebit _$SepaDebitFromJson(Map json) { - return _SepaDebit.fromJson(json); + } /// @nodoc -mixin _$SepaDebit { - /// Two letter ISO code representing the country of the bank account. - String? get country => throw _privateConstructorUsedError; +abstract mixin class _$FpxCopyWith<$Res> implements $FpxCopyWith<$Res> { + factory _$FpxCopyWith(_Fpx value, $Res Function(_Fpx) _then) = __$FpxCopyWithImpl; +@override @useResult +$Res call({ + String? bank, String? accountHolderType +}); - /// Bank code associated with the bankaccount. - String? get bankCode => throw _privateConstructorUsedError; - /// Unique ID for the bank account. - String? get fingerprint => throw _privateConstructorUsedError; - /// Last four characters of IBAN. - String? get last4 => throw _privateConstructorUsedError; - - /// Serializes this SepaDebit to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SepaDebitCopyWith get copyWith => - throw _privateConstructorUsedError; } - /// @nodoc -abstract class $SepaDebitCopyWith<$Res> { - factory $SepaDebitCopyWith(SepaDebit value, $Res Function(SepaDebit) then) = - _$SepaDebitCopyWithImpl<$Res, SepaDebit>; - @useResult - $Res call( - {String? country, String? bankCode, String? fingerprint, String? last4}); -} +class __$FpxCopyWithImpl<$Res> + implements _$FpxCopyWith<$Res> { + __$FpxCopyWithImpl(this._self, this._then); -/// @nodoc -class _$SepaDebitCopyWithImpl<$Res, $Val extends SepaDebit> - implements $SepaDebitCopyWith<$Res> { - _$SepaDebitCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - Object? bankCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_value.copyWith( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - bankCode: freezed == bankCode - ? _value.bankCode - : bankCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + final _Fpx _self; + final $Res Function(_Fpx) _then; + +/// Create a copy of Fpx +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bank = freezed,Object? accountHolderType = freezed,}) { + return _then(_Fpx( +bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$SepaDebitImplCopyWith<$Res> - implements $SepaDebitCopyWith<$Res> { - factory _$$SepaDebitImplCopyWith( - _$SepaDebitImpl value, $Res Function(_$SepaDebitImpl) then) = - __$$SepaDebitImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? country, String? bankCode, String? fingerprint, String? last4}); -} - -/// @nodoc -class __$$SepaDebitImplCopyWithImpl<$Res> - extends _$SepaDebitCopyWithImpl<$Res, _$SepaDebitImpl> - implements _$$SepaDebitImplCopyWith<$Res> { - __$$SepaDebitImplCopyWithImpl( - _$SepaDebitImpl _value, $Res Function(_$SepaDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - Object? bankCode = freezed, - Object? fingerprint = freezed, - Object? last4 = freezed, - }) { - return _then(_$SepaDebitImpl( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - bankCode: freezed == bankCode - ? _value.bankCode - : bankCode // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$SepaDebitImpl implements _SepaDebit { - const _$SepaDebitImpl( - {this.country, this.bankCode, this.fingerprint, this.last4}); +/// @nodoc +mixin _$Ideal { - factory _$SepaDebitImpl.fromJson(Map json) => - _$$SepaDebitImplFromJson(json); +/// The BIC code of the bank + String? get bankIdentifierCode;/// The bank of the customer + String? get bank; +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IdealCopyWith get copyWith => _$IdealCopyWithImpl(this as Ideal, _$identity); - /// Two letter ISO code representing the country of the bank account. - @override - final String? country; + /// Serializes this Ideal to a JSON map. + Map toJson(); - /// Bank code associated with the bankaccount. - @override - final String? bankCode; - /// Unique ID for the bank account. - @override - final String? fingerprint; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Ideal&&(identical(other.bankIdentifierCode, bankIdentifierCode) || other.bankIdentifierCode == bankIdentifierCode)&&(identical(other.bank, bank) || other.bank == bank)); +} - /// Last four characters of IBAN. - @override - final String? last4; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankIdentifierCode,bank); - @override - String toString() { - return 'SepaDebit(country: $country, bankCode: $bankCode, fingerprint: $fingerprint, last4: $last4)'; - } +@override +String toString() { + return 'Ideal(bankIdentifierCode: $bankIdentifierCode, bank: $bank)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SepaDebitImpl && - (identical(other.country, country) || other.country == country) && - (identical(other.bankCode, bankCode) || - other.bankCode == bankCode) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.last4, last4) || other.last4 == last4)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, country, bankCode, fingerprint, last4); - - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SepaDebitImplCopyWith<_$SepaDebitImpl> get copyWith => - __$$SepaDebitImplCopyWithImpl<_$SepaDebitImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SepaDebitImplToJson( - this, - ); - } } -abstract class _SepaDebit implements SepaDebit { - const factory _SepaDebit( - {final String? country, - final String? bankCode, - final String? fingerprint, - final String? last4}) = _$SepaDebitImpl; +/// @nodoc +abstract mixin class $IdealCopyWith<$Res> { + factory $IdealCopyWith(Ideal value, $Res Function(Ideal) _then) = _$IdealCopyWithImpl; +@useResult +$Res call({ + String? bankIdentifierCode, String? bank +}); - factory _SepaDebit.fromJson(Map json) = - _$SepaDebitImpl.fromJson; - /// Two letter ISO code representing the country of the bank account. - @override - String? get country; - /// Bank code associated with the bankaccount. - @override - String? get bankCode; - /// Unique ID for the bank account. - @override - String? get fingerprint; +} +/// @nodoc +class _$IdealCopyWithImpl<$Res> + implements $IdealCopyWith<$Res> { + _$IdealCopyWithImpl(this._self, this._then); + + final Ideal _self; + final $Res Function(Ideal) _then; + +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bankIdentifierCode = freezed,Object? bank = freezed,}) { + return _then(_self.copyWith( +bankIdentifierCode: freezed == bankIdentifierCode ? _self.bankIdentifierCode : bankIdentifierCode // ignore: cast_nullable_to_non_nullable +as String?,bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Ideal]. +extension IdealPatterns on Ideal { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Ideal value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Ideal value) $default,){ +final _that = this; +switch (_that) { +case _Ideal(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Ideal value)? $default,){ +final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bankIdentifierCode, String? bank)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that.bankIdentifierCode,_that.bank);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bankIdentifierCode, String? bank) $default,) {final _that = this; +switch (_that) { +case _Ideal(): +return $default(_that.bankIdentifierCode,_that.bank);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Last four characters of IBAN. - @override - String? get last4; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bankIdentifierCode, String? bank)? $default,) {final _that = this; +switch (_that) { +case _Ideal() when $default != null: +return $default(_that.bankIdentifierCode,_that.bank);case _: + return null; - /// Create a copy of SepaDebit - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SepaDebitImplCopyWith<_$SepaDebitImpl> get copyWith => - throw _privateConstructorUsedError; +} } -Sofort _$SofortFromJson(Map json) { - return _Sofort.fromJson(json); } /// @nodoc -mixin _$Sofort { - /// Two letter ISO code representing the country of the bank account. - String? get country => throw _privateConstructorUsedError; - /// Serializes this Sofort to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _Ideal implements Ideal { + const _Ideal({this.bankIdentifierCode, this.bank}); + factory _Ideal.fromJson(Map json) => _$IdealFromJson(json); - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SofortCopyWith get copyWith => throw _privateConstructorUsedError; -} +/// The BIC code of the bank +@override final String? bankIdentifierCode; +/// The bank of the customer +@override final String? bank; -/// @nodoc -abstract class $SofortCopyWith<$Res> { - factory $SofortCopyWith(Sofort value, $Res Function(Sofort) then) = - _$SofortCopyWithImpl<$Res, Sofort>; - @useResult - $Res call({String? country}); +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IdealCopyWith<_Ideal> get copyWith => __$IdealCopyWithImpl<_Ideal>(this, _$identity); + +@override +Map toJson() { + return _$IdealToJson(this, ); } -/// @nodoc -class _$SofortCopyWithImpl<$Res, $Val extends Sofort> - implements $SofortCopyWith<$Res> { - _$SofortCopyWithImpl(this._value, this._then); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Ideal&&(identical(other.bankIdentifierCode, bankIdentifierCode) || other.bankIdentifierCode == bankIdentifierCode)&&(identical(other.bank, bank) || other.bank == bank)); +} - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankIdentifierCode,bank); - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - }) { - return _then(_value.copyWith( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +@override +String toString() { + return 'Ideal(bankIdentifierCode: $bankIdentifierCode, bank: $bank)'; } -/// @nodoc -abstract class _$$SofortImplCopyWith<$Res> implements $SofortCopyWith<$Res> { - factory _$$SofortImplCopyWith( - _$SofortImpl value, $Res Function(_$SofortImpl) then) = - __$$SofortImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? country}); -} - -/// @nodoc -class __$$SofortImplCopyWithImpl<$Res> - extends _$SofortCopyWithImpl<$Res, _$SofortImpl> - implements _$$SofortImplCopyWith<$Res> { - __$$SofortImplCopyWithImpl( - _$SofortImpl _value, $Res Function(_$SofortImpl) _then) - : super(_value, _then); - - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = freezed, - }) { - return _then(_$SofortImpl( - country: freezed == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc +abstract mixin class _$IdealCopyWith<$Res> implements $IdealCopyWith<$Res> { + factory _$IdealCopyWith(_Ideal value, $Res Function(_Ideal) _then) = __$IdealCopyWithImpl; +@override @useResult +$Res call({ + String? bankIdentifierCode, String? bank +}); -@JsonSerializable(explicitToJson: true) -class _$SofortImpl implements _Sofort { - const _$SofortImpl({this.country}); - factory _$SofortImpl.fromJson(Map json) => - _$$SofortImplFromJson(json); - /// Two letter ISO code representing the country of the bank account. - @override - final String? country; - @override - String toString() { - return 'Sofort(country: $country)'; - } +} +/// @nodoc +class __$IdealCopyWithImpl<$Res> + implements _$IdealCopyWith<$Res> { + __$IdealCopyWithImpl(this._self, this._then); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SofortImpl && - (identical(other.country, country) || other.country == country)); - } + final _Ideal _self; + final $Res Function(_Ideal) _then; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, country); - - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SofortImplCopyWith<_$SofortImpl> get copyWith => - __$$SofortImplCopyWithImpl<_$SofortImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SofortImplToJson( - this, - ); - } +/// Create a copy of Ideal +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bankIdentifierCode = freezed,Object? bank = freezed,}) { + return _then(_Ideal( +bankIdentifierCode: freezed == bankIdentifierCode ? _self.bankIdentifierCode : bankIdentifierCode // ignore: cast_nullable_to_non_nullable +as String?,bank: freezed == bank ? _self.bank : bank // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$SepaDebit { + +/// Two letter ISO code representing the country of the bank account. + String? get country;/// Bank code associated with the bankaccount. + String? get bankCode;/// Unique ID for the bank account. + String? get fingerprint;/// Last four characters of IBAN. + String? get last4; +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SepaDebitCopyWith get copyWith => _$SepaDebitCopyWithImpl(this as SepaDebit, _$identity); + + /// Serializes this SepaDebit to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SepaDebit&&(identical(other.country, country) || other.country == country)&&(identical(other.bankCode, bankCode) || other.bankCode == bankCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,bankCode,fingerprint,last4); + +@override +String toString() { + return 'SepaDebit(country: $country, bankCode: $bankCode, fingerprint: $fingerprint, last4: $last4)'; +} + + +} + +/// @nodoc +abstract mixin class $SepaDebitCopyWith<$Res> { + factory $SepaDebitCopyWith(SepaDebit value, $Res Function(SepaDebit) _then) = _$SepaDebitCopyWithImpl; +@useResult +$Res call({ + String? country, String? bankCode, String? fingerprint, String? last4 +}); + + + + +} +/// @nodoc +class _$SepaDebitCopyWithImpl<$Res> + implements $SepaDebitCopyWith<$Res> { + _$SepaDebitCopyWithImpl(this._self, this._then); + + final SepaDebit _self; + final $Res Function(SepaDebit) _then; + +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? country = freezed,Object? bankCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_self.copyWith( +country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,bankCode: freezed == bankCode ? _self.bankCode : bankCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [SepaDebit]. +extension SepaDebitPatterns on SepaDebit { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SepaDebit value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SepaDebit value) $default,){ +final _that = this; +switch (_that) { +case _SepaDebit(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SepaDebit value)? $default,){ +final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? country, String? bankCode, String? fingerprint, String? last4)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that.country,_that.bankCode,_that.fingerprint,_that.last4);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? country, String? bankCode, String? fingerprint, String? last4) $default,) {final _that = this; +switch (_that) { +case _SepaDebit(): +return $default(_that.country,_that.bankCode,_that.fingerprint,_that.last4);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? country, String? bankCode, String? fingerprint, String? last4)? $default,) {final _that = this; +switch (_that) { +case _SepaDebit() when $default != null: +return $default(_that.country,_that.bankCode,_that.fingerprint,_that.last4);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _SepaDebit implements SepaDebit { + const _SepaDebit({this.country, this.bankCode, this.fingerprint, this.last4}); + factory _SepaDebit.fromJson(Map json) => _$SepaDebitFromJson(json); + +/// Two letter ISO code representing the country of the bank account. +@override final String? country; +/// Bank code associated with the bankaccount. +@override final String? bankCode; +/// Unique ID for the bank account. +@override final String? fingerprint; +/// Last four characters of IBAN. +@override final String? last4; + +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SepaDebitCopyWith<_SepaDebit> get copyWith => __$SepaDebitCopyWithImpl<_SepaDebit>(this, _$identity); + +@override +Map toJson() { + return _$SepaDebitToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SepaDebit&&(identical(other.country, country) || other.country == country)&&(identical(other.bankCode, bankCode) || other.bankCode == bankCode)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.last4, last4) || other.last4 == last4)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,bankCode,fingerprint,last4); + +@override +String toString() { + return 'SepaDebit(country: $country, bankCode: $bankCode, fingerprint: $fingerprint, last4: $last4)'; +} + + +} + +/// @nodoc +abstract mixin class _$SepaDebitCopyWith<$Res> implements $SepaDebitCopyWith<$Res> { + factory _$SepaDebitCopyWith(_SepaDebit value, $Res Function(_SepaDebit) _then) = __$SepaDebitCopyWithImpl; +@override @useResult +$Res call({ + String? country, String? bankCode, String? fingerprint, String? last4 +}); + + + + +} +/// @nodoc +class __$SepaDebitCopyWithImpl<$Res> + implements _$SepaDebitCopyWith<$Res> { + __$SepaDebitCopyWithImpl(this._self, this._then); + + final _SepaDebit _self; + final $Res Function(_SepaDebit) _then; + +/// Create a copy of SepaDebit +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? country = freezed,Object? bankCode = freezed,Object? fingerprint = freezed,Object? last4 = freezed,}) { + return _then(_SepaDebit( +country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String?,bankCode: freezed == bankCode ? _self.bankCode : bankCode // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$Upi { + +/// The customer's vpa. + String? get vpa; +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UpiCopyWith get copyWith => _$UpiCopyWithImpl(this as Upi, _$identity); + + /// Serializes this Upi to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Upi&&(identical(other.vpa, vpa) || other.vpa == vpa)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,vpa); + +@override +String toString() { + return 'Upi(vpa: $vpa)'; +} + + +} + +/// @nodoc +abstract mixin class $UpiCopyWith<$Res> { + factory $UpiCopyWith(Upi value, $Res Function(Upi) _then) = _$UpiCopyWithImpl; +@useResult +$Res call({ + String? vpa +}); + + + + +} +/// @nodoc +class _$UpiCopyWithImpl<$Res> + implements $UpiCopyWith<$Res> { + _$UpiCopyWithImpl(this._self, this._then); + + final Upi _self; + final $Res Function(Upi) _then; + +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? vpa = freezed,}) { + return _then(_self.copyWith( +vpa: freezed == vpa ? _self.vpa : vpa // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [Upi]. +extension UpiPatterns on Upi { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _Upi value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _Upi value) $default,){ +final _that = this; +switch (_that) { +case _Upi(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _Upi value)? $default,){ +final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? vpa)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that.vpa);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? vpa) $default,) {final _that = this; +switch (_that) { +case _Upi(): +return $default(_that.vpa);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? vpa)? $default,) {final _that = this; +switch (_that) { +case _Upi() when $default != null: +return $default(_that.vpa);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _Upi implements Upi { + const _Upi({this.vpa}); + factory _Upi.fromJson(Map json) => _$UpiFromJson(json); + +/// The customer's vpa. +@override final String? vpa; + +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UpiCopyWith<_Upi> get copyWith => __$UpiCopyWithImpl<_Upi>(this, _$identity); + +@override +Map toJson() { + return _$UpiToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Upi&&(identical(other.vpa, vpa) || other.vpa == vpa)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,vpa); + +@override +String toString() { + return 'Upi(vpa: $vpa)'; +} + + +} + +/// @nodoc +abstract mixin class _$UpiCopyWith<$Res> implements $UpiCopyWith<$Res> { + factory _$UpiCopyWith(_Upi value, $Res Function(_Upi) _then) = __$UpiCopyWithImpl; +@override @useResult +$Res call({ + String? vpa +}); + + + + +} +/// @nodoc +class __$UpiCopyWithImpl<$Res> + implements _$UpiCopyWith<$Res> { + __$UpiCopyWithImpl(this._self, this._then); + + final _Upi _self; + final $Res Function(_Upi) _then; + +/// Create a copy of Upi +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? vpa = freezed,}) { + return _then(_Upi( +vpa: freezed == vpa ? _self.vpa : vpa // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$UsBankAccount { + +/// Routing number of the bank account + String? get routingNumber;/// Last 4 digits of the account + String? get last4;/// The bank account type of the holder + BankAccountHolderType? get accountHolderType;/// The account type + UsBankAccountType? get accountType;/// The name of the bank of the account + String? get bankName;/// Unique identifier for the bankaccount. + String? get fingerprint;/// Number of linkedaccount + String? get linkedAccount;/// list of preferred network + String? get preferredNetwork;/// list of preferred network names + List? get supportedNetworks; +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UsBankAccountCopyWith get copyWith => _$UsBankAccountCopyWithImpl(this as UsBankAccount, _$identity); + + /// Serializes this UsBankAccount to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UsBankAccount&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.linkedAccount, linkedAccount) || other.linkedAccount == linkedAccount)&&(identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork)&&const DeepCollectionEquality().equals(other.supportedNetworks, supportedNetworks)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,routingNumber,last4,accountHolderType,accountType,bankName,fingerprint,linkedAccount,preferredNetwork,const DeepCollectionEquality().hash(supportedNetworks)); + +@override +String toString() { + return 'UsBankAccount(routingNumber: $routingNumber, last4: $last4, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, fingerprint: $fingerprint, linkedAccount: $linkedAccount, preferredNetwork: $preferredNetwork, supportedNetworks: $supportedNetworks)'; +} + + +} + +/// @nodoc +abstract mixin class $UsBankAccountCopyWith<$Res> { + factory $UsBankAccountCopyWith(UsBankAccount value, $Res Function(UsBankAccount) _then) = _$UsBankAccountCopyWithImpl; +@useResult +$Res call({ + String? routingNumber, String? last4, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, String? bankName, String? fingerprint, String? linkedAccount, String? preferredNetwork, List? supportedNetworks +}); + + + + +} +/// @nodoc +class _$UsBankAccountCopyWithImpl<$Res> + implements $UsBankAccountCopyWith<$Res> { + _$UsBankAccountCopyWithImpl(this._self, this._then); + + final UsBankAccount _self; + final $Res Function(UsBankAccount) _then; + +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? routingNumber = freezed,Object? last4 = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,Object? bankName = freezed,Object? fingerprint = freezed,Object? linkedAccount = freezed,Object? preferredNetwork = freezed,Object? supportedNetworks = freezed,}) { + return _then(_self.copyWith( +routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,linkedAccount: freezed == linkedAccount ? _self.linkedAccount : linkedAccount // ignore: cast_nullable_to_non_nullable +as String?,preferredNetwork: freezed == preferredNetwork ? _self.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable +as String?,supportedNetworks: freezed == supportedNetworks ? _self.supportedNetworks : supportedNetworks // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [UsBankAccount]. +extension UsBankAccountPatterns on UsBankAccount { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _UsBankAccount value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _UsBankAccount value) $default,){ +final _that = this; +switch (_that) { +case _UsBankAccount(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _UsBankAccount value)? $default,){ +final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? routingNumber, String? last4, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, String? bankName, String? fingerprint, String? linkedAccount, String? preferredNetwork, List? supportedNetworks)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that.routingNumber,_that.last4,_that.accountHolderType,_that.accountType,_that.bankName,_that.fingerprint,_that.linkedAccount,_that.preferredNetwork,_that.supportedNetworks);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? routingNumber, String? last4, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, String? bankName, String? fingerprint, String? linkedAccount, String? preferredNetwork, List? supportedNetworks) $default,) {final _that = this; +switch (_that) { +case _UsBankAccount(): +return $default(_that.routingNumber,_that.last4,_that.accountHolderType,_that.accountType,_that.bankName,_that.fingerprint,_that.linkedAccount,_that.preferredNetwork,_that.supportedNetworks);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? routingNumber, String? last4, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, String? bankName, String? fingerprint, String? linkedAccount, String? preferredNetwork, List? supportedNetworks)? $default,) {final _that = this; +switch (_that) { +case _UsBankAccount() when $default != null: +return $default(_that.routingNumber,_that.last4,_that.accountHolderType,_that.accountType,_that.bankName,_that.fingerprint,_that.linkedAccount,_that.preferredNetwork,_that.supportedNetworks);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _UsBankAccount implements UsBankAccount { + const _UsBankAccount({this.routingNumber, this.last4, this.accountHolderType, this.accountType, this.bankName, this.fingerprint, this.linkedAccount, this.preferredNetwork, final List? supportedNetworks}): _supportedNetworks = supportedNetworks; + factory _UsBankAccount.fromJson(Map json) => _$UsBankAccountFromJson(json); + +/// Routing number of the bank account +@override final String? routingNumber; +/// Last 4 digits of the account +@override final String? last4; +/// The bank account type of the holder +@override final BankAccountHolderType? accountHolderType; +/// The account type +@override final UsBankAccountType? accountType; +/// The name of the bank of the account +@override final String? bankName; +/// Unique identifier for the bankaccount. +@override final String? fingerprint; +/// Number of linkedaccount +@override final String? linkedAccount; +/// list of preferred network +@override final String? preferredNetwork; +/// list of preferred network names + final List? _supportedNetworks; +/// list of preferred network names +@override List? get supportedNetworks { + final value = _supportedNetworks; + if (value == null) return null; + if (_supportedNetworks is EqualUnmodifiableListView) return _supportedNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + + +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UsBankAccountCopyWith<_UsBankAccount> get copyWith => __$UsBankAccountCopyWithImpl<_UsBankAccount>(this, _$identity); + +@override +Map toJson() { + return _$UsBankAccountToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UsBankAccount&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.last4, last4) || other.last4 == last4)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.fingerprint, fingerprint) || other.fingerprint == fingerprint)&&(identical(other.linkedAccount, linkedAccount) || other.linkedAccount == linkedAccount)&&(identical(other.preferredNetwork, preferredNetwork) || other.preferredNetwork == preferredNetwork)&&const DeepCollectionEquality().equals(other._supportedNetworks, _supportedNetworks)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,routingNumber,last4,accountHolderType,accountType,bankName,fingerprint,linkedAccount,preferredNetwork,const DeepCollectionEquality().hash(_supportedNetworks)); + +@override +String toString() { + return 'UsBankAccount(routingNumber: $routingNumber, last4: $last4, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, fingerprint: $fingerprint, linkedAccount: $linkedAccount, preferredNetwork: $preferredNetwork, supportedNetworks: $supportedNetworks)'; +} + + +} + +/// @nodoc +abstract mixin class _$UsBankAccountCopyWith<$Res> implements $UsBankAccountCopyWith<$Res> { + factory _$UsBankAccountCopyWith(_UsBankAccount value, $Res Function(_UsBankAccount) _then) = __$UsBankAccountCopyWithImpl; +@override @useResult +$Res call({ + String? routingNumber, String? last4, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, String? bankName, String? fingerprint, String? linkedAccount, String? preferredNetwork, List? supportedNetworks +}); + + + + +} +/// @nodoc +class __$UsBankAccountCopyWithImpl<$Res> + implements _$UsBankAccountCopyWith<$Res> { + __$UsBankAccountCopyWithImpl(this._self, this._then); + + final _UsBankAccount _self; + final $Res Function(_UsBankAccount) _then; + +/// Create a copy of UsBankAccount +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? routingNumber = freezed,Object? last4 = freezed,Object? accountHolderType = freezed,Object? accountType = freezed,Object? bankName = freezed,Object? fingerprint = freezed,Object? linkedAccount = freezed,Object? preferredNetwork = freezed,Object? supportedNetworks = freezed,}) { + return _then(_UsBankAccount( +routingNumber: freezed == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String?,last4: freezed == last4 ? _self.last4 : last4 // ignore: cast_nullable_to_non_nullable +as String?,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,fingerprint: freezed == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable +as String?,linkedAccount: freezed == linkedAccount ? _self.linkedAccount : linkedAccount // ignore: cast_nullable_to_non_nullable +as String?,preferredNetwork: freezed == preferredNetwork ? _self.preferredNetwork : preferredNetwork // ignore: cast_nullable_to_non_nullable +as String?,supportedNetworks: freezed == supportedNetworks ? _self._supportedNetworks : supportedNetworks // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + + +} + +PaymentMethodParams _$PaymentMethodParamsFromJson( + Map json +) { + switch (json['paymentMethodType']) { + case 'Card': + return _PaymentMethodParamsCard.fromJson( + json + ); + case 'Card': + return _PaymentMethodParamsCardWithToken.fromJson( + json + ); + case 'Card': + return _PaymentMethodParamsCardWithMethodId.fromJson( + json + ); + case 'Alipay': + return _PaymentMethodParamsAlipay.fromJson( + json + ); + case 'CashApp': + return _PaymentMethodParamsCashAppPay.fromJson( + json + ); + case 'Ideal': + return _PaymentMethodParamsIdeal.fromJson( + json + ); + case 'AuBecsDebit': + return _PaymentMethodParamsAubecs.fromJson( + json + ); + case 'Bancontact': + return _PaymentMethodParamsBankContact.fromJson( + json + ); + case 'Giropay': + return _PaymentMethodParamsGiroPay.fromJson( + json + ); + case 'Eps': + return _PaymentMethodParamsEps.fromJson( + json + ); + case 'Affirm': + return _PaymentMethodParamsAffirm.fromJson( + json + ); + case 'GrabPay': + return _PaymentMethodParamsPay.fromJson( + json + ); + case 'P24': + return _PaymentMethodParamsP24.fromJson( + json + ); + case 'Fpx': + return _PaymentMethodParamsFpx.fromJson( + json + ); + case 'SepaDebit': + return _PaymentMethodParamsSepaDebit.fromJson( + json + ); + case 'AfterpayClearpay': + return _PaymentMethodParamsAfterpayClearpay.fromJson( + json + ); + case 'Oxxo': + return _PaymentMethodParamsOxxo.fromJson( + json + ); + case 'Klarna': + return _PaymentMethodParamsKlarna.fromJson( + json + ); + case 'PayPal': + return _PaymentMethodParamsPayPal.fromJson( + json + ); + case 'RevolutPay': + return _PaymentMethodParamsRevolutPay.fromJson( + json + ); + case 'USBankAccount': + return _PaymentMethodParamsUsBankAccount.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'paymentMethodType', + 'PaymentMethodParams', + 'Invalid union type "${json['paymentMethodType']}"!' +); + } + +} + +/// @nodoc +mixin _$PaymentMethodParams { + +/// Paymentmethod data for this paymentmethod. + Object get paymentMethodData; + + /// Serializes this PaymentMethodParams to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodParams&&const DeepCollectionEquality().equals(other.paymentMethodData, paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(paymentMethodData)); + +@override +String toString() { + return 'PaymentMethodParams(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +class $PaymentMethodParamsCopyWith<$Res> { +$PaymentMethodParamsCopyWith(PaymentMethodParams _, $Res Function(PaymentMethodParams) __); +} + + +/// Adds pattern-matching-related methods to [PaymentMethodParams]. +extension PaymentMethodParamsPatterns on PaymentMethodParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _PaymentMethodParamsCard value)? card,TResult Function( _PaymentMethodParamsCardWithToken value)? cardFromToken,TResult Function( _PaymentMethodParamsCardWithMethodId value)? cardFromMethodId,TResult Function( _PaymentMethodParamsAlipay value)? alipay,TResult Function( _PaymentMethodParamsCashAppPay value)? cashAppPay,TResult Function( _PaymentMethodParamsIdeal value)? ideal,TResult Function( _PaymentMethodParamsAubecs value)? aubecs,TResult Function( _PaymentMethodParamsBankContact value)? bancontact,TResult Function( _PaymentMethodParamsGiroPay value)? giroPay,TResult Function( _PaymentMethodParamsEps value)? eps,TResult Function( _PaymentMethodParamsAffirm value)? affirm,TResult Function( _PaymentMethodParamsPay value)? grabPay,TResult Function( _PaymentMethodParamsP24 value)? p24,TResult Function( _PaymentMethodParamsFpx value)? fpx,TResult Function( _PaymentMethodParamsSepaDebit value)? sepaDebit,TResult Function( _PaymentMethodParamsAfterpayClearpay value)? afterpayClearpay,TResult Function( _PaymentMethodParamsOxxo value)? oxxo,TResult Function( _PaymentMethodParamsKlarna value)? klarna,TResult Function( _PaymentMethodParamsPayPal value)? payPal,TResult Function( _PaymentMethodParamsRevolutPay value)? revolutPay,TResult Function( _PaymentMethodParamsUsBankAccount value)? usBankAccount,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that);case _PaymentMethodParamsCashAppPay() when cashAppPay != null: +return cashAppPay(_that);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that);case _PaymentMethodParamsEps() when eps != null: +return eps(_that);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that);case _PaymentMethodParamsRevolutPay() when revolutPay != null: +return revolutPay(_that);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _PaymentMethodParamsCard value) card,required TResult Function( _PaymentMethodParamsCardWithToken value) cardFromToken,required TResult Function( _PaymentMethodParamsCardWithMethodId value) cardFromMethodId,required TResult Function( _PaymentMethodParamsAlipay value) alipay,required TResult Function( _PaymentMethodParamsCashAppPay value) cashAppPay,required TResult Function( _PaymentMethodParamsIdeal value) ideal,required TResult Function( _PaymentMethodParamsAubecs value) aubecs,required TResult Function( _PaymentMethodParamsBankContact value) bancontact,required TResult Function( _PaymentMethodParamsGiroPay value) giroPay,required TResult Function( _PaymentMethodParamsEps value) eps,required TResult Function( _PaymentMethodParamsAffirm value) affirm,required TResult Function( _PaymentMethodParamsPay value) grabPay,required TResult Function( _PaymentMethodParamsP24 value) p24,required TResult Function( _PaymentMethodParamsFpx value) fpx,required TResult Function( _PaymentMethodParamsSepaDebit value) sepaDebit,required TResult Function( _PaymentMethodParamsAfterpayClearpay value) afterpayClearpay,required TResult Function( _PaymentMethodParamsOxxo value) oxxo,required TResult Function( _PaymentMethodParamsKlarna value) klarna,required TResult Function( _PaymentMethodParamsPayPal value) payPal,required TResult Function( _PaymentMethodParamsRevolutPay value) revolutPay,required TResult Function( _PaymentMethodParamsUsBankAccount value) usBankAccount,}){ +final _that = this; +switch (_that) { +case _PaymentMethodParamsCard(): +return card(_that);case _PaymentMethodParamsCardWithToken(): +return cardFromToken(_that);case _PaymentMethodParamsCardWithMethodId(): +return cardFromMethodId(_that);case _PaymentMethodParamsAlipay(): +return alipay(_that);case _PaymentMethodParamsCashAppPay(): +return cashAppPay(_that);case _PaymentMethodParamsIdeal(): +return ideal(_that);case _PaymentMethodParamsAubecs(): +return aubecs(_that);case _PaymentMethodParamsBankContact(): +return bancontact(_that);case _PaymentMethodParamsGiroPay(): +return giroPay(_that);case _PaymentMethodParamsEps(): +return eps(_that);case _PaymentMethodParamsAffirm(): +return affirm(_that);case _PaymentMethodParamsPay(): +return grabPay(_that);case _PaymentMethodParamsP24(): +return p24(_that);case _PaymentMethodParamsFpx(): +return fpx(_that);case _PaymentMethodParamsSepaDebit(): +return sepaDebit(_that);case _PaymentMethodParamsAfterpayClearpay(): +return afterpayClearpay(_that);case _PaymentMethodParamsOxxo(): +return oxxo(_that);case _PaymentMethodParamsKlarna(): +return klarna(_that);case _PaymentMethodParamsPayPal(): +return payPal(_that);case _PaymentMethodParamsRevolutPay(): +return revolutPay(_that);case _PaymentMethodParamsUsBankAccount(): +return usBankAccount(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _PaymentMethodParamsCard value)? card,TResult? Function( _PaymentMethodParamsCardWithToken value)? cardFromToken,TResult? Function( _PaymentMethodParamsCardWithMethodId value)? cardFromMethodId,TResult? Function( _PaymentMethodParamsAlipay value)? alipay,TResult? Function( _PaymentMethodParamsCashAppPay value)? cashAppPay,TResult? Function( _PaymentMethodParamsIdeal value)? ideal,TResult? Function( _PaymentMethodParamsAubecs value)? aubecs,TResult? Function( _PaymentMethodParamsBankContact value)? bancontact,TResult? Function( _PaymentMethodParamsGiroPay value)? giroPay,TResult? Function( _PaymentMethodParamsEps value)? eps,TResult? Function( _PaymentMethodParamsAffirm value)? affirm,TResult? Function( _PaymentMethodParamsPay value)? grabPay,TResult? Function( _PaymentMethodParamsP24 value)? p24,TResult? Function( _PaymentMethodParamsFpx value)? fpx,TResult? Function( _PaymentMethodParamsSepaDebit value)? sepaDebit,TResult? Function( _PaymentMethodParamsAfterpayClearpay value)? afterpayClearpay,TResult? Function( _PaymentMethodParamsOxxo value)? oxxo,TResult? Function( _PaymentMethodParamsKlarna value)? klarna,TResult? Function( _PaymentMethodParamsPayPal value)? payPal,TResult? Function( _PaymentMethodParamsRevolutPay value)? revolutPay,TResult? Function( _PaymentMethodParamsUsBankAccount value)? usBankAccount,}){ +final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that);case _PaymentMethodParamsCashAppPay() when cashAppPay != null: +return cashAppPay(_that);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that);case _PaymentMethodParamsEps() when eps != null: +return eps(_that);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that);case _PaymentMethodParamsRevolutPay() when revolutPay != null: +return revolutPay(_that);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( PaymentMethodData paymentMethodData)? card,TResult Function( PaymentMethodDataCardFromToken paymentMethodData)? cardFromToken,TResult Function( PaymentMethodDataCardFromMethod paymentMethodData)? cardFromMethodId,TResult Function( PaymentMethodData paymentMethodData)? alipay,TResult Function( PaymentMethodData paymentMethodData)? cashAppPay,TResult Function( PaymentMethodDataIdeal paymentMethodData)? ideal,TResult Function( PaymentMethodDataAubecs paymentMethodData)? aubecs,TResult Function( PaymentMethodData paymentMethodData)? bancontact,TResult Function( PaymentMethodData paymentMethodData)? giroPay,TResult Function( PaymentMethodData paymentMethodData)? eps,TResult Function( PaymentMethodData paymentMethodData)? affirm,TResult Function( PaymentMethodData paymentMethodData)? grabPay,TResult Function( PaymentMethodData paymentMethodData)? p24,TResult Function( PaymentMethodDataFpx paymentMethodData)? fpx,TResult Function( PaymentMethodDataSepa paymentMethodData)? sepaDebit,TResult Function( PaymentMethodDataAfterPay paymentMethodData)? afterpayClearpay,TResult Function( PaymentMethodData paymentMethodData)? oxxo,TResult Function( PaymentMethodData paymentMethodData)? klarna,TResult Function( PaymentMethodData paymentMethodData)? payPal,TResult Function( PaymentMethodData paymentMethodData)? revolutPay,TResult Function( PaymentMethodDataUsBank paymentMethodData)? usBankAccount,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that.paymentMethodData);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that.paymentMethodData);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that.paymentMethodData);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that.paymentMethodData);case _PaymentMethodParamsCashAppPay() when cashAppPay != null: +return cashAppPay(_that.paymentMethodData);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that.paymentMethodData);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that.paymentMethodData);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that.paymentMethodData);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that.paymentMethodData);case _PaymentMethodParamsEps() when eps != null: +return eps(_that.paymentMethodData);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that.paymentMethodData);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that.paymentMethodData);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that.paymentMethodData);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that.paymentMethodData);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that.paymentMethodData);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that.paymentMethodData);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that.paymentMethodData);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that.paymentMethodData);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that.paymentMethodData);case _PaymentMethodParamsRevolutPay() when revolutPay != null: +return revolutPay(_that.paymentMethodData);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that.paymentMethodData);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( PaymentMethodData paymentMethodData) card,required TResult Function( PaymentMethodDataCardFromToken paymentMethodData) cardFromToken,required TResult Function( PaymentMethodDataCardFromMethod paymentMethodData) cardFromMethodId,required TResult Function( PaymentMethodData paymentMethodData) alipay,required TResult Function( PaymentMethodData paymentMethodData) cashAppPay,required TResult Function( PaymentMethodDataIdeal paymentMethodData) ideal,required TResult Function( PaymentMethodDataAubecs paymentMethodData) aubecs,required TResult Function( PaymentMethodData paymentMethodData) bancontact,required TResult Function( PaymentMethodData paymentMethodData) giroPay,required TResult Function( PaymentMethodData paymentMethodData) eps,required TResult Function( PaymentMethodData paymentMethodData) affirm,required TResult Function( PaymentMethodData paymentMethodData) grabPay,required TResult Function( PaymentMethodData paymentMethodData) p24,required TResult Function( PaymentMethodDataFpx paymentMethodData) fpx,required TResult Function( PaymentMethodDataSepa paymentMethodData) sepaDebit,required TResult Function( PaymentMethodDataAfterPay paymentMethodData) afterpayClearpay,required TResult Function( PaymentMethodData paymentMethodData) oxxo,required TResult Function( PaymentMethodData paymentMethodData) klarna,required TResult Function( PaymentMethodData paymentMethodData) payPal,required TResult Function( PaymentMethodData paymentMethodData) revolutPay,required TResult Function( PaymentMethodDataUsBank paymentMethodData) usBankAccount,}) {final _that = this; +switch (_that) { +case _PaymentMethodParamsCard(): +return card(_that.paymentMethodData);case _PaymentMethodParamsCardWithToken(): +return cardFromToken(_that.paymentMethodData);case _PaymentMethodParamsCardWithMethodId(): +return cardFromMethodId(_that.paymentMethodData);case _PaymentMethodParamsAlipay(): +return alipay(_that.paymentMethodData);case _PaymentMethodParamsCashAppPay(): +return cashAppPay(_that.paymentMethodData);case _PaymentMethodParamsIdeal(): +return ideal(_that.paymentMethodData);case _PaymentMethodParamsAubecs(): +return aubecs(_that.paymentMethodData);case _PaymentMethodParamsBankContact(): +return bancontact(_that.paymentMethodData);case _PaymentMethodParamsGiroPay(): +return giroPay(_that.paymentMethodData);case _PaymentMethodParamsEps(): +return eps(_that.paymentMethodData);case _PaymentMethodParamsAffirm(): +return affirm(_that.paymentMethodData);case _PaymentMethodParamsPay(): +return grabPay(_that.paymentMethodData);case _PaymentMethodParamsP24(): +return p24(_that.paymentMethodData);case _PaymentMethodParamsFpx(): +return fpx(_that.paymentMethodData);case _PaymentMethodParamsSepaDebit(): +return sepaDebit(_that.paymentMethodData);case _PaymentMethodParamsAfterpayClearpay(): +return afterpayClearpay(_that.paymentMethodData);case _PaymentMethodParamsOxxo(): +return oxxo(_that.paymentMethodData);case _PaymentMethodParamsKlarna(): +return klarna(_that.paymentMethodData);case _PaymentMethodParamsPayPal(): +return payPal(_that.paymentMethodData);case _PaymentMethodParamsRevolutPay(): +return revolutPay(_that.paymentMethodData);case _PaymentMethodParamsUsBankAccount(): +return usBankAccount(_that.paymentMethodData);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( PaymentMethodData paymentMethodData)? card,TResult? Function( PaymentMethodDataCardFromToken paymentMethodData)? cardFromToken,TResult? Function( PaymentMethodDataCardFromMethod paymentMethodData)? cardFromMethodId,TResult? Function( PaymentMethodData paymentMethodData)? alipay,TResult? Function( PaymentMethodData paymentMethodData)? cashAppPay,TResult? Function( PaymentMethodDataIdeal paymentMethodData)? ideal,TResult? Function( PaymentMethodDataAubecs paymentMethodData)? aubecs,TResult? Function( PaymentMethodData paymentMethodData)? bancontact,TResult? Function( PaymentMethodData paymentMethodData)? giroPay,TResult? Function( PaymentMethodData paymentMethodData)? eps,TResult? Function( PaymentMethodData paymentMethodData)? affirm,TResult? Function( PaymentMethodData paymentMethodData)? grabPay,TResult? Function( PaymentMethodData paymentMethodData)? p24,TResult? Function( PaymentMethodDataFpx paymentMethodData)? fpx,TResult? Function( PaymentMethodDataSepa paymentMethodData)? sepaDebit,TResult? Function( PaymentMethodDataAfterPay paymentMethodData)? afterpayClearpay,TResult? Function( PaymentMethodData paymentMethodData)? oxxo,TResult? Function( PaymentMethodData paymentMethodData)? klarna,TResult? Function( PaymentMethodData paymentMethodData)? payPal,TResult? Function( PaymentMethodData paymentMethodData)? revolutPay,TResult? Function( PaymentMethodDataUsBank paymentMethodData)? usBankAccount,}) {final _that = this; +switch (_that) { +case _PaymentMethodParamsCard() when card != null: +return card(_that.paymentMethodData);case _PaymentMethodParamsCardWithToken() when cardFromToken != null: +return cardFromToken(_that.paymentMethodData);case _PaymentMethodParamsCardWithMethodId() when cardFromMethodId != null: +return cardFromMethodId(_that.paymentMethodData);case _PaymentMethodParamsAlipay() when alipay != null: +return alipay(_that.paymentMethodData);case _PaymentMethodParamsCashAppPay() when cashAppPay != null: +return cashAppPay(_that.paymentMethodData);case _PaymentMethodParamsIdeal() when ideal != null: +return ideal(_that.paymentMethodData);case _PaymentMethodParamsAubecs() when aubecs != null: +return aubecs(_that.paymentMethodData);case _PaymentMethodParamsBankContact() when bancontact != null: +return bancontact(_that.paymentMethodData);case _PaymentMethodParamsGiroPay() when giroPay != null: +return giroPay(_that.paymentMethodData);case _PaymentMethodParamsEps() when eps != null: +return eps(_that.paymentMethodData);case _PaymentMethodParamsAffirm() when affirm != null: +return affirm(_that.paymentMethodData);case _PaymentMethodParamsPay() when grabPay != null: +return grabPay(_that.paymentMethodData);case _PaymentMethodParamsP24() when p24 != null: +return p24(_that.paymentMethodData);case _PaymentMethodParamsFpx() when fpx != null: +return fpx(_that.paymentMethodData);case _PaymentMethodParamsSepaDebit() when sepaDebit != null: +return sepaDebit(_that.paymentMethodData);case _PaymentMethodParamsAfterpayClearpay() when afterpayClearpay != null: +return afterpayClearpay(_that.paymentMethodData);case _PaymentMethodParamsOxxo() when oxxo != null: +return oxxo(_that.paymentMethodData);case _PaymentMethodParamsKlarna() when klarna != null: +return klarna(_that.paymentMethodData);case _PaymentMethodParamsPayPal() when payPal != null: +return payPal(_that.paymentMethodData);case _PaymentMethodParamsRevolutPay() when revolutPay != null: +return revolutPay(_that.paymentMethodData);case _PaymentMethodParamsUsBankAccount() when usBankAccount != null: +return usBankAccount(_that.paymentMethodData);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsCard implements PaymentMethodParams { + const _PaymentMethodParamsCard({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Card'; + factory _PaymentMethodParamsCard.fromJson(Map json) => _$PaymentMethodParamsCardFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCardCopyWith<_PaymentMethodParamsCard> get copyWith => __$PaymentMethodParamsCardCopyWithImpl<_PaymentMethodParamsCard>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsCardToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCard&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.card(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsCardCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCardCopyWith(_PaymentMethodParamsCard value, $Res Function(_PaymentMethodParamsCard) _then) = __$PaymentMethodParamsCardCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsCardCopyWithImpl<$Res> + implements _$PaymentMethodParamsCardCopyWith<$Res> { + __$PaymentMethodParamsCardCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsCard _self; + final $Res Function(_PaymentMethodParamsCard) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCard( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsCardWithToken implements PaymentMethodParams { + const _PaymentMethodParamsCardWithToken({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Card'; + factory _PaymentMethodParamsCardWithToken.fromJson(Map json) => _$PaymentMethodParamsCardWithTokenFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataCardFromToken paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCardWithTokenCopyWith<_PaymentMethodParamsCardWithToken> get copyWith => __$PaymentMethodParamsCardWithTokenCopyWithImpl<_PaymentMethodParamsCardWithToken>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsCardWithTokenToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCardWithToken&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.cardFromToken(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsCardWithTokenCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCardWithTokenCopyWith(_PaymentMethodParamsCardWithToken value, $Res Function(_PaymentMethodParamsCardWithToken) _then) = __$PaymentMethodParamsCardWithTokenCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataCardFromToken paymentMethodData +}); + + +$PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsCardWithTokenCopyWithImpl<$Res> + implements _$PaymentMethodParamsCardWithTokenCopyWith<$Res> { + __$PaymentMethodParamsCardWithTokenCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsCardWithToken _self; + final $Res Function(_PaymentMethodParamsCardWithToken) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCardWithToken( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataCardFromToken, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCardFromTokenCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsCardWithMethodId implements PaymentMethodParams { + const _PaymentMethodParamsCardWithMethodId({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Card'; + factory _PaymentMethodParamsCardWithMethodId.fromJson(Map json) => _$PaymentMethodParamsCardWithMethodIdFromJson(json); + +/// Payment method data object for card from payment method. +@override final PaymentMethodDataCardFromMethod paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCardWithMethodIdCopyWith<_PaymentMethodParamsCardWithMethodId> get copyWith => __$PaymentMethodParamsCardWithMethodIdCopyWithImpl<_PaymentMethodParamsCardWithMethodId>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsCardWithMethodIdToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCardWithMethodId&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.cardFromMethodId(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsCardWithMethodIdCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCardWithMethodIdCopyWith(_PaymentMethodParamsCardWithMethodId value, $Res Function(_PaymentMethodParamsCardWithMethodId) _then) = __$PaymentMethodParamsCardWithMethodIdCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataCardFromMethod paymentMethodData +}); + + +$PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsCardWithMethodIdCopyWithImpl<$Res> + implements _$PaymentMethodParamsCardWithMethodIdCopyWith<$Res> { + __$PaymentMethodParamsCardWithMethodIdCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsCardWithMethodId _self; + final $Res Function(_PaymentMethodParamsCardWithMethodId) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCardWithMethodId( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataCardFromMethod, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCardFromMethodCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsAlipay implements PaymentMethodParams { + const _PaymentMethodParamsAlipay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Alipay'; + factory _PaymentMethodParamsAlipay.fromJson(Map json) => _$PaymentMethodParamsAlipayFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAlipayCopyWith<_PaymentMethodParamsAlipay> get copyWith => __$PaymentMethodParamsAlipayCopyWithImpl<_PaymentMethodParamsAlipay>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsAlipayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAlipay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.alipay(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsAlipayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAlipayCopyWith(_PaymentMethodParamsAlipay value, $Res Function(_PaymentMethodParamsAlipay) _then) = __$PaymentMethodParamsAlipayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsAlipayCopyWithImpl<$Res> + implements _$PaymentMethodParamsAlipayCopyWith<$Res> { + __$PaymentMethodParamsAlipayCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsAlipay _self; + final $Res Function(_PaymentMethodParamsAlipay) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAlipay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsCashAppPay implements PaymentMethodParams { + const _PaymentMethodParamsCashAppPay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'CashApp'; + factory _PaymentMethodParamsCashAppPay.fromJson(Map json) => _$PaymentMethodParamsCashAppPayFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsCashAppPayCopyWith<_PaymentMethodParamsCashAppPay> get copyWith => __$PaymentMethodParamsCashAppPayCopyWithImpl<_PaymentMethodParamsCashAppPay>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsCashAppPayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsCashAppPay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.cashAppPay(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsCashAppPayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsCashAppPayCopyWith(_PaymentMethodParamsCashAppPay value, $Res Function(_PaymentMethodParamsCashAppPay) _then) = __$PaymentMethodParamsCashAppPayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsCashAppPayCopyWithImpl<$Res> + implements _$PaymentMethodParamsCashAppPayCopyWith<$Res> { + __$PaymentMethodParamsCashAppPayCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsCashAppPay _self; + final $Res Function(_PaymentMethodParamsCashAppPay) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsCashAppPay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsIdeal implements PaymentMethodParams { + const _PaymentMethodParamsIdeal({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Ideal'; + factory _PaymentMethodParamsIdeal.fromJson(Map json) => _$PaymentMethodParamsIdealFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataIdeal paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsIdealCopyWith<_PaymentMethodParamsIdeal> get copyWith => __$PaymentMethodParamsIdealCopyWithImpl<_PaymentMethodParamsIdeal>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsIdealToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsIdeal&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.ideal(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsIdealCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsIdealCopyWith(_PaymentMethodParamsIdeal value, $Res Function(_PaymentMethodParamsIdeal) _then) = __$PaymentMethodParamsIdealCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataIdeal paymentMethodData +}); + + +$PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsIdealCopyWithImpl<$Res> + implements _$PaymentMethodParamsIdealCopyWith<$Res> { + __$PaymentMethodParamsIdealCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsIdeal _self; + final $Res Function(_PaymentMethodParamsIdeal) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsIdeal( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataIdeal, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataIdealCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } -abstract class _Sofort implements Sofort { - const factory _Sofort({final String? country}) = _$SofortImpl; +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsAubecs implements PaymentMethodParams { + const _PaymentMethodParamsAubecs({required this.paymentMethodData, final String? $type}): $type = $type ?? 'AuBecsDebit'; + factory _PaymentMethodParamsAubecs.fromJson(Map json) => _$PaymentMethodParamsAubecsFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataAubecs paymentMethodData; - factory _Sofort.fromJson(Map json) = _$SofortImpl.fromJson; +@JsonKey(name: 'paymentMethodType') +final String $type; - /// Two letter ISO code representing the country of the bank account. - @override - String? get country; - /// Create a copy of Sofort - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SofortImplCopyWith<_$SofortImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAubecsCopyWith<_PaymentMethodParamsAubecs> get copyWith => __$PaymentMethodParamsAubecsCopyWithImpl<_PaymentMethodParamsAubecs>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsAubecsToJson(this, ); } -Upi _$UpiFromJson(Map json) { - return _Upi.fromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAubecs&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -/// @nodoc -mixin _$Upi { - /// The customer's vpa. - String? get vpa => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.aubecs(paymentMethodData: $paymentMethodData)'; +} - /// Serializes this Upi to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $UpiCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $UpiCopyWith<$Res> { - factory $UpiCopyWith(Upi value, $Res Function(Upi) then) = - _$UpiCopyWithImpl<$Res, Upi>; - @useResult - $Res call({String? vpa}); -} +abstract mixin class _$PaymentMethodParamsAubecsCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAubecsCopyWith(_PaymentMethodParamsAubecs value, $Res Function(_PaymentMethodParamsAubecs) _then) = __$PaymentMethodParamsAubecsCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataAubecs paymentMethodData +}); + +$PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData; + +} /// @nodoc -class _$UpiCopyWithImpl<$Res, $Val extends Upi> implements $UpiCopyWith<$Res> { - _$UpiCopyWithImpl(this._value, this._then); +class __$PaymentMethodParamsAubecsCopyWithImpl<$Res> + implements _$PaymentMethodParamsAubecsCopyWith<$Res> { + __$PaymentMethodParamsAubecsCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final _PaymentMethodParamsAubecs _self; + final $Res Function(_PaymentMethodParamsAubecs) _then; - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? vpa = freezed, - }) { - return _then(_value.copyWith( - vpa: freezed == vpa - ? _value.vpa - : vpa // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAubecs( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataAubecs, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataAubecsCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc -abstract class _$$UpiImplCopyWith<$Res> implements $UpiCopyWith<$Res> { - factory _$$UpiImplCopyWith(_$UpiImpl value, $Res Function(_$UpiImpl) then) = - __$$UpiImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? vpa}); + +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsBankContact implements PaymentMethodParams { + const _PaymentMethodParamsBankContact({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Bancontact'; + factory _PaymentMethodParamsBankContact.fromJson(Map json) => _$PaymentMethodParamsBankContactFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsBankContactCopyWith<_PaymentMethodParamsBankContact> get copyWith => __$PaymentMethodParamsBankContactCopyWithImpl<_PaymentMethodParamsBankContact>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsBankContactToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsBankContact&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.bancontact(paymentMethodData: $paymentMethodData)'; +} + + } /// @nodoc -class __$$UpiImplCopyWithImpl<$Res> extends _$UpiCopyWithImpl<$Res, _$UpiImpl> - implements _$$UpiImplCopyWith<$Res> { - __$$UpiImplCopyWithImpl(_$UpiImpl _value, $Res Function(_$UpiImpl) _then) - : super(_value, _then); +abstract mixin class _$PaymentMethodParamsBankContactCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsBankContactCopyWith(_PaymentMethodParamsBankContact value, $Res Function(_PaymentMethodParamsBankContact) _then) = __$PaymentMethodParamsBankContactCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? vpa = freezed, - }) { - return _then(_$UpiImpl( - vpa: freezed == vpa - ? _value.vpa - : vpa // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsBankContactCopyWithImpl<$Res> + implements _$PaymentMethodParamsBankContactCopyWith<$Res> { + __$PaymentMethodParamsBankContactCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsBankContact _self; + final $Res Function(_PaymentMethodParamsBankContact) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsBankContact( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$UpiImpl implements _Upi { - const _$UpiImpl({this.vpa}); +class _PaymentMethodParamsGiroPay implements PaymentMethodParams { + const _PaymentMethodParamsGiroPay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Giropay'; + factory _PaymentMethodParamsGiroPay.fromJson(Map json) => _$PaymentMethodParamsGiroPayFromJson(json); - factory _$UpiImpl.fromJson(Map json) => - _$$UpiImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// The customer's vpa. - @override - final String? vpa; +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - String toString() { - return 'Upi(vpa: $vpa)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UpiImpl && - (identical(other.vpa, vpa) || other.vpa == vpa)); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsGiroPayCopyWith<_PaymentMethodParamsGiroPay> get copyWith => __$PaymentMethodParamsGiroPayCopyWithImpl<_PaymentMethodParamsGiroPay>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, vpa); - - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$UpiImplCopyWith<_$UpiImpl> get copyWith => - __$$UpiImplCopyWithImpl<_$UpiImpl>(this, _$identity); - - @override - Map toJson() { - return _$$UpiImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PaymentMethodParamsGiroPayToJson(this, ); } -abstract class _Upi implements Upi { - const factory _Upi({final String? vpa}) = _$UpiImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsGiroPay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.giroPay(paymentMethodData: $paymentMethodData)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsGiroPayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsGiroPayCopyWith(_PaymentMethodParamsGiroPay value, $Res Function(_PaymentMethodParamsGiroPay) _then) = __$PaymentMethodParamsGiroPayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + - factory _Upi.fromJson(Map json) = _$UpiImpl.fromJson; +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsGiroPayCopyWithImpl<$Res> + implements _$PaymentMethodParamsGiroPayCopyWith<$Res> { + __$PaymentMethodParamsGiroPayCopyWithImpl(this._self, this._then); - /// The customer's vpa. - @override - String? get vpa; + final _PaymentMethodParamsGiroPay _self; + final $Res Function(_PaymentMethodParamsGiroPay) _then; - /// Create a copy of Upi - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$UpiImplCopyWith<_$UpiImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsGiroPay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); } -UsBankAccount _$UsBankAccountFromJson(Map json) { - return _UsBankAccount.fromJson(json); +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc -mixin _$UsBankAccount { - /// Routing number of the bank account - String? get routingNumber => throw _privateConstructorUsedError; - /// Last 4 digits of the account - String? get last4 => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsEps implements PaymentMethodParams { + const _PaymentMethodParamsEps({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Eps'; + factory _PaymentMethodParamsEps.fromJson(Map json) => _$PaymentMethodParamsEpsFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// The bank account type of the holder - BankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; +@JsonKey(name: 'paymentMethodType') +final String $type; - /// The account type - UsBankAccountType? get accountType => throw _privateConstructorUsedError; - /// The name of the bank of the account - String? get bankName => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsEpsCopyWith<_PaymentMethodParamsEps> get copyWith => __$PaymentMethodParamsEpsCopyWithImpl<_PaymentMethodParamsEps>(this, _$identity); - /// Unique identifier for the bankaccount. - String? get fingerprint => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentMethodParamsEpsToJson(this, ); +} - /// Number of linkedaccount - String? get linkedAccount => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsEps&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - /// list of preferred network - String? get preferredNetwork => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - /// list of preferred network names - List? get supportedNetworks => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodParams.eps(paymentMethodData: $paymentMethodData)'; +} - /// Serializes this UsBankAccount to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $UsBankAccountCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $UsBankAccountCopyWith<$Res> { - factory $UsBankAccountCopyWith( - UsBankAccount value, $Res Function(UsBankAccount) then) = - _$UsBankAccountCopyWithImpl<$Res, UsBankAccount>; - @useResult - $Res call( - {String? routingNumber, - String? last4, - BankAccountHolderType? accountHolderType, - UsBankAccountType? accountType, - String? bankName, - String? fingerprint, - String? linkedAccount, - String? preferredNetwork, - List? supportedNetworks}); -} +abstract mixin class _$PaymentMethodParamsEpsCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsEpsCopyWith(_PaymentMethodParamsEps value, $Res Function(_PaymentMethodParamsEps) _then) = __$PaymentMethodParamsEpsCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; +} /// @nodoc -class _$UsBankAccountCopyWithImpl<$Res, $Val extends UsBankAccount> - implements $UsBankAccountCopyWith<$Res> { - _$UsBankAccountCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? routingNumber = freezed, - Object? last4 = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? bankName = freezed, - Object? fingerprint = freezed, - Object? linkedAccount = freezed, - Object? preferredNetwork = freezed, - Object? supportedNetworks = freezed, - }) { - return _then(_value.copyWith( - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - linkedAccount: freezed == linkedAccount - ? _value.linkedAccount - : linkedAccount // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetwork: freezed == preferredNetwork - ? _value.preferredNetwork - : preferredNetwork // ignore: cast_nullable_to_non_nullable - as String?, - supportedNetworks: freezed == supportedNetworks - ? _value.supportedNetworks - : supportedNetworks // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); - } +class __$PaymentMethodParamsEpsCopyWithImpl<$Res> + implements _$PaymentMethodParamsEpsCopyWith<$Res> { + __$PaymentMethodParamsEpsCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsEps _self; + final $Res Function(_PaymentMethodParamsEps) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsEps( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); } -/// @nodoc -abstract class _$$UsBankAccountImplCopyWith<$Res> - implements $UsBankAccountCopyWith<$Res> { - factory _$$UsBankAccountImplCopyWith( - _$UsBankAccountImpl value, $Res Function(_$UsBankAccountImpl) then) = - __$$UsBankAccountImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? routingNumber, - String? last4, - BankAccountHolderType? accountHolderType, - UsBankAccountType? accountType, - String? bankName, - String? fingerprint, - String? linkedAccount, - String? preferredNetwork, - List? supportedNetworks}); -} - -/// @nodoc -class __$$UsBankAccountImplCopyWithImpl<$Res> - extends _$UsBankAccountCopyWithImpl<$Res, _$UsBankAccountImpl> - implements _$$UsBankAccountImplCopyWith<$Res> { - __$$UsBankAccountImplCopyWithImpl( - _$UsBankAccountImpl _value, $Res Function(_$UsBankAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? routingNumber = freezed, - Object? last4 = freezed, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? bankName = freezed, - Object? fingerprint = freezed, - Object? linkedAccount = freezed, - Object? preferredNetwork = freezed, - Object? supportedNetworks = freezed, - }) { - return _then(_$UsBankAccountImpl( - routingNumber: freezed == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String?, - last4: freezed == last4 - ? _value.last4 - : last4 // ignore: cast_nullable_to_non_nullable - as String?, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - fingerprint: freezed == fingerprint - ? _value.fingerprint - : fingerprint // ignore: cast_nullable_to_non_nullable - as String?, - linkedAccount: freezed == linkedAccount - ? _value.linkedAccount - : linkedAccount // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetwork: freezed == preferredNetwork - ? _value.preferredNetwork - : preferredNetwork // ignore: cast_nullable_to_non_nullable - as String?, - supportedNetworks: freezed == supportedNetworks - ? _value._supportedNetworks - : supportedNetworks // ignore: cast_nullable_to_non_nullable - as List?, - )); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$UsBankAccountImpl implements _UsBankAccount { - const _$UsBankAccountImpl( - {this.routingNumber, - this.last4, - this.accountHolderType, - this.accountType, - this.bankName, - this.fingerprint, - this.linkedAccount, - this.preferredNetwork, - final List? supportedNetworks}) - : _supportedNetworks = supportedNetworks; - - factory _$UsBankAccountImpl.fromJson(Map json) => - _$$UsBankAccountImplFromJson(json); - - /// Routing number of the bank account - @override - final String? routingNumber; - - /// Last 4 digits of the account - @override - final String? last4; - - /// The bank account type of the holder - @override - final BankAccountHolderType? accountHolderType; - - /// The account type - @override - final UsBankAccountType? accountType; - - /// The name of the bank of the account - @override - final String? bankName; - - /// Unique identifier for the bankaccount. - @override - final String? fingerprint; - - /// Number of linkedaccount - @override - final String? linkedAccount; - - /// list of preferred network - @override - final String? preferredNetwork; - - /// list of preferred network names - final List? _supportedNetworks; - - /// list of preferred network names - @override - List? get supportedNetworks { - final value = _supportedNetworks; - if (value == null) return null; - if (_supportedNetworks is EqualUnmodifiableListView) - return _supportedNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _PaymentMethodParamsAffirm implements PaymentMethodParams { + const _PaymentMethodParamsAffirm({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Affirm'; + factory _PaymentMethodParamsAffirm.fromJson(Map json) => _$PaymentMethodParamsAffirmFromJson(json); - @override - String toString() { - return 'UsBankAccount(routingNumber: $routingNumber, last4: $last4, accountHolderType: $accountHolderType, accountType: $accountType, bankName: $bankName, fingerprint: $fingerprint, linkedAccount: $linkedAccount, preferredNetwork: $preferredNetwork, supportedNetworks: $supportedNetworks)'; - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$UsBankAccountImpl && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.last4, last4) || other.last4 == last4) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.accountType, accountType) || - other.accountType == accountType) && - (identical(other.bankName, bankName) || - other.bankName == bankName) && - (identical(other.fingerprint, fingerprint) || - other.fingerprint == fingerprint) && - (identical(other.linkedAccount, linkedAccount) || - other.linkedAccount == linkedAccount) && - (identical(other.preferredNetwork, preferredNetwork) || - other.preferredNetwork == preferredNetwork) && - const DeepCollectionEquality() - .equals(other._supportedNetworks, _supportedNetworks)); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - routingNumber, - last4, - accountHolderType, - accountType, - bankName, - fingerprint, - linkedAccount, - preferredNetwork, - const DeepCollectionEquality().hash(_supportedNetworks)); - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$UsBankAccountImplCopyWith<_$UsBankAccountImpl> get copyWith => - __$$UsBankAccountImplCopyWithImpl<_$UsBankAccountImpl>(this, _$identity); - - @override - Map toJson() { - return _$$UsBankAccountImplToJson( - this, - ); - } + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAffirmCopyWith<_PaymentMethodParamsAffirm> get copyWith => __$PaymentMethodParamsAffirmCopyWithImpl<_PaymentMethodParamsAffirm>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsAffirmToJson(this, ); } -abstract class _UsBankAccount implements UsBankAccount { - const factory _UsBankAccount( - {final String? routingNumber, - final String? last4, - final BankAccountHolderType? accountHolderType, - final UsBankAccountType? accountType, - final String? bankName, - final String? fingerprint, - final String? linkedAccount, - final String? preferredNetwork, - final List? supportedNetworks}) = _$UsBankAccountImpl; - - factory _UsBankAccount.fromJson(Map json) = - _$UsBankAccountImpl.fromJson; - - /// Routing number of the bank account - @override - String? get routingNumber; - - /// Last 4 digits of the account - @override - String? get last4; - - /// The bank account type of the holder - @override - BankAccountHolderType? get accountHolderType; - - /// The account type - @override - UsBankAccountType? get accountType; - - /// The name of the bank of the account - @override - String? get bankName; - - /// Unique identifier for the bankaccount. - @override - String? get fingerprint; - - /// Number of linkedaccount - @override - String? get linkedAccount; - - /// list of preferred network - @override - String? get preferredNetwork; - - /// list of preferred network names - @override - List? get supportedNetworks; - - /// Create a copy of UsBankAccount - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$UsBankAccountImplCopyWith<_$UsBankAccountImpl> get copyWith => - throw _privateConstructorUsedError; -} - -PaymentMethodParams _$PaymentMethodParamsFromJson(Map json) { - switch (json['paymentMethodType']) { - case 'Card': - return _PaymentMethodParamsCard.fromJson(json); - case 'Card': - return _PaymentMethodParamsCardWithToken.fromJson(json); - case 'Card': - return _PaymentMethodParamsCardWithMethodId.fromJson(json); - case 'Alipay': - return _PaymentMethodParamsAlipay.fromJson(json); - case 'CashApp': - return _PaymentMethodParamsCashAppPay.fromJson(json); - case 'Ideal': - return _PaymentMethodParamsIdeal.fromJson(json); - case 'AuBecsDebit': - return _PaymentMethodParamsAubecs.fromJson(json); - case 'Bancontact': - return _PaymentMethodParamsBankContact.fromJson(json); - case 'Giropay': - return _PaymentMethodParamsGiroPay.fromJson(json); - case 'Eps': - return _PaymentMethodParamsEps.fromJson(json); - case 'Affirm': - return _PaymentMethodParamsAffirm.fromJson(json); - case 'GrabPay': - return _PaymentMethodParamsPay.fromJson(json); - case 'P24': - return _PaymentMethodParamsP24.fromJson(json); - case 'Fpx': - return _PaymentMethodParamsFpx.fromJson(json); - case 'SepaDebit': - return _PaymentMethodParamsSepaDebit.fromJson(json); - case 'Sofort': - return _PaymentMethodParamsSofort.fromJson(json); - case 'AfterpayClearpay': - return _PaymentMethodParamsAfterpayClearpay.fromJson(json); - case 'Oxxo': - return _PaymentMethodParamsOxxo.fromJson(json); - case 'Klarna': - return _PaymentMethodParamsKlarna.fromJson(json); - case 'PayPal': - return _PaymentMethodParamsPayPal.fromJson(json); - case 'RevolutPay': - return _PaymentMethodParamsRevolutPay.fromJson(json); - case 'USBankAccount': - return _PaymentMethodParamsUsBankAccount.fromJson(json); - - default: - throw CheckedFromJsonException( - json, - 'paymentMethodType', - 'PaymentMethodParams', - 'Invalid union type "${json['paymentMethodType']}"!'); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAffirm&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -/// @nodoc -mixin _$PaymentMethodParams { - /// Paymentmethod data for this paymentmethod. - Object get paymentMethodData => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - /// Serializes this PaymentMethodParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodParams.affirm(paymentMethodData: $paymentMethodData)'; } -/// @nodoc -abstract class $PaymentMethodParamsCopyWith<$Res> { - factory $PaymentMethodParamsCopyWith( - PaymentMethodParams value, $Res Function(PaymentMethodParams) then) = - _$PaymentMethodParamsCopyWithImpl<$Res, PaymentMethodParams>; + } /// @nodoc -class _$PaymentMethodParamsCopyWithImpl<$Res, $Val extends PaymentMethodParams> - implements $PaymentMethodParamsCopyWith<$Res> { - _$PaymentMethodParamsCopyWithImpl(this._value, this._then); +abstract mixin class _$PaymentMethodParamsAffirmCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAffirmCopyWith(_PaymentMethodParamsAffirm value, $Res Function(_PaymentMethodParamsAffirm) _then) = __$PaymentMethodParamsAffirmCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsAffirmCopyWithImpl<$Res> + implements _$PaymentMethodParamsAffirmCopyWith<$Res> { + __$PaymentMethodParamsAffirmCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final _PaymentMethodParamsAffirm _self; + final $Res Function(_PaymentMethodParamsAffirm) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAffirm( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc -abstract class _$$PaymentMethodParamsCardImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCardImplCopyWith( - _$PaymentMethodParamsCardImpl value, - $Res Function(_$PaymentMethodParamsCardImpl) then) = - __$$PaymentMethodParamsCardImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsPay implements PaymentMethodParams { + const _PaymentMethodParamsPay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'GrabPay'; + factory _PaymentMethodParamsPay.fromJson(Map json) => _$PaymentMethodParamsPayFromJson(json); + +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; + +@JsonKey(name: 'paymentMethodType') +final String $type; + + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsPayCopyWith<_PaymentMethodParamsPay> get copyWith => __$PaymentMethodParamsPayCopyWithImpl<_PaymentMethodParamsPay>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodParamsPayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsPay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.grabPay(paymentMethodData: $paymentMethodData)'; +} + + } /// @nodoc -class __$$PaymentMethodParamsCardImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCardImpl> - implements _$$PaymentMethodParamsCardImplCopyWith<$Res> { - __$$PaymentMethodParamsCardImplCopyWithImpl( - _$PaymentMethodParamsCardImpl _value, - $Res Function(_$PaymentMethodParamsCardImpl) _then) - : super(_value, _then); +abstract mixin class _$PaymentMethodParamsPayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsPayCopyWith(_PaymentMethodParamsPay value, $Res Function(_PaymentMethodParamsPay) _then) = __$PaymentMethodParamsPayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCardImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsPayCopyWithImpl<$Res> + implements _$PaymentMethodParamsPayCopyWith<$Res> { + __$PaymentMethodParamsPayCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsPay _self; + final $Res Function(_PaymentMethodParamsPay) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsPay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCardImpl implements _PaymentMethodParamsCard { - const _$PaymentMethodParamsCardImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Card'; +class _PaymentMethodParamsP24 implements PaymentMethodParams { + const _PaymentMethodParamsP24({required this.paymentMethodData, final String? $type}): $type = $type ?? 'P24'; + factory _PaymentMethodParamsP24.fromJson(Map json) => _$PaymentMethodParamsP24FromJson(json); - factory _$PaymentMethodParamsCardImpl.fromJson(Map json) => - _$$PaymentMethodParamsCardImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.card(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsP24CopyWith<_PaymentMethodParamsP24> get copyWith => __$PaymentMethodParamsP24CopyWithImpl<_PaymentMethodParamsP24>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCardImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@override +Map toJson() { + return _$PaymentMethodParamsP24ToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCardImplCopyWith<_$PaymentMethodParamsCardImpl> - get copyWith => __$$PaymentMethodParamsCardImplCopyWithImpl< - _$PaymentMethodParamsCardImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return card(paymentMethodData); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsP24&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return card?.call(paymentMethodData); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (card != null) { - return card(paymentMethodData); - } - return orElse(); - } +@override +String toString() { + return 'PaymentMethodParams.p24(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return card(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return card?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (card != null) { - return card(this); - } - return orElse(); - } +/// @nodoc +abstract mixin class _$PaymentMethodParamsP24CopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsP24CopyWith(_PaymentMethodParamsP24 value, $Res Function(_PaymentMethodParamsP24) _then) = __$PaymentMethodParamsP24CopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); + + +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - @override - Map toJson() { - return _$$PaymentMethodParamsCardImplToJson( - this, - ); - } } +/// @nodoc +class __$PaymentMethodParamsP24CopyWithImpl<$Res> + implements _$PaymentMethodParamsP24CopyWith<$Res> { + __$PaymentMethodParamsP24CopyWithImpl(this._self, this._then); -abstract class _PaymentMethodParamsCard implements PaymentMethodParams { - const factory _PaymentMethodParamsCard( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsCardImpl; - - factory _PaymentMethodParamsCard.fromJson(Map json) = - _$PaymentMethodParamsCardImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCardImplCopyWith<_$PaymentMethodParamsCardImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsCardWithTokenImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCardWithTokenImplCopyWith( - _$PaymentMethodParamsCardWithTokenImpl value, - $Res Function(_$PaymentMethodParamsCardWithTokenImpl) then) = - __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataCardFromToken paymentMethodData}); - - $PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCardWithTokenImpl> - implements _$$PaymentMethodParamsCardWithTokenImplCopyWith<$Res> { - __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl( - _$PaymentMethodParamsCardWithTokenImpl _value, - $Res Function(_$PaymentMethodParamsCardWithTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCardWithTokenImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataCardFromToken, - )); - } + final _PaymentMethodParamsP24 _self; + final $Res Function(_PaymentMethodParamsP24) _then; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCardFromTokenCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCardFromTokenCopyWith<$Res>( - _value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsP24( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCardWithTokenImpl - implements _PaymentMethodParamsCardWithToken { - const _$PaymentMethodParamsCardWithTokenImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Card'; - - factory _$PaymentMethodParamsCardWithTokenImpl.fromJson( - Map json) => - _$$PaymentMethodParamsCardWithTokenImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataCardFromToken paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.cardFromToken(paymentMethodData: $paymentMethodData)'; - } +class _PaymentMethodParamsFpx implements PaymentMethodParams { + const _PaymentMethodParamsFpx({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Fpx'; + factory _PaymentMethodParamsFpx.fromJson(Map json) => _$PaymentMethodParamsFpxFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCardWithTokenImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataFpx paymentMethodData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCardWithTokenImplCopyWith< - _$PaymentMethodParamsCardWithTokenImpl> - get copyWith => __$$PaymentMethodParamsCardWithTokenImplCopyWithImpl< - _$PaymentMethodParamsCardWithTokenImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return cardFromToken(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return cardFromToken?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromToken != null) { - return cardFromToken(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsFpxCopyWith<_PaymentMethodParamsFpx> get copyWith => __$PaymentMethodParamsFpxCopyWithImpl<_PaymentMethodParamsFpx>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return cardFromToken(this); - } +@override +Map toJson() { + return _$PaymentMethodParamsFpxToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return cardFromToken?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsFpx&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromToken != null) { - return cardFromToken(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - Map toJson() { - return _$$PaymentMethodParamsCardWithTokenImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodParams.fpx(paymentMethodData: $paymentMethodData)'; } -abstract class _PaymentMethodParamsCardWithToken - implements PaymentMethodParams { - const factory _PaymentMethodParamsCardWithToken( - {required final PaymentMethodDataCardFromToken paymentMethodData}) = - _$PaymentMethodParamsCardWithTokenImpl; - - factory _PaymentMethodParamsCardWithToken.fromJson( - Map json) = - _$PaymentMethodParamsCardWithTokenImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataCardFromToken get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCardWithTokenImplCopyWith< - _$PaymentMethodParamsCardWithTokenImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsCardWithMethodIdImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCardWithMethodIdImplCopyWith( - _$PaymentMethodParamsCardWithMethodIdImpl value, - $Res Function(_$PaymentMethodParamsCardWithMethodIdImpl) then) = - __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataCardFromMethod paymentMethodData}); - - $PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCardWithMethodIdImpl> - implements _$$PaymentMethodParamsCardWithMethodIdImplCopyWith<$Res> { - __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl( - _$PaymentMethodParamsCardWithMethodIdImpl _value, - $Res Function(_$PaymentMethodParamsCardWithMethodIdImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCardWithMethodIdImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataCardFromMethod, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCardFromMethodCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCardFromMethodCopyWith<$Res>( - _value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsFpxCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsFpxCopyWith(_PaymentMethodParamsFpx value, $Res Function(_PaymentMethodParamsFpx) _then) = __$PaymentMethodParamsFpxCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataFpx paymentMethodData +}); + + +$PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsFpxCopyWithImpl<$Res> + implements _$PaymentMethodParamsFpxCopyWith<$Res> { + __$PaymentMethodParamsFpxCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsFpx _self; + final $Res Function(_PaymentMethodParamsFpx) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsFpx( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataFpx, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataFpxCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCardWithMethodIdImpl - implements _PaymentMethodParamsCardWithMethodId { - const _$PaymentMethodParamsCardWithMethodIdImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Card'; - - factory _$PaymentMethodParamsCardWithMethodIdImpl.fromJson( - Map json) => - _$$PaymentMethodParamsCardWithMethodIdImplFromJson(json); - - /// Payment method data object for card from payment method. - @override - final PaymentMethodDataCardFromMethod paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.cardFromMethodId(paymentMethodData: $paymentMethodData)'; - } +class _PaymentMethodParamsSepaDebit implements PaymentMethodParams { + const _PaymentMethodParamsSepaDebit({required this.paymentMethodData, final String? $type}): $type = $type ?? 'SepaDebit'; + factory _PaymentMethodParamsSepaDebit.fromJson(Map json) => _$PaymentMethodParamsSepaDebitFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCardWithMethodIdImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataSepa paymentMethodData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCardWithMethodIdImplCopyWith< - _$PaymentMethodParamsCardWithMethodIdImpl> - get copyWith => __$$PaymentMethodParamsCardWithMethodIdImplCopyWithImpl< - _$PaymentMethodParamsCardWithMethodIdImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return cardFromMethodId(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return cardFromMethodId?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromMethodId != null) { - return cardFromMethodId(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsSepaDebitCopyWith<_PaymentMethodParamsSepaDebit> get copyWith => __$PaymentMethodParamsSepaDebitCopyWithImpl<_PaymentMethodParamsSepaDebit>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return cardFromMethodId(this); - } +@override +Map toJson() { + return _$PaymentMethodParamsSepaDebitToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return cardFromMethodId?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsSepaDebit&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (cardFromMethodId != null) { - return cardFromMethodId(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - Map toJson() { - return _$$PaymentMethodParamsCardWithMethodIdImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodParams.sepaDebit(paymentMethodData: $paymentMethodData)'; } -abstract class _PaymentMethodParamsCardWithMethodId - implements PaymentMethodParams { - const factory _PaymentMethodParamsCardWithMethodId( - {required final PaymentMethodDataCardFromMethod paymentMethodData}) = - _$PaymentMethodParamsCardWithMethodIdImpl; - - factory _PaymentMethodParamsCardWithMethodId.fromJson( - Map json) = - _$PaymentMethodParamsCardWithMethodIdImpl.fromJson; - - /// Payment method data object for card from payment method. - @override - PaymentMethodDataCardFromMethod get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCardWithMethodIdImplCopyWith< - _$PaymentMethodParamsCardWithMethodIdImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsAlipayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAlipayImplCopyWith( - _$PaymentMethodParamsAlipayImpl value, - $Res Function(_$PaymentMethodParamsAlipayImpl) then) = - __$$PaymentMethodParamsAlipayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsAlipayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAlipayImpl> - implements _$$PaymentMethodParamsAlipayImplCopyWith<$Res> { - __$$PaymentMethodParamsAlipayImplCopyWithImpl( - _$PaymentMethodParamsAlipayImpl _value, - $Res Function(_$PaymentMethodParamsAlipayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAlipayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +} + +/// @nodoc +abstract mixin class _$PaymentMethodParamsSepaDebitCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsSepaDebitCopyWith(_PaymentMethodParamsSepaDebit value, $Res Function(_PaymentMethodParamsSepaDebit) _then) = __$PaymentMethodParamsSepaDebitCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataSepa paymentMethodData +}); + + +$PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData; + +} +/// @nodoc +class __$PaymentMethodParamsSepaDebitCopyWithImpl<$Res> + implements _$PaymentMethodParamsSepaDebitCopyWith<$Res> { + __$PaymentMethodParamsSepaDebitCopyWithImpl(this._self, this._then); + + final _PaymentMethodParamsSepaDebit _self; + final $Res Function(_PaymentMethodParamsSepaDebit) _then; + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsSepaDebit( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataSepa, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataSepaCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAlipayImpl implements _PaymentMethodParamsAlipay { - const _$PaymentMethodParamsAlipayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Alipay'; +class _PaymentMethodParamsAfterpayClearpay implements PaymentMethodParams { + const _PaymentMethodParamsAfterpayClearpay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'AfterpayClearpay'; + factory _PaymentMethodParamsAfterpayClearpay.fromJson(Map json) => _$PaymentMethodParamsAfterpayClearpayFromJson(json); - factory _$PaymentMethodParamsAlipayImpl.fromJson(Map json) => - _$$PaymentMethodParamsAlipayImplFromJson(json); +@override final PaymentMethodDataAfterPay paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.alipay(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsAfterpayClearpayCopyWith<_PaymentMethodParamsAfterpayClearpay> get copyWith => __$PaymentMethodParamsAfterpayClearpayCopyWithImpl<_PaymentMethodParamsAfterpayClearpay>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAlipayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@override +Map toJson() { + return _$PaymentMethodParamsAfterpayClearpayToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAlipayImplCopyWith<_$PaymentMethodParamsAlipayImpl> - get copyWith => __$$PaymentMethodParamsAlipayImplCopyWithImpl< - _$PaymentMethodParamsAlipayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return alipay(paymentMethodData); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsAfterpayClearpay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return alipay?.call(paymentMethodData); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (alipay != null) { - return alipay(paymentMethodData); - } - return orElse(); - } +@override +String toString() { + return 'PaymentMethodParams.afterpayClearpay(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return alipay(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return alipay?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (alipay != null) { - return alipay(this); - } - return orElse(); - } +/// @nodoc +abstract mixin class _$PaymentMethodParamsAfterpayClearpayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsAfterpayClearpayCopyWith(_PaymentMethodParamsAfterpayClearpay value, $Res Function(_PaymentMethodParamsAfterpayClearpay) _then) = __$PaymentMethodParamsAfterpayClearpayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataAfterPay paymentMethodData +}); + + +$PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData; - @override - Map toJson() { - return _$$PaymentMethodParamsAlipayImplToJson( - this, - ); - } } +/// @nodoc +class __$PaymentMethodParamsAfterpayClearpayCopyWithImpl<$Res> + implements _$PaymentMethodParamsAfterpayClearpayCopyWith<$Res> { + __$PaymentMethodParamsAfterpayClearpayCopyWithImpl(this._self, this._then); -abstract class _PaymentMethodParamsAlipay implements PaymentMethodParams { - const factory _PaymentMethodParamsAlipay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsAlipayImpl; - - factory _PaymentMethodParamsAlipay.fromJson(Map json) = - _$PaymentMethodParamsAlipayImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAlipayImplCopyWith<_$PaymentMethodParamsAlipayImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsCashAppPayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsCashAppPayImplCopyWith( - _$PaymentMethodParamsCashAppPayImpl value, - $Res Function(_$PaymentMethodParamsCashAppPayImpl) then) = - __$$PaymentMethodParamsCashAppPayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsCashAppPayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsCashAppPayImpl> - implements _$$PaymentMethodParamsCashAppPayImplCopyWith<$Res> { - __$$PaymentMethodParamsCashAppPayImplCopyWithImpl( - _$PaymentMethodParamsCashAppPayImpl _value, - $Res Function(_$PaymentMethodParamsCashAppPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsCashAppPayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } + final _PaymentMethodParamsAfterpayClearpay _self; + final $Res Function(_PaymentMethodParamsAfterpayClearpay) _then; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsAfterpayClearpay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataAfterPay, + )); +} + +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataAfterPayCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsCashAppPayImpl - implements _PaymentMethodParamsCashAppPay { - const _$PaymentMethodParamsCashAppPayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'CashApp'; - - factory _$PaymentMethodParamsCashAppPayImpl.fromJson( - Map json) => - _$$PaymentMethodParamsCashAppPayImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.cashAppPay(paymentMethodData: $paymentMethodData)'; - } +class _PaymentMethodParamsOxxo implements PaymentMethodParams { + const _PaymentMethodParamsOxxo({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Oxxo'; + factory _PaymentMethodParamsOxxo.fromJson(Map json) => _$PaymentMethodParamsOxxoFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsCashAppPayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsCashAppPayImplCopyWith< - _$PaymentMethodParamsCashAppPayImpl> - get copyWith => __$$PaymentMethodParamsCashAppPayImplCopyWithImpl< - _$PaymentMethodParamsCashAppPayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return cashAppPay(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return cashAppPay?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (cashAppPay != null) { - return cashAppPay(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsOxxoCopyWith<_PaymentMethodParamsOxxo> get copyWith => __$PaymentMethodParamsOxxoCopyWithImpl<_PaymentMethodParamsOxxo>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return cashAppPay(this); - } +@override +Map toJson() { + return _$PaymentMethodParamsOxxoToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return cashAppPay?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsOxxo&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (cashAppPay != null) { - return cashAppPay(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - Map toJson() { - return _$$PaymentMethodParamsCashAppPayImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodParams.oxxo(paymentMethodData: $paymentMethodData)'; } -abstract class _PaymentMethodParamsCashAppPay implements PaymentMethodParams { - const factory _PaymentMethodParamsCashAppPay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsCashAppPayImpl; - - factory _PaymentMethodParamsCashAppPay.fromJson(Map json) = - _$PaymentMethodParamsCashAppPayImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsCashAppPayImplCopyWith< - _$PaymentMethodParamsCashAppPayImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsIdealImplCopyWith<$Res> { - factory _$$PaymentMethodParamsIdealImplCopyWith( - _$PaymentMethodParamsIdealImpl value, - $Res Function(_$PaymentMethodParamsIdealImpl) then) = - __$$PaymentMethodParamsIdealImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataIdeal paymentMethodData}); - - $PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsIdealImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsIdealImpl> - implements _$$PaymentMethodParamsIdealImplCopyWith<$Res> { - __$$PaymentMethodParamsIdealImplCopyWithImpl( - _$PaymentMethodParamsIdealImpl _value, - $Res Function(_$PaymentMethodParamsIdealImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsIdealImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataIdeal, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataIdealCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataIdealCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class _$PaymentMethodParamsOxxoCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsOxxoCopyWith(_PaymentMethodParamsOxxo value, $Res Function(_PaymentMethodParamsOxxo) _then) = __$PaymentMethodParamsOxxoCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsIdealImpl implements _PaymentMethodParamsIdeal { - const _$PaymentMethodParamsIdealImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Ideal'; - factory _$PaymentMethodParamsIdealImpl.fromJson(Map json) => - _$$PaymentMethodParamsIdealImplFromJson(json); +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataIdeal paymentMethodData; +} +/// @nodoc +class __$PaymentMethodParamsOxxoCopyWithImpl<$Res> + implements _$PaymentMethodParamsOxxoCopyWith<$Res> { + __$PaymentMethodParamsOxxoCopyWithImpl(this._self, this._then); - @JsonKey(name: 'paymentMethodType') - final String $type; + final _PaymentMethodParamsOxxo _self; + final $Res Function(_PaymentMethodParamsOxxo) _then; - @override - String toString() { - return 'PaymentMethodParams.ideal(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsOxxo( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsIdealImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsIdealImplCopyWith<_$PaymentMethodParamsIdealImpl> - get copyWith => __$$PaymentMethodParamsIdealImplCopyWithImpl< - _$PaymentMethodParamsIdealImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return ideal(paymentMethodData); - } +/// @nodoc - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return ideal?.call(paymentMethodData); - } +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsKlarna implements PaymentMethodParams { + const _PaymentMethodParamsKlarna({required this.paymentMethodData, final String? $type}): $type = $type ?? 'Klarna'; + factory _PaymentMethodParamsKlarna.fromJson(Map json) => _$PaymentMethodParamsKlarnaFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (ideal != null) { - return ideal(paymentMethodData); - } - return orElse(); - } +/// Paymentmethod data for this paymentmethod. +/// +/// Make sure to add an email and country (part of the address) in the +/// billingdetails which is required for using Klarna. +@override final PaymentMethodData paymentMethodData; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return ideal(this); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return ideal?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (ideal != null) { - return ideal(this); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsKlarnaCopyWith<_PaymentMethodParamsKlarna> get copyWith => __$PaymentMethodParamsKlarnaCopyWithImpl<_PaymentMethodParamsKlarna>(this, _$identity); - @override - Map toJson() { - return _$$PaymentMethodParamsIdealImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PaymentMethodParamsKlarnaToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsKlarna&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); + +@override +String toString() { + return 'PaymentMethodParams.klarna(paymentMethodData: $paymentMethodData)'; } -abstract class _PaymentMethodParamsIdeal implements PaymentMethodParams { - const factory _PaymentMethodParamsIdeal( - {required final PaymentMethodDataIdeal paymentMethodData}) = - _$PaymentMethodParamsIdealImpl; - - factory _PaymentMethodParamsIdeal.fromJson(Map json) = - _$PaymentMethodParamsIdealImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataIdeal get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsIdealImplCopyWith<_$PaymentMethodParamsIdealImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsAubecsImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAubecsImplCopyWith( - _$PaymentMethodParamsAubecsImpl value, - $Res Function(_$PaymentMethodParamsAubecsImpl) then) = - __$$PaymentMethodParamsAubecsImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataAubecs paymentMethodData}); - - $PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsAubecsImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAubecsImpl> - implements _$$PaymentMethodParamsAubecsImplCopyWith<$Res> { - __$$PaymentMethodParamsAubecsImplCopyWithImpl( - _$PaymentMethodParamsAubecsImpl _value, - $Res Function(_$PaymentMethodParamsAubecsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAubecsImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataAubecs, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataAubecsCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataAubecsCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class _$PaymentMethodParamsKlarnaCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsKlarnaCopyWith(_PaymentMethodParamsKlarna value, $Res Function(_PaymentMethodParamsKlarna) _then) = __$PaymentMethodParamsKlarnaCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAubecsImpl implements _PaymentMethodParamsAubecs { - const _$PaymentMethodParamsAubecsImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'AuBecsDebit'; - factory _$PaymentMethodParamsAubecsImpl.fromJson(Map json) => - _$$PaymentMethodParamsAubecsImplFromJson(json); +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataAubecs paymentMethodData; +} +/// @nodoc +class __$PaymentMethodParamsKlarnaCopyWithImpl<$Res> + implements _$PaymentMethodParamsKlarnaCopyWith<$Res> { + __$PaymentMethodParamsKlarnaCopyWithImpl(this._self, this._then); - @JsonKey(name: 'paymentMethodType') - final String $type; + final _PaymentMethodParamsKlarna _self; + final $Res Function(_PaymentMethodParamsKlarna) _then; - @override - String toString() { - return 'PaymentMethodParams.aubecs(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsKlarna( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAubecsImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAubecsImplCopyWith<_$PaymentMethodParamsAubecsImpl> - get copyWith => __$$PaymentMethodParamsAubecsImplCopyWithImpl< - _$PaymentMethodParamsAubecsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return aubecs(paymentMethodData); - } +/// @nodoc - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return aubecs?.call(paymentMethodData); - } +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsPayPal implements PaymentMethodParams { + const _PaymentMethodParamsPayPal({required this.paymentMethodData, final String? $type}): $type = $type ?? 'PayPal'; + factory _PaymentMethodParamsPayPal.fromJson(Map json) => _$PaymentMethodParamsPayPalFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (aubecs != null) { - return aubecs(paymentMethodData); - } - return orElse(); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return aubecs(this); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return aubecs?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (aubecs != null) { - return aubecs(this); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsPayPalCopyWith<_PaymentMethodParamsPayPal> get copyWith => __$PaymentMethodParamsPayPalCopyWithImpl<_PaymentMethodParamsPayPal>(this, _$identity); - @override - Map toJson() { - return _$$PaymentMethodParamsAubecsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PaymentMethodParamsPayPalToJson(this, ); } -abstract class _PaymentMethodParamsAubecs implements PaymentMethodParams { - const factory _PaymentMethodParamsAubecs( - {required final PaymentMethodDataAubecs paymentMethodData}) = - _$PaymentMethodParamsAubecsImpl; - - factory _PaymentMethodParamsAubecs.fromJson(Map json) = - _$PaymentMethodParamsAubecsImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataAubecs get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAubecsImplCopyWith<_$PaymentMethodParamsAubecsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsBankContactImplCopyWith<$Res> { - factory _$$PaymentMethodParamsBankContactImplCopyWith( - _$PaymentMethodParamsBankContactImpl value, - $Res Function(_$PaymentMethodParamsBankContactImpl) then) = - __$$PaymentMethodParamsBankContactImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsBankContactImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsBankContactImpl> - implements _$$PaymentMethodParamsBankContactImplCopyWith<$Res> { - __$$PaymentMethodParamsBankContactImplCopyWithImpl( - _$PaymentMethodParamsBankContactImpl _value, - $Res Function(_$PaymentMethodParamsBankContactImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsBankContactImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsPayPal&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); } -/// @nodoc +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsBankContactImpl - implements _PaymentMethodParamsBankContact { - const _$PaymentMethodParamsBankContactImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Bancontact'; - - factory _$PaymentMethodParamsBankContactImpl.fromJson( - Map json) => - _$$PaymentMethodParamsBankContactImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.bancontact(paymentMethodData: $paymentMethodData)'; - } +@override +String toString() { + return 'PaymentMethodParams.payPal(paymentMethodData: $paymentMethodData)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsBankContactImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsBankContactImplCopyWith< - _$PaymentMethodParamsBankContactImpl> - get copyWith => __$$PaymentMethodParamsBankContactImplCopyWithImpl< - _$PaymentMethodParamsBankContactImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return bancontact(paymentMethodData); - } +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return bancontact?.call(paymentMethodData); - } +/// @nodoc +abstract mixin class _$PaymentMethodParamsPayPalCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsPayPalCopyWith(_PaymentMethodParamsPayPal value, $Res Function(_PaymentMethodParamsPayPal) _then) = __$PaymentMethodParamsPayPalCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (bancontact != null) { - return bancontact(paymentMethodData); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return bancontact(this); - } +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return bancontact?.call(this); - } +} +/// @nodoc +class __$PaymentMethodParamsPayPalCopyWithImpl<$Res> + implements _$PaymentMethodParamsPayPalCopyWith<$Res> { + __$PaymentMethodParamsPayPalCopyWithImpl(this._self, this._then); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (bancontact != null) { - return bancontact(this); - } - return orElse(); - } + final _PaymentMethodParamsPayPal _self; + final $Res Function(_PaymentMethodParamsPayPal) _then; - @override - Map toJson() { - return _$$PaymentMethodParamsBankContactImplToJson( - this, - ); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsPayPal( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); } -abstract class _PaymentMethodParamsBankContact implements PaymentMethodParams { - const factory _PaymentMethodParamsBankContact( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsBankContactImpl; - - factory _PaymentMethodParamsBankContact.fromJson(Map json) = - _$PaymentMethodParamsBankContactImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsBankContactImplCopyWith< - _$PaymentMethodParamsBankContactImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsGiroPayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsGiroPayImplCopyWith( - _$PaymentMethodParamsGiroPayImpl value, - $Res Function(_$PaymentMethodParamsGiroPayImpl) then) = - __$$PaymentMethodParamsGiroPayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsGiroPayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsGiroPayImpl> - implements _$$PaymentMethodParamsGiroPayImplCopyWith<$Res> { - __$$PaymentMethodParamsGiroPayImplCopyWithImpl( - _$PaymentMethodParamsGiroPayImpl _value, - $Res Function(_$PaymentMethodParamsGiroPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsGiroPayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsGiroPayImpl implements _PaymentMethodParamsGiroPay { - const _$PaymentMethodParamsGiroPayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Giropay'; +class _PaymentMethodParamsRevolutPay implements PaymentMethodParams { + const _PaymentMethodParamsRevolutPay({required this.paymentMethodData, final String? $type}): $type = $type ?? 'RevolutPay'; + factory _PaymentMethodParamsRevolutPay.fromJson(Map json) => _$PaymentMethodParamsRevolutPayFromJson(json); - factory _$PaymentMethodParamsGiroPayImpl.fromJson( - Map json) => - _$$PaymentMethodParamsGiroPayImplFromJson(json); +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodData paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +@JsonKey(name: 'paymentMethodType') +final String $type; - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.giroPay(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsRevolutPayCopyWith<_PaymentMethodParamsRevolutPay> get copyWith => __$PaymentMethodParamsRevolutPayCopyWithImpl<_PaymentMethodParamsRevolutPay>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsGiroPayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@override +Map toJson() { + return _$PaymentMethodParamsRevolutPayToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsGiroPayImplCopyWith<_$PaymentMethodParamsGiroPayImpl> - get copyWith => __$$PaymentMethodParamsGiroPayImplCopyWithImpl< - _$PaymentMethodParamsGiroPayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return giroPay(paymentMethodData); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsRevolutPay&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return giroPay?.call(paymentMethodData); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (giroPay != null) { - return giroPay(paymentMethodData); - } - return orElse(); - } +@override +String toString() { + return 'PaymentMethodParams.revolutPay(paymentMethodData: $paymentMethodData)'; +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return giroPay(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return giroPay?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (giroPay != null) { - return giroPay(this); - } - return orElse(); - } +/// @nodoc +abstract mixin class _$PaymentMethodParamsRevolutPayCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsRevolutPayCopyWith(_PaymentMethodParamsRevolutPay value, $Res Function(_PaymentMethodParamsRevolutPay) _then) = __$PaymentMethodParamsRevolutPayCopyWithImpl; +@useResult +$Res call({ + PaymentMethodData paymentMethodData +}); - @override - Map toJson() { - return _$$PaymentMethodParamsGiroPayImplToJson( - this, - ); - } -} -abstract class _PaymentMethodParamsGiroPay implements PaymentMethodParams { - const factory _PaymentMethodParamsGiroPay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsGiroPayImpl; - - factory _PaymentMethodParamsGiroPay.fromJson(Map json) = - _$PaymentMethodParamsGiroPayImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsGiroPayImplCopyWith<_$PaymentMethodParamsGiroPayImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsEpsImplCopyWith<$Res> { - factory _$$PaymentMethodParamsEpsImplCopyWith( - _$PaymentMethodParamsEpsImpl value, - $Res Function(_$PaymentMethodParamsEpsImpl) then) = - __$$PaymentMethodParamsEpsImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsEpsImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsEpsImpl> - implements _$$PaymentMethodParamsEpsImplCopyWith<$Res> { - __$$PaymentMethodParamsEpsImplCopyWithImpl( - _$PaymentMethodParamsEpsImpl _value, - $Res Function(_$PaymentMethodParamsEpsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsEpsImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +$PaymentMethodDataCopyWith<$Res> get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } - /// @nodoc +class __$PaymentMethodParamsRevolutPayCopyWithImpl<$Res> + implements _$PaymentMethodParamsRevolutPayCopyWith<$Res> { + __$PaymentMethodParamsRevolutPayCopyWithImpl(this._self, this._then); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsEpsImpl implements _PaymentMethodParamsEps { - const _$PaymentMethodParamsEpsImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Eps'; + final _PaymentMethodParamsRevolutPay _self; + final $Res Function(_PaymentMethodParamsRevolutPay) _then; - factory _$PaymentMethodParamsEpsImpl.fromJson(Map json) => - _$$PaymentMethodParamsEpsImplFromJson(json); +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsRevolutPay( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodData, + )); +} - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} - @JsonKey(name: 'paymentMethodType') - final String $type; +/// @nodoc - @override - String toString() { - return 'PaymentMethodParams.eps(paymentMethodData: $paymentMethodData)'; - } +@JsonSerializable(explicitToJson: true) +class _PaymentMethodParamsUsBankAccount implements PaymentMethodParams { + const _PaymentMethodParamsUsBankAccount({required this.paymentMethodData, final String? $type}): $type = $type ?? 'USBankAccount'; + factory _PaymentMethodParamsUsBankAccount.fromJson(Map json) => _$PaymentMethodParamsUsBankAccountFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsEpsImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Paymentmethod data for this paymentmethod. +@override final PaymentMethodDataUsBank paymentMethodData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsEpsImplCopyWith<_$PaymentMethodParamsEpsImpl> - get copyWith => __$$PaymentMethodParamsEpsImplCopyWithImpl< - _$PaymentMethodParamsEpsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return eps(paymentMethodData); - } +@JsonKey(name: 'paymentMethodType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return eps?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (eps != null) { - return eps(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodParamsUsBankAccountCopyWith<_PaymentMethodParamsUsBankAccount> get copyWith => __$PaymentMethodParamsUsBankAccountCopyWithImpl<_PaymentMethodParamsUsBankAccount>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return eps(this); - } +@override +Map toJson() { + return _$PaymentMethodParamsUsBankAccountToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return eps?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodParamsUsBankAccount&&(identical(other.paymentMethodData, paymentMethodData) || other.paymentMethodData == paymentMethodData)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (eps != null) { - return eps(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodData); - @override - Map toJson() { - return _$$PaymentMethodParamsEpsImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodParams.usBankAccount(paymentMethodData: $paymentMethodData)'; } -abstract class _PaymentMethodParamsEps implements PaymentMethodParams { - const factory _PaymentMethodParamsEps( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsEpsImpl; - - factory _PaymentMethodParamsEps.fromJson(Map json) = - _$PaymentMethodParamsEpsImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsEpsImplCopyWith<_$PaymentMethodParamsEpsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsAffirmImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAffirmImplCopyWith( - _$PaymentMethodParamsAffirmImpl value, - $Res Function(_$PaymentMethodParamsAffirmImpl) then) = - __$$PaymentMethodParamsAffirmImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsAffirmImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAffirmImpl> - implements _$$PaymentMethodParamsAffirmImplCopyWith<$Res> { - __$$PaymentMethodParamsAffirmImplCopyWithImpl( - _$PaymentMethodParamsAffirmImpl _value, - $Res Function(_$PaymentMethodParamsAffirmImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAffirmImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class _$PaymentMethodParamsUsBankAccountCopyWith<$Res> implements $PaymentMethodParamsCopyWith<$Res> { + factory _$PaymentMethodParamsUsBankAccountCopyWith(_PaymentMethodParamsUsBankAccount value, $Res Function(_PaymentMethodParamsUsBankAccount) _then) = __$PaymentMethodParamsUsBankAccountCopyWithImpl; +@useResult +$Res call({ + PaymentMethodDataUsBank paymentMethodData +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAffirmImpl implements _PaymentMethodParamsAffirm { - const _$PaymentMethodParamsAffirmImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Affirm'; - factory _$PaymentMethodParamsAffirmImpl.fromJson(Map json) => - _$$PaymentMethodParamsAffirmImplFromJson(json); +$PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +} +/// @nodoc +class __$PaymentMethodParamsUsBankAccountCopyWithImpl<$Res> + implements _$PaymentMethodParamsUsBankAccountCopyWith<$Res> { + __$PaymentMethodParamsUsBankAccountCopyWithImpl(this._self, this._then); - @JsonKey(name: 'paymentMethodType') - final String $type; + final _PaymentMethodParamsUsBankAccount _self; + final $Res Function(_PaymentMethodParamsUsBankAccount) _then; - @override - String toString() { - return 'PaymentMethodParams.affirm(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? paymentMethodData = null,}) { + return _then(_PaymentMethodParamsUsBankAccount( +paymentMethodData: null == paymentMethodData ? _self.paymentMethodData : paymentMethodData // ignore: cast_nullable_to_non_nullable +as PaymentMethodDataUsBank, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAffirmImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +/// Create a copy of PaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData { + + return $PaymentMethodDataUsBankCopyWith<$Res>(_self.paymentMethodData, (value) { + return _then(_self.copyWith(paymentMethodData: value)); + }); +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAffirmImplCopyWith<_$PaymentMethodParamsAffirmImpl> - get copyWith => __$$PaymentMethodParamsAffirmImplCopyWithImpl< - _$PaymentMethodParamsAffirmImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return affirm(paymentMethodData); - } - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return affirm?.call(paymentMethodData); - } +/// @nodoc +mixin _$PaymentMethodData { - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (affirm != null) { - return affirm(paymentMethodData); - } - return orElse(); - } +/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataCopyWith get copyWith => _$PaymentMethodDataCopyWithImpl(this as PaymentMethodData, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return affirm(this); - } + /// Serializes this PaymentMethodData to a JSON map. + Map toJson(); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return affirm?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (affirm != null) { - return affirm(this); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodData&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} - @override - Map toJson() { - return _$$PaymentMethodParamsAffirmImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); + +@override +String toString() { + return 'PaymentMethodData(billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -abstract class _PaymentMethodParamsAffirm implements PaymentMethodParams { - const factory _PaymentMethodParamsAffirm( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsAffirmImpl; - - factory _PaymentMethodParamsAffirm.fromJson(Map json) = - _$PaymentMethodParamsAffirmImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAffirmImplCopyWith<_$PaymentMethodParamsAffirmImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsPayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsPayImplCopyWith( - _$PaymentMethodParamsPayImpl value, - $Res Function(_$PaymentMethodParamsPayImpl) then) = - __$$PaymentMethodParamsPayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsPayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsPayImpl> - implements _$$PaymentMethodParamsPayImplCopyWith<$Res> { - __$$PaymentMethodParamsPayImplCopyWithImpl( - _$PaymentMethodParamsPayImpl _value, - $Res Function(_$PaymentMethodParamsPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsPayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class $PaymentMethodDataCopyWith<$Res> { + factory $PaymentMethodDataCopyWith(PaymentMethodData value, $Res Function(PaymentMethodData) _then) = _$PaymentMethodDataCopyWithImpl; +@useResult +$Res call({ + BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsPayImpl implements _PaymentMethodParamsPay { - const _$PaymentMethodParamsPayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'GrabPay'; - - factory _$PaymentMethodParamsPayImpl.fromJson(Map json) => - _$$PaymentMethodParamsPayImplFromJson(json); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - @JsonKey(name: 'paymentMethodType') - final String $type; +} +/// @nodoc +class _$PaymentMethodDataCopyWithImpl<$Res> + implements $PaymentMethodDataCopyWith<$Res> { + _$PaymentMethodDataCopyWithImpl(this._self, this._then); + + final PaymentMethodData _self; + final $Res Function(PaymentMethodData) _then; + +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodData]. +extension PaymentMethodDataPatterns on PaymentMethodData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodData value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodData value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodData(): +return $default(_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - @override - String toString() { - return 'PaymentMethodParams.grabPay(paymentMethodData: $paymentMethodData)'; - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodData() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsPayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsPayImplCopyWith<_$PaymentMethodParamsPayImpl> - get copyWith => __$$PaymentMethodParamsPayImplCopyWithImpl< - _$PaymentMethodParamsPayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return grabPay(paymentMethodData); - } +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return grabPay?.call(paymentMethodData); - } +/// @nodoc - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (grabPay != null) { - return grabPay(paymentMethodData); - } - return orElse(); - } +@JsonSerializable(explicitToJson: true) +class _PaymentMethodData implements PaymentMethodData { + const _PaymentMethodData({this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodData.fromJson(Map json) => _$PaymentMethodDataFromJson(json); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return grabPay(this); - } +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return grabPay?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (grabPay != null) { - return grabPay(this); - } - return orElse(); - } +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataCopyWith<_PaymentMethodData> get copyWith => __$PaymentMethodDataCopyWithImpl<_PaymentMethodData>(this, _$identity); - @override - Map toJson() { - return _$$PaymentMethodParamsPayImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PaymentMethodDataToJson(this, ); } -abstract class _PaymentMethodParamsPay implements PaymentMethodParams { - const factory _PaymentMethodParamsPay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsPayImpl; - - factory _PaymentMethodParamsPay.fromJson(Map json) = - _$PaymentMethodParamsPayImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsPayImplCopyWith<_$PaymentMethodParamsPayImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsP24ImplCopyWith<$Res> { - factory _$$PaymentMethodParamsP24ImplCopyWith( - _$PaymentMethodParamsP24Impl value, - $Res Function(_$PaymentMethodParamsP24Impl) then) = - __$$PaymentMethodParamsP24ImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsP24ImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsP24Impl> - implements _$$PaymentMethodParamsP24ImplCopyWith<$Res> { - __$$PaymentMethodParamsP24ImplCopyWithImpl( - _$PaymentMethodParamsP24Impl _value, - $Res Function(_$PaymentMethodParamsP24Impl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsP24Impl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodData&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); } -/// @nodoc +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsP24Impl implements _PaymentMethodParamsP24 { - const _$PaymentMethodParamsP24Impl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'P24'; +@override +String toString() { + return 'PaymentMethodData(billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} - factory _$PaymentMethodParamsP24Impl.fromJson(Map json) => - _$$PaymentMethodParamsP24ImplFromJson(json); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +} - @JsonKey(name: 'paymentMethodType') - final String $type; +/// @nodoc +abstract mixin class _$PaymentMethodDataCopyWith<$Res> implements $PaymentMethodDataCopyWith<$Res> { + factory _$PaymentMethodDataCopyWith(_PaymentMethodData value, $Res Function(_PaymentMethodData) _then) = __$PaymentMethodDataCopyWithImpl; +@override @useResult +$Res call({ + BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - @override - String toString() { - return 'PaymentMethodParams.p24(paymentMethodData: $paymentMethodData)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsP24Impl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsP24ImplCopyWith<_$PaymentMethodParamsP24Impl> - get copyWith => __$$PaymentMethodParamsP24ImplCopyWithImpl< - _$PaymentMethodParamsP24Impl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return p24(paymentMethodData); - } +} +/// @nodoc +class __$PaymentMethodDataCopyWithImpl<$Res> + implements _$PaymentMethodDataCopyWith<$Res> { + __$PaymentMethodDataCopyWithImpl(this._self, this._then); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return p24?.call(paymentMethodData); - } + final _PaymentMethodData _self; + final $Res Function(_PaymentMethodData) _then; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (p24 != null) { - return p24(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodData( +billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return p24(this); +/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return p24?.call(this); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (p24 != null) { - return p24(this); - } - return orElse(); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - @override - Map toJson() { - return _$$PaymentMethodParamsP24ImplToJson( - this, - ); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); } - -abstract class _PaymentMethodParamsP24 implements PaymentMethodParams { - const factory _PaymentMethodParamsP24( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsP24Impl; - - factory _PaymentMethodParamsP24.fromJson(Map json) = - _$PaymentMethodParamsP24Impl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsP24ImplCopyWith<_$PaymentMethodParamsP24Impl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsFpxImplCopyWith<$Res> { - factory _$$PaymentMethodParamsFpxImplCopyWith( - _$PaymentMethodParamsFpxImpl value, - $Res Function(_$PaymentMethodParamsFpxImpl) then) = - __$$PaymentMethodParamsFpxImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataFpx paymentMethodData}); - - $PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsFpxImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsFpxImpl> - implements _$$PaymentMethodParamsFpxImplCopyWith<$Res> { - __$$PaymentMethodParamsFpxImplCopyWithImpl( - _$PaymentMethodParamsFpxImpl _value, - $Res Function(_$PaymentMethodParamsFpxImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsFpxImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataFpx, - )); - } - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataFpxCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataFpxCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsFpxImpl implements _PaymentMethodParamsFpx { - const _$PaymentMethodParamsFpxImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Fpx'; +/// @nodoc +mixin _$PaymentMethodDataCardFromToken { - factory _$PaymentMethodParamsFpxImpl.fromJson(Map json) => - _$$PaymentMethodParamsFpxImplFromJson(json); +/// Token. + String get token;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromTokenCopyWith get copyWith => _$PaymentMethodDataCardFromTokenCopyWithImpl(this as PaymentMethodDataCardFromToken, _$identity); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataFpx paymentMethodData; + /// Serializes this PaymentMethodDataCardFromToken to a JSON map. + Map toJson(); - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.fpx(paymentMethodData: $paymentMethodData)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataCardFromToken&&(identical(other.token, token) || other.token == token)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsFpxImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsFpxImplCopyWith<_$PaymentMethodParamsFpxImpl> - get copyWith => __$$PaymentMethodParamsFpxImplCopyWithImpl< - _$PaymentMethodParamsFpxImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return fpx(paymentMethodData); - } +@override +String toString() { + return 'PaymentMethodDataCardFromToken(token: $token, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return fpx?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (fpx != null) { - return fpx(paymentMethodData); - } - return orElse(); - } +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return fpx(this); - } +/// @nodoc +abstract mixin class $PaymentMethodDataCardFromTokenCopyWith<$Res> { + factory $PaymentMethodDataCardFromTokenCopyWith(PaymentMethodDataCardFromToken value, $Res Function(PaymentMethodDataCardFromToken) _then) = _$PaymentMethodDataCardFromTokenCopyWithImpl; +@useResult +$Res call({ + String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return fpx?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (fpx != null) { - return fpx(this); - } - return orElse(); - } +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - @override - Map toJson() { - return _$$PaymentMethodParamsFpxImplToJson( - this, - ); - } } +/// @nodoc +class _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res> + implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { + _$PaymentMethodDataCardFromTokenCopyWithImpl(this._self, this._then); + + final PaymentMethodDataCardFromToken _self; + final $Res Function(PaymentMethodDataCardFromToken) _then; + +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? token = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataCardFromToken]. +extension PaymentMethodDataCardFromTokenPatterns on PaymentMethodDataCardFromToken { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataCardFromToken value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataCardFromToken value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataCardFromToken value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that.token,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken(): +return $default(_that.token,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` -abstract class _PaymentMethodParamsFpx implements PaymentMethodParams { - const factory _PaymentMethodParamsFpx( - {required final PaymentMethodDataFpx paymentMethodData}) = - _$PaymentMethodParamsFpxImpl; - - factory _PaymentMethodParamsFpx.fromJson(Map json) = - _$PaymentMethodParamsFpxImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataFpx get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsFpxImplCopyWith<_$PaymentMethodParamsFpxImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsSepaDebitImplCopyWith<$Res> { - factory _$$PaymentMethodParamsSepaDebitImplCopyWith( - _$PaymentMethodParamsSepaDebitImpl value, - $Res Function(_$PaymentMethodParamsSepaDebitImpl) then) = - __$$PaymentMethodParamsSepaDebitImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataSepa paymentMethodData}); - - $PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsSepaDebitImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsSepaDebitImpl> - implements _$$PaymentMethodParamsSepaDebitImplCopyWith<$Res> { - __$$PaymentMethodParamsSepaDebitImplCopyWithImpl( - _$PaymentMethodParamsSepaDebitImpl _value, - $Res Function(_$PaymentMethodParamsSepaDebitImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsSepaDebitImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataSepa, - )); - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromToken() when $default != null: +return $default(_that.token,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; + +} +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataSepaCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataSepaCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsSepaDebitImpl - implements _PaymentMethodParamsSepaDebit { - const _$PaymentMethodParamsSepaDebitImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'SepaDebit'; - - factory _$PaymentMethodParamsSepaDebitImpl.fromJson( - Map json) => - _$$PaymentMethodParamsSepaDebitImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataSepa paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.sepaDebit(paymentMethodData: $paymentMethodData)'; - } +class _PaymentMethodDataCardFromToken implements PaymentMethodDataCardFromToken { + const _PaymentMethodDataCardFromToken({required this.token, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataCardFromToken.fromJson(Map json) => _$PaymentMethodDataCardFromTokenFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsSepaDebitImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsSepaDebitImplCopyWith< - _$PaymentMethodParamsSepaDebitImpl> - get copyWith => __$$PaymentMethodParamsSepaDebitImplCopyWithImpl< - _$PaymentMethodParamsSepaDebitImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return sepaDebit(paymentMethodData); - } +/// Token. +@override final String token; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return sepaDebit?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (sepaDebit != null) { - return sepaDebit(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataCardFromTokenCopyWith<_PaymentMethodDataCardFromToken> get copyWith => __$PaymentMethodDataCardFromTokenCopyWithImpl<_PaymentMethodDataCardFromToken>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return sepaDebit(this); - } +@override +Map toJson() { + return _$PaymentMethodDataCardFromTokenToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return sepaDebit?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataCardFromToken&&(identical(other.token, token) || other.token == token)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (sepaDebit != null) { - return sepaDebit(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - @override - Map toJson() { - return _$$PaymentMethodParamsSepaDebitImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodDataCardFromToken(token: $token, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -abstract class _PaymentMethodParamsSepaDebit implements PaymentMethodParams { - const factory _PaymentMethodParamsSepaDebit( - {required final PaymentMethodDataSepa paymentMethodData}) = - _$PaymentMethodParamsSepaDebitImpl; - - factory _PaymentMethodParamsSepaDebit.fromJson(Map json) = - _$PaymentMethodParamsSepaDebitImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataSepa get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsSepaDebitImplCopyWith< - _$PaymentMethodParamsSepaDebitImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsSofortImplCopyWith<$Res> { - factory _$$PaymentMethodParamsSofortImplCopyWith( - _$PaymentMethodParamsSofortImpl value, - $Res Function(_$PaymentMethodParamsSofortImpl) then) = - __$$PaymentMethodParamsSofortImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataSofort paymentMethodData}); - - $PaymentMethodDataSofortCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsSofortImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsSofortImpl> - implements _$$PaymentMethodParamsSofortImplCopyWith<$Res> { - __$$PaymentMethodParamsSofortImplCopyWithImpl( - _$PaymentMethodParamsSofortImpl _value, - $Res Function(_$PaymentMethodParamsSofortImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsSofortImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataSofort, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataSofortCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataSofortCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class _$PaymentMethodDataCardFromTokenCopyWith<$Res> implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { + factory _$PaymentMethodDataCardFromTokenCopyWith(_PaymentMethodDataCardFromToken value, $Res Function(_PaymentMethodDataCardFromToken) _then) = __$PaymentMethodDataCardFromTokenCopyWithImpl; +@override @useResult +$Res call({ + String token, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsSofortImpl implements _PaymentMethodParamsSofort { - const _$PaymentMethodParamsSofortImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Sofort'; - factory _$PaymentMethodParamsSofortImpl.fromJson(Map json) => - _$$PaymentMethodParamsSofortImplFromJson(json); +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - @override - final PaymentMethodDataSofort paymentMethodData; +} +/// @nodoc +class __$PaymentMethodDataCardFromTokenCopyWithImpl<$Res> + implements _$PaymentMethodDataCardFromTokenCopyWith<$Res> { + __$PaymentMethodDataCardFromTokenCopyWithImpl(this._self, this._then); - @JsonKey(name: 'paymentMethodType') - final String $type; + final _PaymentMethodDataCardFromToken _self; + final $Res Function(_PaymentMethodDataCardFromToken) _then; - @override - String toString() { - return 'PaymentMethodParams.sofort(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? token = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataCardFromToken( +token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsSofortImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); +/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsSofortImplCopyWith<_$PaymentMethodParamsSofortImpl> - get copyWith => __$$PaymentMethodParamsSofortImplCopyWithImpl< - _$PaymentMethodParamsSofortImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return sofort(paymentMethodData); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return sofort?.call(paymentMethodData); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromToken +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (sofort != null) { - return sofort(paymentMethodData); - } - return orElse(); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return sofort(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return sofort?.call(this); - } +/// @nodoc +mixin _$PaymentMethodDataCardFromMethod { - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (sofort != null) { - return sofort(this); - } - return orElse(); - } +/// Payment method id. + String get paymentMethodId;/// Cvc of the cart + String? get cvc;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataCardFromMethodCopyWith get copyWith => _$PaymentMethodDataCardFromMethodCopyWithImpl(this as PaymentMethodDataCardFromMethod, _$identity); - @override - Map toJson() { - return _$$PaymentMethodParamsSofortImplToJson( - this, - ); - } + /// Serializes this PaymentMethodDataCardFromMethod to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataCardFromMethod&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); } -abstract class _PaymentMethodParamsSofort implements PaymentMethodParams { - const factory _PaymentMethodParamsSofort( - {required final PaymentMethodDataSofort paymentMethodData}) = - _$PaymentMethodParamsSofortImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodId,cvc,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); - factory _PaymentMethodParamsSofort.fromJson(Map json) = - _$PaymentMethodParamsSofortImpl.fromJson; +@override +String toString() { + return 'PaymentMethodDataCardFromMethod(paymentMethodId: $paymentMethodId, cvc: $cvc, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} - @override - PaymentMethodDataSofort get paymentMethodData; - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsSofortImplCopyWith<_$PaymentMethodParamsSofortImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentMethodParamsAfterpayClearpayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsAfterpayClearpayImplCopyWith( - _$PaymentMethodParamsAfterpayClearpayImpl value, - $Res Function(_$PaymentMethodParamsAfterpayClearpayImpl) then) = - __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataAfterPay paymentMethodData}); +abstract mixin class $PaymentMethodDataCardFromMethodCopyWith<$Res> { + factory $PaymentMethodDataCardFromMethodCopyWith(PaymentMethodDataCardFromMethod value, $Res Function(PaymentMethodDataCardFromMethod) _then) = _$PaymentMethodDataCardFromMethodCopyWithImpl; +@useResult +$Res call({ + String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - $PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData; -} +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; + +} /// @nodoc -class __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsAfterpayClearpayImpl> - implements _$$PaymentMethodParamsAfterpayClearpayImplCopyWith<$Res> { - __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl( - _$PaymentMethodParamsAfterpayClearpayImpl _value, - $Res Function(_$PaymentMethodParamsAfterpayClearpayImpl) _then) - : super(_value, _then); +class _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res> + implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { + _$PaymentMethodDataCardFromMethodCopyWithImpl(this._self, this._then); + + final PaymentMethodDataCardFromMethod _self; + final $Res Function(PaymentMethodDataCardFromMethod) _then; + +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethodId = null,Object? cvc = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +paymentMethodId: null == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataCardFromMethod]. +extension PaymentMethodDataCardFromMethodPatterns on PaymentMethodDataCardFromMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataCardFromMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataCardFromMethod value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataCardFromMethod value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that.paymentMethodId,_that.cvc,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod(): +return $default(_that.paymentMethodId,_that.cvc,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsAfterpayClearpayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataAfterPay, - )); - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataCardFromMethod() when $default != null: +return $default(_that.paymentMethodId,_that.cvc,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; + +} +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataAfterPayCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataAfterPayCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsAfterpayClearpayImpl - implements _PaymentMethodParamsAfterpayClearpay { - const _$PaymentMethodParamsAfterpayClearpayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'AfterpayClearpay'; +class _PaymentMethodDataCardFromMethod implements PaymentMethodDataCardFromMethod { + const _PaymentMethodDataCardFromMethod({required this.paymentMethodId, this.cvc, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataCardFromMethod.fromJson(Map json) => _$PaymentMethodDataCardFromMethodFromJson(json); - factory _$PaymentMethodParamsAfterpayClearpayImpl.fromJson( - Map json) => - _$$PaymentMethodParamsAfterpayClearpayImplFromJson(json); +/// Payment method id. +@override final String paymentMethodId; +/// Cvc of the cart +@override final String? cvc; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} - @override - final PaymentMethodDataAfterPay paymentMethodData; - @JsonKey(name: 'paymentMethodType') - final String $type; +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataCardFromMethodCopyWith<_PaymentMethodDataCardFromMethod> get copyWith => __$PaymentMethodDataCardFromMethodCopyWithImpl<_PaymentMethodDataCardFromMethod>(this, _$identity); - @override - String toString() { - return 'PaymentMethodParams.afterpayClearpay(paymentMethodData: $paymentMethodData)'; - } +@override +Map toJson() { + return _$PaymentMethodDataCardFromMethodToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsAfterpayClearpayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataCardFromMethod&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.cvc, cvc) || other.cvc == cvc)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsAfterpayClearpayImplCopyWith< - _$PaymentMethodParamsAfterpayClearpayImpl> - get copyWith => __$$PaymentMethodParamsAfterpayClearpayImplCopyWithImpl< - _$PaymentMethodParamsAfterpayClearpayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return afterpayClearpay(paymentMethodData); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethodId,cvc,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return afterpayClearpay?.call(paymentMethodData); - } +@override +String toString() { + return 'PaymentMethodDataCardFromMethod(paymentMethodId: $paymentMethodId, cvc: $cvc, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (afterpayClearpay != null) { - return afterpayClearpay(paymentMethodData); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return afterpayClearpay(this); - } +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return afterpayClearpay?.call(this); - } +/// @nodoc +abstract mixin class _$PaymentMethodDataCardFromMethodCopyWith<$Res> implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { + factory _$PaymentMethodDataCardFromMethodCopyWith(_PaymentMethodDataCardFromMethod value, $Res Function(_PaymentMethodDataCardFromMethod) _then) = __$PaymentMethodDataCardFromMethodCopyWithImpl; +@override @useResult +$Res call({ + String paymentMethodId, String? cvc, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (afterpayClearpay != null) { - return afterpayClearpay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PaymentMethodParamsAfterpayClearpayImplToJson( - this, - ); - } +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; + +} +/// @nodoc +class __$PaymentMethodDataCardFromMethodCopyWithImpl<$Res> + implements _$PaymentMethodDataCardFromMethodCopyWith<$Res> { + __$PaymentMethodDataCardFromMethodCopyWithImpl(this._self, this._then); + + final _PaymentMethodDataCardFromMethod _self; + final $Res Function(_PaymentMethodDataCardFromMethod) _then; + +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethodId = null,Object? cvc = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataCardFromMethod( +paymentMethodId: null == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String,cvc: freezed == cvc ? _self.cvc : cvc // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); } -abstract class _PaymentMethodParamsAfterpayClearpay - implements PaymentMethodParams { - const factory _PaymentMethodParamsAfterpayClearpay( - {required final PaymentMethodDataAfterPay paymentMethodData}) = - _$PaymentMethodParamsAfterpayClearpayImpl; - - factory _PaymentMethodParamsAfterpayClearpay.fromJson( - Map json) = - _$PaymentMethodParamsAfterpayClearpayImpl.fromJson; - - @override - PaymentMethodDataAfterPay get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsAfterpayClearpayImplCopyWith< - _$PaymentMethodParamsAfterpayClearpayImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsOxxoImplCopyWith<$Res> { - factory _$$PaymentMethodParamsOxxoImplCopyWith( - _$PaymentMethodParamsOxxoImpl value, - $Res Function(_$PaymentMethodParamsOxxoImpl) then) = - __$$PaymentMethodParamsOxxoImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsOxxoImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsOxxoImpl> - implements _$$PaymentMethodParamsOxxoImplCopyWith<$Res> { - __$$PaymentMethodParamsOxxoImplCopyWithImpl( - _$PaymentMethodParamsOxxoImpl _value, - $Res Function(_$PaymentMethodParamsOxxoImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsOxxoImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); +/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataCardFromMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} } -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsOxxoImpl implements _PaymentMethodParamsOxxo { - const _$PaymentMethodParamsOxxoImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Oxxo'; +/// @nodoc +mixin _$PaymentMethodDataIdeal { - factory _$PaymentMethodParamsOxxoImpl.fromJson(Map json) => - _$$PaymentMethodParamsOxxoImplFromJson(json); +/// The bank identifier code of the bank. + String? get bankIdentifierCode;/// The name of bank. + String? get bankName;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataIdealCopyWith get copyWith => _$PaymentMethodDataIdealCopyWithImpl(this as PaymentMethodDataIdeal, _$identity); - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; + /// Serializes this PaymentMethodDataIdeal to a JSON map. + Map toJson(); - @JsonKey(name: 'paymentMethodType') - final String $type; - @override - String toString() { - return 'PaymentMethodParams.oxxo(paymentMethodData: $paymentMethodData)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataIdeal&&(identical(other.bankIdentifierCode, bankIdentifierCode) || other.bankIdentifierCode == bankIdentifierCode)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsOxxoImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankIdentifierCode,bankName,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsOxxoImplCopyWith<_$PaymentMethodParamsOxxoImpl> - get copyWith => __$$PaymentMethodParamsOxxoImplCopyWithImpl< - _$PaymentMethodParamsOxxoImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return oxxo(paymentMethodData); - } +@override +String toString() { + return 'PaymentMethodDataIdeal(bankIdentifierCode: $bankIdentifierCode, bankName: $bankName, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return oxxo?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (oxxo != null) { - return oxxo(paymentMethodData); - } - return orElse(); - } +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return oxxo(this); - } +/// @nodoc +abstract mixin class $PaymentMethodDataIdealCopyWith<$Res> { + factory $PaymentMethodDataIdealCopyWith(PaymentMethodDataIdeal value, $Res Function(PaymentMethodDataIdeal) _then) = _$PaymentMethodDataIdealCopyWithImpl; +@useResult +$Res call({ + String? bankIdentifierCode, String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return oxxo?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (oxxo != null) { - return oxxo(this); - } - return orElse(); - } +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - @override - Map toJson() { - return _$$PaymentMethodParamsOxxoImplToJson( - this, - ); - } } +/// @nodoc +class _$PaymentMethodDataIdealCopyWithImpl<$Res> + implements $PaymentMethodDataIdealCopyWith<$Res> { + _$PaymentMethodDataIdealCopyWithImpl(this._self, this._then); + + final PaymentMethodDataIdeal _self; + final $Res Function(PaymentMethodDataIdeal) _then; + +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? bankIdentifierCode = freezed,Object? bankName = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +bankIdentifierCode: freezed == bankIdentifierCode ? _self.bankIdentifierCode : bankIdentifierCode // ignore: cast_nullable_to_non_nullable +as String?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataIdeal]. +extension PaymentMethodDataIdealPatterns on PaymentMethodDataIdeal { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataIdeal value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataIdeal value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataIdeal value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? bankIdentifierCode, String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that.bankIdentifierCode,_that.bankName,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? bankIdentifierCode, String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal(): +return $default(_that.bankIdentifierCode,_that.bankName,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` -abstract class _PaymentMethodParamsOxxo implements PaymentMethodParams { - const factory _PaymentMethodParamsOxxo( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsOxxoImpl; - - factory _PaymentMethodParamsOxxo.fromJson(Map json) = - _$PaymentMethodParamsOxxoImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsOxxoImplCopyWith<_$PaymentMethodParamsOxxoImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsKlarnaImplCopyWith<$Res> { - factory _$$PaymentMethodParamsKlarnaImplCopyWith( - _$PaymentMethodParamsKlarnaImpl value, - $Res Function(_$PaymentMethodParamsKlarnaImpl) then) = - __$$PaymentMethodParamsKlarnaImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsKlarnaImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsKlarnaImpl> - implements _$$PaymentMethodParamsKlarnaImplCopyWith<$Res> { - __$$PaymentMethodParamsKlarnaImplCopyWithImpl( - _$PaymentMethodParamsKlarnaImpl _value, - $Res Function(_$PaymentMethodParamsKlarnaImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsKlarnaImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? bankIdentifierCode, String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataIdeal() when $default != null: +return $default(_that.bankIdentifierCode,_that.bankName,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; + +} +} - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsKlarnaImpl implements _PaymentMethodParamsKlarna { - const _$PaymentMethodParamsKlarnaImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'Klarna'; - - factory _$PaymentMethodParamsKlarnaImpl.fromJson(Map json) => - _$$PaymentMethodParamsKlarnaImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - /// - /// Make sure to add an email and country (part of the address) in the - /// billingdetails which is required for using Klarna. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.klarna(paymentMethodData: $paymentMethodData)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsKlarnaImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +class _PaymentMethodDataIdeal implements PaymentMethodDataIdeal { + const _PaymentMethodDataIdeal({this.bankIdentifierCode, this.bankName, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataIdeal.fromJson(Map json) => _$PaymentMethodDataIdealFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsKlarnaImplCopyWith<_$PaymentMethodParamsKlarnaImpl> - get copyWith => __$$PaymentMethodParamsKlarnaImplCopyWithImpl< - _$PaymentMethodParamsKlarnaImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return klarna(paymentMethodData); - } +/// The bank identifier code of the bank. +@override final String? bankIdentifierCode; +/// The name of bank. +@override final String? bankName; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return klarna?.call(paymentMethodData); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (klarna != null) { - return klarna(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataIdealCopyWith<_PaymentMethodDataIdeal> get copyWith => __$PaymentMethodDataIdealCopyWithImpl<_PaymentMethodDataIdeal>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return klarna(this); - } +@override +Map toJson() { + return _$PaymentMethodDataIdealToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return klarna?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataIdeal&&(identical(other.bankIdentifierCode, bankIdentifierCode) || other.bankIdentifierCode == bankIdentifierCode)&&(identical(other.bankName, bankName) || other.bankName == bankName)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (klarna != null) { - return klarna(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,bankIdentifierCode,bankName,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - @override - Map toJson() { - return _$$PaymentMethodParamsKlarnaImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentMethodDataIdeal(bankIdentifierCode: $bankIdentifierCode, bankName: $bankName, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -abstract class _PaymentMethodParamsKlarna implements PaymentMethodParams { - const factory _PaymentMethodParamsKlarna( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsKlarnaImpl; - - factory _PaymentMethodParamsKlarna.fromJson(Map json) = - _$PaymentMethodParamsKlarnaImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - /// - /// Make sure to add an email and country (part of the address) in the - /// billingdetails which is required for using Klarna. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsKlarnaImplCopyWith<_$PaymentMethodParamsKlarnaImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsPayPalImplCopyWith<$Res> { - factory _$$PaymentMethodParamsPayPalImplCopyWith( - _$PaymentMethodParamsPayPalImpl value, - $Res Function(_$PaymentMethodParamsPayPalImpl) then) = - __$$PaymentMethodParamsPayPalImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsPayPalImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsPayPalImpl> - implements _$$PaymentMethodParamsPayPalImplCopyWith<$Res> { - __$$PaymentMethodParamsPayPalImplCopyWithImpl( - _$PaymentMethodParamsPayPalImpl _value, - $Res Function(_$PaymentMethodParamsPayPalImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsPayPalImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class _$PaymentMethodDataIdealCopyWith<$Res> implements $PaymentMethodDataIdealCopyWith<$Res> { + factory _$PaymentMethodDataIdealCopyWith(_PaymentMethodDataIdeal value, $Res Function(_PaymentMethodDataIdeal) _then) = __$PaymentMethodDataIdealCopyWithImpl; +@override @useResult +$Res call({ + String? bankIdentifierCode, String? bankName, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsPayPalImpl implements _PaymentMethodParamsPayPal { - const _$PaymentMethodParamsPayPalImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'PayPal'; - factory _$PaymentMethodParamsPayPalImpl.fromJson(Map json) => - _$$PaymentMethodParamsPayPalImplFromJson(json); +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; +} +/// @nodoc +class __$PaymentMethodDataIdealCopyWithImpl<$Res> + implements _$PaymentMethodDataIdealCopyWith<$Res> { + __$PaymentMethodDataIdealCopyWithImpl(this._self, this._then); - @JsonKey(name: 'paymentMethodType') - final String $type; + final _PaymentMethodDataIdeal _self; + final $Res Function(_PaymentMethodDataIdeal) _then; - @override - String toString() { - return 'PaymentMethodParams.payPal(paymentMethodData: $paymentMethodData)'; - } +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? bankIdentifierCode = freezed,Object? bankName = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataIdeal( +bankIdentifierCode: freezed == bankIdentifierCode ? _self.bankIdentifierCode : bankIdentifierCode // ignore: cast_nullable_to_non_nullable +as String?,bankName: freezed == bankName ? _self.bankName : bankName // ignore: cast_nullable_to_non_nullable +as String?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsPayPalImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); +/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsPayPalImplCopyWith<_$PaymentMethodParamsPayPalImpl> - get copyWith => __$$PaymentMethodParamsPayPalImplCopyWithImpl< - _$PaymentMethodParamsPayPalImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return payPal(paymentMethodData); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return payPal?.call(paymentMethodData); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataIdeal +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (payPal != null) { - return payPal(paymentMethodData); - } - return orElse(); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return payPal(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return payPal?.call(this); - } +/// @nodoc +mixin _$PaymentMethodDataAubecs { - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (payPal != null) { - return payPal(this); - } - return orElse(); - } +/// form input details + AubecsFormInputDetails get formDetails;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataAubecsCopyWith get copyWith => _$PaymentMethodDataAubecsCopyWithImpl(this as PaymentMethodDataAubecs, _$identity); - @override - Map toJson() { - return _$$PaymentMethodParamsPayPalImplToJson( - this, - ); - } + /// Serializes this PaymentMethodDataAubecs to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataAubecs&&(identical(other.formDetails, formDetails) || other.formDetails == formDetails)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,formDetails,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); + +@override +String toString() { + return 'PaymentMethodDataAubecs(formDetails: $formDetails, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -abstract class _PaymentMethodParamsPayPal implements PaymentMethodParams { - const factory _PaymentMethodParamsPayPal( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsPayPalImpl; - - factory _PaymentMethodParamsPayPal.fromJson(Map json) = - _$PaymentMethodParamsPayPalImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsPayPalImplCopyWith<_$PaymentMethodParamsPayPalImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsRevolutPayImplCopyWith<$Res> { - factory _$$PaymentMethodParamsRevolutPayImplCopyWith( - _$PaymentMethodParamsRevolutPayImpl value, - $Res Function(_$PaymentMethodParamsRevolutPayImpl) then) = - __$$PaymentMethodParamsRevolutPayImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodData paymentMethodData}); - - $PaymentMethodDataCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsRevolutPayImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsRevolutPayImpl> - implements _$$PaymentMethodParamsRevolutPayImplCopyWith<$Res> { - __$$PaymentMethodParamsRevolutPayImplCopyWithImpl( - _$PaymentMethodParamsRevolutPayImpl _value, - $Res Function(_$PaymentMethodParamsRevolutPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsRevolutPayImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodData, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataCopyWith<$Res>(_value.paymentMethodData, (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class $PaymentMethodDataAubecsCopyWith<$Res> { + factory $PaymentMethodDataAubecsCopyWith(PaymentMethodDataAubecs value, $Res Function(PaymentMethodDataAubecs) _then) = _$PaymentMethodDataAubecsCopyWithImpl; +@useResult +$Res call({ + AubecsFormInputDetails formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsRevolutPayImpl - implements _PaymentMethodParamsRevolutPay { - const _$PaymentMethodParamsRevolutPayImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'RevolutPay'; - - factory _$PaymentMethodParamsRevolutPayImpl.fromJson( - Map json) => - _$$PaymentMethodParamsRevolutPayImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodData paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.revolutPay(paymentMethodData: $paymentMethodData)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsRevolutPayImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +$AubecsFormInputDetailsCopyWith<$Res> get formDetails;$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsRevolutPayImplCopyWith< - _$PaymentMethodParamsRevolutPayImpl> - get copyWith => __$$PaymentMethodParamsRevolutPayImplCopyWithImpl< - _$PaymentMethodParamsRevolutPayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return revolutPay(paymentMethodData); - } +} +/// @nodoc +class _$PaymentMethodDataAubecsCopyWithImpl<$Res> + implements $PaymentMethodDataAubecsCopyWith<$Res> { + _$PaymentMethodDataAubecsCopyWithImpl(this._self, this._then); + + final PaymentMethodDataAubecs _self; + final $Res Function(PaymentMethodDataAubecs) _then; + +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? formDetails = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +formDetails: null == formDetails ? _self.formDetails : formDetails // ignore: cast_nullable_to_non_nullable +as AubecsFormInputDetails,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AubecsFormInputDetailsCopyWith<$Res> get formDetails { + + return $AubecsFormInputDetailsCopyWith<$Res>(_self.formDetails, (value) { + return _then(_self.copyWith(formDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataAubecs]. +extension PaymentMethodDataAubecsPatterns on PaymentMethodDataAubecs { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataAubecs value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataAubecs value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataAubecs value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( AubecsFormInputDetails formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that.formDetails,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( AubecsFormInputDetails formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs(): +return $default(_that.formDetails,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return revolutPay?.call(paymentMethodData); - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( AubecsFormInputDetails formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAubecs() when $default != null: +return $default(_that.formDetails,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (revolutPay != null) { - return revolutPay(paymentMethodData); - } - return orElse(); - } +} +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return revolutPay(this); - } +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return revolutPay?.call(this); - } +/// @nodoc - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (revolutPay != null) { - return revolutPay(this); - } - return orElse(); - } +@JsonSerializable(explicitToJson: true) +class _PaymentMethodDataAubecs implements PaymentMethodDataAubecs { + const _PaymentMethodDataAubecs({required this.formDetails, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataAubecs.fromJson(Map json) => _$PaymentMethodDataAubecsFromJson(json); - @override - Map toJson() { - return _$$PaymentMethodParamsRevolutPayImplToJson( - this, - ); - } +/// form input details +@override final AubecsFormInputDetails formDetails; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + + +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataAubecsCopyWith<_PaymentMethodDataAubecs> get copyWith => __$PaymentMethodDataAubecsCopyWithImpl<_PaymentMethodDataAubecs>(this, _$identity); + +@override +Map toJson() { + return _$PaymentMethodDataAubecsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataAubecs&&(identical(other.formDetails, formDetails) || other.formDetails == formDetails)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,formDetails,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); + +@override +String toString() { + return 'PaymentMethodDataAubecs(formDetails: $formDetails, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -abstract class _PaymentMethodParamsRevolutPay implements PaymentMethodParams { - const factory _PaymentMethodParamsRevolutPay( - {required final PaymentMethodData paymentMethodData}) = - _$PaymentMethodParamsRevolutPayImpl; - - factory _PaymentMethodParamsRevolutPay.fromJson(Map json) = - _$PaymentMethodParamsRevolutPayImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodData get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsRevolutPayImplCopyWith< - _$PaymentMethodParamsRevolutPayImpl> - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$PaymentMethodParamsUsBankAccountImplCopyWith<$Res> { - factory _$$PaymentMethodParamsUsBankAccountImplCopyWith( - _$PaymentMethodParamsUsBankAccountImpl value, - $Res Function(_$PaymentMethodParamsUsBankAccountImpl) then) = - __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl<$Res>; - @useResult - $Res call({PaymentMethodDataUsBank paymentMethodData}); - - $PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData; -} - -/// @nodoc -class __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl<$Res> - extends _$PaymentMethodParamsCopyWithImpl<$Res, - _$PaymentMethodParamsUsBankAccountImpl> - implements _$$PaymentMethodParamsUsBankAccountImplCopyWith<$Res> { - __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl( - _$PaymentMethodParamsUsBankAccountImpl _value, - $Res Function(_$PaymentMethodParamsUsBankAccountImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodData = null, - }) { - return _then(_$PaymentMethodParamsUsBankAccountImpl( - paymentMethodData: null == paymentMethodData - ? _value.paymentMethodData - : paymentMethodData // ignore: cast_nullable_to_non_nullable - as PaymentMethodDataUsBank, - )); - } - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodDataUsBankCopyWith<$Res> get paymentMethodData { - return $PaymentMethodDataUsBankCopyWith<$Res>(_value.paymentMethodData, - (value) { - return _then(_value.copyWith(paymentMethodData: value)); - }); - } } /// @nodoc +abstract mixin class _$PaymentMethodDataAubecsCopyWith<$Res> implements $PaymentMethodDataAubecsCopyWith<$Res> { + factory _$PaymentMethodDataAubecsCopyWith(_PaymentMethodDataAubecs value, $Res Function(_PaymentMethodDataAubecs) _then) = __$PaymentMethodDataAubecsCopyWithImpl; +@override @useResult +$Res call({ + AubecsFormInputDetails formDetails, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodParamsUsBankAccountImpl - implements _PaymentMethodParamsUsBankAccount { - const _$PaymentMethodParamsUsBankAccountImpl( - {required this.paymentMethodData, final String? $type}) - : $type = $type ?? 'USBankAccount'; - - factory _$PaymentMethodParamsUsBankAccountImpl.fromJson( - Map json) => - _$$PaymentMethodParamsUsBankAccountImplFromJson(json); - - /// Paymentmethod data for this paymentmethod. - @override - final PaymentMethodDataUsBank paymentMethodData; - - @JsonKey(name: 'paymentMethodType') - final String $type; - - @override - String toString() { - return 'PaymentMethodParams.usBankAccount(paymentMethodData: $paymentMethodData)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodParamsUsBankAccountImpl && - (identical(other.paymentMethodData, paymentMethodData) || - other.paymentMethodData == paymentMethodData)); - } +@override $AubecsFormInputDetailsCopyWith<$Res> get formDetails;@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethodData); - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodParamsUsBankAccountImplCopyWith< - _$PaymentMethodParamsUsBankAccountImpl> - get copyWith => __$$PaymentMethodParamsUsBankAccountImplCopyWithImpl< - _$PaymentMethodParamsUsBankAccountImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(PaymentMethodData paymentMethodData) card, - required TResult Function(PaymentMethodDataCardFromToken paymentMethodData) - cardFromToken, - required TResult Function(PaymentMethodDataCardFromMethod paymentMethodData) - cardFromMethodId, - required TResult Function(PaymentMethodData paymentMethodData) alipay, - required TResult Function(PaymentMethodData paymentMethodData) cashAppPay, - required TResult Function(PaymentMethodDataIdeal paymentMethodData) ideal, - required TResult Function(PaymentMethodDataAubecs paymentMethodData) aubecs, - required TResult Function(PaymentMethodData paymentMethodData) bancontact, - required TResult Function(PaymentMethodData paymentMethodData) giroPay, - required TResult Function(PaymentMethodData paymentMethodData) eps, - required TResult Function(PaymentMethodData paymentMethodData) affirm, - required TResult Function(PaymentMethodData paymentMethodData) grabPay, - required TResult Function(PaymentMethodData paymentMethodData) p24, - required TResult Function(PaymentMethodDataFpx paymentMethodData) fpx, - required TResult Function(PaymentMethodDataSepa paymentMethodData) - sepaDebit, - required TResult Function(PaymentMethodDataSofort paymentMethodData) sofort, - required TResult Function(PaymentMethodDataAfterPay paymentMethodData) - afterpayClearpay, - required TResult Function(PaymentMethodData paymentMethodData) oxxo, - required TResult Function(PaymentMethodData paymentMethodData) klarna, - required TResult Function(PaymentMethodData paymentMethodData) payPal, - required TResult Function(PaymentMethodData paymentMethodData) revolutPay, - required TResult Function(PaymentMethodDataUsBank paymentMethodData) - usBankAccount, - }) { - return usBankAccount(paymentMethodData); - } +} +/// @nodoc +class __$PaymentMethodDataAubecsCopyWithImpl<$Res> + implements _$PaymentMethodDataAubecsCopyWith<$Res> { + __$PaymentMethodDataAubecsCopyWithImpl(this._self, this._then); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(PaymentMethodData paymentMethodData)? card, - TResult? Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult? Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult? Function(PaymentMethodData paymentMethodData)? alipay, - TResult? Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult? Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult? Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult? Function(PaymentMethodData paymentMethodData)? bancontact, - TResult? Function(PaymentMethodData paymentMethodData)? giroPay, - TResult? Function(PaymentMethodData paymentMethodData)? eps, - TResult? Function(PaymentMethodData paymentMethodData)? affirm, - TResult? Function(PaymentMethodData paymentMethodData)? grabPay, - TResult? Function(PaymentMethodData paymentMethodData)? p24, - TResult? Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult? Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult? Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult? Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult? Function(PaymentMethodData paymentMethodData)? oxxo, - TResult? Function(PaymentMethodData paymentMethodData)? klarna, - TResult? Function(PaymentMethodData paymentMethodData)? payPal, - TResult? Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult? Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - }) { - return usBankAccount?.call(paymentMethodData); - } + final _PaymentMethodDataAubecs _self; + final $Res Function(_PaymentMethodDataAubecs) _then; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(PaymentMethodData paymentMethodData)? card, - TResult Function(PaymentMethodDataCardFromToken paymentMethodData)? - cardFromToken, - TResult Function(PaymentMethodDataCardFromMethod paymentMethodData)? - cardFromMethodId, - TResult Function(PaymentMethodData paymentMethodData)? alipay, - TResult Function(PaymentMethodData paymentMethodData)? cashAppPay, - TResult Function(PaymentMethodDataIdeal paymentMethodData)? ideal, - TResult Function(PaymentMethodDataAubecs paymentMethodData)? aubecs, - TResult Function(PaymentMethodData paymentMethodData)? bancontact, - TResult Function(PaymentMethodData paymentMethodData)? giroPay, - TResult Function(PaymentMethodData paymentMethodData)? eps, - TResult Function(PaymentMethodData paymentMethodData)? affirm, - TResult Function(PaymentMethodData paymentMethodData)? grabPay, - TResult Function(PaymentMethodData paymentMethodData)? p24, - TResult Function(PaymentMethodDataFpx paymentMethodData)? fpx, - TResult Function(PaymentMethodDataSepa paymentMethodData)? sepaDebit, - TResult Function(PaymentMethodDataSofort paymentMethodData)? sofort, - TResult Function(PaymentMethodDataAfterPay paymentMethodData)? - afterpayClearpay, - TResult Function(PaymentMethodData paymentMethodData)? oxxo, - TResult Function(PaymentMethodData paymentMethodData)? klarna, - TResult Function(PaymentMethodData paymentMethodData)? payPal, - TResult Function(PaymentMethodData paymentMethodData)? revolutPay, - TResult Function(PaymentMethodDataUsBank paymentMethodData)? usBankAccount, - required TResult orElse(), - }) { - if (usBankAccount != null) { - return usBankAccount(paymentMethodData); - } - return orElse(); - } +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? formDetails = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataAubecs( +formDetails: null == formDetails ? _self.formDetails : formDetails // ignore: cast_nullable_to_non_nullable +as AubecsFormInputDetails,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMethodParamsCard value) card, - required TResult Function(_PaymentMethodParamsCardWithToken value) - cardFromToken, - required TResult Function(_PaymentMethodParamsCardWithMethodId value) - cardFromMethodId, - required TResult Function(_PaymentMethodParamsAlipay value) alipay, - required TResult Function(_PaymentMethodParamsCashAppPay value) cashAppPay, - required TResult Function(_PaymentMethodParamsIdeal value) ideal, - required TResult Function(_PaymentMethodParamsAubecs value) aubecs, - required TResult Function(_PaymentMethodParamsBankContact value) bancontact, - required TResult Function(_PaymentMethodParamsGiroPay value) giroPay, - required TResult Function(_PaymentMethodParamsEps value) eps, - required TResult Function(_PaymentMethodParamsAffirm value) affirm, - required TResult Function(_PaymentMethodParamsPay value) grabPay, - required TResult Function(_PaymentMethodParamsP24 value) p24, - required TResult Function(_PaymentMethodParamsFpx value) fpx, - required TResult Function(_PaymentMethodParamsSepaDebit value) sepaDebit, - required TResult Function(_PaymentMethodParamsSofort value) sofort, - required TResult Function(_PaymentMethodParamsAfterpayClearpay value) - afterpayClearpay, - required TResult Function(_PaymentMethodParamsOxxo value) oxxo, - required TResult Function(_PaymentMethodParamsKlarna value) klarna, - required TResult Function(_PaymentMethodParamsPayPal value) payPal, - required TResult Function(_PaymentMethodParamsRevolutPay value) revolutPay, - required TResult Function(_PaymentMethodParamsUsBankAccount value) - usBankAccount, - }) { - return usBankAccount(this); +/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AubecsFormInputDetailsCopyWith<$Res> get formDetails { + + return $AubecsFormInputDetailsCopyWith<$Res>(_self.formDetails, (value) { + return _then(_self.copyWith(formDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMethodParamsCard value)? card, - TResult? Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult? Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult? Function(_PaymentMethodParamsAlipay value)? alipay, - TResult? Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult? Function(_PaymentMethodParamsIdeal value)? ideal, - TResult? Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult? Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult? Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult? Function(_PaymentMethodParamsEps value)? eps, - TResult? Function(_PaymentMethodParamsAffirm value)? affirm, - TResult? Function(_PaymentMethodParamsPay value)? grabPay, - TResult? Function(_PaymentMethodParamsP24 value)? p24, - TResult? Function(_PaymentMethodParamsFpx value)? fpx, - TResult? Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult? Function(_PaymentMethodParamsSofort value)? sofort, - TResult? Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult? Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult? Function(_PaymentMethodParamsKlarna value)? klarna, - TResult? Function(_PaymentMethodParamsPayPal value)? payPal, - TResult? Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult? Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - }) { - return usBankAccount?.call(this); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMethodParamsCard value)? card, - TResult Function(_PaymentMethodParamsCardWithToken value)? cardFromToken, - TResult Function(_PaymentMethodParamsCardWithMethodId value)? - cardFromMethodId, - TResult Function(_PaymentMethodParamsAlipay value)? alipay, - TResult Function(_PaymentMethodParamsCashAppPay value)? cashAppPay, - TResult Function(_PaymentMethodParamsIdeal value)? ideal, - TResult Function(_PaymentMethodParamsAubecs value)? aubecs, - TResult Function(_PaymentMethodParamsBankContact value)? bancontact, - TResult Function(_PaymentMethodParamsGiroPay value)? giroPay, - TResult Function(_PaymentMethodParamsEps value)? eps, - TResult Function(_PaymentMethodParamsAffirm value)? affirm, - TResult Function(_PaymentMethodParamsPay value)? grabPay, - TResult Function(_PaymentMethodParamsP24 value)? p24, - TResult Function(_PaymentMethodParamsFpx value)? fpx, - TResult Function(_PaymentMethodParamsSepaDebit value)? sepaDebit, - TResult Function(_PaymentMethodParamsSofort value)? sofort, - TResult Function(_PaymentMethodParamsAfterpayClearpay value)? - afterpayClearpay, - TResult Function(_PaymentMethodParamsOxxo value)? oxxo, - TResult Function(_PaymentMethodParamsKlarna value)? klarna, - TResult Function(_PaymentMethodParamsPayPal value)? payPal, - TResult Function(_PaymentMethodParamsRevolutPay value)? revolutPay, - TResult Function(_PaymentMethodParamsUsBankAccount value)? usBankAccount, - required TResult orElse(), - }) { - if (usBankAccount != null) { - return usBankAccount(this); - } - return orElse(); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAubecs +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - @override - Map toJson() { - return _$$PaymentMethodParamsUsBankAccountImplToJson( - this, - ); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); } - -abstract class _PaymentMethodParamsUsBankAccount - implements PaymentMethodParams { - const factory _PaymentMethodParamsUsBankAccount( - {required final PaymentMethodDataUsBank paymentMethodData}) = - _$PaymentMethodParamsUsBankAccountImpl; - - factory _PaymentMethodParamsUsBankAccount.fromJson( - Map json) = - _$PaymentMethodParamsUsBankAccountImpl.fromJson; - - /// Paymentmethod data for this paymentmethod. - @override - PaymentMethodDataUsBank get paymentMethodData; - - /// Create a copy of PaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodParamsUsBankAccountImplCopyWith< - _$PaymentMethodParamsUsBankAccountImpl> - get copyWith => throw _privateConstructorUsedError; } -PaymentMethodData _$PaymentMethodDataFromJson(Map json) { - return _PaymentMethodData.fromJson(json); -} /// @nodoc -mixin _$PaymentMethodData { - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +mixin _$PaymentMethodDataFpx { - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// When set to true you can test offline payment. + bool get testOfflineBank;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataFpxCopyWith get copyWith => _$PaymentMethodDataFpxCopyWithImpl(this as PaymentMethodDataFpx, _$identity); - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; + /// Serializes this PaymentMethodDataFpx to a JSON map. + Map toJson(); - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; - /// Serializes this PaymentMethodData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataFpx&&(identical(other.testOfflineBank, testOfflineBank) || other.testOfflineBank == testOfflineBank)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataCopyWith get copyWith => - throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testOfflineBank,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); + +@override +String toString() { + return 'PaymentMethodDataFpx(testOfflineBank: $testOfflineBank, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -/// @nodoc -abstract class $PaymentMethodDataCopyWith<$Res> { - factory $PaymentMethodDataCopyWith( - PaymentMethodData value, $Res Function(PaymentMethodData) then) = - _$PaymentMethodDataCopyWithImpl<$Res, PaymentMethodData>; - @useResult - $Res call( - {BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; } /// @nodoc -class _$PaymentMethodDataCopyWithImpl<$Res, $Val extends PaymentMethodData> - implements $PaymentMethodDataCopyWith<$Res> { - _$PaymentMethodDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataFpxCopyWith<$Res> { + factory $PaymentMethodDataFpxCopyWith(PaymentMethodDataFpx value, $Res Function(PaymentMethodDataFpx) _then) = _$PaymentMethodDataFpxCopyWithImpl; +@useResult +$Res call({ + bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } } - /// @nodoc -abstract class _$$PaymentMethodDataImplCopyWith<$Res> - implements $PaymentMethodDataCopyWith<$Res> { - factory _$$PaymentMethodDataImplCopyWith(_$PaymentMethodDataImpl value, - $Res Function(_$PaymentMethodDataImpl) then) = - __$$PaymentMethodDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataImplCopyWithImpl<$Res> - extends _$PaymentMethodDataCopyWithImpl<$Res, _$PaymentMethodDataImpl> - implements _$$PaymentMethodDataImplCopyWith<$Res> { - __$$PaymentMethodDataImplCopyWithImpl(_$PaymentMethodDataImpl _value, - $Res Function(_$PaymentMethodDataImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataImpl( - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } +class _$PaymentMethodDataFpxCopyWithImpl<$Res> + implements $PaymentMethodDataFpxCopyWith<$Res> { + _$PaymentMethodDataFpxCopyWithImpl(this._self, this._then); + + final PaymentMethodDataFpx _self; + final $Res Function(PaymentMethodDataFpx) _then; + +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? testOfflineBank = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +testOfflineBank: null == testOfflineBank ? _self.testOfflineBank : testOfflineBank // ignore: cast_nullable_to_non_nullable +as bool,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataFpx]. +extension PaymentMethodDataFpxPatterns on PaymentMethodDataFpx { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataFpx value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataFpx value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataFpx(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataFpx value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that.testOfflineBank,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataFpx(): +return $default(_that.testOfflineBank,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataFpx() when $default != null: +return $default(_that.testOfflineBank,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataImpl implements _PaymentMethodData { - const _$PaymentMethodDataImpl( - {this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataImpl.fromJson(Map json) => - _$$PaymentMethodDataImplFromJson(json); - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - @override - String toString() { - return 'PaymentMethodData(billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } +class _PaymentMethodDataFpx implements PaymentMethodDataFpx { + const _PaymentMethodDataFpx({this.testOfflineBank = false, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataFpx.fromJson(Map json) => _$PaymentMethodDataFpxFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails, shippingDetails, - mandateData, const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataImplCopyWith<_$PaymentMethodDataImpl> get copyWith => - __$$PaymentMethodDataImplCopyWithImpl<_$PaymentMethodDataImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataImplToJson( - this, - ); - } +/// When set to true you can test offline payment. +@override@JsonKey() final bool testOfflineBank; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); } -abstract class _PaymentMethodData implements PaymentMethodData { - const factory _PaymentMethodData( - {final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataImpl; - factory _PaymentMethodData.fromJson(Map json) = - _$PaymentMethodDataImpl.fromJson; +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataFpxCopyWith<_PaymentMethodDataFpx> get copyWith => __$PaymentMethodDataFpxCopyWithImpl<_PaymentMethodDataFpx>(this, _$identity); - /// Billing information. - @override - BillingDetails? get billingDetails; - - /// Shipping details - @override - ShippingDetails? get shippingDetails; +@override +Map toJson() { + return _$PaymentMethodDataFpxToJson(this, ); +} - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataFpx&&(identical(other.testOfflineBank, testOfflineBank) || other.testOfflineBank == testOfflineBank)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - /// Metadata for this payment method - @override - Map? get metadata; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testOfflineBank,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - /// Create a copy of PaymentMethodData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataImplCopyWith<_$PaymentMethodDataImpl> get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataFpx(testOfflineBank: $testOfflineBank, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -PaymentMethodDataCardFromToken _$PaymentMethodDataCardFromTokenFromJson( - Map json) { - return _PaymentMethodDataCardFromToken.fromJson(json); + } /// @nodoc -mixin _$PaymentMethodDataCardFromToken { - /// Token. - String get token => throw _privateConstructorUsedError; - - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +abstract mixin class _$PaymentMethodDataFpxCopyWith<$Res> implements $PaymentMethodDataFpxCopyWith<$Res> { + factory _$PaymentMethodDataFpxCopyWith(_PaymentMethodDataFpx value, $Res Function(_PaymentMethodDataFpx) _then) = __$PaymentMethodDataFpxCopyWithImpl; +@override @useResult +$Res call({ + bool testOfflineBank, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; - - /// Serializes this PaymentMethodDataCardFromToken to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataCardFromTokenCopyWith - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentMethodDataCardFromTokenCopyWith<$Res> { - factory $PaymentMethodDataCardFromTokenCopyWith( - PaymentMethodDataCardFromToken value, - $Res Function(PaymentMethodDataCardFromToken) then) = - _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res, - PaymentMethodDataCardFromToken>; - @useResult - $Res call( - {String token, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); +class __$PaymentMethodDataFpxCopyWithImpl<$Res> + implements _$PaymentMethodDataFpxCopyWith<$Res> { + __$PaymentMethodDataFpxCopyWithImpl(this._self, this._then); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; + final _PaymentMethodDataFpx _self; + final $Res Function(_PaymentMethodDataFpx) _then; + +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? testOfflineBank = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataFpx( +testOfflineBank: null == testOfflineBank ? _self.testOfflineBank : testOfflineBank // ignore: cast_nullable_to_non_nullable +as bool,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); } -/// @nodoc -class _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res, - $Val extends PaymentMethodDataCardFromToken> - implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { - _$PaymentMethodDataCardFromTokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); +/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataFpx +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); } - -/// @nodoc -abstract class _$$PaymentMethodDataCardFromTokenImplCopyWith<$Res> - implements $PaymentMethodDataCardFromTokenCopyWith<$Res> { - factory _$$PaymentMethodDataCardFromTokenImplCopyWith( - _$PaymentMethodDataCardFromTokenImpl value, - $Res Function(_$PaymentMethodDataCardFromTokenImpl) then) = - __$$PaymentMethodDataCardFromTokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String token, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataCardFromTokenImplCopyWithImpl<$Res> - extends _$PaymentMethodDataCardFromTokenCopyWithImpl<$Res, - _$PaymentMethodDataCardFromTokenImpl> - implements _$$PaymentMethodDataCardFromTokenImplCopyWith<$Res> { - __$$PaymentMethodDataCardFromTokenImplCopyWithImpl( - _$PaymentMethodDataCardFromTokenImpl _value, - $Res Function(_$PaymentMethodDataCardFromTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataCardFromTokenImpl( - token: null == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } } + /// @nodoc +mixin _$PaymentMethodDataSofort { -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataCardFromTokenImpl - implements _PaymentMethodDataCardFromToken { - const _$PaymentMethodDataCardFromTokenImpl( - {required this.token, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataCardFromTokenImpl.fromJson( - Map json) => - _$$PaymentMethodDataCardFromTokenImplFromJson(json); - - /// Token. - @override - final String token; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +/// Country of the accountholder + String get country;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataSofortCopyWith get copyWith => _$PaymentMethodDataSofortCopyWithImpl(this as PaymentMethodDataSofort, _$identity); - @override - String toString() { - return 'PaymentMethodDataCardFromToken(token: $token, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } + /// Serializes this PaymentMethodDataSofort to a JSON map. + Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataCardFromTokenImpl && - (identical(other.token, token) || other.token == token) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - token, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataCardFromTokenImplCopyWith< - _$PaymentMethodDataCardFromTokenImpl> - get copyWith => __$$PaymentMethodDataCardFromTokenImplCopyWithImpl< - _$PaymentMethodDataCardFromTokenImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataCardFromTokenImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataSofort&&(identical(other.country, country) || other.country == country)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); } -abstract class _PaymentMethodDataCardFromToken - implements PaymentMethodDataCardFromToken { - const factory _PaymentMethodDataCardFromToken( - {required final String token, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = - _$PaymentMethodDataCardFromTokenImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); - factory _PaymentMethodDataCardFromToken.fromJson(Map json) = - _$PaymentMethodDataCardFromTokenImpl.fromJson; +@override +String toString() { + return 'PaymentMethodDataSofort(country: $country, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} + + +} - /// Token. - @override - String get token; +/// @nodoc +abstract mixin class $PaymentMethodDataSofortCopyWith<$Res> { + factory $PaymentMethodDataSofortCopyWith(PaymentMethodDataSofort value, $Res Function(PaymentMethodDataSofort) _then) = _$PaymentMethodDataSofortCopyWithImpl; +@useResult +$Res call({ + String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Billing information. - @override - BillingDetails? get billingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +} +/// @nodoc +class _$PaymentMethodDataSofortCopyWithImpl<$Res> + implements $PaymentMethodDataSofortCopyWith<$Res> { + _$PaymentMethodDataSofortCopyWithImpl(this._self, this._then); + + final PaymentMethodDataSofort _self; + final $Res Function(PaymentMethodDataSofort) _then; + +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? country = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataSofort]. +extension PaymentMethodDataSofortPatterns on PaymentMethodDataSofort { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataSofort value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataSofort value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSofort(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataSofort value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that.country,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSofort(): +return $default(_that.country,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Metadata for this payment method - @override - Map? get metadata; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSofort() when $default != null: +return $default(_that.country,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; - /// Create a copy of PaymentMethodDataCardFromToken - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataCardFromTokenImplCopyWith< - _$PaymentMethodDataCardFromTokenImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentMethodDataCardFromMethod _$PaymentMethodDataCardFromMethodFromJson( - Map json) { - return _PaymentMethodDataCardFromMethod.fromJson(json); } /// @nodoc -mixin _$PaymentMethodDataCardFromMethod { - /// Payment method id. - String get paymentMethodId => throw _privateConstructorUsedError; - /// Cvc of the cart - String? get cvc => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodDataSofort implements PaymentMethodDataSofort { + const _PaymentMethodDataSofort({required this.country, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataSofort.fromJson(Map json) => _$PaymentMethodDataSofortFromJson(json); + +/// Country of the accountholder +@override final String country; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataSofortCopyWith<_PaymentMethodDataSofort> get copyWith => __$PaymentMethodDataSofortCopyWithImpl<_PaymentMethodDataSofort>(this, _$identity); - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentMethodDataSofortToJson(this, ); +} - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataSofort&&(identical(other.country, country) || other.country == country)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - /// Serializes this PaymentMethodDataCardFromMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataCardFromMethodCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataSofort(country: $country, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -/// @nodoc -abstract class $PaymentMethodDataCardFromMethodCopyWith<$Res> { - factory $PaymentMethodDataCardFromMethodCopyWith( - PaymentMethodDataCardFromMethod value, - $Res Function(PaymentMethodDataCardFromMethod) then) = - _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res, - PaymentMethodDataCardFromMethod>; - @useResult - $Res call( - {String paymentMethodId, - String? cvc, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; } /// @nodoc -class _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res, - $Val extends PaymentMethodDataCardFromMethod> - implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { - _$PaymentMethodDataCardFromMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodId = null, - Object? cvc = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - paymentMethodId: null == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +abstract mixin class _$PaymentMethodDataSofortCopyWith<$Res> implements $PaymentMethodDataSofortCopyWith<$Res> { + factory _$PaymentMethodDataSofortCopyWith(_PaymentMethodDataSofort value, $Res Function(_PaymentMethodDataSofort) _then) = __$PaymentMethodDataSofortCopyWithImpl; +@override @useResult +$Res call({ + String country, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } } - /// @nodoc -abstract class _$$PaymentMethodDataCardFromMethodImplCopyWith<$Res> - implements $PaymentMethodDataCardFromMethodCopyWith<$Res> { - factory _$$PaymentMethodDataCardFromMethodImplCopyWith( - _$PaymentMethodDataCardFromMethodImpl value, - $Res Function(_$PaymentMethodDataCardFromMethodImpl) then) = - __$$PaymentMethodDataCardFromMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String paymentMethodId, - String? cvc, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataCardFromMethodImplCopyWithImpl<$Res> - extends _$PaymentMethodDataCardFromMethodCopyWithImpl<$Res, - _$PaymentMethodDataCardFromMethodImpl> - implements _$$PaymentMethodDataCardFromMethodImplCopyWith<$Res> { - __$$PaymentMethodDataCardFromMethodImplCopyWithImpl( - _$PaymentMethodDataCardFromMethodImpl _value, - $Res Function(_$PaymentMethodDataCardFromMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethodId = null, - Object? cvc = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataCardFromMethodImpl( - paymentMethodId: null == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String, - cvc: freezed == cvc - ? _value.cvc - : cvc // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } -} +class __$PaymentMethodDataSofortCopyWithImpl<$Res> + implements _$PaymentMethodDataSofortCopyWith<$Res> { + __$PaymentMethodDataSofortCopyWithImpl(this._self, this._then); -/// @nodoc + final _PaymentMethodDataSofort _self; + final $Res Function(_PaymentMethodDataSofort) _then; -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataCardFromMethodImpl - implements _PaymentMethodDataCardFromMethod { - const _$PaymentMethodDataCardFromMethodImpl( - {required this.paymentMethodId, - this.cvc, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataCardFromMethodImpl.fromJson( - Map json) => - _$$PaymentMethodDataCardFromMethodImplFromJson(json); - - /// Payment method id. - @override - final String paymentMethodId; - - /// Cvc of the cart - @override - final String? cvc; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? country = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataSofort( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - @override - String toString() { - return 'PaymentMethodDataCardFromMethod(paymentMethodId: $paymentMethodId, cvc: $cvc, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataCardFromMethodImpl && - (identical(other.paymentMethodId, paymentMethodId) || - other.paymentMethodId == paymentMethodId) && - (identical(other.cvc, cvc) || other.cvc == cvc) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - paymentMethodId, - cvc, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataCardFromMethodImplCopyWith< - _$PaymentMethodDataCardFromMethodImpl> - get copyWith => __$$PaymentMethodDataCardFromMethodImplCopyWithImpl< - _$PaymentMethodDataCardFromMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataCardFromMethodImplToJson( - this, - ); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSofort +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } -} -abstract class _PaymentMethodDataCardFromMethod - implements PaymentMethodDataCardFromMethod { - const factory _PaymentMethodDataCardFromMethod( - {required final String paymentMethodId, - final String? cvc, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = - _$PaymentMethodDataCardFromMethodImpl; + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} - factory _PaymentMethodDataCardFromMethod.fromJson(Map json) = - _$PaymentMethodDataCardFromMethodImpl.fromJson; - /// Payment method id. - @override - String get paymentMethodId; +/// @nodoc +mixin _$PaymentMethodDataSepa { - /// Cvc of the cart - @override - String? get cvc; +/// Iban number of the accountholder + String get iban;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataSepaCopyWith get copyWith => _$PaymentMethodDataSepaCopyWithImpl(this as PaymentMethodDataSepa, _$identity); - /// Billing information. - @override - BillingDetails? get billingDetails; + /// Serializes this PaymentMethodDataSepa to a JSON map. + Map toJson(); - /// Shipping details - @override - ShippingDetails? get shippingDetails; - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataSepa&&(identical(other.iban, iban) || other.iban == iban)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} - /// Metadata for this payment method - @override - Map? get metadata; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,iban,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); - /// Create a copy of PaymentMethodDataCardFromMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataCardFromMethodImplCopyWith< - _$PaymentMethodDataCardFromMethodImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataSepa(iban: $iban, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -PaymentMethodDataIdeal _$PaymentMethodDataIdealFromJson( - Map json) { - return _PaymentMethodDataIdeal.fromJson(json); + } /// @nodoc -mixin _$PaymentMethodDataIdeal { - /// The bank identifier code of the bank. - String? get bankIdentifierCode => throw _privateConstructorUsedError; - - /// The name of bank. - String? get bankName => throw _privateConstructorUsedError; +abstract mixin class $PaymentMethodDataSepaCopyWith<$Res> { + factory $PaymentMethodDataSepaCopyWith(PaymentMethodDataSepa value, $Res Function(PaymentMethodDataSepa) _then) = _$PaymentMethodDataSepaCopyWithImpl; +@useResult +$Res call({ + String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; +} +/// @nodoc +class _$PaymentMethodDataSepaCopyWithImpl<$Res> + implements $PaymentMethodDataSepaCopyWith<$Res> { + _$PaymentMethodDataSepaCopyWithImpl(this._self, this._then); + + final PaymentMethodDataSepa _self; + final $Res Function(PaymentMethodDataSepa) _then; + +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? iban = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +iban: null == iban ? _self.iban : iban // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataSepa]. +extension PaymentMethodDataSepaPatterns on PaymentMethodDataSepa { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataSepa value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataSepa value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSepa(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataSepa value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that.iban,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSepa(): +return $default(_that.iban,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataSepa() when $default != null: +return $default(_that.iban,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; - /// Serializes this PaymentMethodDataIdeal to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataIdealCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentMethodDataIdealCopyWith<$Res> { - factory $PaymentMethodDataIdealCopyWith(PaymentMethodDataIdeal value, - $Res Function(PaymentMethodDataIdeal) then) = - _$PaymentMethodDataIdealCopyWithImpl<$Res, PaymentMethodDataIdeal>; - @useResult - $Res call( - {String? bankIdentifierCode, - String? bankName, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; -} +@JsonSerializable(explicitToJson: true) +class _PaymentMethodDataSepa implements PaymentMethodDataSepa { + const _PaymentMethodDataSepa({required this.iban, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataSepa.fromJson(Map json) => _$PaymentMethodDataSepaFromJson(json); -/// @nodoc -class _$PaymentMethodDataIdealCopyWithImpl<$Res, - $Val extends PaymentMethodDataIdeal> - implements $PaymentMethodDataIdealCopyWith<$Res> { - _$PaymentMethodDataIdealCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankIdentifierCode = freezed, - Object? bankName = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - bankIdentifierCode: freezed == bankIdentifierCode - ? _value.bankIdentifierCode - : bankIdentifierCode // ignore: cast_nullable_to_non_nullable - as String?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +/// Iban number of the accountholder +@override final String iban; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataSepaCopyWith<_PaymentMethodDataSepa> get copyWith => __$PaymentMethodDataSepaCopyWithImpl<_PaymentMethodDataSepa>(this, _$identity); - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } +@override +Map toJson() { + return _$PaymentMethodDataSepaToJson(this, ); } -/// @nodoc -abstract class _$$PaymentMethodDataIdealImplCopyWith<$Res> - implements $PaymentMethodDataIdealCopyWith<$Res> { - factory _$$PaymentMethodDataIdealImplCopyWith( - _$PaymentMethodDataIdealImpl value, - $Res Function(_$PaymentMethodDataIdealImpl) then) = - __$$PaymentMethodDataIdealImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? bankIdentifierCode, - String? bankName, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataIdealImplCopyWithImpl<$Res> - extends _$PaymentMethodDataIdealCopyWithImpl<$Res, - _$PaymentMethodDataIdealImpl> - implements _$$PaymentMethodDataIdealImplCopyWith<$Res> { - __$$PaymentMethodDataIdealImplCopyWithImpl( - _$PaymentMethodDataIdealImpl _value, - $Res Function(_$PaymentMethodDataIdealImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? bankIdentifierCode = freezed, - Object? bankName = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataIdealImpl( - bankIdentifierCode: freezed == bankIdentifierCode - ? _value.bankIdentifierCode - : bankIdentifierCode // ignore: cast_nullable_to_non_nullable - as String?, - bankName: freezed == bankName - ? _value.bankName - : bankName // ignore: cast_nullable_to_non_nullable - as String?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataSepa&&(identical(other.iban, iban) || other.iban == iban)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); } -/// @nodoc - -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataIdealImpl implements _PaymentMethodDataIdeal { - const _$PaymentMethodDataIdealImpl( - {this.bankIdentifierCode, - this.bankName, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataIdealImpl.fromJson(Map json) => - _$$PaymentMethodDataIdealImplFromJson(json); - - /// The bank identifier code of the bank. - @override - final String? bankIdentifierCode; - - /// The name of bank. - @override - final String? bankName; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,iban,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - @override - String toString() { - return 'PaymentMethodDataIdeal(bankIdentifierCode: $bankIdentifierCode, bankName: $bankName, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } +@override +String toString() { + return 'PaymentMethodDataSepa(iban: $iban, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataIdealImpl && - (identical(other.bankIdentifierCode, bankIdentifierCode) || - other.bankIdentifierCode == bankIdentifierCode) && - (identical(other.bankName, bankName) || - other.bankName == bankName) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - bankIdentifierCode, - bankName, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataIdealImplCopyWith<_$PaymentMethodDataIdealImpl> - get copyWith => __$$PaymentMethodDataIdealImplCopyWithImpl< - _$PaymentMethodDataIdealImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataIdealImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataIdeal implements PaymentMethodDataIdeal { - const factory _PaymentMethodDataIdeal( - {final String? bankIdentifierCode, - final String? bankName, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataIdealImpl; +/// @nodoc +abstract mixin class _$PaymentMethodDataSepaCopyWith<$Res> implements $PaymentMethodDataSepaCopyWith<$Res> { + factory _$PaymentMethodDataSepaCopyWith(_PaymentMethodDataSepa value, $Res Function(_PaymentMethodDataSepa) _then) = __$PaymentMethodDataSepaCopyWithImpl; +@override @useResult +$Res call({ + String iban, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); + - factory _PaymentMethodDataIdeal.fromJson(Map json) = - _$PaymentMethodDataIdealImpl.fromJson; +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - /// The bank identifier code of the bank. - @override - String? get bankIdentifierCode; +} +/// @nodoc +class __$PaymentMethodDataSepaCopyWithImpl<$Res> + implements _$PaymentMethodDataSepaCopyWith<$Res> { + __$PaymentMethodDataSepaCopyWithImpl(this._self, this._then); - /// The name of bank. - @override - String? get bankName; + final _PaymentMethodDataSepa _self; + final $Res Function(_PaymentMethodDataSepa) _then; - /// Billing information. - @override - BillingDetails? get billingDetails; +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? iban = null,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataSepa( +iban: null == iban ? _self.iban : iban // ignore: cast_nullable_to_non_nullable +as String,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - /// Shipping details - @override - ShippingDetails? get shippingDetails; +/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } - /// Metadata for this payment method - @override - Map? get metadata; + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataSepa +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } - /// Create a copy of PaymentMethodDataIdeal - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataIdealImplCopyWith<_$PaymentMethodDataIdealImpl> - get copyWith => throw _privateConstructorUsedError; + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); } - -PaymentMethodDataAubecs _$PaymentMethodDataAubecsFromJson( - Map json) { - return _PaymentMethodDataAubecs.fromJson(json); } + /// @nodoc -mixin _$PaymentMethodDataAubecs { - /// form input details - AubecsFormInputDetails get formDetails => throw _privateConstructorUsedError; +mixin _$PaymentMethodDataAfterPay { - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +/// Billing information. + BillingDetails get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataAfterPayCopyWith get copyWith => _$PaymentMethodDataAfterPayCopyWithImpl(this as PaymentMethodDataAfterPay, _$identity); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; + /// Serializes this PaymentMethodDataAfterPay to a JSON map. + Map toJson(); - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataAfterPay&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} - /// Serializes this PaymentMethodDataAubecs to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataAubecsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataAfterPay(billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -/// @nodoc -abstract class $PaymentMethodDataAubecsCopyWith<$Res> { - factory $PaymentMethodDataAubecsCopyWith(PaymentMethodDataAubecs value, - $Res Function(PaymentMethodDataAubecs) then) = - _$PaymentMethodDataAubecsCopyWithImpl<$Res, PaymentMethodDataAubecs>; - @useResult - $Res call( - {AubecsFormInputDetails formDetails, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $AubecsFormInputDetailsCopyWith<$Res> get formDetails; - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; } /// @nodoc -class _$PaymentMethodDataAubecsCopyWithImpl<$Res, - $Val extends PaymentMethodDataAubecs> - implements $PaymentMethodDataAubecsCopyWith<$Res> { - _$PaymentMethodDataAubecsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? formDetails = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - formDetails: null == formDetails - ? _value.formDetails - : formDetails // ignore: cast_nullable_to_non_nullable - as AubecsFormInputDetails, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +abstract mixin class $PaymentMethodDataAfterPayCopyWith<$Res> { + factory $PaymentMethodDataAfterPayCopyWith(PaymentMethodDataAfterPay value, $Res Function(PaymentMethodDataAfterPay) _then) = _$PaymentMethodDataAfterPayCopyWithImpl; +@useResult +$Res call({ + BillingDetails billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AubecsFormInputDetailsCopyWith<$Res> get formDetails { - return $AubecsFormInputDetailsCopyWith<$Res>(_value.formDetails, (value) { - return _then(_value.copyWith(formDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +$BillingDetailsCopyWith<$Res> get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +} +/// @nodoc +class _$PaymentMethodDataAfterPayCopyWithImpl<$Res> + implements $PaymentMethodDataAfterPayCopyWith<$Res> { + _$PaymentMethodDataAfterPayCopyWithImpl(this._self, this._then); + + final PaymentMethodDataAfterPay _self; + final $Res Function(PaymentMethodDataAfterPay) _then; + +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? billingDetails = null,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataAfterPay]. +extension PaymentMethodDataAfterPayPatterns on PaymentMethodDataAfterPay { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataAfterPay value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataAfterPay value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataAfterPay value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( BillingDetails billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( BillingDetails billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay(): +return $default(_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( BillingDetails billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataAfterPay() when $default != null: +return $default(_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$PaymentMethodDataAubecsImplCopyWith<$Res> - implements $PaymentMethodDataAubecsCopyWith<$Res> { - factory _$$PaymentMethodDataAubecsImplCopyWith( - _$PaymentMethodDataAubecsImpl value, - $Res Function(_$PaymentMethodDataAubecsImpl) then) = - __$$PaymentMethodDataAubecsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {AubecsFormInputDetails formDetails, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $AubecsFormInputDetailsCopyWith<$Res> get formDetails; - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataAubecsImplCopyWithImpl<$Res> - extends _$PaymentMethodDataAubecsCopyWithImpl<$Res, - _$PaymentMethodDataAubecsImpl> - implements _$$PaymentMethodDataAubecsImplCopyWith<$Res> { - __$$PaymentMethodDataAubecsImplCopyWithImpl( - _$PaymentMethodDataAubecsImpl _value, - $Res Function(_$PaymentMethodDataAubecsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? formDetails = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataAubecsImpl( - formDetails: null == formDetails - ? _value.formDetails - : formDetails // ignore: cast_nullable_to_non_nullable - as AubecsFormInputDetails, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataAubecsImpl implements _PaymentMethodDataAubecs { - const _$PaymentMethodDataAubecsImpl( - {required this.formDetails, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataAubecsImpl.fromJson(Map json) => - _$$PaymentMethodDataAubecsImplFromJson(json); - - /// form input details - @override - final AubecsFormInputDetails formDetails; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - @override - String toString() { - return 'PaymentMethodDataAubecs(formDetails: $formDetails, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataAubecsImpl && - (identical(other.formDetails, formDetails) || - other.formDetails == formDetails) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } +class _PaymentMethodDataAfterPay implements PaymentMethodDataAfterPay { + const _PaymentMethodDataAfterPay({required this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataAfterPay.fromJson(Map json) => _$PaymentMethodDataAfterPayFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - formDetails, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataAubecsImplCopyWith<_$PaymentMethodDataAubecsImpl> - get copyWith => __$$PaymentMethodDataAubecsImplCopyWithImpl< - _$PaymentMethodDataAubecsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataAubecsImplToJson( - this, - ); - } +/// Billing information. +@override final BillingDetails billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); } -abstract class _PaymentMethodDataAubecs implements PaymentMethodDataAubecs { - const factory _PaymentMethodDataAubecs( - {required final AubecsFormInputDetails formDetails, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataAubecsImpl; - - factory _PaymentMethodDataAubecs.fromJson(Map json) = - _$PaymentMethodDataAubecsImpl.fromJson; - - /// form input details - @override - AubecsFormInputDetails get formDetails; - /// Billing information. - @override - BillingDetails? get billingDetails; +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataAfterPayCopyWith<_PaymentMethodDataAfterPay> get copyWith => __$PaymentMethodDataAfterPayCopyWithImpl<_PaymentMethodDataAfterPay>(this, _$identity); - /// Shipping details - @override - ShippingDetails? get shippingDetails; +@override +Map toJson() { + return _$PaymentMethodDataAfterPayToJson(this, ); +} - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataAfterPay&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - /// Metadata for this payment method - @override - Map? get metadata; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - /// Create a copy of PaymentMethodDataAubecs - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataAubecsImplCopyWith<_$PaymentMethodDataAubecsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataAfterPay(billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -PaymentMethodDataFpx _$PaymentMethodDataFpxFromJson(Map json) { - return _PaymentMethodDataFpx.fromJson(json); + } /// @nodoc -mixin _$PaymentMethodDataFpx { - /// When set to true you can test offline payment. - bool get testOfflineBank => throw _privateConstructorUsedError; +abstract mixin class _$PaymentMethodDataAfterPayCopyWith<$Res> implements $PaymentMethodDataAfterPayCopyWith<$Res> { + factory _$PaymentMethodDataAfterPayCopyWith(_PaymentMethodDataAfterPay value, $Res Function(_PaymentMethodDataAfterPay) _then) = __$PaymentMethodDataAfterPayCopyWithImpl; +@override @useResult +$Res call({ + BillingDetails billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +@override $BillingDetailsCopyWith<$Res> get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; - - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; - - /// Serializes this PaymentMethodDataFpx to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataFpxCopyWith get copyWith => - throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentMethodDataFpxCopyWith<$Res> { - factory $PaymentMethodDataFpxCopyWith(PaymentMethodDataFpx value, - $Res Function(PaymentMethodDataFpx) then) = - _$PaymentMethodDataFpxCopyWithImpl<$Res, PaymentMethodDataFpx>; - @useResult - $Res call( - {bool testOfflineBank, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); +class __$PaymentMethodDataAfterPayCopyWithImpl<$Res> + implements _$PaymentMethodDataAfterPayCopyWith<$Res> { + __$PaymentMethodDataAfterPayCopyWithImpl(this._self, this._then); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; -} + final _PaymentMethodDataAfterPay _self; + final $Res Function(_PaymentMethodDataAfterPay) _then; -/// @nodoc -class _$PaymentMethodDataFpxCopyWithImpl<$Res, - $Val extends PaymentMethodDataFpx> - implements $PaymentMethodDataFpxCopyWith<$Res> { - _$PaymentMethodDataFpxCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testOfflineBank = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - testOfflineBank: null == testOfflineBank - ? _value.testOfflineBank - : testOfflineBank // ignore: cast_nullable_to_non_nullable - as bool, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? billingDetails = null,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataAfterPay( +billingDetails: null == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); +/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res> get billingDetails { + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataAfterPay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); } - -/// @nodoc -abstract class _$$PaymentMethodDataFpxImplCopyWith<$Res> - implements $PaymentMethodDataFpxCopyWith<$Res> { - factory _$$PaymentMethodDataFpxImplCopyWith(_$PaymentMethodDataFpxImpl value, - $Res Function(_$PaymentMethodDataFpxImpl) then) = - __$$PaymentMethodDataFpxImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool testOfflineBank, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataFpxImplCopyWithImpl<$Res> - extends _$PaymentMethodDataFpxCopyWithImpl<$Res, _$PaymentMethodDataFpxImpl> - implements _$$PaymentMethodDataFpxImplCopyWith<$Res> { - __$$PaymentMethodDataFpxImplCopyWithImpl(_$PaymentMethodDataFpxImpl _value, - $Res Function(_$PaymentMethodDataFpxImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testOfflineBank = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataFpxImpl( - testOfflineBank: null == testOfflineBank - ? _value.testOfflineBank - : testOfflineBank // ignore: cast_nullable_to_non_nullable - as bool, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } } + /// @nodoc +mixin _$PaymentMethodDataUsBank { -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataFpxImpl implements _PaymentMethodDataFpx { - const _$PaymentMethodDataFpxImpl( - {this.testOfflineBank = false, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataFpxImpl.fromJson(Map json) => - _$$PaymentMethodDataFpxImplFromJson(json); - - /// When set to true you can test offline payment. - @override - @JsonKey() - final bool testOfflineBank; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +/// The account number of the bank account. + String get accountNumber;///The routing number, sort code, or other country-appropriate institution +///number for the bank account. + String get routingNumber;/// The bank account type of the holder + BankAccountHolderType? get accountHolderType;/// The account type + UsBankAccountType? get accountType;/// Billing information. + BillingDetails? get billingDetails;/// Shipping details + ShippingDetails? get shippingDetails;/// Mandata data for this paymentmethod. + MandateData? get mandateData;/// Metadata for this payment method + Map? get metadata; +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodDataUsBankCopyWith get copyWith => _$PaymentMethodDataUsBankCopyWithImpl(this as PaymentMethodDataUsBank, _$identity); - @override - String toString() { - return 'PaymentMethodDataFpx(testOfflineBank: $testOfflineBank, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } + /// Serializes this PaymentMethodDataUsBank to a JSON map. + Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataFpxImpl && - (identical(other.testOfflineBank, testOfflineBank) || - other.testOfflineBank == testOfflineBank) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - testOfflineBank, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataFpxImplCopyWith<_$PaymentMethodDataFpxImpl> - get copyWith => - __$$PaymentMethodDataFpxImplCopyWithImpl<_$PaymentMethodDataFpxImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataFpxImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodDataUsBank&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other.metadata, metadata)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,accountNumber,routingNumber,accountHolderType,accountType,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(metadata)); + +@override +String toString() { + return 'PaymentMethodDataUsBank(accountNumber: $accountNumber, routingNumber: $routingNumber, accountHolderType: $accountHolderType, accountType: $accountType, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -abstract class _PaymentMethodDataFpx implements PaymentMethodDataFpx { - const factory _PaymentMethodDataFpx( - {final bool testOfflineBank, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataFpxImpl; - factory _PaymentMethodDataFpx.fromJson(Map json) = - _$PaymentMethodDataFpxImpl.fromJson; +} - /// When set to true you can test offline payment. - @override - bool get testOfflineBank; +/// @nodoc +abstract mixin class $PaymentMethodDataUsBankCopyWith<$Res> { + factory $PaymentMethodDataUsBankCopyWith(PaymentMethodDataUsBank value, $Res Function(PaymentMethodDataUsBank) _then) = _$PaymentMethodDataUsBankCopyWithImpl; +@useResult +$Res call({ + String accountNumber, String routingNumber, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Billing information. - @override - BillingDetails? get billingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +$BillingDetailsCopyWith<$Res>? get billingDetails;$ShippingDetailsCopyWith<$Res>? get shippingDetails;$MandateDataCopyWith<$Res>? get mandateData; - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +} +/// @nodoc +class _$PaymentMethodDataUsBankCopyWithImpl<$Res> + implements $PaymentMethodDataUsBankCopyWith<$Res> { + _$PaymentMethodDataUsBankCopyWithImpl(this._self, this._then); + + final PaymentMethodDataUsBank _self; + final $Res Function(PaymentMethodDataUsBank) _then; + +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? accountNumber = null,Object? routingNumber = null,Object? accountHolderType = freezed,Object? accountType = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_self.copyWith( +accountNumber: null == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String,routingNumber: null == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self.metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; + } + + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; + } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentMethodDataUsBank]. +extension PaymentMethodDataUsBankPatterns on PaymentMethodDataUsBank { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodDataUsBank value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodDataUsBank value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodDataUsBank value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String accountNumber, String routingNumber, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that.accountNumber,_that.routingNumber,_that.accountHolderType,_that.accountType,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String accountNumber, String routingNumber, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank(): +return $default(_that.accountNumber,_that.routingNumber,_that.accountHolderType,_that.accountType,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Metadata for this payment method - @override - Map? get metadata; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String accountNumber, String routingNumber, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodDataUsBank() when $default != null: +return $default(_that.accountNumber,_that.routingNumber,_that.accountHolderType,_that.accountType,_that.billingDetails,_that.shippingDetails,_that.mandateData,_that.metadata);case _: + return null; - /// Create a copy of PaymentMethodDataFpx - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataFpxImplCopyWith<_$PaymentMethodDataFpxImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentMethodDataSofort _$PaymentMethodDataSofortFromJson( - Map json) { - return _PaymentMethodDataSofort.fromJson(json); } /// @nodoc -mixin _$PaymentMethodDataSofort { - /// Country of the accountholder - String get country => throw _privateConstructorUsedError; - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentMethodDataUsBank implements PaymentMethodDataUsBank { + const _PaymentMethodDataUsBank({required this.accountNumber, required this.routingNumber, this.accountHolderType, this.accountType, this.billingDetails, this.shippingDetails, this.mandateData, final Map? metadata}): _metadata = metadata; + factory _PaymentMethodDataUsBank.fromJson(Map json) => _$PaymentMethodDataUsBankFromJson(json); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +/// The account number of the bank account. +@override final String accountNumber; +///The routing number, sort code, or other country-appropriate institution +///number for the bank account. +@override final String routingNumber; +/// The bank account type of the holder +@override final BankAccountHolderType? accountHolderType; +/// The account type +@override final UsBankAccountType? accountType; +/// Billing information. +@override final BillingDetails? billingDetails; +/// Shipping details +@override final ShippingDetails? shippingDetails; +/// Mandata data for this paymentmethod. +@override final MandateData? mandateData; +/// Metadata for this payment method + final Map? _metadata; +/// Metadata for this payment method +@override Map? get metadata { + final value = _metadata; + if (value == null) return null; + if (_metadata is EqualUnmodifiableMapView) return _metadata; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); +} + + +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodDataUsBankCopyWith<_PaymentMethodDataUsBank> get copyWith => __$PaymentMethodDataUsBankCopyWithImpl<_PaymentMethodDataUsBank>(this, _$identity); - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentMethodDataUsBankToJson(this, ); +} - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodDataUsBank&&(identical(other.accountNumber, accountNumber) || other.accountNumber == accountNumber)&&(identical(other.routingNumber, routingNumber) || other.routingNumber == routingNumber)&&(identical(other.accountHolderType, accountHolderType) || other.accountHolderType == accountHolderType)&&(identical(other.accountType, accountType) || other.accountType == accountType)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.shippingDetails, shippingDetails) || other.shippingDetails == shippingDetails)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)&&const DeepCollectionEquality().equals(other._metadata, _metadata)); +} - /// Serializes this PaymentMethodDataSofort to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,accountNumber,routingNumber,accountHolderType,accountType,billingDetails,shippingDetails,mandateData,const DeepCollectionEquality().hash(_metadata)); - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataSofortCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodDataUsBank(accountNumber: $accountNumber, routingNumber: $routingNumber, accountHolderType: $accountHolderType, accountType: $accountType, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; } -/// @nodoc -abstract class $PaymentMethodDataSofortCopyWith<$Res> { - factory $PaymentMethodDataSofortCopyWith(PaymentMethodDataSofort value, - $Res Function(PaymentMethodDataSofort) then) = - _$PaymentMethodDataSofortCopyWithImpl<$Res, PaymentMethodDataSofort>; - @useResult - $Res call( - {String country, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; } /// @nodoc -class _$PaymentMethodDataSofortCopyWithImpl<$Res, - $Val extends PaymentMethodDataSofort> - implements $PaymentMethodDataSofortCopyWith<$Res> { - _$PaymentMethodDataSofortCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +abstract mixin class _$PaymentMethodDataUsBankCopyWith<$Res> implements $PaymentMethodDataUsBankCopyWith<$Res> { + factory _$PaymentMethodDataUsBankCopyWith(_PaymentMethodDataUsBank value, $Res Function(_PaymentMethodDataUsBank) _then) = __$PaymentMethodDataUsBankCopyWithImpl; +@override @useResult +$Res call({ + String accountNumber, String routingNumber, BankAccountHolderType? accountHolderType, UsBankAccountType? accountType, BillingDetails? billingDetails, ShippingDetails? shippingDetails, MandateData? mandateData, Map? metadata +}); - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $ShippingDetailsCopyWith<$Res>? get shippingDetails;@override $MandateDataCopyWith<$Res>? get mandateData; - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } } - /// @nodoc -abstract class _$$PaymentMethodDataSofortImplCopyWith<$Res> - implements $PaymentMethodDataSofortCopyWith<$Res> { - factory _$$PaymentMethodDataSofortImplCopyWith( - _$PaymentMethodDataSofortImpl value, - $Res Function(_$PaymentMethodDataSofortImpl) then) = - __$$PaymentMethodDataSofortImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String country, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataSofortImplCopyWithImpl<$Res> - extends _$PaymentMethodDataSofortCopyWithImpl<$Res, - _$PaymentMethodDataSofortImpl> - implements _$$PaymentMethodDataSofortImplCopyWith<$Res> { - __$$PaymentMethodDataSofortImplCopyWithImpl( - _$PaymentMethodDataSofortImpl _value, - $Res Function(_$PaymentMethodDataSofortImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataSofortImpl( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } -} +class __$PaymentMethodDataUsBankCopyWithImpl<$Res> + implements _$PaymentMethodDataUsBankCopyWith<$Res> { + __$PaymentMethodDataUsBankCopyWithImpl(this._self, this._then); -/// @nodoc + final _PaymentMethodDataUsBank _self; + final $Res Function(_PaymentMethodDataUsBank) _then; -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataSofortImpl implements _PaymentMethodDataSofort { - const _$PaymentMethodDataSofortImpl( - {required this.country, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataSofortImpl.fromJson(Map json) => - _$$PaymentMethodDataSofortImplFromJson(json); - - /// Country of the accountholder - @override - final String country; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? accountNumber = null,Object? routingNumber = null,Object? accountHolderType = freezed,Object? accountType = freezed,Object? billingDetails = freezed,Object? shippingDetails = freezed,Object? mandateData = freezed,Object? metadata = freezed,}) { + return _then(_PaymentMethodDataUsBank( +accountNumber: null == accountNumber ? _self.accountNumber : accountNumber // ignore: cast_nullable_to_non_nullable +as String,routingNumber: null == routingNumber ? _self.routingNumber : routingNumber // ignore: cast_nullable_to_non_nullable +as String,accountHolderType: freezed == accountHolderType ? _self.accountHolderType : accountHolderType // ignore: cast_nullable_to_non_nullable +as BankAccountHolderType?,accountType: freezed == accountType ? _self.accountType : accountType // ignore: cast_nullable_to_non_nullable +as UsBankAccountType?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,shippingDetails: freezed == shippingDetails ? _self.shippingDetails : shippingDetails // ignore: cast_nullable_to_non_nullable +as ShippingDetails?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?,metadata: freezed == metadata ? _self._metadata : metadata // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} - @override - String toString() { - return 'PaymentMethodDataSofort(country: $country, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; +/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataSofortImpl && - (identical(other.country, country) || other.country == country) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ShippingDetailsCopyWith<$Res>? get shippingDetails { + if (_self.shippingDetails == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - country, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataSofortImplCopyWith<_$PaymentMethodDataSofortImpl> - get copyWith => __$$PaymentMethodDataSofortImplCopyWithImpl< - _$PaymentMethodDataSofortImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataSofortImplToJson( - this, - ); + return $ShippingDetailsCopyWith<$Res>(_self.shippingDetails!, (value) { + return _then(_self.copyWith(shippingDetails: value)); + }); +}/// Create a copy of PaymentMethodDataUsBank +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} } -abstract class _PaymentMethodDataSofort implements PaymentMethodDataSofort { - const factory _PaymentMethodDataSofort( - {required final String country, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataSofortImpl; - factory _PaymentMethodDataSofort.fromJson(Map json) = - _$PaymentMethodDataSofortImpl.fromJson; +/// @nodoc +mixin _$PaymentMethodOptions { - /// Country of the accountholder - @override - String get country; +/// Indicates whether or not you want to reuse this method for future payments. + PaymentIntentsFutureUsage? get setupFutureUsage;/// This is an experimental feature that may be removed at any time +/// A map of payment method types to setup_future_usage value. (e.g. card: 'OffSession') +@JsonKey(name: 'setup_future_usage_values') Map? get setupFutureUsageValues; +/// Create a copy of PaymentMethodOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentMethodOptionsCopyWith get copyWith => _$PaymentMethodOptionsCopyWithImpl(this as PaymentMethodOptions, _$identity); - /// Billing information. - @override - BillingDetails? get billingDetails; + /// Serializes this PaymentMethodOptions to a JSON map. + Map toJson(); - /// Shipping details - @override - ShippingDetails? get shippingDetails; - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentMethodOptions&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&const DeepCollectionEquality().equals(other.setupFutureUsageValues, setupFutureUsageValues)); +} - /// Metadata for this payment method - @override - Map? get metadata; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,setupFutureUsage,const DeepCollectionEquality().hash(setupFutureUsageValues)); - /// Create a copy of PaymentMethodDataSofort - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataSofortImplCopyWith<_$PaymentMethodDataSofortImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodOptions(setupFutureUsage: $setupFutureUsage, setupFutureUsageValues: $setupFutureUsageValues)'; } -PaymentMethodDataSepa _$PaymentMethodDataSepaFromJson( - Map json) { - return _PaymentMethodDataSepa.fromJson(json); + } /// @nodoc -mixin _$PaymentMethodDataSepa { - /// Iban number of the accountholder - String get iban => throw _privateConstructorUsedError; - - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +abstract mixin class $PaymentMethodOptionsCopyWith<$Res> { + factory $PaymentMethodOptionsCopyWith(PaymentMethodOptions value, $Res Function(PaymentMethodOptions) _then) = _$PaymentMethodOptionsCopyWithImpl; +@useResult +$Res call({ + PaymentIntentsFutureUsage? setupFutureUsage,@JsonKey(name: 'setup_future_usage_values') Map? setupFutureUsageValues +}); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; - - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; - - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; - - /// Serializes this PaymentMethodDataSepa to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataSepaCopyWith get copyWith => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $PaymentMethodDataSepaCopyWith<$Res> { - factory $PaymentMethodDataSepaCopyWith(PaymentMethodDataSepa value, - $Res Function(PaymentMethodDataSepa) then) = - _$PaymentMethodDataSepaCopyWithImpl<$Res, PaymentMethodDataSepa>; - @useResult - $Res call( - {String iban, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; } - /// @nodoc -class _$PaymentMethodDataSepaCopyWithImpl<$Res, - $Val extends PaymentMethodDataSepa> - implements $PaymentMethodDataSepaCopyWith<$Res> { - _$PaymentMethodDataSepaCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? iban = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - iban: null == iban - ? _value.iban - : iban // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +class _$PaymentMethodOptionsCopyWithImpl<$Res> + implements $PaymentMethodOptionsCopyWith<$Res> { + _$PaymentMethodOptionsCopyWithImpl(this._self, this._then); + + final PaymentMethodOptions _self; + final $Res Function(PaymentMethodOptions) _then; + +/// Create a copy of PaymentMethodOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? setupFutureUsage = freezed,Object? setupFutureUsageValues = freezed,}) { + return _then(_self.copyWith( +setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentsFutureUsage?,setupFutureUsageValues: freezed == setupFutureUsageValues ? _self.setupFutureUsageValues : setupFutureUsageValues // ignore: cast_nullable_to_non_nullable +as Map?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentMethodOptions]. +extension PaymentMethodOptionsPatterns on PaymentMethodOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentMethodOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMethodOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentMethodOptions value) $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentMethodOptions value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentMethodOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentIntentsFutureUsage? setupFutureUsage, @JsonKey(name: 'setup_future_usage_values') Map? setupFutureUsageValues)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMethodOptions() when $default != null: +return $default(_that.setupFutureUsage,_that.setupFutureUsageValues);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentIntentsFutureUsage? setupFutureUsage, @JsonKey(name: 'setup_future_usage_values') Map? setupFutureUsageValues) $default,) {final _that = this; +switch (_that) { +case _PaymentMethodOptions(): +return $default(_that.setupFutureUsage,_that.setupFutureUsageValues);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentIntentsFutureUsage? setupFutureUsage, @JsonKey(name: 'setup_future_usage_values') Map? setupFutureUsageValues)? $default,) {final _that = this; +switch (_that) { +case _PaymentMethodOptions() when $default != null: +return $default(_that.setupFutureUsage,_that.setupFutureUsageValues);case _: + return null; - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$PaymentMethodDataSepaImplCopyWith<$Res> - implements $PaymentMethodDataSepaCopyWith<$Res> { - factory _$$PaymentMethodDataSepaImplCopyWith( - _$PaymentMethodDataSepaImpl value, - $Res Function(_$PaymentMethodDataSepaImpl) then) = - __$$PaymentMethodDataSepaImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String iban, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataSepaImplCopyWithImpl<$Res> - extends _$PaymentMethodDataSepaCopyWithImpl<$Res, - _$PaymentMethodDataSepaImpl> - implements _$$PaymentMethodDataSepaImplCopyWith<$Res> { - __$$PaymentMethodDataSepaImplCopyWithImpl(_$PaymentMethodDataSepaImpl _value, - $Res Function(_$PaymentMethodDataSepaImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? iban = null, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataSepaImpl( - iban: null == iban - ? _value.iban - : iban // ignore: cast_nullable_to_non_nullable - as String, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataSepaImpl implements _PaymentMethodDataSepa { - const _$PaymentMethodDataSepaImpl( - {required this.iban, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataSepaImpl.fromJson(Map json) => - _$$PaymentMethodDataSepaImplFromJson(json); - - /// Iban number of the accountholder - @override - final String iban; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } - - @override - String toString() { - return 'PaymentMethodDataSepa(iban: $iban, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataSepaImpl && - (identical(other.iban, iban) || other.iban == iban) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } +class _PaymentMethodOptions implements PaymentMethodOptions { + const _PaymentMethodOptions({this.setupFutureUsage, @JsonKey(name: 'setup_future_usage_values') final Map? setupFutureUsageValues}): _setupFutureUsageValues = setupFutureUsageValues; + factory _PaymentMethodOptions.fromJson(Map json) => _$PaymentMethodOptionsFromJson(json); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - iban, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataSepaImplCopyWith<_$PaymentMethodDataSepaImpl> - get copyWith => __$$PaymentMethodDataSepaImplCopyWithImpl< - _$PaymentMethodDataSepaImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataSepaImplToJson( - this, - ); - } +/// Indicates whether or not you want to reuse this method for future payments. +@override final PaymentIntentsFutureUsage? setupFutureUsage; +/// This is an experimental feature that may be removed at any time +/// A map of payment method types to setup_future_usage value. (e.g. card: 'OffSession') + final Map? _setupFutureUsageValues; +/// This is an experimental feature that may be removed at any time +/// A map of payment method types to setup_future_usage value. (e.g. card: 'OffSession') +@override@JsonKey(name: 'setup_future_usage_values') Map? get setupFutureUsageValues { + final value = _setupFutureUsageValues; + if (value == null) return null; + if (_setupFutureUsageValues is EqualUnmodifiableMapView) return _setupFutureUsageValues; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); } -abstract class _PaymentMethodDataSepa implements PaymentMethodDataSepa { - const factory _PaymentMethodDataSepa( - {required final String iban, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataSepaImpl; - factory _PaymentMethodDataSepa.fromJson(Map json) = - _$PaymentMethodDataSepaImpl.fromJson; +/// Create a copy of PaymentMethodOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentMethodOptionsCopyWith<_PaymentMethodOptions> get copyWith => __$PaymentMethodOptionsCopyWithImpl<_PaymentMethodOptions>(this, _$identity); - /// Iban number of the accountholder - @override - String get iban; - - /// Billing information. - @override - BillingDetails? get billingDetails; - - /// Shipping details - @override - ShippingDetails? get shippingDetails; +@override +Map toJson() { + return _$PaymentMethodOptionsToJson(this, ); +} - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMethodOptions&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&const DeepCollectionEquality().equals(other._setupFutureUsageValues, _setupFutureUsageValues)); +} - /// Metadata for this payment method - @override - Map? get metadata; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,setupFutureUsage,const DeepCollectionEquality().hash(_setupFutureUsageValues)); - /// Create a copy of PaymentMethodDataSepa - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataSepaImplCopyWith<_$PaymentMethodDataSepaImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentMethodOptions(setupFutureUsage: $setupFutureUsage, setupFutureUsageValues: $setupFutureUsageValues)'; } -PaymentMethodDataAfterPay _$PaymentMethodDataAfterPayFromJson( - Map json) { - return _PaymentMethodDataAfterPay.fromJson(json); + } /// @nodoc -mixin _$PaymentMethodDataAfterPay { - /// Billing information. - BillingDetails get billingDetails => throw _privateConstructorUsedError; +abstract mixin class _$PaymentMethodOptionsCopyWith<$Res> implements $PaymentMethodOptionsCopyWith<$Res> { + factory _$PaymentMethodOptionsCopyWith(_PaymentMethodOptions value, $Res Function(_PaymentMethodOptions) _then) = __$PaymentMethodOptionsCopyWithImpl; +@override @useResult +$Res call({ + PaymentIntentsFutureUsage? setupFutureUsage,@JsonKey(name: 'setup_future_usage_values') Map? setupFutureUsageValues +}); - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; - /// Serializes this PaymentMethodDataAfterPay to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +/// @nodoc +class __$PaymentMethodOptionsCopyWithImpl<$Res> + implements _$PaymentMethodOptionsCopyWith<$Res> { + __$PaymentMethodOptionsCopyWithImpl(this._self, this._then); + + final _PaymentMethodOptions _self; + final $Res Function(_PaymentMethodOptions) _then; - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataAfterPayCopyWith get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of PaymentMethodOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? setupFutureUsage = freezed,Object? setupFutureUsageValues = freezed,}) { + return _then(_PaymentMethodOptions( +setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as PaymentIntentsFutureUsage?,setupFutureUsageValues: freezed == setupFutureUsageValues ? _self._setupFutureUsageValues : setupFutureUsageValues // ignore: cast_nullable_to_non_nullable +as Map?, + )); } -/// @nodoc -abstract class $PaymentMethodDataAfterPayCopyWith<$Res> { - factory $PaymentMethodDataAfterPayCopyWith(PaymentMethodDataAfterPay value, - $Res Function(PaymentMethodDataAfterPay) then) = - _$PaymentMethodDataAfterPayCopyWithImpl<$Res, PaymentMethodDataAfterPay>; - @useResult - $Res call( - {BillingDetails billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - $BillingDetailsCopyWith<$Res> get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; } + /// @nodoc -class _$PaymentMethodDataAfterPayCopyWithImpl<$Res, - $Val extends PaymentMethodDataAfterPay> - implements $PaymentMethodDataAfterPayCopyWith<$Res> { - _$PaymentMethodDataAfterPayCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +mixin _$MandateData { - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res> get billingDetails { - return $BillingDetailsCopyWith<$Res>(_value.billingDetails, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +/// The type of mandate to create. + MandateDataCustomerAcceptance? get customerAcceptance; +/// Create a copy of MandateData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$MandateDataCopyWith get copyWith => _$MandateDataCopyWithImpl(this as MandateData, _$identity); - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } + /// Serializes this MandateData to a JSON map. + Map toJson(); - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } -} -/// @nodoc -abstract class _$$PaymentMethodDataAfterPayImplCopyWith<$Res> - implements $PaymentMethodDataAfterPayCopyWith<$Res> { - factory _$$PaymentMethodDataAfterPayImplCopyWith( - _$PaymentMethodDataAfterPayImpl value, - $Res Function(_$PaymentMethodDataAfterPayImpl) then) = - __$$PaymentMethodDataAfterPayImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {BillingDetails billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res> get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataAfterPayImplCopyWithImpl<$Res> - extends _$PaymentMethodDataAfterPayCopyWithImpl<$Res, - _$PaymentMethodDataAfterPayImpl> - implements _$$PaymentMethodDataAfterPayImplCopyWith<$Res> { - __$$PaymentMethodDataAfterPayImplCopyWithImpl( - _$PaymentMethodDataAfterPayImpl _value, - $Res Function(_$PaymentMethodDataAfterPayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? billingDetails = null, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataAfterPayImpl( - billingDetails: null == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is MandateData&&(identical(other.customerAcceptance, customerAcceptance) || other.customerAcceptance == customerAcceptance)); } -/// @nodoc - -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataAfterPayImpl implements _PaymentMethodDataAfterPay { - const _$PaymentMethodDataAfterPayImpl( - {required this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataAfterPayImpl.fromJson(Map json) => - _$$PaymentMethodDataAfterPayImplFromJson(json); - - /// Billing information. - @override - final BillingDetails billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,customerAcceptance); - @override - String toString() { - return 'PaymentMethodDataAfterPay(billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } +@override +String toString() { + return 'MandateData(customerAcceptance: $customerAcceptance)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataAfterPayImpl && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, billingDetails, shippingDetails, - mandateData, const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataAfterPayImplCopyWith<_$PaymentMethodDataAfterPayImpl> - get copyWith => __$$PaymentMethodDataAfterPayImplCopyWithImpl< - _$PaymentMethodDataAfterPayImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataAfterPayImplToJson( - this, - ); - } } -abstract class _PaymentMethodDataAfterPay implements PaymentMethodDataAfterPay { - const factory _PaymentMethodDataAfterPay( - {required final BillingDetails billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataAfterPayImpl; - - factory _PaymentMethodDataAfterPay.fromJson(Map json) = - _$PaymentMethodDataAfterPayImpl.fromJson; +/// @nodoc +abstract mixin class $MandateDataCopyWith<$Res> { + factory $MandateDataCopyWith(MandateData value, $Res Function(MandateData) _then) = _$MandateDataCopyWithImpl; +@useResult +$Res call({ + MandateDataCustomerAcceptance? customerAcceptance +}); - /// Billing information. - @override - BillingDetails get billingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +$MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance; - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +} +/// @nodoc +class _$MandateDataCopyWithImpl<$Res> + implements $MandateDataCopyWith<$Res> { + _$MandateDataCopyWithImpl(this._self, this._then); + + final MandateData _self; + final $Res Function(MandateData) _then; + +/// Create a copy of MandateData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? customerAcceptance = freezed,}) { + return _then(_self.copyWith( +customerAcceptance: freezed == customerAcceptance ? _self.customerAcceptance : customerAcceptance // ignore: cast_nullable_to_non_nullable +as MandateDataCustomerAcceptance?, + )); +} +/// Create a copy of MandateData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance { + if (_self.customerAcceptance == null) { + return null; + } + + return $MandateDataCustomerAcceptanceCopyWith<$Res>(_self.customerAcceptance!, (value) { + return _then(_self.copyWith(customerAcceptance: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [MandateData]. +extension MandateDataPatterns on MandateData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _MandateData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _MandateData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _MandateData value) $default,){ +final _that = this; +switch (_that) { +case _MandateData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _MandateData value)? $default,){ +final _that = this; +switch (_that) { +case _MandateData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( MandateDataCustomerAcceptance? customerAcceptance)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _MandateData() when $default != null: +return $default(_that.customerAcceptance);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( MandateDataCustomerAcceptance? customerAcceptance) $default,) {final _that = this; +switch (_that) { +case _MandateData(): +return $default(_that.customerAcceptance);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Metadata for this payment method - @override - Map? get metadata; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( MandateDataCustomerAcceptance? customerAcceptance)? $default,) {final _that = this; +switch (_that) { +case _MandateData() when $default != null: +return $default(_that.customerAcceptance);case _: + return null; - /// Create a copy of PaymentMethodDataAfterPay - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataAfterPayImplCopyWith<_$PaymentMethodDataAfterPayImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentMethodDataUsBank _$PaymentMethodDataUsBankFromJson( - Map json) { - return _PaymentMethodDataUsBank.fromJson(json); } /// @nodoc -mixin _$PaymentMethodDataUsBank { - /// The account number of the bank account. - String get accountNumber => throw _privateConstructorUsedError; - ///The routing number, sort code, or other country-appropriate institution - ///number for the bank account. - String get routingNumber => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _MandateData implements MandateData { + const _MandateData({this.customerAcceptance}); + factory _MandateData.fromJson(Map json) => _$MandateDataFromJson(json); - /// The bank account type of the holder - BankAccountHolderType? get accountHolderType => - throw _privateConstructorUsedError; +/// The type of mandate to create. +@override final MandateDataCustomerAcceptance? customerAcceptance; - /// The account type - UsBankAccountType? get accountType => throw _privateConstructorUsedError; +/// Create a copy of MandateData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$MandateDataCopyWith<_MandateData> get copyWith => __$MandateDataCopyWithImpl<_MandateData>(this, _$identity); - /// Billing information. - BillingDetails? get billingDetails => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$MandateDataToJson(this, ); +} - /// Shipping details - ShippingDetails? get shippingDetails => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _MandateData&&(identical(other.customerAcceptance, customerAcceptance) || other.customerAcceptance == customerAcceptance)); +} - /// Mandata data for this paymentmethod. - MandateData? get mandateData => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,customerAcceptance); - /// Metadata for this payment method - Map? get metadata => throw _privateConstructorUsedError; +@override +String toString() { + return 'MandateData(customerAcceptance: $customerAcceptance)'; +} - /// Serializes this PaymentMethodDataUsBank to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodDataUsBankCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentMethodDataUsBankCopyWith<$Res> { - factory $PaymentMethodDataUsBankCopyWith(PaymentMethodDataUsBank value, - $Res Function(PaymentMethodDataUsBank) then) = - _$PaymentMethodDataUsBankCopyWithImpl<$Res, PaymentMethodDataUsBank>; - @useResult - $Res call( - {String accountNumber, - String routingNumber, - BankAccountHolderType? accountHolderType, - UsBankAccountType? accountType, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); +abstract mixin class _$MandateDataCopyWith<$Res> implements $MandateDataCopyWith<$Res> { + factory _$MandateDataCopyWith(_MandateData value, $Res Function(_MandateData) _then) = __$MandateDataCopyWithImpl; +@override @useResult +$Res call({ + MandateDataCustomerAcceptance? customerAcceptance +}); - $BillingDetailsCopyWith<$Res>? get billingDetails; - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - $MandateDataCopyWith<$Res>? get mandateData; -} -/// @nodoc -class _$PaymentMethodDataUsBankCopyWithImpl<$Res, - $Val extends PaymentMethodDataUsBank> - implements $PaymentMethodDataUsBankCopyWith<$Res> { - _$PaymentMethodDataUsBankCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? accountNumber = null, - Object? routingNumber = null, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_value.copyWith( - accountNumber: null == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String, - routingNumber: null == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value.metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); - } +@override $MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance; - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +} +/// @nodoc +class __$MandateDataCopyWithImpl<$Res> + implements _$MandateDataCopyWith<$Res> { + __$MandateDataCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ShippingDetailsCopyWith<$Res>? get shippingDetails { - if (_value.shippingDetails == null) { - return null; - } - - return $ShippingDetailsCopyWith<$Res>(_value.shippingDetails!, (value) { - return _then(_value.copyWith(shippingDetails: value) as $Val); - }); - } + final _MandateData _self; + final $Res Function(_MandateData) _then; - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } +/// Create a copy of MandateData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? customerAcceptance = freezed,}) { + return _then(_MandateData( +customerAcceptance: freezed == customerAcceptance ? _self.customerAcceptance : customerAcceptance // ignore: cast_nullable_to_non_nullable +as MandateDataCustomerAcceptance?, + )); } -/// @nodoc -abstract class _$$PaymentMethodDataUsBankImplCopyWith<$Res> - implements $PaymentMethodDataUsBankCopyWith<$Res> { - factory _$$PaymentMethodDataUsBankImplCopyWith( - _$PaymentMethodDataUsBankImpl value, - $Res Function(_$PaymentMethodDataUsBankImpl) then) = - __$$PaymentMethodDataUsBankImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String accountNumber, - String routingNumber, - BankAccountHolderType? accountHolderType, - UsBankAccountType? accountType, - BillingDetails? billingDetails, - ShippingDetails? shippingDetails, - MandateData? mandateData, - Map? metadata}); - - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $ShippingDetailsCopyWith<$Res>? get shippingDetails; - @override - $MandateDataCopyWith<$Res>? get mandateData; -} - -/// @nodoc -class __$$PaymentMethodDataUsBankImplCopyWithImpl<$Res> - extends _$PaymentMethodDataUsBankCopyWithImpl<$Res, - _$PaymentMethodDataUsBankImpl> - implements _$$PaymentMethodDataUsBankImplCopyWith<$Res> { - __$$PaymentMethodDataUsBankImplCopyWithImpl( - _$PaymentMethodDataUsBankImpl _value, - $Res Function(_$PaymentMethodDataUsBankImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? accountNumber = null, - Object? routingNumber = null, - Object? accountHolderType = freezed, - Object? accountType = freezed, - Object? billingDetails = freezed, - Object? shippingDetails = freezed, - Object? mandateData = freezed, - Object? metadata = freezed, - }) { - return _then(_$PaymentMethodDataUsBankImpl( - accountNumber: null == accountNumber - ? _value.accountNumber - : accountNumber // ignore: cast_nullable_to_non_nullable - as String, - routingNumber: null == routingNumber - ? _value.routingNumber - : routingNumber // ignore: cast_nullable_to_non_nullable - as String, - accountHolderType: freezed == accountHolderType - ? _value.accountHolderType - : accountHolderType // ignore: cast_nullable_to_non_nullable - as BankAccountHolderType?, - accountType: freezed == accountType - ? _value.accountType - : accountType // ignore: cast_nullable_to_non_nullable - as UsBankAccountType?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - shippingDetails: freezed == shippingDetails - ? _value.shippingDetails - : shippingDetails // ignore: cast_nullable_to_non_nullable - as ShippingDetails?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - metadata: freezed == metadata - ? _value._metadata - : metadata // ignore: cast_nullable_to_non_nullable - as Map?, - )); +/// Create a copy of MandateData +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance { + if (_self.customerAcceptance == null) { + return null; } + + return $MandateDataCustomerAcceptanceCopyWith<$Res>(_self.customerAcceptance!, (value) { + return _then(_self.copyWith(customerAcceptance: value)); + }); +} } /// @nodoc +mixin _$MandateDataCustomerAcceptance { -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodDataUsBankImpl implements _PaymentMethodDataUsBank { - const _$PaymentMethodDataUsBankImpl( - {required this.accountNumber, - required this.routingNumber, - this.accountHolderType, - this.accountType, - this.billingDetails, - this.shippingDetails, - this.mandateData, - final Map? metadata}) - : _metadata = metadata; - - factory _$PaymentMethodDataUsBankImpl.fromJson(Map json) => - _$$PaymentMethodDataUsBankImplFromJson(json); - - /// The account number of the bank account. - @override - final String accountNumber; - - ///The routing number, sort code, or other country-appropriate institution - ///number for the bank account. - @override - final String routingNumber; - - /// The bank account type of the holder - @override - final BankAccountHolderType? accountHolderType; - - /// The account type - @override - final UsBankAccountType? accountType; - - /// Billing information. - @override - final BillingDetails? billingDetails; - - /// Shipping details - @override - final ShippingDetails? shippingDetails; - - /// Mandata data for this paymentmethod. - @override - final MandateData? mandateData; - - /// Metadata for this payment method - final Map? _metadata; - - /// Metadata for this payment method - @override - Map? get metadata { - final value = _metadata; - if (value == null) return null; - if (_metadata is EqualUnmodifiableMapView) return _metadata; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(value); - } +/// Online data regarding the mandate. + MandateDataOnlineData? get ipAddress; +/// Create a copy of MandateDataCustomerAcceptance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$MandateDataCustomerAcceptanceCopyWith get copyWith => _$MandateDataCustomerAcceptanceCopyWithImpl(this as MandateDataCustomerAcceptance, _$identity); - @override - String toString() { - return 'PaymentMethodDataUsBank(accountNumber: $accountNumber, routingNumber: $routingNumber, accountHolderType: $accountHolderType, accountType: $accountType, billingDetails: $billingDetails, shippingDetails: $shippingDetails, mandateData: $mandateData, metadata: $metadata)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodDataUsBankImpl && - (identical(other.accountNumber, accountNumber) || - other.accountNumber == accountNumber) && - (identical(other.routingNumber, routingNumber) || - other.routingNumber == routingNumber) && - (identical(other.accountHolderType, accountHolderType) || - other.accountHolderType == accountHolderType) && - (identical(other.accountType, accountType) || - other.accountType == accountType) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.shippingDetails, shippingDetails) || - other.shippingDetails == shippingDetails) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData) && - const DeepCollectionEquality().equals(other._metadata, _metadata)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - accountNumber, - routingNumber, - accountHolderType, - accountType, - billingDetails, - shippingDetails, - mandateData, - const DeepCollectionEquality().hash(_metadata)); - - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodDataUsBankImplCopyWith<_$PaymentMethodDataUsBankImpl> - get copyWith => __$$PaymentMethodDataUsBankImplCopyWithImpl< - _$PaymentMethodDataUsBankImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodDataUsBankImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is MandateDataCustomerAcceptance&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)); } -abstract class _PaymentMethodDataUsBank implements PaymentMethodDataUsBank { - const factory _PaymentMethodDataUsBank( - {required final String accountNumber, - required final String routingNumber, - final BankAccountHolderType? accountHolderType, - final UsBankAccountType? accountType, - final BillingDetails? billingDetails, - final ShippingDetails? shippingDetails, - final MandateData? mandateData, - final Map? metadata}) = _$PaymentMethodDataUsBankImpl; - factory _PaymentMethodDataUsBank.fromJson(Map json) = - _$PaymentMethodDataUsBankImpl.fromJson; +@override +int get hashCode => Object.hash(runtimeType,ipAddress); - /// The account number of the bank account. - @override - String get accountNumber; +@override +String toString() { + return 'MandateDataCustomerAcceptance(ipAddress: $ipAddress)'; +} - ///The routing number, sort code, or other country-appropriate institution - ///number for the bank account. - @override - String get routingNumber; - /// The bank account type of the holder - @override - BankAccountHolderType? get accountHolderType; +} - /// The account type - @override - UsBankAccountType? get accountType; +/// @nodoc +abstract mixin class $MandateDataCustomerAcceptanceCopyWith<$Res> { + factory $MandateDataCustomerAcceptanceCopyWith(MandateDataCustomerAcceptance value, $Res Function(MandateDataCustomerAcceptance) _then) = _$MandateDataCustomerAcceptanceCopyWithImpl; +@useResult +$Res call({ + MandateDataOnlineData? ipAddress +}); - /// Billing information. - @override - BillingDetails? get billingDetails; - /// Shipping details - @override - ShippingDetails? get shippingDetails; +$MandateDataOnlineDataCopyWith<$Res>? get ipAddress; - /// Mandata data for this paymentmethod. - @override - MandateData? get mandateData; +} +/// @nodoc +class _$MandateDataCustomerAcceptanceCopyWithImpl<$Res> + implements $MandateDataCustomerAcceptanceCopyWith<$Res> { + _$MandateDataCustomerAcceptanceCopyWithImpl(this._self, this._then); + + final MandateDataCustomerAcceptance _self; + final $Res Function(MandateDataCustomerAcceptance) _then; + +/// Create a copy of MandateDataCustomerAcceptance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? ipAddress = freezed,}) { + return _then(_self.copyWith( +ipAddress: freezed == ipAddress ? _self.ipAddress : ipAddress // ignore: cast_nullable_to_non_nullable +as MandateDataOnlineData?, + )); +} +/// Create a copy of MandateDataCustomerAcceptance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataOnlineDataCopyWith<$Res>? get ipAddress { + if (_self.ipAddress == null) { + return null; + } + + return $MandateDataOnlineDataCopyWith<$Res>(_self.ipAddress!, (value) { + return _then(_self.copyWith(ipAddress: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [MandateDataCustomerAcceptance]. +extension MandateDataCustomerAcceptancePatterns on MandateDataCustomerAcceptance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _MandateDataCustomerAcceptance value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _MandateDataCustomerAcceptance() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _MandateDataCustomerAcceptance value) $default,){ +final _that = this; +switch (_that) { +case _MandateDataCustomerAcceptance(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Metadata for this payment method - @override - Map? get metadata; +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _MandateDataCustomerAcceptance value)? $default,){ +final _that = this; +switch (_that) { +case _MandateDataCustomerAcceptance() when $default != null: +return $default(_that);case _: + return null; - /// Create a copy of PaymentMethodDataUsBank - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodDataUsBankImplCopyWith<_$PaymentMethodDataUsBankImpl> - get copyWith => throw _privateConstructorUsedError; } - -PaymentMethodOptions _$PaymentMethodOptionsFromJson(Map json) { - return _PaymentMethodOptions.fromJson(json); } +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` -/// @nodoc -mixin _$PaymentMethodOptions { - /// Indicates whether or not you want to reuse this method for future payments. - PaymentIntentsFutureUsage? get setupFutureUsage => - throw _privateConstructorUsedError; - - /// Serializes this PaymentMethodOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@optionalTypeArgs TResult maybeWhen(TResult Function( MandateDataOnlineData? ipAddress)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _MandateDataCustomerAcceptance() when $default != null: +return $default(_that.ipAddress);case _: + return orElse(); - /// Create a copy of PaymentMethodOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentMethodOptionsCopyWith get copyWith => - throw _privateConstructorUsedError; } +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( MandateDataOnlineData? ipAddress) $default,) {final _that = this; +switch (_that) { +case _MandateDataCustomerAcceptance(): +return $default(_that.ipAddress);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class $PaymentMethodOptionsCopyWith<$Res> { - factory $PaymentMethodOptionsCopyWith(PaymentMethodOptions value, - $Res Function(PaymentMethodOptions) then) = - _$PaymentMethodOptionsCopyWithImpl<$Res, PaymentMethodOptions>; - @useResult - $Res call({PaymentIntentsFutureUsage? setupFutureUsage}); } +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` -/// @nodoc -class _$PaymentMethodOptionsCopyWithImpl<$Res, - $Val extends PaymentMethodOptions> - implements $PaymentMethodOptionsCopyWith<$Res> { - _$PaymentMethodOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentMethodOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? setupFutureUsage = freezed, - }) { - return _then(_value.copyWith( - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentsFutureUsage?, - ) as $Val); - } +@optionalTypeArgs TResult? whenOrNull(TResult? Function( MandateDataOnlineData? ipAddress)? $default,) {final _that = this; +switch (_that) { +case _MandateDataCustomerAcceptance() when $default != null: +return $default(_that.ipAddress);case _: + return null; + +} } -/// @nodoc -abstract class _$$PaymentMethodOptionsImplCopyWith<$Res> - implements $PaymentMethodOptionsCopyWith<$Res> { - factory _$$PaymentMethodOptionsImplCopyWith(_$PaymentMethodOptionsImpl value, - $Res Function(_$PaymentMethodOptionsImpl) then) = - __$$PaymentMethodOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({PaymentIntentsFutureUsage? setupFutureUsage}); -} - -/// @nodoc -class __$$PaymentMethodOptionsImplCopyWithImpl<$Res> - extends _$PaymentMethodOptionsCopyWithImpl<$Res, _$PaymentMethodOptionsImpl> - implements _$$PaymentMethodOptionsImplCopyWith<$Res> { - __$$PaymentMethodOptionsImplCopyWithImpl(_$PaymentMethodOptionsImpl _value, - $Res Function(_$PaymentMethodOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentMethodOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? setupFutureUsage = freezed, - }) { - return _then(_$PaymentMethodOptionsImpl( - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as PaymentIntentsFutureUsage?, - )); - } } /// @nodoc -@JsonSerializable(explicitToJson: true) -class _$PaymentMethodOptionsImpl implements _PaymentMethodOptions { - const _$PaymentMethodOptionsImpl({this.setupFutureUsage}); - factory _$PaymentMethodOptionsImpl.fromJson(Map json) => - _$$PaymentMethodOptionsImplFromJson(json); +class _MandateDataCustomerAcceptance extends MandateDataCustomerAcceptance { + const _MandateDataCustomerAcceptance({this.ipAddress}): super._(); + - /// Indicates whether or not you want to reuse this method for future payments. - @override - final PaymentIntentsFutureUsage? setupFutureUsage; +/// Online data regarding the mandate. +@override final MandateDataOnlineData? ipAddress; - @override - String toString() { - return 'PaymentMethodOptions(setupFutureUsage: $setupFutureUsage)'; - } +/// Create a copy of MandateDataCustomerAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$MandateDataCustomerAcceptanceCopyWith<_MandateDataCustomerAcceptance> get copyWith => __$MandateDataCustomerAcceptanceCopyWithImpl<_MandateDataCustomerAcceptance>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentMethodOptionsImpl && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, setupFutureUsage); - - /// Create a copy of PaymentMethodOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentMethodOptionsImplCopyWith<_$PaymentMethodOptionsImpl> - get copyWith => - __$$PaymentMethodOptionsImplCopyWithImpl<_$PaymentMethodOptionsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentMethodOptionsImplToJson( - this, - ); - } -} -abstract class _PaymentMethodOptions implements PaymentMethodOptions { - const factory _PaymentMethodOptions( - {final PaymentIntentsFutureUsage? setupFutureUsage}) = - _$PaymentMethodOptionsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _MandateDataCustomerAcceptance&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)); +} - factory _PaymentMethodOptions.fromJson(Map json) = - _$PaymentMethodOptionsImpl.fromJson; - /// Indicates whether or not you want to reuse this method for future payments. - @override - PaymentIntentsFutureUsage? get setupFutureUsage; +@override +int get hashCode => Object.hash(runtimeType,ipAddress); - /// Create a copy of PaymentMethodOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentMethodOptionsImplCopyWith<_$PaymentMethodOptionsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'MandateDataCustomerAcceptance(ipAddress: $ipAddress)'; } -MandateData _$MandateDataFromJson(Map json) { - return _MandateData.fromJson(json); + } /// @nodoc -mixin _$MandateData { - /// The type of mandate to create. - MandateDataCustomerAcceptance? get customerAcceptance => - throw _privateConstructorUsedError; +abstract mixin class _$MandateDataCustomerAcceptanceCopyWith<$Res> implements $MandateDataCustomerAcceptanceCopyWith<$Res> { + factory _$MandateDataCustomerAcceptanceCopyWith(_MandateDataCustomerAcceptance value, $Res Function(_MandateDataCustomerAcceptance) _then) = __$MandateDataCustomerAcceptanceCopyWithImpl; +@override @useResult +$Res call({ + MandateDataOnlineData? ipAddress +}); - /// Serializes this MandateData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of MandateData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $MandateDataCopyWith get copyWith => - throw _privateConstructorUsedError; -} +@override $MandateDataOnlineDataCopyWith<$Res>? get ipAddress; +} /// @nodoc -abstract class $MandateDataCopyWith<$Res> { - factory $MandateDataCopyWith( - MandateData value, $Res Function(MandateData) then) = - _$MandateDataCopyWithImpl<$Res, MandateData>; - @useResult - $Res call({MandateDataCustomerAcceptance? customerAcceptance}); +class __$MandateDataCustomerAcceptanceCopyWithImpl<$Res> + implements _$MandateDataCustomerAcceptanceCopyWith<$Res> { + __$MandateDataCustomerAcceptanceCopyWithImpl(this._self, this._then); - $MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance; + final _MandateDataCustomerAcceptance _self; + final $Res Function(_MandateDataCustomerAcceptance) _then; + +/// Create a copy of MandateDataCustomerAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? ipAddress = freezed,}) { + return _then(_MandateDataCustomerAcceptance( +ipAddress: freezed == ipAddress ? _self.ipAddress : ipAddress // ignore: cast_nullable_to_non_nullable +as MandateDataOnlineData?, + )); } -/// @nodoc -class _$MandateDataCopyWithImpl<$Res, $Val extends MandateData> - implements $MandateDataCopyWith<$Res> { - _$MandateDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of MandateData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? customerAcceptance = freezed, - }) { - return _then(_value.copyWith( - customerAcceptance: freezed == customerAcceptance - ? _value.customerAcceptance - : customerAcceptance // ignore: cast_nullable_to_non_nullable - as MandateDataCustomerAcceptance?, - ) as $Val); +/// Create a copy of MandateDataCustomerAcceptance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataOnlineDataCopyWith<$Res>? get ipAddress { + if (_self.ipAddress == null) { + return null; } - /// Create a copy of MandateData - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance { - if (_value.customerAcceptance == null) { - return null; - } - - return $MandateDataCustomerAcceptanceCopyWith<$Res>( - _value.customerAcceptance!, (value) { - return _then(_value.copyWith(customerAcceptance: value) as $Val); - }); - } + return $MandateDataOnlineDataCopyWith<$Res>(_self.ipAddress!, (value) { + return _then(_self.copyWith(ipAddress: value)); + }); } - -/// @nodoc -abstract class _$$MandateDataImplCopyWith<$Res> - implements $MandateDataCopyWith<$Res> { - factory _$$MandateDataImplCopyWith( - _$MandateDataImpl value, $Res Function(_$MandateDataImpl) then) = - __$$MandateDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({MandateDataCustomerAcceptance? customerAcceptance}); - - @override - $MandateDataCustomerAcceptanceCopyWith<$Res>? get customerAcceptance; -} - -/// @nodoc -class __$$MandateDataImplCopyWithImpl<$Res> - extends _$MandateDataCopyWithImpl<$Res, _$MandateDataImpl> - implements _$$MandateDataImplCopyWith<$Res> { - __$$MandateDataImplCopyWithImpl( - _$MandateDataImpl _value, $Res Function(_$MandateDataImpl) _then) - : super(_value, _then); - - /// Create a copy of MandateData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? customerAcceptance = freezed, - }) { - return _then(_$MandateDataImpl( - customerAcceptance: freezed == customerAcceptance - ? _value.customerAcceptance - : customerAcceptance // ignore: cast_nullable_to_non_nullable - as MandateDataCustomerAcceptance?, - )); - } } -/// @nodoc - -@JsonSerializable(explicitToJson: true) -class _$MandateDataImpl implements _MandateData { - const _$MandateDataImpl({this.customerAcceptance}); - factory _$MandateDataImpl.fromJson(Map json) => - _$$MandateDataImplFromJson(json); +/// @nodoc +mixin _$MandateDataOnlineData { - /// The type of mandate to create. - @override - final MandateDataCustomerAcceptance? customerAcceptance; +/// The ip address of the user. + String? get ipAddress;/// The user agent of the user. + String? get userAgent; +/// Create a copy of MandateDataOnlineData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$MandateDataOnlineDataCopyWith get copyWith => _$MandateDataOnlineDataCopyWithImpl(this as MandateDataOnlineData, _$identity); - @override - String toString() { - return 'MandateData(customerAcceptance: $customerAcceptance)'; - } + /// Serializes this MandateDataOnlineData to a JSON map. + Map toJson(); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MandateDataImpl && - (identical(other.customerAcceptance, customerAcceptance) || - other.customerAcceptance == customerAcceptance)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, customerAcceptance); - - /// Create a copy of MandateData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$MandateDataImplCopyWith<_$MandateDataImpl> get copyWith => - __$$MandateDataImplCopyWithImpl<_$MandateDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$MandateDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is MandateDataOnlineData&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)); } -abstract class _MandateData implements MandateData { - const factory _MandateData( - {final MandateDataCustomerAcceptance? customerAcceptance}) = - _$MandateDataImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,ipAddress,userAgent); - factory _MandateData.fromJson(Map json) = - _$MandateDataImpl.fromJson; +@override +String toString() { + return 'MandateDataOnlineData(ipAddress: $ipAddress, userAgent: $userAgent)'; +} - /// The type of mandate to create. - @override - MandateDataCustomerAcceptance? get customerAcceptance; - /// Create a copy of MandateData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$MandateDataImplCopyWith<_$MandateDataImpl> get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -mixin _$MandateDataCustomerAcceptance { - /// Online data regarding the mandate. - MandateDataOnlineData? get ipAddress => throw _privateConstructorUsedError; +abstract mixin class $MandateDataOnlineDataCopyWith<$Res> { + factory $MandateDataOnlineDataCopyWith(MandateDataOnlineData value, $Res Function(MandateDataOnlineData) _then) = _$MandateDataOnlineDataCopyWithImpl; +@useResult +$Res call({ + String? ipAddress, String? userAgent +}); - /// Create a copy of MandateDataCustomerAcceptance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $MandateDataCustomerAcceptanceCopyWith - get copyWith => throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $MandateDataCustomerAcceptanceCopyWith<$Res> { - factory $MandateDataCustomerAcceptanceCopyWith( - MandateDataCustomerAcceptance value, - $Res Function(MandateDataCustomerAcceptance) then) = - _$MandateDataCustomerAcceptanceCopyWithImpl<$Res, - MandateDataCustomerAcceptance>; - @useResult - $Res call({MandateDataOnlineData? ipAddress}); - $MandateDataOnlineDataCopyWith<$Res>? get ipAddress; -} +} /// @nodoc -class _$MandateDataCustomerAcceptanceCopyWithImpl<$Res, - $Val extends MandateDataCustomerAcceptance> - implements $MandateDataCustomerAcceptanceCopyWith<$Res> { - _$MandateDataCustomerAcceptanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of MandateDataCustomerAcceptance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ipAddress = freezed, - }) { - return _then(_value.copyWith( - ipAddress: freezed == ipAddress - ? _value.ipAddress - : ipAddress // ignore: cast_nullable_to_non_nullable - as MandateDataOnlineData?, - ) as $Val); - } +class _$MandateDataOnlineDataCopyWithImpl<$Res> + implements $MandateDataOnlineDataCopyWith<$Res> { + _$MandateDataOnlineDataCopyWithImpl(this._self, this._then); + + final MandateDataOnlineData _self; + final $Res Function(MandateDataOnlineData) _then; + +/// Create a copy of MandateDataOnlineData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? ipAddress = freezed,Object? userAgent = freezed,}) { + return _then(_self.copyWith( +ipAddress: freezed == ipAddress ? _self.ipAddress : ipAddress // ignore: cast_nullable_to_non_nullable +as String?,userAgent: freezed == userAgent ? _self.userAgent : userAgent // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [MandateDataOnlineData]. +extension MandateDataOnlineDataPatterns on MandateDataOnlineData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _MandateDataOnlineData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _MandateDataOnlineData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _MandateDataOnlineData value) $default,){ +final _that = this; +switch (_that) { +case _MandateDataOnlineData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _MandateDataOnlineData value)? $default,){ +final _that = this; +switch (_that) { +case _MandateDataOnlineData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? ipAddress, String? userAgent)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _MandateDataOnlineData() when $default != null: +return $default(_that.ipAddress,_that.userAgent);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? ipAddress, String? userAgent) $default,) {final _that = this; +switch (_that) { +case _MandateDataOnlineData(): +return $default(_that.ipAddress,_that.userAgent);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? ipAddress, String? userAgent)? $default,) {final _that = this; +switch (_that) { +case _MandateDataOnlineData() when $default != null: +return $default(_that.ipAddress,_that.userAgent);case _: + return null; - /// Create a copy of MandateDataCustomerAcceptance - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataOnlineDataCopyWith<$Res>? get ipAddress { - if (_value.ipAddress == null) { - return null; - } - - return $MandateDataOnlineDataCopyWith<$Res>(_value.ipAddress!, (value) { - return _then(_value.copyWith(ipAddress: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$MandateDataCustomerAcceptanceImplCopyWith<$Res> - implements $MandateDataCustomerAcceptanceCopyWith<$Res> { - factory _$$MandateDataCustomerAcceptanceImplCopyWith( - _$MandateDataCustomerAcceptanceImpl value, - $Res Function(_$MandateDataCustomerAcceptanceImpl) then) = - __$$MandateDataCustomerAcceptanceImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({MandateDataOnlineData? ipAddress}); - - @override - $MandateDataOnlineDataCopyWith<$Res>? get ipAddress; -} - -/// @nodoc -class __$$MandateDataCustomerAcceptanceImplCopyWithImpl<$Res> - extends _$MandateDataCustomerAcceptanceCopyWithImpl<$Res, - _$MandateDataCustomerAcceptanceImpl> - implements _$$MandateDataCustomerAcceptanceImplCopyWith<$Res> { - __$$MandateDataCustomerAcceptanceImplCopyWithImpl( - _$MandateDataCustomerAcceptanceImpl _value, - $Res Function(_$MandateDataCustomerAcceptanceImpl) _then) - : super(_value, _then); - - /// Create a copy of MandateDataCustomerAcceptance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ipAddress = freezed, - }) { - return _then(_$MandateDataCustomerAcceptanceImpl( - ipAddress: freezed == ipAddress - ? _value.ipAddress - : ipAddress // ignore: cast_nullable_to_non_nullable - as MandateDataOnlineData?, - )); - } } /// @nodoc -class _$MandateDataCustomerAcceptanceImpl - extends _MandateDataCustomerAcceptance { - const _$MandateDataCustomerAcceptanceImpl({this.ipAddress}) : super._(); - - /// Online data regarding the mandate. - @override - final MandateDataOnlineData? ipAddress; - - @override - String toString() { - return 'MandateDataCustomerAcceptance(ipAddress: $ipAddress)'; - } +@JsonSerializable(explicitToJson: true) +class _MandateDataOnlineData implements MandateDataOnlineData { + const _MandateDataOnlineData({this.ipAddress, this.userAgent}); + factory _MandateDataOnlineData.fromJson(Map json) => _$MandateDataOnlineDataFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MandateDataCustomerAcceptanceImpl && - (identical(other.ipAddress, ipAddress) || - other.ipAddress == ipAddress)); - } +/// The ip address of the user. +@override final String? ipAddress; +/// The user agent of the user. +@override final String? userAgent; - @override - int get hashCode => Object.hash(runtimeType, ipAddress); +/// Create a copy of MandateDataOnlineData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$MandateDataOnlineDataCopyWith<_MandateDataOnlineData> get copyWith => __$MandateDataOnlineDataCopyWithImpl<_MandateDataOnlineData>(this, _$identity); - /// Create a copy of MandateDataCustomerAcceptance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$MandateDataCustomerAcceptanceImplCopyWith< - _$MandateDataCustomerAcceptanceImpl> - get copyWith => __$$MandateDataCustomerAcceptanceImplCopyWithImpl< - _$MandateDataCustomerAcceptanceImpl>(this, _$identity); +@override +Map toJson() { + return _$MandateDataOnlineDataToJson(this, ); } -abstract class _MandateDataCustomerAcceptance - extends MandateDataCustomerAcceptance { - const factory _MandateDataCustomerAcceptance( - {final MandateDataOnlineData? ipAddress}) = - _$MandateDataCustomerAcceptanceImpl; - const _MandateDataCustomerAcceptance._() : super._(); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _MandateDataOnlineData&&(identical(other.ipAddress, ipAddress) || other.ipAddress == ipAddress)&&(identical(other.userAgent, userAgent) || other.userAgent == userAgent)); +} - /// Online data regarding the mandate. - @override - MandateDataOnlineData? get ipAddress; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,ipAddress,userAgent); - /// Create a copy of MandateDataCustomerAcceptance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$MandateDataCustomerAcceptanceImplCopyWith< - _$MandateDataCustomerAcceptanceImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'MandateDataOnlineData(ipAddress: $ipAddress, userAgent: $userAgent)'; } -MandateDataOnlineData _$MandateDataOnlineDataFromJson( - Map json) { - return _MandateDataOnlineData.fromJson(json); + } /// @nodoc -mixin _$MandateDataOnlineData { - /// The ip address of the user. - String? get ipAddress => throw _privateConstructorUsedError; +abstract mixin class _$MandateDataOnlineDataCopyWith<$Res> implements $MandateDataOnlineDataCopyWith<$Res> { + factory _$MandateDataOnlineDataCopyWith(_MandateDataOnlineData value, $Res Function(_MandateDataOnlineData) _then) = __$MandateDataOnlineDataCopyWithImpl; +@override @useResult +$Res call({ + String? ipAddress, String? userAgent +}); - /// The user agent of the user. - String? get userAgent => throw _privateConstructorUsedError; - /// Serializes this MandateDataOnlineData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of MandateDataOnlineData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $MandateDataOnlineDataCopyWith get copyWith => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $MandateDataOnlineDataCopyWith<$Res> { - factory $MandateDataOnlineDataCopyWith(MandateDataOnlineData value, - $Res Function(MandateDataOnlineData) then) = - _$MandateDataOnlineDataCopyWithImpl<$Res, MandateDataOnlineData>; - @useResult - $Res call({String? ipAddress, String? userAgent}); } - /// @nodoc -class _$MandateDataOnlineDataCopyWithImpl<$Res, - $Val extends MandateDataOnlineData> - implements $MandateDataOnlineDataCopyWith<$Res> { - _$MandateDataOnlineDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of MandateDataOnlineData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ipAddress = freezed, - Object? userAgent = freezed, - }) { - return _then(_value.copyWith( - ipAddress: freezed == ipAddress - ? _value.ipAddress - : ipAddress // ignore: cast_nullable_to_non_nullable - as String?, - userAgent: freezed == userAgent - ? _value.userAgent - : userAgent // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +class __$MandateDataOnlineDataCopyWithImpl<$Res> + implements _$MandateDataOnlineDataCopyWith<$Res> { + __$MandateDataOnlineDataCopyWithImpl(this._self, this._then); + + final _MandateDataOnlineData _self; + final $Res Function(_MandateDataOnlineData) _then; + +/// Create a copy of MandateDataOnlineData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? ipAddress = freezed,Object? userAgent = freezed,}) { + return _then(_MandateDataOnlineData( +ipAddress: freezed == ipAddress ? _self.ipAddress : ipAddress // ignore: cast_nullable_to_non_nullable +as String?,userAgent: freezed == userAgent ? _self.userAgent : userAgent // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$MandateDataOnlineDataImplCopyWith<$Res> - implements $MandateDataOnlineDataCopyWith<$Res> { - factory _$$MandateDataOnlineDataImplCopyWith( - _$MandateDataOnlineDataImpl value, - $Res Function(_$MandateDataOnlineDataImpl) then) = - __$$MandateDataOnlineDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? ipAddress, String? userAgent}); -} - -/// @nodoc -class __$$MandateDataOnlineDataImplCopyWithImpl<$Res> - extends _$MandateDataOnlineDataCopyWithImpl<$Res, - _$MandateDataOnlineDataImpl> - implements _$$MandateDataOnlineDataImplCopyWith<$Res> { - __$$MandateDataOnlineDataImplCopyWithImpl(_$MandateDataOnlineDataImpl _value, - $Res Function(_$MandateDataOnlineDataImpl) _then) - : super(_value, _then); - - /// Create a copy of MandateDataOnlineData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? ipAddress = freezed, - Object? userAgent = freezed, - }) { - return _then(_$MandateDataOnlineDataImpl( - ipAddress: freezed == ipAddress - ? _value.ipAddress - : ipAddress // ignore: cast_nullable_to_non_nullable - as String?, - userAgent: freezed == userAgent - ? _value.userAgent - : userAgent // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } + /// @nodoc +mixin _$ThreeDSecureUsage { -@JsonSerializable(explicitToJson: true) -class _$MandateDataOnlineDataImpl implements _MandateDataOnlineData { - const _$MandateDataOnlineDataImpl({this.ipAddress, this.userAgent}); +/// Whether 3ds is supported or not. + bool? get isSupported; +/// Create a copy of ThreeDSecureUsage +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThreeDSecureUsageCopyWith get copyWith => _$ThreeDSecureUsageCopyWithImpl(this as ThreeDSecureUsage, _$identity); - factory _$MandateDataOnlineDataImpl.fromJson(Map json) => - _$$MandateDataOnlineDataImplFromJson(json); + /// Serializes this ThreeDSecureUsage to a JSON map. + Map toJson(); - /// The ip address of the user. - @override - final String? ipAddress; - /// The user agent of the user. - @override - final String? userAgent; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThreeDSecureUsage&&(identical(other.isSupported, isSupported) || other.isSupported == isSupported)); +} - @override - String toString() { - return 'MandateDataOnlineData(ipAddress: $ipAddress, userAgent: $userAgent)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isSupported); + +@override +String toString() { + return 'ThreeDSecureUsage(isSupported: $isSupported)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$MandateDataOnlineDataImpl && - (identical(other.ipAddress, ipAddress) || - other.ipAddress == ipAddress) && - (identical(other.userAgent, userAgent) || - other.userAgent == userAgent)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, ipAddress, userAgent); - - /// Create a copy of MandateDataOnlineData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$MandateDataOnlineDataImplCopyWith<_$MandateDataOnlineDataImpl> - get copyWith => __$$MandateDataOnlineDataImplCopyWithImpl< - _$MandateDataOnlineDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$MandateDataOnlineDataImplToJson( - this, - ); - } } -abstract class _MandateDataOnlineData implements MandateDataOnlineData { - const factory _MandateDataOnlineData( - {final String? ipAddress, - final String? userAgent}) = _$MandateDataOnlineDataImpl; +/// @nodoc +abstract mixin class $ThreeDSecureUsageCopyWith<$Res> { + factory $ThreeDSecureUsageCopyWith(ThreeDSecureUsage value, $Res Function(ThreeDSecureUsage) _then) = _$ThreeDSecureUsageCopyWithImpl; +@useResult +$Res call({ + bool? isSupported +}); + - factory _MandateDataOnlineData.fromJson(Map json) = - _$MandateDataOnlineDataImpl.fromJson; - /// The ip address of the user. - @override - String? get ipAddress; - /// The user agent of the user. - @override - String? get userAgent; +} +/// @nodoc +class _$ThreeDSecureUsageCopyWithImpl<$Res> + implements $ThreeDSecureUsageCopyWith<$Res> { + _$ThreeDSecureUsageCopyWithImpl(this._self, this._then); + + final ThreeDSecureUsage _self; + final $Res Function(ThreeDSecureUsage) _then; + +/// Create a copy of ThreeDSecureUsage +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isSupported = freezed,}) { + return _then(_self.copyWith( +isSupported: freezed == isSupported ? _self.isSupported : isSupported // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ThreeDSecureUsage]. +extension ThreeDSecureUsagePatterns on ThreeDSecureUsage { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ThreeDSecureUsage value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThreeDSecureUsage() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ThreeDSecureUsage value) $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureUsage(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ThreeDSecureUsage value)? $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureUsage() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? isSupported)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThreeDSecureUsage() when $default != null: +return $default(_that.isSupported);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? isSupported) $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureUsage(): +return $default(_that.isSupported);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? isSupported)? $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureUsage() when $default != null: +return $default(_that.isSupported);case _: + return null; - /// Create a copy of MandateDataOnlineData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$MandateDataOnlineDataImplCopyWith<_$MandateDataOnlineDataImpl> - get copyWith => throw _privateConstructorUsedError; +} } -ThreeDSecureUsage _$ThreeDSecureUsageFromJson(Map json) { - return _ThreeDSecureUsage.fromJson(json); } /// @nodoc -mixin _$ThreeDSecureUsage { - /// Whether 3ds is supported or not. - bool? get isSupported => throw _privateConstructorUsedError; - /// Serializes this ThreeDSecureUsage to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _ThreeDSecureUsage implements ThreeDSecureUsage { + const _ThreeDSecureUsage({this.isSupported}); + factory _ThreeDSecureUsage.fromJson(Map json) => _$ThreeDSecureUsageFromJson(json); - /// Create a copy of ThreeDSecureUsage - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ThreeDSecureUsageCopyWith get copyWith => - throw _privateConstructorUsedError; -} +/// Whether 3ds is supported or not. +@override final bool? isSupported; -/// @nodoc -abstract class $ThreeDSecureUsageCopyWith<$Res> { - factory $ThreeDSecureUsageCopyWith( - ThreeDSecureUsage value, $Res Function(ThreeDSecureUsage) then) = - _$ThreeDSecureUsageCopyWithImpl<$Res, ThreeDSecureUsage>; - @useResult - $Res call({bool? isSupported}); +/// Create a copy of ThreeDSecureUsage +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThreeDSecureUsageCopyWith<_ThreeDSecureUsage> get copyWith => __$ThreeDSecureUsageCopyWithImpl<_ThreeDSecureUsage>(this, _$identity); + +@override +Map toJson() { + return _$ThreeDSecureUsageToJson(this, ); } -/// @nodoc -class _$ThreeDSecureUsageCopyWithImpl<$Res, $Val extends ThreeDSecureUsage> - implements $ThreeDSecureUsageCopyWith<$Res> { - _$ThreeDSecureUsageCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ThreeDSecureUsage - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isSupported = freezed, - }) { - return _then(_value.copyWith( - isSupported: freezed == isSupported - ? _value.isSupported - : isSupported // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThreeDSecureUsage&&(identical(other.isSupported, isSupported) || other.isSupported == isSupported)); } -/// @nodoc -abstract class _$$ThreeDSecureUsageImplCopyWith<$Res> - implements $ThreeDSecureUsageCopyWith<$Res> { - factory _$$ThreeDSecureUsageImplCopyWith(_$ThreeDSecureUsageImpl value, - $Res Function(_$ThreeDSecureUsageImpl) then) = - __$$ThreeDSecureUsageImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool? isSupported}); -} - -/// @nodoc -class __$$ThreeDSecureUsageImplCopyWithImpl<$Res> - extends _$ThreeDSecureUsageCopyWithImpl<$Res, _$ThreeDSecureUsageImpl> - implements _$$ThreeDSecureUsageImplCopyWith<$Res> { - __$$ThreeDSecureUsageImplCopyWithImpl(_$ThreeDSecureUsageImpl _value, - $Res Function(_$ThreeDSecureUsageImpl) _then) - : super(_value, _then); - - /// Create a copy of ThreeDSecureUsage - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isSupported = freezed, - }) { - return _then(_$ThreeDSecureUsageImpl( - isSupported: freezed == isSupported - ? _value.isSupported - : isSupported // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isSupported); + +@override +String toString() { + return 'ThreeDSecureUsage(isSupported: $isSupported)'; } -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$ThreeDSecureUsageImpl implements _ThreeDSecureUsage { - const _$ThreeDSecureUsageImpl({this.isSupported}); +} - factory _$ThreeDSecureUsageImpl.fromJson(Map json) => - _$$ThreeDSecureUsageImplFromJson(json); +/// @nodoc +abstract mixin class _$ThreeDSecureUsageCopyWith<$Res> implements $ThreeDSecureUsageCopyWith<$Res> { + factory _$ThreeDSecureUsageCopyWith(_ThreeDSecureUsage value, $Res Function(_ThreeDSecureUsage) _then) = __$ThreeDSecureUsageCopyWithImpl; +@override @useResult +$Res call({ + bool? isSupported +}); - /// Whether 3ds is supported or not. - @override - final bool? isSupported; - @override - String toString() { - return 'ThreeDSecureUsage(isSupported: $isSupported)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ThreeDSecureUsageImpl && - (identical(other.isSupported, isSupported) || - other.isSupported == isSupported)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, isSupported); - - /// Create a copy of ThreeDSecureUsage - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ThreeDSecureUsageImplCopyWith<_$ThreeDSecureUsageImpl> get copyWith => - __$$ThreeDSecureUsageImplCopyWithImpl<_$ThreeDSecureUsageImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ThreeDSecureUsageImplToJson( - this, - ); - } } +/// @nodoc +class __$ThreeDSecureUsageCopyWithImpl<$Res> + implements _$ThreeDSecureUsageCopyWith<$Res> { + __$ThreeDSecureUsageCopyWithImpl(this._self, this._then); -abstract class _ThreeDSecureUsage implements ThreeDSecureUsage { - const factory _ThreeDSecureUsage({final bool? isSupported}) = - _$ThreeDSecureUsageImpl; + final _ThreeDSecureUsage _self; + final $Res Function(_ThreeDSecureUsage) _then; - factory _ThreeDSecureUsage.fromJson(Map json) = - _$ThreeDSecureUsageImpl.fromJson; +/// Create a copy of ThreeDSecureUsage +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isSupported = freezed,}) { + return _then(_ThreeDSecureUsage( +isSupported: freezed == isSupported ? _self.isSupported : isSupported // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} - /// Whether 3ds is supported or not. - @override - bool? get isSupported; - /// Create a copy of ThreeDSecureUsage - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ThreeDSecureUsageImplCopyWith<_$ThreeDSecureUsageImpl> get copyWith => - throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart b/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart index afbbe9bea..cc33d1b64 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_methods.g.dart @@ -6,28 +6,30 @@ part of 'payment_methods.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PaymentMethodImpl _$$PaymentMethodImplFromJson(Map json) => - _$PaymentMethodImpl( +_PaymentMethod _$PaymentMethodFromJson(Map json) => + _PaymentMethod( id: json['id'] as String, livemode: json['livemode'] as bool, paymentMethodType: json['paymentMethodType'] as String, billingDetails: BillingDetails.fromJson( - json['billingDetails'] as Map), + json['billingDetails'] as Map, + ), card: Card.fromJson(json['Card'] as Map), sepaDebit: SepaDebit.fromJson(json['SepaDebit'] as Map), bacsDebit: BacsDebit.fromJson(json['BacsDebit'] as Map), - auBecsDebit: - AuBecsDebit.fromJson(json['AuBecsDebit'] as Map), - sofort: Sofort.fromJson(json['Sofort'] as Map), + auBecsDebit: AuBecsDebit.fromJson( + json['AuBecsDebit'] as Map, + ), ideal: Ideal.fromJson(json['Ideal'] as Map), fpx: Fpx.fromJson(json['Fpx'] as Map), upi: Upi.fromJson(json['Upi'] as Map), - usBankAccount: - UsBankAccount.fromJson(json['USBankAccount'] as Map), + usBankAccount: UsBankAccount.fromJson( + json['USBankAccount'] as Map, + ), customerId: json['customerId'] as String?, ); -Map _$$PaymentMethodImplToJson(_$PaymentMethodImpl instance) => +Map _$PaymentMethodToJson(_PaymentMethod instance) => { 'id': instance.id, 'livemode': instance.livemode, @@ -37,7 +39,6 @@ Map _$$PaymentMethodImplToJson(_$PaymentMethodImpl instance) => 'SepaDebit': instance.sepaDebit.toJson(), 'BacsDebit': instance.bacsDebit.toJson(), 'AuBecsDebit': instance.auBecsDebit.toJson(), - 'Sofort': instance.sofort.toJson(), 'Ideal': instance.ideal.toJson(), 'Fpx': instance.fpx.toJson(), 'Upi': instance.upi.toJson(), @@ -45,8 +46,8 @@ Map _$$PaymentMethodImplToJson(_$PaymentMethodImpl instance) => 'customerId': instance.customerId, }; -_$BillingDetailsImpl _$$BillingDetailsImplFromJson(Map json) => - _$BillingDetailsImpl( +_BillingDetails _$BillingDetailsFromJson(Map json) => + _BillingDetails( email: json['email'] as String?, address: json['address'] == null ? null @@ -55,8 +56,7 @@ _$BillingDetailsImpl _$$BillingDetailsImplFromJson(Map json) => name: json['name'] as String?, ); -Map _$$BillingDetailsImplToJson( - _$BillingDetailsImpl instance) => +Map _$BillingDetailsToJson(_BillingDetails instance) => { 'email': instance.email, 'address': instance.address, @@ -64,94 +64,90 @@ Map _$$BillingDetailsImplToJson( 'name': instance.name, }; -_$AuBecsDebitImpl _$$AuBecsDebitImplFromJson(Map json) => - _$AuBecsDebitImpl( - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - bsbNumber: json['bsbNumber'] as String?, - ); +_AuBecsDebit _$AuBecsDebitFromJson(Map json) => _AuBecsDebit( + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, + bsbNumber: json['bsbNumber'] as String?, +); -Map _$$AuBecsDebitImplToJson(_$AuBecsDebitImpl instance) => +Map _$AuBecsDebitToJson(_AuBecsDebit instance) => { 'fingerprint': instance.fingerprint, 'last4': instance.last4, 'bsbNumber': instance.bsbNumber, }; -_$BacsDebitImpl _$$BacsDebitImplFromJson(Map json) => - _$BacsDebitImpl( - sortCode: json['sortCode'] as String?, - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - ); +_BacsDebit _$BacsDebitFromJson(Map json) => _BacsDebit( + sortCode: json['sortCode'] as String?, + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, +); -Map _$$BacsDebitImplToJson(_$BacsDebitImpl instance) => +Map _$BacsDebitToJson(_BacsDebit instance) => { 'sortCode': instance.sortCode, 'fingerprint': instance.fingerprint, 'last4': instance.last4, }; -_$CardImpl _$$CardImplFromJson(Map json) => _$CardImpl( - brand: json['brand'] as String?, - country: json['country'] as String?, - expYear: (json['expYear'] as num?)?.toInt(), - expMonth: (json['expMonth'] as num?)?.toInt(), - funding: json['funding'] as String?, - last4: json['last4'] as String?, - preferredNetwork: json['preferredNetwork'] as String?, - availableNetworks: (json['availableNetworks'] as List?) - ?.map((e) => e as String) - .toList(), - threeDSecureUsage: json['threeDSecureUsage'] == null - ? null - : ThreeDSecureUsage.fromJson( - json['threeDSecureUsage'] as Map), - ); - -Map _$$CardImplToJson(_$CardImpl instance) => - { - 'brand': instance.brand, - 'country': instance.country, - 'expYear': instance.expYear, - 'expMonth': instance.expMonth, - 'funding': instance.funding, - 'last4': instance.last4, - 'preferredNetwork': instance.preferredNetwork, - 'availableNetworks': instance.availableNetworks, - 'threeDSecureUsage': instance.threeDSecureUsage?.toJson(), - }; +_Card _$CardFromJson(Map json) => _Card( + brand: json['brand'] as String?, + country: json['country'] as String?, + expYear: (json['expYear'] as num?)?.toInt(), + expMonth: (json['expMonth'] as num?)?.toInt(), + funding: json['funding'] as String?, + last4: json['last4'] as String?, + preferredNetwork: json['preferredNetwork'] as String?, + availableNetworks: (json['availableNetworks'] as List?) + ?.map((e) => e as String) + .toList(), + threeDSecureUsage: json['threeDSecureUsage'] == null + ? null + : ThreeDSecureUsage.fromJson( + json['threeDSecureUsage'] as Map, + ), +); + +Map _$CardToJson(_Card instance) => { + 'brand': instance.brand, + 'country': instance.country, + 'expYear': instance.expYear, + 'expMonth': instance.expMonth, + 'funding': instance.funding, + 'last4': instance.last4, + 'preferredNetwork': instance.preferredNetwork, + 'availableNetworks': instance.availableNetworks, + 'threeDSecureUsage': instance.threeDSecureUsage?.toJson(), +}; -_$FpxImpl _$$FpxImplFromJson(Map json) => _$FpxImpl( - bank: json['bank'] as String?, - accountHolderType: json['accountHolderType'] as String?, - ); +_Fpx _$FpxFromJson(Map json) => _Fpx( + bank: json['bank'] as String?, + accountHolderType: json['accountHolderType'] as String?, +); -Map _$$FpxImplToJson(_$FpxImpl instance) => { - 'bank': instance.bank, - 'accountHolderType': instance.accountHolderType, - }; +Map _$FpxToJson(_Fpx instance) => { + 'bank': instance.bank, + 'accountHolderType': instance.accountHolderType, +}; -_$IdealImpl _$$IdealImplFromJson(Map json) => _$IdealImpl( - bankIdentifierCode: json['bankIdentifierCode'] as String?, - bank: json['bank'] as String?, - ); +_Ideal _$IdealFromJson(Map json) => _Ideal( + bankIdentifierCode: json['bankIdentifierCode'] as String?, + bank: json['bank'] as String?, +); -Map _$$IdealImplToJson(_$IdealImpl instance) => - { - 'bankIdentifierCode': instance.bankIdentifierCode, - 'bank': instance.bank, - }; +Map _$IdealToJson(_Ideal instance) => { + 'bankIdentifierCode': instance.bankIdentifierCode, + 'bank': instance.bank, +}; -_$SepaDebitImpl _$$SepaDebitImplFromJson(Map json) => - _$SepaDebitImpl( - country: json['country'] as String?, - bankCode: json['bankCode'] as String?, - fingerprint: json['fingerprint'] as String?, - last4: json['last4'] as String?, - ); +_SepaDebit _$SepaDebitFromJson(Map json) => _SepaDebit( + country: json['country'] as String?, + bankCode: json['bankCode'] as String?, + fingerprint: json['fingerprint'] as String?, + last4: json['last4'] as String?, +); -Map _$$SepaDebitImplToJson(_$SepaDebitImpl instance) => +Map _$SepaDebitToJson(_SepaDebit instance) => { 'country': instance.country, 'bankCode': instance.bankCode, @@ -159,31 +155,25 @@ Map _$$SepaDebitImplToJson(_$SepaDebitImpl instance) => 'last4': instance.last4, }; -_$SofortImpl _$$SofortImplFromJson(Map json) => _$SofortImpl( - country: json['country'] as String?, - ); - -Map _$$SofortImplToJson(_$SofortImpl instance) => - { - 'country': instance.country, - }; +_Upi _$UpiFromJson(Map json) => + _Upi(vpa: json['vpa'] as String?); -_$UpiImpl _$$UpiImplFromJson(Map json) => _$UpiImpl( - vpa: json['vpa'] as String?, - ); - -Map _$$UpiImplToJson(_$UpiImpl instance) => { - 'vpa': instance.vpa, - }; +Map _$UpiToJson(_Upi instance) => { + 'vpa': instance.vpa, +}; -_$UsBankAccountImpl _$$UsBankAccountImplFromJson(Map json) => - _$UsBankAccountImpl( +_UsBankAccount _$UsBankAccountFromJson(Map json) => + _UsBankAccount( routingNumber: json['routingNumber'] as String?, last4: json['last4'] as String?, accountHolderType: $enumDecodeNullable( - _$BankAccountHolderTypeEnumMap, json['accountHolderType']), - accountType: - $enumDecodeNullable(_$UsBankAccountTypeEnumMap, json['accountType']), + _$BankAccountHolderTypeEnumMap, + json['accountHolderType'], + ), + accountType: $enumDecodeNullable( + _$UsBankAccountTypeEnumMap, + json['accountType'], + ), bankName: json['bankName'] as String?, fingerprint: json['fingerprint'] as String?, linkedAccount: json['linkedAccount'] as String?, @@ -193,7 +183,7 @@ _$UsBankAccountImpl _$$UsBankAccountImplFromJson(Map json) => .toList(), ); -Map _$$UsBankAccountImplToJson(_$UsBankAccountImpl instance) => +Map _$UsBankAccountToJson(_UsBankAccount instance) => { 'routingNumber': instance.routingNumber, 'last4': instance.last4, @@ -219,445 +209,354 @@ const _$UsBankAccountTypeEnumMap = { UsBankAccountType.Unknown: 'Unknown', }; -_$PaymentMethodParamsCardImpl _$$PaymentMethodParamsCardImplFromJson( - Map json) => - _$PaymentMethodParamsCardImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsCardImplToJson( - _$PaymentMethodParamsCardImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsCardWithTokenImpl - _$$PaymentMethodParamsCardWithTokenImplFromJson( - Map json) => - _$PaymentMethodParamsCardWithTokenImpl( - paymentMethodData: PaymentMethodDataCardFromToken.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsCardWithTokenImplToJson( - _$PaymentMethodParamsCardWithTokenImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsCardWithMethodIdImpl - _$$PaymentMethodParamsCardWithMethodIdImplFromJson( - Map json) => - _$PaymentMethodParamsCardWithMethodIdImpl( - paymentMethodData: PaymentMethodDataCardFromMethod.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsCardWithMethodIdImplToJson( - _$PaymentMethodParamsCardWithMethodIdImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsAlipayImpl _$$PaymentMethodParamsAlipayImplFromJson( - Map json) => - _$PaymentMethodParamsAlipayImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsAlipayImplToJson( - _$PaymentMethodParamsAlipayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsCashAppPayImpl - _$$PaymentMethodParamsCashAppPayImplFromJson(Map json) => - _$PaymentMethodParamsCashAppPayImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsCashAppPayImplToJson( - _$PaymentMethodParamsCashAppPayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsIdealImpl _$$PaymentMethodParamsIdealImplFromJson( - Map json) => - _$PaymentMethodParamsIdealImpl( - paymentMethodData: PaymentMethodDataIdeal.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsIdealImplToJson( - _$PaymentMethodParamsIdealImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsAubecsImpl _$$PaymentMethodParamsAubecsImplFromJson( - Map json) => - _$PaymentMethodParamsAubecsImpl( - paymentMethodData: PaymentMethodDataAubecs.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsAubecsImplToJson( - _$PaymentMethodParamsAubecsImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsBankContactImpl - _$$PaymentMethodParamsBankContactImplFromJson(Map json) => - _$PaymentMethodParamsBankContactImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsBankContactImplToJson( - _$PaymentMethodParamsBankContactImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsGiroPayImpl _$$PaymentMethodParamsGiroPayImplFromJson( - Map json) => - _$PaymentMethodParamsGiroPayImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsGiroPayImplToJson( - _$PaymentMethodParamsGiroPayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsEpsImpl _$$PaymentMethodParamsEpsImplFromJson( - Map json) => - _$PaymentMethodParamsEpsImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsEpsImplToJson( - _$PaymentMethodParamsEpsImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsAffirmImpl _$$PaymentMethodParamsAffirmImplFromJson( - Map json) => - _$PaymentMethodParamsAffirmImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsCard _$PaymentMethodParamsCardFromJson( + Map json, +) => _PaymentMethodParamsCard( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsCardToJson( + _PaymentMethodParamsCard instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsAffirmImplToJson( - _$PaymentMethodParamsAffirmImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsCardWithToken _$PaymentMethodParamsCardWithTokenFromJson( + Map json, +) => _PaymentMethodParamsCardWithToken( + paymentMethodData: PaymentMethodDataCardFromToken.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsCardWithTokenToJson( + _PaymentMethodParamsCardWithToken instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsPayImpl _$$PaymentMethodParamsPayImplFromJson( - Map json) => - _$PaymentMethodParamsPayImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), +_PaymentMethodParamsCardWithMethodId +_$PaymentMethodParamsCardWithMethodIdFromJson(Map json) => + _PaymentMethodParamsCardWithMethodId( + paymentMethodData: PaymentMethodDataCardFromMethod.fromJson( + json['paymentMethodData'] as Map, + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsPayImplToJson( - _$PaymentMethodParamsPayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsP24Impl _$$PaymentMethodParamsP24ImplFromJson( - Map json) => - _$PaymentMethodParamsP24Impl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +Map _$PaymentMethodParamsCardWithMethodIdToJson( + _PaymentMethodParamsCardWithMethodId instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsP24ImplToJson( - _$PaymentMethodParamsP24Impl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsAlipay _$PaymentMethodParamsAlipayFromJson( + Map json, +) => _PaymentMethodParamsAlipay( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsAlipayToJson( + _PaymentMethodParamsAlipay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsFpxImpl _$$PaymentMethodParamsFpxImplFromJson( - Map json) => - _$PaymentMethodParamsFpxImpl( - paymentMethodData: PaymentMethodDataFpx.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsCashAppPay _$PaymentMethodParamsCashAppPayFromJson( + Map json, +) => _PaymentMethodParamsCashAppPay( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsCashAppPayToJson( + _PaymentMethodParamsCashAppPay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsFpxImplToJson( - _$PaymentMethodParamsFpxImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsIdeal _$PaymentMethodParamsIdealFromJson( + Map json, +) => _PaymentMethodParamsIdeal( + paymentMethodData: PaymentMethodDataIdeal.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsIdealToJson( + _PaymentMethodParamsIdeal instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsSepaDebitImpl _$$PaymentMethodParamsSepaDebitImplFromJson( - Map json) => - _$PaymentMethodParamsSepaDebitImpl( - paymentMethodData: PaymentMethodDataSepa.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsAubecs _$PaymentMethodParamsAubecsFromJson( + Map json, +) => _PaymentMethodParamsAubecs( + paymentMethodData: PaymentMethodDataAubecs.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsAubecsToJson( + _PaymentMethodParamsAubecs instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsSepaDebitImplToJson( - _$PaymentMethodParamsSepaDebitImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsBankContact _$PaymentMethodParamsBankContactFromJson( + Map json, +) => _PaymentMethodParamsBankContact( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsBankContactToJson( + _PaymentMethodParamsBankContact instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsSofortImpl _$$PaymentMethodParamsSofortImplFromJson( - Map json) => - _$PaymentMethodParamsSofortImpl( - paymentMethodData: PaymentMethodDataSofort.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsGiroPay _$PaymentMethodParamsGiroPayFromJson( + Map json, +) => _PaymentMethodParamsGiroPay( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsGiroPayToJson( + _PaymentMethodParamsGiroPay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsSofortImplToJson( - _$PaymentMethodParamsSofortImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsEps _$PaymentMethodParamsEpsFromJson( + Map json, +) => _PaymentMethodParamsEps( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsEpsToJson( + _PaymentMethodParamsEps instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsAfterpayClearpayImpl - _$$PaymentMethodParamsAfterpayClearpayImplFromJson( - Map json) => - _$PaymentMethodParamsAfterpayClearpayImpl( - paymentMethodData: PaymentMethodDataAfterPay.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsAfterpayClearpayImplToJson( - _$PaymentMethodParamsAfterpayClearpayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsAffirm _$PaymentMethodParamsAffirmFromJson( + Map json, +) => _PaymentMethodParamsAffirm( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsAffirmToJson( + _PaymentMethodParamsAffirm instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsOxxoImpl _$$PaymentMethodParamsOxxoImplFromJson( - Map json) => - _$PaymentMethodParamsOxxoImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsPay _$PaymentMethodParamsPayFromJson( + Map json, +) => _PaymentMethodParamsPay( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsPayToJson( + _PaymentMethodParamsPay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsOxxoImplToJson( - _$PaymentMethodParamsOxxoImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsP24 _$PaymentMethodParamsP24FromJson( + Map json, +) => _PaymentMethodParamsP24( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsP24ToJson( + _PaymentMethodParamsP24 instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsKlarnaImpl _$$PaymentMethodParamsKlarnaImplFromJson( - Map json) => - _$PaymentMethodParamsKlarnaImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); +_PaymentMethodParamsFpx _$PaymentMethodParamsFpxFromJson( + Map json, +) => _PaymentMethodParamsFpx( + paymentMethodData: PaymentMethodDataFpx.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsFpxToJson( + _PaymentMethodParamsFpx instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodParamsKlarnaImplToJson( - _$PaymentMethodParamsKlarnaImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsSepaDebit _$PaymentMethodParamsSepaDebitFromJson( + Map json, +) => _PaymentMethodParamsSepaDebit( + paymentMethodData: PaymentMethodDataSepa.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsSepaDebitToJson( + _PaymentMethodParamsSepaDebit instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsPayPalImpl _$$PaymentMethodParamsPayPalImplFromJson( - Map json) => - _$PaymentMethodParamsPayPalImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), +_PaymentMethodParamsAfterpayClearpay +_$PaymentMethodParamsAfterpayClearpayFromJson(Map json) => + _PaymentMethodParamsAfterpayClearpay( + paymentMethodData: PaymentMethodDataAfterPay.fromJson( + json['paymentMethodData'] as Map, + ), $type: json['paymentMethodType'] as String?, ); -Map _$$PaymentMethodParamsPayPalImplToJson( - _$PaymentMethodParamsPayPalImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; - -_$PaymentMethodParamsRevolutPayImpl - _$$PaymentMethodParamsRevolutPayImplFromJson(Map json) => - _$PaymentMethodParamsRevolutPayImpl( - paymentMethodData: PaymentMethodData.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsRevolutPayImplToJson( - _$PaymentMethodParamsRevolutPayImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +Map _$PaymentMethodParamsAfterpayClearpayToJson( + _PaymentMethodParamsAfterpayClearpay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodParamsUsBankAccountImpl - _$$PaymentMethodParamsUsBankAccountImplFromJson( - Map json) => - _$PaymentMethodParamsUsBankAccountImpl( - paymentMethodData: PaymentMethodDataUsBank.fromJson( - json['paymentMethodData'] as Map), - $type: json['paymentMethodType'] as String?, - ); - -Map _$$PaymentMethodParamsUsBankAccountImplToJson( - _$PaymentMethodParamsUsBankAccountImpl instance) => - { - 'paymentMethodData': instance.paymentMethodData.toJson(), - 'paymentMethodType': instance.$type, - }; +_PaymentMethodParamsOxxo _$PaymentMethodParamsOxxoFromJson( + Map json, +) => _PaymentMethodParamsOxxo( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsOxxoToJson( + _PaymentMethodParamsOxxo instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodDataImpl _$$PaymentMethodDataImplFromJson( - Map json) => - _$PaymentMethodDataImpl( - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); +_PaymentMethodParamsKlarna _$PaymentMethodParamsKlarnaFromJson( + Map json, +) => _PaymentMethodParamsKlarna( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsKlarnaToJson( + _PaymentMethodParamsKlarna instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -Map _$$PaymentMethodDataImplToJson( - _$PaymentMethodDataImpl instance) => - { - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodParamsPayPal _$PaymentMethodParamsPayPalFromJson( + Map json, +) => _PaymentMethodParamsPayPal( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsPayPalToJson( + _PaymentMethodParamsPayPal instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodDataCardFromTokenImpl - _$$PaymentMethodDataCardFromTokenImplFromJson(Map json) => - _$PaymentMethodDataCardFromTokenImpl( - token: json['token'] as String, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson( - json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); - -Map _$$PaymentMethodDataCardFromTokenImplToJson( - _$PaymentMethodDataCardFromTokenImpl instance) => - { - 'token': instance.token, - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodParamsRevolutPay _$PaymentMethodParamsRevolutPayFromJson( + Map json, +) => _PaymentMethodParamsRevolutPay( + paymentMethodData: PaymentMethodData.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsRevolutPayToJson( + _PaymentMethodParamsRevolutPay instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodDataCardFromMethodImpl - _$$PaymentMethodDataCardFromMethodImplFromJson(Map json) => - _$PaymentMethodDataCardFromMethodImpl( - paymentMethodId: json['paymentMethodId'] as String, - cvc: json['cvc'] as String?, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson( - json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); - -Map _$$PaymentMethodDataCardFromMethodImplToJson( - _$PaymentMethodDataCardFromMethodImpl instance) => - { - 'paymentMethodId': instance.paymentMethodId, - 'cvc': instance.cvc, - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodParamsUsBankAccount _$PaymentMethodParamsUsBankAccountFromJson( + Map json, +) => _PaymentMethodParamsUsBankAccount( + paymentMethodData: PaymentMethodDataUsBank.fromJson( + json['paymentMethodData'] as Map, + ), + $type: json['paymentMethodType'] as String?, +); + +Map _$PaymentMethodParamsUsBankAccountToJson( + _PaymentMethodParamsUsBankAccount instance, +) => { + 'paymentMethodData': instance.paymentMethodData.toJson(), + 'paymentMethodType': instance.$type, +}; -_$PaymentMethodDataIdealImpl _$$PaymentMethodDataIdealImplFromJson( - Map json) => - _$PaymentMethodDataIdealImpl( - bankIdentifierCode: json['bankIdentifierCode'] as String?, - bankName: json['bankName'] as String?, +_PaymentMethodData _$PaymentMethodDataFromJson(Map json) => + _PaymentMethodData( billingDetails: json['billingDetails'] == null ? null : BillingDetails.fromJson( - json['billingDetails'] as Map), + json['billingDetails'] as Map, + ), shippingDetails: json['shippingDetails'] == null ? null : ShippingDetails.fromJson( - json['shippingDetails'] as Map), + json['shippingDetails'] as Map, + ), mandateData: json['mandateData'] == null ? null : MandateData.fromJson(json['mandateData'] as Map), @@ -666,257 +565,363 @@ _$PaymentMethodDataIdealImpl _$$PaymentMethodDataIdealImplFromJson( ), ); -Map _$$PaymentMethodDataIdealImplToJson( - _$PaymentMethodDataIdealImpl instance) => +Map _$PaymentMethodDataToJson(_PaymentMethodData instance) => { - 'bankIdentifierCode': instance.bankIdentifierCode, - 'bankName': instance.bankName, 'billingDetails': instance.billingDetails?.toJson(), 'shippingDetails': instance.shippingDetails?.toJson(), 'mandateData': instance.mandateData?.toJson(), 'metadata': instance.metadata, }; -_$PaymentMethodDataAubecsImpl _$$PaymentMethodDataAubecsImplFromJson( - Map json) => - _$PaymentMethodDataAubecsImpl( - formDetails: AubecsFormInputDetails.fromJson( - json['formDetails'] as Map), - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); - -Map _$$PaymentMethodDataAubecsImplToJson( - _$PaymentMethodDataAubecsImpl instance) => - { - 'formDetails': instance.formDetails.toJson(), - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodDataCardFromToken _$PaymentMethodDataCardFromTokenFromJson( + Map json, +) => _PaymentMethodDataCardFromToken( + token: json['token'] as String, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataCardFromTokenToJson( + _PaymentMethodDataCardFromToken instance, +) => { + 'token': instance.token, + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -_$PaymentMethodDataFpxImpl _$$PaymentMethodDataFpxImplFromJson( - Map json) => - _$PaymentMethodDataFpxImpl( - testOfflineBank: json['testOfflineBank'] as bool? ?? false, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); +_PaymentMethodDataCardFromMethod _$PaymentMethodDataCardFromMethodFromJson( + Map json, +) => _PaymentMethodDataCardFromMethod( + paymentMethodId: json['paymentMethodId'] as String, + cvc: json['cvc'] as String?, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataCardFromMethodToJson( + _PaymentMethodDataCardFromMethod instance, +) => { + 'paymentMethodId': instance.paymentMethodId, + 'cvc': instance.cvc, + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -Map _$$PaymentMethodDataFpxImplToJson( - _$PaymentMethodDataFpxImpl instance) => - { - 'testOfflineBank': instance.testOfflineBank, - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodDataIdeal _$PaymentMethodDataIdealFromJson( + Map json, +) => _PaymentMethodDataIdeal( + bankIdentifierCode: json['bankIdentifierCode'] as String?, + bankName: json['bankName'] as String?, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataIdealToJson( + _PaymentMethodDataIdeal instance, +) => { + 'bankIdentifierCode': instance.bankIdentifierCode, + 'bankName': instance.bankName, + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -_$PaymentMethodDataSofortImpl _$$PaymentMethodDataSofortImplFromJson( - Map json) => - _$PaymentMethodDataSofortImpl( - country: json['country'] as String, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); +_PaymentMethodDataAubecs _$PaymentMethodDataAubecsFromJson( + Map json, +) => _PaymentMethodDataAubecs( + formDetails: AubecsFormInputDetails.fromJson( + json['formDetails'] as Map, + ), + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataAubecsToJson( + _PaymentMethodDataAubecs instance, +) => { + 'formDetails': instance.formDetails.toJson(), + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -Map _$$PaymentMethodDataSofortImplToJson( - _$PaymentMethodDataSofortImpl instance) => - { - 'country': instance.country, - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodDataFpx _$PaymentMethodDataFpxFromJson( + Map json, +) => _PaymentMethodDataFpx( + testOfflineBank: json['testOfflineBank'] as bool? ?? false, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataFpxToJson( + _PaymentMethodDataFpx instance, +) => { + 'testOfflineBank': instance.testOfflineBank, + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -_$PaymentMethodDataSepaImpl _$$PaymentMethodDataSepaImplFromJson( - Map json) => - _$PaymentMethodDataSepaImpl( - iban: json['iban'] as String, - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); +_PaymentMethodDataSofort _$PaymentMethodDataSofortFromJson( + Map json, +) => _PaymentMethodDataSofort( + country: json['country'] as String, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataSofortToJson( + _PaymentMethodDataSofort instance, +) => { + 'country': instance.country, + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -Map _$$PaymentMethodDataSepaImplToJson( - _$PaymentMethodDataSepaImpl instance) => - { - 'iban': instance.iban, - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodDataSepa _$PaymentMethodDataSepaFromJson( + Map json, +) => _PaymentMethodDataSepa( + iban: json['iban'] as String, + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataSepaToJson( + _PaymentMethodDataSepa instance, +) => { + 'iban': instance.iban, + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -_$PaymentMethodDataAfterPayImpl _$$PaymentMethodDataAfterPayImplFromJson( - Map json) => - _$PaymentMethodDataAfterPayImpl( - billingDetails: BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), - ), - ); +_PaymentMethodDataAfterPay _$PaymentMethodDataAfterPayFromJson( + Map json, +) => _PaymentMethodDataAfterPay( + billingDetails: BillingDetails.fromJson( + json['billingDetails'] as Map, + ), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataAfterPayToJson( + _PaymentMethodDataAfterPay instance, +) => { + 'billingDetails': instance.billingDetails.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -Map _$$PaymentMethodDataAfterPayImplToJson( - _$PaymentMethodDataAfterPayImpl instance) => - { - 'billingDetails': instance.billingDetails.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; +_PaymentMethodDataUsBank _$PaymentMethodDataUsBankFromJson( + Map json, +) => _PaymentMethodDataUsBank( + accountNumber: json['accountNumber'] as String, + routingNumber: json['routingNumber'] as String, + accountHolderType: $enumDecodeNullable( + _$BankAccountHolderTypeEnumMap, + json['accountHolderType'], + ), + accountType: $enumDecodeNullable( + _$UsBankAccountTypeEnumMap, + json['accountType'], + ), + billingDetails: json['billingDetails'] == null + ? null + : BillingDetails.fromJson(json['billingDetails'] as Map), + shippingDetails: json['shippingDetails'] == null + ? null + : ShippingDetails.fromJson( + json['shippingDetails'] as Map, + ), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), + metadata: (json['metadata'] as Map?)?.map( + (k, e) => MapEntry(k, e as String), + ), +); + +Map _$PaymentMethodDataUsBankToJson( + _PaymentMethodDataUsBank instance, +) => { + 'accountNumber': instance.accountNumber, + 'routingNumber': instance.routingNumber, + 'accountHolderType': + _$BankAccountHolderTypeEnumMap[instance.accountHolderType], + 'accountType': _$UsBankAccountTypeEnumMap[instance.accountType], + 'billingDetails': instance.billingDetails?.toJson(), + 'shippingDetails': instance.shippingDetails?.toJson(), + 'mandateData': instance.mandateData?.toJson(), + 'metadata': instance.metadata, +}; -_$PaymentMethodDataUsBankImpl _$$PaymentMethodDataUsBankImplFromJson( - Map json) => - _$PaymentMethodDataUsBankImpl( - accountNumber: json['accountNumber'] as String, - routingNumber: json['routingNumber'] as String, - accountHolderType: $enumDecodeNullable( - _$BankAccountHolderTypeEnumMap, json['accountHolderType']), - accountType: - $enumDecodeNullable(_$UsBankAccountTypeEnumMap, json['accountType']), - billingDetails: json['billingDetails'] == null - ? null - : BillingDetails.fromJson( - json['billingDetails'] as Map), - shippingDetails: json['shippingDetails'] == null - ? null - : ShippingDetails.fromJson( - json['shippingDetails'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - metadata: (json['metadata'] as Map?)?.map( - (k, e) => MapEntry(k, e as String), +_PaymentMethodOptions _$PaymentMethodOptionsFromJson( + Map json, +) => _PaymentMethodOptions( + setupFutureUsage: $enumDecodeNullable( + _$PaymentIntentsFutureUsageEnumMap, + json['setupFutureUsage'], + ), + setupFutureUsageValues: + (json['setup_future_usage_values'] as Map?)?.map( + (k, e) => MapEntry(k, $enumDecode(_$IntentFutureUsageEnumMap, e)), ), - ); - -Map _$$PaymentMethodDataUsBankImplToJson( - _$PaymentMethodDataUsBankImpl instance) => - { - 'accountNumber': instance.accountNumber, - 'routingNumber': instance.routingNumber, - 'accountHolderType': - _$BankAccountHolderTypeEnumMap[instance.accountHolderType], - 'accountType': _$UsBankAccountTypeEnumMap[instance.accountType], - 'billingDetails': instance.billingDetails?.toJson(), - 'shippingDetails': instance.shippingDetails?.toJson(), - 'mandateData': instance.mandateData?.toJson(), - 'metadata': instance.metadata, - }; - -_$PaymentMethodOptionsImpl _$$PaymentMethodOptionsImplFromJson( - Map json) => - _$PaymentMethodOptionsImpl( - setupFutureUsage: $enumDecodeNullable( - _$PaymentIntentsFutureUsageEnumMap, json['setupFutureUsage']), - ); - -Map _$$PaymentMethodOptionsImplToJson( - _$PaymentMethodOptionsImpl instance) => - { - 'setupFutureUsage': - _$PaymentIntentsFutureUsageEnumMap[instance.setupFutureUsage], - }; +); + +Map _$PaymentMethodOptionsToJson( + _PaymentMethodOptions instance, +) => { + 'setupFutureUsage': + _$PaymentIntentsFutureUsageEnumMap[instance.setupFutureUsage], + 'setup_future_usage_values': instance.setupFutureUsageValues?.map( + (k, e) => MapEntry(k, _$IntentFutureUsageEnumMap[e]!), + ), +}; const _$PaymentIntentsFutureUsageEnumMap = { PaymentIntentsFutureUsage.OffSession: 'OffSession', PaymentIntentsFutureUsage.OnSession: 'OnSession', }; -_$MandateDataImpl _$$MandateDataImplFromJson(Map json) => - _$MandateDataImpl( - customerAcceptance: json['customerAcceptance'] == null - ? null - : MandateDataCustomerAcceptance.fromJson( - json['customerAcceptance'] as Map), - ); +const _$IntentFutureUsageEnumMap = { + IntentFutureUsage.OffSession: 'OffSession', + IntentFutureUsage.OnSession: 'OnSession', +}; + +_MandateData _$MandateDataFromJson(Map json) => _MandateData( + customerAcceptance: json['customerAcceptance'] == null + ? null + : MandateDataCustomerAcceptance.fromJson( + json['customerAcceptance'] as Map, + ), +); -Map _$$MandateDataImplToJson(_$MandateDataImpl instance) => +Map _$MandateDataToJson(_MandateData instance) => { 'customerAcceptance': instance.customerAcceptance?.toJson(), }; -_$MandateDataOnlineDataImpl _$$MandateDataOnlineDataImplFromJson( - Map json) => - _$MandateDataOnlineDataImpl( - ipAddress: json['ipAddress'] as String?, - userAgent: json['userAgent'] as String?, - ); +_MandateDataOnlineData _$MandateDataOnlineDataFromJson( + Map json, +) => _MandateDataOnlineData( + ipAddress: json['ipAddress'] as String?, + userAgent: json['userAgent'] as String?, +); -Map _$$MandateDataOnlineDataImplToJson( - _$MandateDataOnlineDataImpl instance) => - { - 'ipAddress': instance.ipAddress, - 'userAgent': instance.userAgent, - }; +Map _$MandateDataOnlineDataToJson( + _MandateDataOnlineData instance, +) => { + 'ipAddress': instance.ipAddress, + 'userAgent': instance.userAgent, +}; -_$ThreeDSecureUsageImpl _$$ThreeDSecureUsageImplFromJson( - Map json) => - _$ThreeDSecureUsageImpl( - isSupported: json['isSupported'] as bool?, - ); +_ThreeDSecureUsage _$ThreeDSecureUsageFromJson(Map json) => + _ThreeDSecureUsage(isSupported: json['isSupported'] as bool?); -Map _$$ThreeDSecureUsageImplToJson( - _$ThreeDSecureUsageImpl instance) => - { - 'isSupported': instance.isSupported, - }; +Map _$ThreeDSecureUsageToJson(_ThreeDSecureUsage instance) => + {'isSupported': instance.isSupported}; diff --git a/packages/stripe_platform_interface/lib/src/models/payment_sheet.dart b/packages/stripe_platform_interface/lib/src/models/payment_sheet.dart index 18762083a..e6fcb6101 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_sheet.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_sheet.dart @@ -12,7 +12,7 @@ part 'payment_sheet.g.dart'; /// /// For more info about the payment sheet see: https://stripe.com/docs/payments/accept-a-payment. @freezed -class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { +abstract class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { @JsonSerializable(explicitToJson: true) const factory SetupPaymentSheetParameters({ /// Whether or not to use a custom flow. @@ -44,7 +44,6 @@ class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { /// The client secret of this SetupIntent /// /// If this value is null make sure to add a [paymentIntentClientSecret] - String? setupIntentClientSecret, /// Use this when you want to collect payment information before creating a @@ -67,6 +66,9 @@ class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { /// If set, PaymentSheet displays Google Pay as a payment option PaymentSheetGooglePay? googlePay, + /// Configuration related to Link + LinkDisplayParams? linkDisplayParams, + /// Flag that allows payment methods that do not move money at the send of the checkout. /// /// Defaul value is false. @@ -102,7 +104,7 @@ class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { /// Configuration for how billing details are collected during checkout. BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, + billingDetailsCollectionConfiguration, /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. String? removeSavedPaymentMethodMessage, @@ -117,6 +119,9 @@ class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { /// Note: This is only a client-side solution. ///Note: Card brand filtering is not currently supported in Link. CardBrandAcceptance? cardBrandAcceptance, + + /// Configuration for custom payment methods in PaymentSheet + CustomPaymentMethodConfiguration? customPaymentMethodConfiguration, }) = _SetupParameters; factory SetupPaymentSheetParameters.fromJson(Map json) => @@ -124,7 +129,7 @@ class SetupPaymentSheetParameters with _$SetupPaymentSheetParameters { } @freezed -class IntentConfiguration with _$IntentConfiguration { +abstract class IntentConfiguration with _$IntentConfiguration { @JsonSerializable(explicitToJson: true) const factory IntentConfiguration({ /// Data related to the future payment intent @@ -159,6 +164,9 @@ sealed class IntentMode with _$IntentMode { /// Capture method for the future payment intent CaptureMethod? captureMethod, + + /// Payment method options + PaymentMethodOptions? paymentMethodOptions, }) = _PaymentMode; @JsonSerializable(explicitToJson: true) @@ -175,7 +183,7 @@ sealed class IntentMode with _$IntentMode { /// Parameters related to the Payment sheet Apple Pay config. @freezed -class PaymentSheetApplePay with _$PaymentSheetApplePay { +abstract class PaymentSheetApplePay with _$PaymentSheetApplePay { @JsonSerializable(explicitToJson: true) const factory PaymentSheetApplePay({ ///The two-letter ISO 3166 code of the country of your business, e.g. "US" @@ -205,7 +213,7 @@ class PaymentSheetApplePay with _$PaymentSheetApplePay { /// Parameters related to the Payment sheet Google Pay config. @freezed -class PaymentSheetGooglePay with _$PaymentSheetGooglePay { +abstract class PaymentSheetGooglePay with _$PaymentSheetGooglePay { @JsonSerializable(explicitToJson: true) const factory PaymentSheetGooglePay({ ///The two-letter ISO 3166 code of the country of your business, e.g. "US" @@ -236,7 +244,7 @@ class PaymentSheetGooglePay with _$PaymentSheetGooglePay { /// Parameters that change the appearance of the payment sheet. @freezed -class PaymentSheetAppearance with _$PaymentSheetAppearance { +abstract class PaymentSheetAppearance with _$PaymentSheetAppearance { @JsonSerializable(explicitToJson: true) const factory PaymentSheetAppearance({ /// Color parameters @@ -247,6 +255,12 @@ class PaymentSheetAppearance with _$PaymentSheetAppearance { /// PaymentSheet appearance PaymentSheetPrimaryButtonAppearance? primaryButton, + + /// Describes the appearance of the Embedded Mobile Payment Element + EmbeddedPaymentElementAppearance? embeddedPaymentElement, + + /// Describes the inset values applied to Mobile Payment Element forms + EdgeInsetsConfig? formInsetValues, }) = _PaymentSheetAppearance; factory PaymentSheetAppearance.fromJson(Map json) => @@ -255,7 +269,8 @@ class PaymentSheetAppearance with _$PaymentSheetAppearance { /// Color settings for the Paymentsheet. @freezed -class PaymentSheetAppearanceColors with _$PaymentSheetAppearanceColors { +abstract class PaymentSheetAppearanceColors + with _$PaymentSheetAppearanceColors { const factory PaymentSheetAppearanceColors({ /// Color of the button that represents the primary action on the payment sheet. /// @@ -310,7 +325,7 @@ class PaymentSheetAppearanceColors with _$PaymentSheetAppearanceColors { /// Parameters that change the appearance of the payment sheet. @freezed -class PaymentSheetShape with _$PaymentSheetShape { +abstract class PaymentSheetShape with _$PaymentSheetShape { @JsonSerializable(explicitToJson: true) const factory PaymentSheetShape({ /// Borderradius for the paymentsheet corners @@ -329,7 +344,7 @@ class PaymentSheetShape with _$PaymentSheetShape { /// Shadow config parameters @freezed -class PaymentSheetShadowParams with _$PaymentSheetShadowParams { +abstract class PaymentSheetShadowParams with _$PaymentSheetShadowParams { @JsonSerializable(explicitToJson: true) const factory PaymentSheetShadowParams({ /// Shadow color @@ -348,7 +363,7 @@ class PaymentSheetShadowParams with _$PaymentSheetShadowParams { /// Shadow config parameters @freezed -class PaymentSheetShadowOffset with _$PaymentSheetShadowOffset { +abstract class PaymentSheetShadowOffset with _$PaymentSheetShadowOffset { @JsonSerializable(explicitToJson: true) const factory PaymentSheetShadowOffset({ /// X value @@ -363,7 +378,7 @@ class PaymentSheetShadowOffset with _$PaymentSheetShadowOffset { } @freezed -class PaymentSheetPrimaryButtonAppearance +abstract class PaymentSheetPrimaryButtonAppearance with _$PaymentSheetPrimaryButtonAppearance { @JsonSerializable(explicitToJson: true) const factory PaymentSheetPrimaryButtonAppearance({ @@ -375,12 +390,13 @@ class PaymentSheetPrimaryButtonAppearance }) = _PaymentSheetPrimaryButtonAppearance; factory PaymentSheetPrimaryButtonAppearance.fromJson( - Map json) => - _$PaymentSheetPrimaryButtonAppearanceFromJson(json); + Map json, + ) => _$PaymentSheetPrimaryButtonAppearanceFromJson(json); } @freezed -class PaymentSheetPrimaryButtonShape with _$PaymentSheetPrimaryButtonShape { +abstract class PaymentSheetPrimaryButtonShape + with _$PaymentSheetPrimaryButtonShape { @JsonSerializable(explicitToJson: true) const factory PaymentSheetPrimaryButtonShape({ /// Configuration of the primary button's shadow. @@ -398,7 +414,8 @@ class PaymentSheetPrimaryButtonShape with _$PaymentSheetPrimaryButtonShape { } @freezed -class PaymentSheetPrimaryButtonTheme with _$PaymentSheetPrimaryButtonTheme { +abstract class PaymentSheetPrimaryButtonTheme + with _$PaymentSheetPrimaryButtonTheme { @JsonSerializable(explicitToJson: true) const factory PaymentSheetPrimaryButtonTheme({ /// Colors when displaying button in dark theme @@ -413,7 +430,7 @@ class PaymentSheetPrimaryButtonTheme with _$PaymentSheetPrimaryButtonTheme { } @freezed -class PaymentSheetPrimaryButtonThemeColors +abstract class PaymentSheetPrimaryButtonThemeColors with _$PaymentSheetPrimaryButtonThemeColors { const factory PaymentSheetPrimaryButtonThemeColors({ /// Primary button background color @@ -429,8 +446,8 @@ class PaymentSheetPrimaryButtonThemeColors }) = _PaymentSheetPrimaryButtonThemeColors; factory PaymentSheetPrimaryButtonThemeColors.fromJson( - Map json) => - _$PaymentSheetPrimaryButtonThemeColorsFromJson(json); + Map json, + ) => _$PaymentSheetPrimaryButtonThemeColorsFromJson(json); } class UserInterfaceStyleKey { @@ -448,7 +465,7 @@ class UserInterfaceStyleKey { } } - static Color? fromJson(value) { + static Color? fromJson(Object? value) { throw UnimplementedError(); } } @@ -456,7 +473,8 @@ class UserInterfaceStyleKey { /// Parameters used to display the payment sheet. @freezed @Deprecated('Parameters are now inherited from initPaymentSheet') -class PresentPaymentSheetParameters with _$PresentPaymentSheetParameters { +abstract class PresentPaymentSheetParameters + with _$PresentPaymentSheetParameters { const factory PresentPaymentSheetParameters({ /// Key used for client-side retrieval using a publishable key. required String clientSecret, @@ -476,7 +494,7 @@ class PresentPaymentSheetParameters with _$PresentPaymentSheetParameters { } @freezed -class PaymentSheetPresentOptions with _$PaymentSheetPresentOptions { +abstract class PaymentSheetPresentOptions with _$PaymentSheetPresentOptions { @JsonSerializable(explicitToJson: true) const factory PaymentSheetPresentOptions({ /// The number of milliseconds (after presenting) before the Payment Sheet @@ -491,7 +509,7 @@ class PaymentSheetPresentOptions with _$PaymentSheetPresentOptions { } @freezed -class PaymentSheetPaymentOption with _$PaymentSheetPaymentOption { +abstract class PaymentSheetPaymentOption with _$PaymentSheetPaymentOption { @JsonSerializable(explicitToJson: true) const factory PaymentSheetPaymentOption({ /// The label of the payment option @@ -506,7 +524,7 @@ class PaymentSheetPaymentOption with _$PaymentSheetPaymentOption { } @freezed -class BillingDetailsCollectionConfiguration +abstract class BillingDetailsCollectionConfiguration with _$BillingDetailsCollectionConfiguration { @JsonSerializable(explicitToJson: true) const factory BillingDetailsCollectionConfiguration({ @@ -537,8 +555,8 @@ class BillingDetailsCollectionConfiguration }) = _BillingDetailsCollectionConfiguration; factory BillingDetailsCollectionConfiguration.fromJson( - Map json) => - _$BillingDetailsCollectionConfigurationFromJson(json); + Map json, + ) => _$BillingDetailsCollectionConfigurationFromJson(json); } /// Types of how to collect non address fields @@ -578,10 +596,8 @@ enum IntentFutureUsage { OnSession, } -typedef ConfirmHandler = void Function( - PaymentMethod result, - bool shouldSavePaymentMethod, -); +typedef ConfirmHandler = + void Function(PaymentMethod result, bool shouldSavePaymentMethod); List _cardBrandListToJson(List? list) { if (list == null) { @@ -619,9 +635,8 @@ enum CardBrandAcceptanceFilter { } @freezed - /// Options to block certain card brands on the client -class CardBrandAcceptance with _$CardBrandAcceptance { +abstract class CardBrandAcceptance with _$CardBrandAcceptance { const factory CardBrandAcceptance.all({ @Default(CardBrandAcceptanceFilter.all) CardBrandAcceptanceFilter filter, }) = _CardBrandAcceptanceAll; @@ -647,3 +662,247 @@ class CardBrandAcceptance with _$CardBrandAcceptance { factory CardBrandAcceptance.fromJson(Map json) => _$CardBrandAcceptanceFromJson(json); } + +@freezed +/// Parameters for Link display +abstract class LinkDisplayParams with _$LinkDisplayParams { + const factory LinkDisplayParams({ + /// Display configuration for Link + required LinkDisplay linkDisplay, + }) = _LinkDisplayParams; + + factory LinkDisplayParams.fromJson(Map json) => + _$LinkDisplayParamsFromJson(json); +} + +enum LinkDisplay { + /// Link will be displayed when available + automatic, + + /// Link will be displayed when available + manual, +} + +@freezed +abstract class EdgeInsetsConfig with _$EdgeInsetsConfig { + const factory EdgeInsetsConfig({ + double? top, + double? bottom, + double? left, + double? right, + }) = _EdgeInsetsConfig; + + factory EdgeInsetsConfig.fromJson(Map json) => + _$EdgeInsetsConfigFromJson(json); +} + +enum RowStyle { + /// A flat style with radio buttons + flatWithRadio, + + /// A floating button style + floatingButton, + + /// A flat style with a checkmark + flatWithCheckmark, + + /// A flat style with a chevron + /// Note that the EmbeddedPaymentElementConfiguration.rowSelectionBehavior must be set to `immediateAction` to use this style. + flatWithChevron, +} + +/// Describes the appearance of the radio button +@freezed +abstract class RadioConfig with _$RadioConfig { + const factory RadioConfig({ + /// The color of the radio button when selected, represented as a hex string #AARRGGBB or #RRGGBB. + /// @default The root appearance.colors.primary + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) + Color? selectedColor, + + /// The color of the radio button when unselected, represented as a hex string #AARRGGBB or #RRGGBB. + /// @default The root appearance.colors.componentBorder + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) + Color? unselectedColor, + }) = _RadioConfig; + + factory RadioConfig.fromJson(Map json) => + _$RadioConfigFromJson(json); +} + +/// Describes the appearance of the checkmark +@freezed +abstract class CheckmarkConfig with _$CheckmarkConfig { + const factory CheckmarkConfig({ + /// The color of the checkmark when selected, represented as a hex string #AARRGGBB or #RRGGBB. + /// @default The root appearance.colors.primary + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, + }) = _CheckmarkConfig; + + factory CheckmarkConfig.fromJson(Map json) => + _$CheckmarkConfigFromJson(json); +} + +/// Describes the appearance of the chevron +@freezed +abstract class ChevronConfig with _$ChevronConfig { + const factory ChevronConfig({ + /// The color of the chevron, represented as a hex string #AARRGGBB or #RRGGBB. + /// @default The iOS or Android system gray color + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, + }) = _ChevronConfig; + + factory ChevronConfig.fromJson(Map json) => + _$ChevronConfigFromJson(json); +} + +/// Describes the appearance of the flat style row +@freezed +abstract class FlatConfig with _$FlatConfig { + const factory FlatConfig({ + /// The thickness of the separator line between rows. + /// @default 1.0 + double? separatorThickness, + + /// The color of the separator line between rows, represented as a hex string #AARRGGBB or #RRGGBB. + /// @default The root appearance.colors.componentBorder + @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) + Color? separatorColor, + + /// The insets of the separator line between rows. + /// @default { top: 0, left: 30, bottom: 0, right: 0 } for RowStyle.FlatWithRadio + /// @default { top: 0, left: 0, bottom: 0, right: 0 } for RowStyle.FlatWithCheckmark, RowStyle.FlatWithChevron, and RowStyle.FloatingButton + EdgeInsetsConfig? separatorInsets, + + /// Determines if the top separator is visible at the top of the Element. + /// @default true + bool? topSeparatorEnabled, + + /// Determines if the bottom separator is visible at the bottom of the Element. + /// @default true + bool? bottomSeparatorEnabled, + + /// Appearance settings for the radio button (used when RowStyle is FlatWithRadio) + RadioConfig? radio, + + /// Appearance settings for the checkmark (used when RowStyle is FlatWithCheckmark) + CheckmarkConfig? checkmark, + + /// Appearance settings for the chevron (used when RowStyle is FlatWithChevron) + ChevronConfig? chevron, + }) = _FlatConfig; + + factory FlatConfig.fromJson(Map json) => + _$FlatConfigFromJson(json); +} + +/// Describes the appearance of the floating button style payment method row +@freezed +abstract class FloatingConfig with _$FloatingConfig { + const factory FloatingConfig({ + /// The spacing between payment method rows. + double? spacing, + }) = _FloatingConfig; + + factory FloatingConfig.fromJson(Map json) => + _$FloatingConfigFromJson(json); +} + +/// Describes the appearance of the row in the Embedded Mobile Payment Element +@freezed +abstract class RowConfig with _$RowConfig { + const factory RowConfig({ + /// The display style of the row. + RowStyle? style, + + /// Additional vertical insets applied to a payment method row. + /// Increasing this value increases the height of each row. + /// @default 6.0 + double? additionalInsets, + + /// Appearance settings for the flat style row + FlatConfig? flat, + + /// Appearance settings for the floating button style row + FloatingConfig? floating, + }) = _RowConfig; + + factory RowConfig.fromJson(Map json) => + _$RowConfigFromJson(json); +} + +/// Describes the appearance of the Embedded Mobile Payment Element +@freezed +abstract class EmbeddedPaymentElementAppearance + with _$EmbeddedPaymentElementAppearance { + const factory EmbeddedPaymentElementAppearance({RowConfig? row}) = + _EmbeddedPaymentElementAppearance; + + factory EmbeddedPaymentElementAppearance.fromJson( + Map json, + ) => _$EmbeddedPaymentElementAppearanceFromJson(json); +} + +/// +///Configuration for a custom payment method. +/// +@freezed +abstract class CustomPaymentMethod with _$CustomPaymentMethod { + @JsonSerializable(explicitToJson: true) + const factory CustomPaymentMethod({ + /// The custom payment method ID (beginning with `cpmt_`) as created in your Stripe Dashboard. + required String id, + + /// Optional subtitle to display beneath the custom payment method name. + String? subtitle, + + /// Whether to disable billing detail collection for this custom payment method. Defaults to true. + bool? disableBillingDetailCollection, + }) = _CustomPaymentMethod; + + factory CustomPaymentMethod.fromJson(Map json) => + _$CustomPaymentMethodFromJson(json); +} + +/// +/// Custom payment method confirmation result type for PaymentSheet. +/// +enum CustomPaymentMethodResultStatus { + /// The custom payment method transaction was completed successfully */ + completed, + + /// The custom payment method transaction was canceled by the user */ + canceled, + + /// The custom payment method transaction failed */ + failed, +} + +/// Callback function called when a custom payment method is selected and confirmed. +/// Your implementation should complete the payment using your custom payment provider's SDK. +typedef ConfirmCustomPaymentMethodCallback = + void Function( + CustomPaymentMethod customPaymentMethod, + BillingDetails? billingDetails, + void Function(CustomPaymentMethodResultStatus result) resultHandler, + ); + +/// Configuration for custom payment methods in PaymentSheet. +@freezed +abstract class CustomPaymentMethodConfiguration + with _$CustomPaymentMethodConfiguration { + @JsonSerializable(explicitToJson: true) + const factory CustomPaymentMethodConfiguration({ + /// Array of custom payment methods to display in the Payment Sheet + @JsonKey(name: 'customPaymentMethods') + required List customPaymentMethods, + + /// Callback function to handle custom payment method confirmation + @JsonKey(includeFromJson: false, includeToJson: false) + ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback, + }) = _CustomPaymentMethodConfiguration; + + factory CustomPaymentMethodConfiguration.fromJson( + Map json, + ) => _$CustomPaymentMethodConfigurationFromJson(json); +} diff --git a/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart b/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart index 3261a48eb..bba420e71 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_sheet.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,6489 +9,9618 @@ part of 'payment_sheet.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - SetupPaymentSheetParameters _$SetupPaymentSheetParametersFromJson( - Map json) { - return _SetupParameters.fromJson(json); + Map json +) { + return _SetupParameters.fromJson( + json + ); } /// @nodoc mixin _$SetupPaymentSheetParameters { - /// Whether or not to use a custom flow. - /// - /// If this value is true, the payment sheet will allow to select a payment method - /// and a later confirmation will be needed by calling [confirmPaymentSheetPayment] - /// By default, false. - bool get customFlow => throw _privateConstructorUsedError; - - /// The identifier of the Stripe Customer object. - /// See https://stripe.com/docs/api/customers/object#customer_object-id - String? get customerId => throw _privateConstructorUsedError; - - /// The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents - String? get primaryButtonLabel => throw _privateConstructorUsedError; - - ///A temp key can be used for API operations that require a secret key. - String? get customerEphemeralKeySecret => throw _privateConstructorUsedError; - - /// (Experimental) This parameter can be changed or removed at any time (use at your own risk). - /// The client secret of this Customer Session. Used on the client to set up secure access to the given customer. - String? get customerSessionClientSecret => throw _privateConstructorUsedError; - - /// Secret used for client-side retrieval using a publishable key. - /// - /// If this value is null make sure to add a [setupIntentClientSecret] - String? get paymentIntentClientSecret => throw _privateConstructorUsedError; - - /// The client secret of this SetupIntent - /// - /// If this value is null make sure to add a [paymentIntentClientSecret] - String? get setupIntentClientSecret => throw _privateConstructorUsedError; - - /// Use this when you want to collect payment information before creating a - /// setupintent or payment intent. - IntentConfiguration? get intentConfiguration => - throw _privateConstructorUsedError; - - /// Display name of the merchant - String? get merchantDisplayName => throw _privateConstructorUsedError; - - /// Configuration related to Apple Pay - /// If set, PaymentSheet displays Apple Pay as a payment option - PaymentSheetApplePay? get applePay => throw _privateConstructorUsedError; - - /// iOS only style options for colors in PaymentSheet - /// - /// Parts can be overridden by [appearance]. - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - ThemeMode? get style => throw _privateConstructorUsedError; - - /// Configuration related to Google Pay - /// If set, PaymentSheet displays Google Pay as a payment option - PaymentSheetGooglePay? get googlePay => throw _privateConstructorUsedError; - - /// Flag that allows payment methods that do not move money at the send of the checkout. - /// - /// Defaul value is false. - bool get allowsDelayedPaymentMethods => throw _privateConstructorUsedError; - - /// Appearance of the paymentsheet. - /// - /// When no appearance defined it will fallback to [style] or Stripe default. - PaymentSheetAppearance? get appearance => throw _privateConstructorUsedError; - - /// Default billing information of the customer. - /// - /// Use this field to already prefill the customers billingDetails in the payment sheet. - /// For example when you supply a country the country will be set on the payment sheet + - /// alternative localization options. This does not set the billingDetails on the - /// paymentIntent since the customer can change those. - @JsonKey(name: 'defaultBillingDetails') - BillingDetails? get billingDetails => throw _privateConstructorUsedError; - - ///This is an experimental feature that may be removed at any time. - /// Defaults to true. If true, the customer can delete all saved payment methods. - /// If false, the customer can't delete if they only have one saved payment method remaining. - bool? get allowsRemovalOfLastSavedPaymentMethod => - throw _privateConstructorUsedError; - - /// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. - /// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. - /// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. - /// Example: ["card", "external_paypal", "klarna"] - /// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. - List? get paymentMethodOrder => throw _privateConstructorUsedError; - - /// Return URL is required for IDEAL, Klarna and few other payment methods - String? get returnURL => throw _privateConstructorUsedError; - - /// Configuration for how billing details are collected during checkout. - BillingDetailsCollectionConfiguration? - get billingDetailsCollectionConfiguration => - throw _privateConstructorUsedError; - - /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. - String? get removeSavedPaymentMethodMessage => - throw _privateConstructorUsedError; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - @JsonKey(toJson: _cardBrandListToJson) - List? get preferredNetworks => throw _privateConstructorUsedError; - - /// By default, PaymentSheet will accept all supported cards by Stripe. - /// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. - /// - /// Note: This is only a client-side solution. - ///Note: Card brand filtering is not currently supported in Link. - CardBrandAcceptance? get cardBrandAcceptance => - throw _privateConstructorUsedError; - /// Serializes this SetupPaymentSheetParameters to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SetupPaymentSheetParametersCopyWith - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $SetupPaymentSheetParametersCopyWith<$Res> { - factory $SetupPaymentSheetParametersCopyWith( - SetupPaymentSheetParameters value, - $Res Function(SetupPaymentSheetParameters) then) = - _$SetupPaymentSheetParametersCopyWithImpl<$Res, - SetupPaymentSheetParameters>; - @useResult - $Res call( - {bool customFlow, - String? customerId, - String? primaryButtonLabel, - String? customerEphemeralKeySecret, - String? customerSessionClientSecret, - String? paymentIntentClientSecret, - String? setupIntentClientSecret, - IntentConfiguration? intentConfiguration, - String? merchantDisplayName, - PaymentSheetApplePay? applePay, - @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, - PaymentSheetGooglePay? googlePay, - bool allowsDelayedPaymentMethods, - PaymentSheetAppearance? appearance, - @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, - bool? allowsRemovalOfLastSavedPaymentMethod, - List? paymentMethodOrder, - String? returnURL, - BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, - String? removeSavedPaymentMethodMessage, - @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance}); - - $IntentConfigurationCopyWith<$Res>? get intentConfiguration; - $PaymentSheetApplePayCopyWith<$Res>? get applePay; - $PaymentSheetGooglePayCopyWith<$Res>? get googlePay; - $PaymentSheetAppearanceCopyWith<$Res>? get appearance; - $BillingDetailsCopyWith<$Res>? get billingDetails; - $BillingDetailsCollectionConfigurationCopyWith<$Res>? - get billingDetailsCollectionConfiguration; - $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance; -} - -/// @nodoc -class _$SetupPaymentSheetParametersCopyWithImpl<$Res, - $Val extends SetupPaymentSheetParameters> - implements $SetupPaymentSheetParametersCopyWith<$Res> { - _$SetupPaymentSheetParametersCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? customFlow = null, - Object? customerId = freezed, - Object? primaryButtonLabel = freezed, - Object? customerEphemeralKeySecret = freezed, - Object? customerSessionClientSecret = freezed, - Object? paymentIntentClientSecret = freezed, - Object? setupIntentClientSecret = freezed, - Object? intentConfiguration = freezed, - Object? merchantDisplayName = freezed, - Object? applePay = freezed, - Object? style = freezed, - Object? googlePay = freezed, - Object? allowsDelayedPaymentMethods = null, - Object? appearance = freezed, - Object? billingDetails = freezed, - Object? allowsRemovalOfLastSavedPaymentMethod = freezed, - Object? paymentMethodOrder = freezed, - Object? returnURL = freezed, - Object? billingDetailsCollectionConfiguration = freezed, - Object? removeSavedPaymentMethodMessage = freezed, - Object? preferredNetworks = freezed, - Object? cardBrandAcceptance = freezed, - }) { - return _then(_value.copyWith( - customFlow: null == customFlow - ? _value.customFlow - : customFlow // ignore: cast_nullable_to_non_nullable - as bool, - customerId: freezed == customerId - ? _value.customerId - : customerId // ignore: cast_nullable_to_non_nullable - as String?, - primaryButtonLabel: freezed == primaryButtonLabel - ? _value.primaryButtonLabel - : primaryButtonLabel // ignore: cast_nullable_to_non_nullable - as String?, - customerEphemeralKeySecret: freezed == customerEphemeralKeySecret - ? _value.customerEphemeralKeySecret - : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable - as String?, - customerSessionClientSecret: freezed == customerSessionClientSecret - ? _value.customerSessionClientSecret - : customerSessionClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - paymentIntentClientSecret: freezed == paymentIntentClientSecret - ? _value.paymentIntentClientSecret - : paymentIntentClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - setupIntentClientSecret: freezed == setupIntentClientSecret - ? _value.setupIntentClientSecret - : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - intentConfiguration: freezed == intentConfiguration - ? _value.intentConfiguration - : intentConfiguration // ignore: cast_nullable_to_non_nullable - as IntentConfiguration?, - merchantDisplayName: freezed == merchantDisplayName - ? _value.merchantDisplayName - : merchantDisplayName // ignore: cast_nullable_to_non_nullable - as String?, - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentSheetApplePay?, - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as ThemeMode?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as PaymentSheetGooglePay?, - allowsDelayedPaymentMethods: null == allowsDelayedPaymentMethods - ? _value.allowsDelayedPaymentMethods - : allowsDelayedPaymentMethods // ignore: cast_nullable_to_non_nullable - as bool, - appearance: freezed == appearance - ? _value.appearance - : appearance // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearance?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - allowsRemovalOfLastSavedPaymentMethod: freezed == - allowsRemovalOfLastSavedPaymentMethod - ? _value.allowsRemovalOfLastSavedPaymentMethod - : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable - as bool?, - paymentMethodOrder: freezed == paymentMethodOrder - ? _value.paymentMethodOrder - : paymentMethodOrder // ignore: cast_nullable_to_non_nullable - as List?, - returnURL: freezed == returnURL - ? _value.returnURL - : returnURL // ignore: cast_nullable_to_non_nullable - as String?, - billingDetailsCollectionConfiguration: freezed == - billingDetailsCollectionConfiguration - ? _value.billingDetailsCollectionConfiguration - : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable - as BillingDetailsCollectionConfiguration?, - removeSavedPaymentMethodMessage: freezed == - removeSavedPaymentMethodMessage - ? _value.removeSavedPaymentMethodMessage - : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetworks: freezed == preferredNetworks - ? _value.preferredNetworks - : preferredNetworks // ignore: cast_nullable_to_non_nullable - as List?, - cardBrandAcceptance: freezed == cardBrandAcceptance - ? _value.cardBrandAcceptance - : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptance?, - ) as $Val); - } +/// Whether or not to use a custom flow. +/// +/// If this value is true, the payment sheet will allow to select a payment method +/// and a later confirmation will be needed by calling [confirmPaymentSheetPayment] +/// By default, false. + bool get customFlow;/// The identifier of the Stripe Customer object. +/// See https://stripe.com/docs/api/customers/object#customer_object-id + String? get customerId;/// The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents + String? get primaryButtonLabel;///A temp key can be used for API operations that require a secret key. + String? get customerEphemeralKeySecret;/// (Experimental) This parameter can be changed or removed at any time (use at your own risk). +/// The client secret of this Customer Session. Used on the client to set up secure access to the given customer. + String? get customerSessionClientSecret;/// Secret used for client-side retrieval using a publishable key. +/// +/// If this value is null make sure to add a [setupIntentClientSecret] + String? get paymentIntentClientSecret;/// The client secret of this SetupIntent +/// +/// If this value is null make sure to add a [paymentIntentClientSecret] + String? get setupIntentClientSecret;/// Use this when you want to collect payment information before creating a +/// setupintent or payment intent. + IntentConfiguration? get intentConfiguration;/// Display name of the merchant + String? get merchantDisplayName;/// Configuration related to Apple Pay +/// If set, PaymentSheet displays Apple Pay as a payment option + PaymentSheetApplePay? get applePay;/// iOS only style options for colors in PaymentSheet +/// +/// Parts can be overridden by [appearance]. +@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? get style;/// Configuration related to Google Pay +/// If set, PaymentSheet displays Google Pay as a payment option + PaymentSheetGooglePay? get googlePay;/// Configuration related to Link + LinkDisplayParams? get linkDisplayParams;/// Flag that allows payment methods that do not move money at the send of the checkout. +/// +/// Defaul value is false. + bool get allowsDelayedPaymentMethods;/// Appearance of the paymentsheet. +/// +/// When no appearance defined it will fallback to [style] or Stripe default. + PaymentSheetAppearance? get appearance;/// Default billing information of the customer. +/// +/// Use this field to already prefill the customers billingDetails in the payment sheet. +/// For example when you supply a country the country will be set on the payment sheet + +/// alternative localization options. This does not set the billingDetails on the +/// paymentIntent since the customer can change those. +@JsonKey(name: 'defaultBillingDetails') BillingDetails? get billingDetails;///This is an experimental feature that may be removed at any time. +/// Defaults to true. If true, the customer can delete all saved payment methods. +/// If false, the customer can't delete if they only have one saved payment method remaining. + bool? get allowsRemovalOfLastSavedPaymentMethod;/// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. +/// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. +/// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. +/// Example: ["card", "external_paypal", "klarna"] +/// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. + List? get paymentMethodOrder;/// Return URL is required for IDEAL, Klarna and few other payment methods + String? get returnURL;/// Configuration for how billing details are collected during checkout. + BillingDetailsCollectionConfiguration? get billingDetailsCollectionConfiguration;/// Optional configuration to display a custom message when a saved payment method is removed. iOS only. + String? get removeSavedPaymentMethodMessage;/// The list of preferred networks that should be used to process payments made with a co-branded card. +/// This value will only be used if your user hasn't selected a network themselves. +@JsonKey(toJson: _cardBrandListToJson) List? get preferredNetworks;/// By default, PaymentSheet will accept all supported cards by Stripe. +/// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. +/// +/// Note: This is only a client-side solution. +///Note: Card brand filtering is not currently supported in Link. + CardBrandAcceptance? get cardBrandAcceptance;/// Configuration for custom payment methods in PaymentSheet + CustomPaymentMethodConfiguration? get customPaymentMethodConfiguration; +/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SetupPaymentSheetParametersCopyWith get copyWith => _$SetupPaymentSheetParametersCopyWithImpl(this as SetupPaymentSheetParameters, _$identity); - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $IntentConfigurationCopyWith<$Res>? get intentConfiguration { - if (_value.intentConfiguration == null) { - return null; - } - - return $IntentConfigurationCopyWith<$Res>(_value.intentConfiguration!, - (value) { - return _then(_value.copyWith(intentConfiguration: value) as $Val); - }); - } + /// Serializes this SetupPaymentSheetParameters to a JSON map. + Map toJson(); - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetApplePayCopyWith<$Res>? get applePay { - if (_value.applePay == null) { - return null; - } - - return $PaymentSheetApplePayCopyWith<$Res>(_value.applePay!, (value) { - return _then(_value.copyWith(applePay: value) as $Val); - }); - } - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetGooglePayCopyWith<$Res>? get googlePay { - if (_value.googlePay == null) { - return null; - } - - return $PaymentSheetGooglePayCopyWith<$Res>(_value.googlePay!, (value) { - return _then(_value.copyWith(googlePay: value) as $Val); - }); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SetupPaymentSheetParameters&&(identical(other.customFlow, customFlow) || other.customFlow == customFlow)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.primaryButtonLabel, primaryButtonLabel) || other.primaryButtonLabel == primaryButtonLabel)&&(identical(other.customerEphemeralKeySecret, customerEphemeralKeySecret) || other.customerEphemeralKeySecret == customerEphemeralKeySecret)&&(identical(other.customerSessionClientSecret, customerSessionClientSecret) || other.customerSessionClientSecret == customerSessionClientSecret)&&(identical(other.paymentIntentClientSecret, paymentIntentClientSecret) || other.paymentIntentClientSecret == paymentIntentClientSecret)&&(identical(other.setupIntentClientSecret, setupIntentClientSecret) || other.setupIntentClientSecret == setupIntentClientSecret)&&(identical(other.intentConfiguration, intentConfiguration) || other.intentConfiguration == intentConfiguration)&&(identical(other.merchantDisplayName, merchantDisplayName) || other.merchantDisplayName == merchantDisplayName)&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.style, style) || other.style == style)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.linkDisplayParams, linkDisplayParams) || other.linkDisplayParams == linkDisplayParams)&&(identical(other.allowsDelayedPaymentMethods, allowsDelayedPaymentMethods) || other.allowsDelayedPaymentMethods == allowsDelayedPaymentMethods)&&(identical(other.appearance, appearance) || other.appearance == appearance)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.allowsRemovalOfLastSavedPaymentMethod, allowsRemovalOfLastSavedPaymentMethod) || other.allowsRemovalOfLastSavedPaymentMethod == allowsRemovalOfLastSavedPaymentMethod)&&const DeepCollectionEquality().equals(other.paymentMethodOrder, paymentMethodOrder)&&(identical(other.returnURL, returnURL) || other.returnURL == returnURL)&&(identical(other.billingDetailsCollectionConfiguration, billingDetailsCollectionConfiguration) || other.billingDetailsCollectionConfiguration == billingDetailsCollectionConfiguration)&&(identical(other.removeSavedPaymentMethodMessage, removeSavedPaymentMethodMessage) || other.removeSavedPaymentMethodMessage == removeSavedPaymentMethodMessage)&&const DeepCollectionEquality().equals(other.preferredNetworks, preferredNetworks)&&(identical(other.cardBrandAcceptance, cardBrandAcceptance) || other.cardBrandAcceptance == cardBrandAcceptance)&&(identical(other.customPaymentMethodConfiguration, customPaymentMethodConfiguration) || other.customPaymentMethodConfiguration == customPaymentMethodConfiguration)); +} - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetAppearanceCopyWith<$Res>? get appearance { - if (_value.appearance == null) { - return null; - } - - return $PaymentSheetAppearanceCopyWith<$Res>(_value.appearance!, (value) { - return _then(_value.copyWith(appearance: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,customFlow,customerId,primaryButtonLabel,customerEphemeralKeySecret,customerSessionClientSecret,paymentIntentClientSecret,setupIntentClientSecret,intentConfiguration,merchantDisplayName,applePay,style,googlePay,linkDisplayParams,allowsDelayedPaymentMethods,appearance,billingDetails,allowsRemovalOfLastSavedPaymentMethod,const DeepCollectionEquality().hash(paymentMethodOrder),returnURL,billingDetailsCollectionConfiguration,removeSavedPaymentMethodMessage,const DeepCollectionEquality().hash(preferredNetworks),cardBrandAcceptance,customPaymentMethodConfiguration]); - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCopyWith<$Res>? get billingDetails { - if (_value.billingDetails == null) { - return null; - } - - return $BillingDetailsCopyWith<$Res>(_value.billingDetails!, (value) { - return _then(_value.copyWith(billingDetails: value) as $Val); - }); - } +@override +String toString() { + return 'SetupPaymentSheetParameters(customFlow: $customFlow, customerId: $customerId, primaryButtonLabel: $primaryButtonLabel, customerEphemeralKeySecret: $customerEphemeralKeySecret, customerSessionClientSecret: $customerSessionClientSecret, paymentIntentClientSecret: $paymentIntentClientSecret, setupIntentClientSecret: $setupIntentClientSecret, intentConfiguration: $intentConfiguration, merchantDisplayName: $merchantDisplayName, applePay: $applePay, style: $style, googlePay: $googlePay, linkDisplayParams: $linkDisplayParams, allowsDelayedPaymentMethods: $allowsDelayedPaymentMethods, appearance: $appearance, billingDetails: $billingDetails, allowsRemovalOfLastSavedPaymentMethod: $allowsRemovalOfLastSavedPaymentMethod, paymentMethodOrder: $paymentMethodOrder, returnURL: $returnURL, billingDetailsCollectionConfiguration: $billingDetailsCollectionConfiguration, removeSavedPaymentMethodMessage: $removeSavedPaymentMethodMessage, preferredNetworks: $preferredNetworks, cardBrandAcceptance: $cardBrandAcceptance, customPaymentMethodConfiguration: $customPaymentMethodConfiguration)'; +} - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $BillingDetailsCollectionConfigurationCopyWith<$Res>? - get billingDetailsCollectionConfiguration { - if (_value.billingDetailsCollectionConfiguration == null) { - return null; - } - - return $BillingDetailsCollectionConfigurationCopyWith<$Res>( - _value.billingDetailsCollectionConfiguration!, (value) { - return _then(_value.copyWith(billingDetailsCollectionConfiguration: value) - as $Val); - }); - } - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance { - if (_value.cardBrandAcceptance == null) { - return null; - } - - return $CardBrandAcceptanceCopyWith<$Res>(_value.cardBrandAcceptance!, - (value) { - return _then(_value.copyWith(cardBrandAcceptance: value) as $Val); - }); - } } /// @nodoc -abstract class _$$SetupParametersImplCopyWith<$Res> +abstract mixin class $SetupPaymentSheetParametersCopyWith<$Res> { + factory $SetupPaymentSheetParametersCopyWith(SetupPaymentSheetParameters value, $Res Function(SetupPaymentSheetParameters) _then) = _$SetupPaymentSheetParametersCopyWithImpl; +@useResult +$Res call({ + bool customFlow, String? customerId, String? primaryButtonLabel, String? customerEphemeralKeySecret, String? customerSessionClientSecret, String? paymentIntentClientSecret, String? setupIntentClientSecret, IntentConfiguration? intentConfiguration, String? merchantDisplayName, PaymentSheetApplePay? applePay,@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetGooglePay? googlePay, LinkDisplayParams? linkDisplayParams, bool allowsDelayedPaymentMethods, PaymentSheetAppearance? appearance,@JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, bool? allowsRemovalOfLastSavedPaymentMethod, List? paymentMethodOrder, String? returnURL, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? removeSavedPaymentMethodMessage,@JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, CustomPaymentMethodConfiguration? customPaymentMethodConfiguration +}); + + +$IntentConfigurationCopyWith<$Res>? get intentConfiguration;$PaymentSheetApplePayCopyWith<$Res>? get applePay;$PaymentSheetGooglePayCopyWith<$Res>? get googlePay;$LinkDisplayParamsCopyWith<$Res>? get linkDisplayParams;$PaymentSheetAppearanceCopyWith<$Res>? get appearance;$BillingDetailsCopyWith<$Res>? get billingDetails;$BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration;$CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance;$CustomPaymentMethodConfigurationCopyWith<$Res>? get customPaymentMethodConfiguration; + +} +/// @nodoc +class _$SetupPaymentSheetParametersCopyWithImpl<$Res> implements $SetupPaymentSheetParametersCopyWith<$Res> { - factory _$$SetupParametersImplCopyWith(_$SetupParametersImpl value, - $Res Function(_$SetupParametersImpl) then) = - __$$SetupParametersImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool customFlow, - String? customerId, - String? primaryButtonLabel, - String? customerEphemeralKeySecret, - String? customerSessionClientSecret, - String? paymentIntentClientSecret, - String? setupIntentClientSecret, - IntentConfiguration? intentConfiguration, - String? merchantDisplayName, - PaymentSheetApplePay? applePay, - @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, - PaymentSheetGooglePay? googlePay, - bool allowsDelayedPaymentMethods, - PaymentSheetAppearance? appearance, - @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, - bool? allowsRemovalOfLastSavedPaymentMethod, - List? paymentMethodOrder, - String? returnURL, - BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, - String? removeSavedPaymentMethodMessage, - @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance}); - - @override - $IntentConfigurationCopyWith<$Res>? get intentConfiguration; - @override - $PaymentSheetApplePayCopyWith<$Res>? get applePay; - @override - $PaymentSheetGooglePayCopyWith<$Res>? get googlePay; - @override - $PaymentSheetAppearanceCopyWith<$Res>? get appearance; - @override - $BillingDetailsCopyWith<$Res>? get billingDetails; - @override - $BillingDetailsCollectionConfigurationCopyWith<$Res>? - get billingDetailsCollectionConfiguration; - @override - $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance; -} - -/// @nodoc -class __$$SetupParametersImplCopyWithImpl<$Res> - extends _$SetupPaymentSheetParametersCopyWithImpl<$Res, - _$SetupParametersImpl> implements _$$SetupParametersImplCopyWith<$Res> { - __$$SetupParametersImplCopyWithImpl( - _$SetupParametersImpl _value, $Res Function(_$SetupParametersImpl) _then) - : super(_value, _then); - - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? customFlow = null, - Object? customerId = freezed, - Object? primaryButtonLabel = freezed, - Object? customerEphemeralKeySecret = freezed, - Object? customerSessionClientSecret = freezed, - Object? paymentIntentClientSecret = freezed, - Object? setupIntentClientSecret = freezed, - Object? intentConfiguration = freezed, - Object? merchantDisplayName = freezed, - Object? applePay = freezed, - Object? style = freezed, - Object? googlePay = freezed, - Object? allowsDelayedPaymentMethods = null, - Object? appearance = freezed, - Object? billingDetails = freezed, - Object? allowsRemovalOfLastSavedPaymentMethod = freezed, - Object? paymentMethodOrder = freezed, - Object? returnURL = freezed, - Object? billingDetailsCollectionConfiguration = freezed, - Object? removeSavedPaymentMethodMessage = freezed, - Object? preferredNetworks = freezed, - Object? cardBrandAcceptance = freezed, - }) { - return _then(_$SetupParametersImpl( - customFlow: null == customFlow - ? _value.customFlow - : customFlow // ignore: cast_nullable_to_non_nullable - as bool, - customerId: freezed == customerId - ? _value.customerId - : customerId // ignore: cast_nullable_to_non_nullable - as String?, - primaryButtonLabel: freezed == primaryButtonLabel - ? _value.primaryButtonLabel - : primaryButtonLabel // ignore: cast_nullable_to_non_nullable - as String?, - customerEphemeralKeySecret: freezed == customerEphemeralKeySecret - ? _value.customerEphemeralKeySecret - : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable - as String?, - customerSessionClientSecret: freezed == customerSessionClientSecret - ? _value.customerSessionClientSecret - : customerSessionClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - paymentIntentClientSecret: freezed == paymentIntentClientSecret - ? _value.paymentIntentClientSecret - : paymentIntentClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - setupIntentClientSecret: freezed == setupIntentClientSecret - ? _value.setupIntentClientSecret - : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable - as String?, - intentConfiguration: freezed == intentConfiguration - ? _value.intentConfiguration - : intentConfiguration // ignore: cast_nullable_to_non_nullable - as IntentConfiguration?, - merchantDisplayName: freezed == merchantDisplayName - ? _value.merchantDisplayName - : merchantDisplayName // ignore: cast_nullable_to_non_nullable - as String?, - applePay: freezed == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as PaymentSheetApplePay?, - style: freezed == style - ? _value.style - : style // ignore: cast_nullable_to_non_nullable - as ThemeMode?, - googlePay: freezed == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as PaymentSheetGooglePay?, - allowsDelayedPaymentMethods: null == allowsDelayedPaymentMethods - ? _value.allowsDelayedPaymentMethods - : allowsDelayedPaymentMethods // ignore: cast_nullable_to_non_nullable - as bool, - appearance: freezed == appearance - ? _value.appearance - : appearance // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearance?, - billingDetails: freezed == billingDetails - ? _value.billingDetails - : billingDetails // ignore: cast_nullable_to_non_nullable - as BillingDetails?, - allowsRemovalOfLastSavedPaymentMethod: freezed == - allowsRemovalOfLastSavedPaymentMethod - ? _value.allowsRemovalOfLastSavedPaymentMethod - : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable - as bool?, - paymentMethodOrder: freezed == paymentMethodOrder - ? _value._paymentMethodOrder - : paymentMethodOrder // ignore: cast_nullable_to_non_nullable - as List?, - returnURL: freezed == returnURL - ? _value.returnURL - : returnURL // ignore: cast_nullable_to_non_nullable - as String?, - billingDetailsCollectionConfiguration: freezed == - billingDetailsCollectionConfiguration - ? _value.billingDetailsCollectionConfiguration - : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable - as BillingDetailsCollectionConfiguration?, - removeSavedPaymentMethodMessage: freezed == - removeSavedPaymentMethodMessage - ? _value.removeSavedPaymentMethodMessage - : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable - as String?, - preferredNetworks: freezed == preferredNetworks - ? _value._preferredNetworks - : preferredNetworks // ignore: cast_nullable_to_non_nullable - as List?, - cardBrandAcceptance: freezed == cardBrandAcceptance - ? _value.cardBrandAcceptance - : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptance?, - )); - } + _$SetupPaymentSheetParametersCopyWithImpl(this._self, this._then); + + final SetupPaymentSheetParameters _self; + final $Res Function(SetupPaymentSheetParameters) _then; + +/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? customFlow = null,Object? customerId = freezed,Object? primaryButtonLabel = freezed,Object? customerEphemeralKeySecret = freezed,Object? customerSessionClientSecret = freezed,Object? paymentIntentClientSecret = freezed,Object? setupIntentClientSecret = freezed,Object? intentConfiguration = freezed,Object? merchantDisplayName = freezed,Object? applePay = freezed,Object? style = freezed,Object? googlePay = freezed,Object? linkDisplayParams = freezed,Object? allowsDelayedPaymentMethods = null,Object? appearance = freezed,Object? billingDetails = freezed,Object? allowsRemovalOfLastSavedPaymentMethod = freezed,Object? paymentMethodOrder = freezed,Object? returnURL = freezed,Object? billingDetailsCollectionConfiguration = freezed,Object? removeSavedPaymentMethodMessage = freezed,Object? preferredNetworks = freezed,Object? cardBrandAcceptance = freezed,Object? customPaymentMethodConfiguration = freezed,}) { + return _then(_self.copyWith( +customFlow: null == customFlow ? _self.customFlow : customFlow // ignore: cast_nullable_to_non_nullable +as bool,customerId: freezed == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable +as String?,primaryButtonLabel: freezed == primaryButtonLabel ? _self.primaryButtonLabel : primaryButtonLabel // ignore: cast_nullable_to_non_nullable +as String?,customerEphemeralKeySecret: freezed == customerEphemeralKeySecret ? _self.customerEphemeralKeySecret : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable +as String?,customerSessionClientSecret: freezed == customerSessionClientSecret ? _self.customerSessionClientSecret : customerSessionClientSecret // ignore: cast_nullable_to_non_nullable +as String?,paymentIntentClientSecret: freezed == paymentIntentClientSecret ? _self.paymentIntentClientSecret : paymentIntentClientSecret // ignore: cast_nullable_to_non_nullable +as String?,setupIntentClientSecret: freezed == setupIntentClientSecret ? _self.setupIntentClientSecret : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable +as String?,intentConfiguration: freezed == intentConfiguration ? _self.intentConfiguration : intentConfiguration // ignore: cast_nullable_to_non_nullable +as IntentConfiguration?,merchantDisplayName: freezed == merchantDisplayName ? _self.merchantDisplayName : merchantDisplayName // ignore: cast_nullable_to_non_nullable +as String?,applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentSheetApplePay?,style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as ThemeMode?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as PaymentSheetGooglePay?,linkDisplayParams: freezed == linkDisplayParams ? _self.linkDisplayParams : linkDisplayParams // ignore: cast_nullable_to_non_nullable +as LinkDisplayParams?,allowsDelayedPaymentMethods: null == allowsDelayedPaymentMethods ? _self.allowsDelayedPaymentMethods : allowsDelayedPaymentMethods // ignore: cast_nullable_to_non_nullable +as bool,appearance: freezed == appearance ? _self.appearance : appearance // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearance?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,allowsRemovalOfLastSavedPaymentMethod: freezed == allowsRemovalOfLastSavedPaymentMethod ? _self.allowsRemovalOfLastSavedPaymentMethod : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable +as bool?,paymentMethodOrder: freezed == paymentMethodOrder ? _self.paymentMethodOrder : paymentMethodOrder // ignore: cast_nullable_to_non_nullable +as List?,returnURL: freezed == returnURL ? _self.returnURL : returnURL // ignore: cast_nullable_to_non_nullable +as String?,billingDetailsCollectionConfiguration: freezed == billingDetailsCollectionConfiguration ? _self.billingDetailsCollectionConfiguration : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable +as BillingDetailsCollectionConfiguration?,removeSavedPaymentMethodMessage: freezed == removeSavedPaymentMethodMessage ? _self.removeSavedPaymentMethodMessage : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable +as String?,preferredNetworks: freezed == preferredNetworks ? _self.preferredNetworks : preferredNetworks // ignore: cast_nullable_to_non_nullable +as List?,cardBrandAcceptance: freezed == cardBrandAcceptance ? _self.cardBrandAcceptance : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptance?,customPaymentMethodConfiguration: freezed == customPaymentMethodConfiguration ? _self.customPaymentMethodConfiguration : customPaymentMethodConfiguration // ignore: cast_nullable_to_non_nullable +as CustomPaymentMethodConfiguration?, + )); +} +/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IntentConfigurationCopyWith<$Res>? get intentConfiguration { + if (_self.intentConfiguration == null) { + return null; + } + + return $IntentConfigurationCopyWith<$Res>(_self.intentConfiguration!, (value) { + return _then(_self.copyWith(intentConfiguration: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetApplePayCopyWith<$Res>? get applePay { + if (_self.applePay == null) { + return null; + } + + return $PaymentSheetApplePayCopyWith<$Res>(_self.applePay!, (value) { + return _then(_self.copyWith(applePay: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetGooglePayCopyWith<$Res>? get googlePay { + if (_self.googlePay == null) { + return null; + } + + return $PaymentSheetGooglePayCopyWith<$Res>(_self.googlePay!, (value) { + return _then(_self.copyWith(googlePay: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LinkDisplayParamsCopyWith<$Res>? get linkDisplayParams { + if (_self.linkDisplayParams == null) { + return null; + } + + return $LinkDisplayParamsCopyWith<$Res>(_self.linkDisplayParams!, (value) { + return _then(_self.copyWith(linkDisplayParams: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith<$Res>? get appearance { + if (_self.appearance == null) { + return null; + } + + return $PaymentSheetAppearanceCopyWith<$Res>(_self.appearance!, (value) { + return _then(_self.copyWith(appearance: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration { + if (_self.billingDetailsCollectionConfiguration == null) { + return null; + } + + return $BillingDetailsCollectionConfigurationCopyWith<$Res>(_self.billingDetailsCollectionConfiguration!, (value) { + return _then(_self.copyWith(billingDetailsCollectionConfiguration: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance { + if (_self.cardBrandAcceptance == null) { + return null; + } + + return $CardBrandAcceptanceCopyWith<$Res>(_self.cardBrandAcceptance!, (value) { + return _then(_self.copyWith(cardBrandAcceptance: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CustomPaymentMethodConfigurationCopyWith<$Res>? get customPaymentMethodConfiguration { + if (_self.customPaymentMethodConfiguration == null) { + return null; + } + + return $CustomPaymentMethodConfigurationCopyWith<$Res>(_self.customPaymentMethodConfiguration!, (value) { + return _then(_self.copyWith(customPaymentMethodConfiguration: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [SetupPaymentSheetParameters]. +extension SetupPaymentSheetParametersPatterns on SetupPaymentSheetParameters { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SetupParameters value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SetupParameters() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SetupParameters value) $default,){ +final _that = this; +switch (_that) { +case _SetupParameters(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SetupParameters value)? $default,){ +final _that = this; +switch (_that) { +case _SetupParameters() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool customFlow, String? customerId, String? primaryButtonLabel, String? customerEphemeralKeySecret, String? customerSessionClientSecret, String? paymentIntentClientSecret, String? setupIntentClientSecret, IntentConfiguration? intentConfiguration, String? merchantDisplayName, PaymentSheetApplePay? applePay, @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetGooglePay? googlePay, LinkDisplayParams? linkDisplayParams, bool allowsDelayedPaymentMethods, PaymentSheetAppearance? appearance, @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, bool? allowsRemovalOfLastSavedPaymentMethod, List? paymentMethodOrder, String? returnURL, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? removeSavedPaymentMethodMessage, @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, CustomPaymentMethodConfiguration? customPaymentMethodConfiguration)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SetupParameters() when $default != null: +return $default(_that.customFlow,_that.customerId,_that.primaryButtonLabel,_that.customerEphemeralKeySecret,_that.customerSessionClientSecret,_that.paymentIntentClientSecret,_that.setupIntentClientSecret,_that.intentConfiguration,_that.merchantDisplayName,_that.applePay,_that.style,_that.googlePay,_that.linkDisplayParams,_that.allowsDelayedPaymentMethods,_that.appearance,_that.billingDetails,_that.allowsRemovalOfLastSavedPaymentMethod,_that.paymentMethodOrder,_that.returnURL,_that.billingDetailsCollectionConfiguration,_that.removeSavedPaymentMethodMessage,_that.preferredNetworks,_that.cardBrandAcceptance,_that.customPaymentMethodConfiguration);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool customFlow, String? customerId, String? primaryButtonLabel, String? customerEphemeralKeySecret, String? customerSessionClientSecret, String? paymentIntentClientSecret, String? setupIntentClientSecret, IntentConfiguration? intentConfiguration, String? merchantDisplayName, PaymentSheetApplePay? applePay, @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetGooglePay? googlePay, LinkDisplayParams? linkDisplayParams, bool allowsDelayedPaymentMethods, PaymentSheetAppearance? appearance, @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, bool? allowsRemovalOfLastSavedPaymentMethod, List? paymentMethodOrder, String? returnURL, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? removeSavedPaymentMethodMessage, @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, CustomPaymentMethodConfiguration? customPaymentMethodConfiguration) $default,) {final _that = this; +switch (_that) { +case _SetupParameters(): +return $default(_that.customFlow,_that.customerId,_that.primaryButtonLabel,_that.customerEphemeralKeySecret,_that.customerSessionClientSecret,_that.paymentIntentClientSecret,_that.setupIntentClientSecret,_that.intentConfiguration,_that.merchantDisplayName,_that.applePay,_that.style,_that.googlePay,_that.linkDisplayParams,_that.allowsDelayedPaymentMethods,_that.appearance,_that.billingDetails,_that.allowsRemovalOfLastSavedPaymentMethod,_that.paymentMethodOrder,_that.returnURL,_that.billingDetailsCollectionConfiguration,_that.removeSavedPaymentMethodMessage,_that.preferredNetworks,_that.cardBrandAcceptance,_that.customPaymentMethodConfiguration);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool customFlow, String? customerId, String? primaryButtonLabel, String? customerEphemeralKeySecret, String? customerSessionClientSecret, String? paymentIntentClientSecret, String? setupIntentClientSecret, IntentConfiguration? intentConfiguration, String? merchantDisplayName, PaymentSheetApplePay? applePay, @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetGooglePay? googlePay, LinkDisplayParams? linkDisplayParams, bool allowsDelayedPaymentMethods, PaymentSheetAppearance? appearance, @JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, bool? allowsRemovalOfLastSavedPaymentMethod, List? paymentMethodOrder, String? returnURL, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? removeSavedPaymentMethodMessage, @JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, CustomPaymentMethodConfiguration? customPaymentMethodConfiguration)? $default,) {final _that = this; +switch (_that) { +case _SetupParameters() when $default != null: +return $default(_that.customFlow,_that.customerId,_that.primaryButtonLabel,_that.customerEphemeralKeySecret,_that.customerSessionClientSecret,_that.paymentIntentClientSecret,_that.setupIntentClientSecret,_that.intentConfiguration,_that.merchantDisplayName,_that.applePay,_that.style,_that.googlePay,_that.linkDisplayParams,_that.allowsDelayedPaymentMethods,_that.appearance,_that.billingDetails,_that.allowsRemovalOfLastSavedPaymentMethod,_that.paymentMethodOrder,_that.returnURL,_that.billingDetailsCollectionConfiguration,_that.removeSavedPaymentMethodMessage,_that.preferredNetworks,_that.cardBrandAcceptance,_that.customPaymentMethodConfiguration);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$SetupParametersImpl implements _SetupParameters { - const _$SetupParametersImpl( - {this.customFlow = false, - this.customerId, - this.primaryButtonLabel, - this.customerEphemeralKeySecret, - this.customerSessionClientSecret, - this.paymentIntentClientSecret, - this.setupIntentClientSecret, - this.intentConfiguration, - this.merchantDisplayName, - this.applePay, - @JsonKey(toJson: UserInterfaceStyleKey.toJson) this.style, - this.googlePay, - this.allowsDelayedPaymentMethods = false, - this.appearance, - @JsonKey(name: 'defaultBillingDetails') this.billingDetails, - this.allowsRemovalOfLastSavedPaymentMethod, - final List? paymentMethodOrder, - this.returnURL, - this.billingDetailsCollectionConfiguration, - this.removeSavedPaymentMethodMessage, - @JsonKey(toJson: _cardBrandListToJson) - final List? preferredNetworks, - this.cardBrandAcceptance}) - : _paymentMethodOrder = paymentMethodOrder, - _preferredNetworks = preferredNetworks; - - factory _$SetupParametersImpl.fromJson(Map json) => - _$$SetupParametersImplFromJson(json); - - /// Whether or not to use a custom flow. - /// - /// If this value is true, the payment sheet will allow to select a payment method - /// and a later confirmation will be needed by calling [confirmPaymentSheetPayment] - /// By default, false. - @override - @JsonKey() - final bool customFlow; - - /// The identifier of the Stripe Customer object. - /// See https://stripe.com/docs/api/customers/object#customer_object-id - @override - final String? customerId; - - /// The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents - @override - final String? primaryButtonLabel; - - ///A temp key can be used for API operations that require a secret key. - @override - final String? customerEphemeralKeySecret; - - /// (Experimental) This parameter can be changed or removed at any time (use at your own risk). - /// The client secret of this Customer Session. Used on the client to set up secure access to the given customer. - @override - final String? customerSessionClientSecret; - - /// Secret used for client-side retrieval using a publishable key. - /// - /// If this value is null make sure to add a [setupIntentClientSecret] - @override - final String? paymentIntentClientSecret; - - /// The client secret of this SetupIntent - /// - /// If this value is null make sure to add a [paymentIntentClientSecret] - @override - final String? setupIntentClientSecret; - - /// Use this when you want to collect payment information before creating a - /// setupintent or payment intent. - @override - final IntentConfiguration? intentConfiguration; - - /// Display name of the merchant - @override - final String? merchantDisplayName; - - /// Configuration related to Apple Pay - /// If set, PaymentSheet displays Apple Pay as a payment option - @override - final PaymentSheetApplePay? applePay; - - /// iOS only style options for colors in PaymentSheet - /// - /// Parts can be overridden by [appearance]. - @override - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - final ThemeMode? style; - - /// Configuration related to Google Pay - /// If set, PaymentSheet displays Google Pay as a payment option - @override - final PaymentSheetGooglePay? googlePay; - - /// Flag that allows payment methods that do not move money at the send of the checkout. - /// - /// Defaul value is false. - @override - @JsonKey() - final bool allowsDelayedPaymentMethods; - - /// Appearance of the paymentsheet. - /// - /// When no appearance defined it will fallback to [style] or Stripe default. - @override - final PaymentSheetAppearance? appearance; - - /// Default billing information of the customer. - /// - /// Use this field to already prefill the customers billingDetails in the payment sheet. - /// For example when you supply a country the country will be set on the payment sheet + - /// alternative localization options. This does not set the billingDetails on the - /// paymentIntent since the customer can change those. - @override - @JsonKey(name: 'defaultBillingDetails') - final BillingDetails? billingDetails; - - ///This is an experimental feature that may be removed at any time. - /// Defaults to true. If true, the customer can delete all saved payment methods. - /// If false, the customer can't delete if they only have one saved payment method remaining. - @override - final bool? allowsRemovalOfLastSavedPaymentMethod; - - /// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. - /// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. - /// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. - /// Example: ["card", "external_paypal", "klarna"] - /// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. - final List? _paymentMethodOrder; - - /// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. - /// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. - /// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. - /// Example: ["card", "external_paypal", "klarna"] - /// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. - @override - List? get paymentMethodOrder { - final value = _paymentMethodOrder; - if (value == null) return null; - if (_paymentMethodOrder is EqualUnmodifiableListView) - return _paymentMethodOrder; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _SetupParameters implements SetupPaymentSheetParameters { + const _SetupParameters({this.customFlow = false, this.customerId, this.primaryButtonLabel, this.customerEphemeralKeySecret, this.customerSessionClientSecret, this.paymentIntentClientSecret, this.setupIntentClientSecret, this.intentConfiguration, this.merchantDisplayName, this.applePay, @JsonKey(toJson: UserInterfaceStyleKey.toJson) this.style, this.googlePay, this.linkDisplayParams, this.allowsDelayedPaymentMethods = false, this.appearance, @JsonKey(name: 'defaultBillingDetails') this.billingDetails, this.allowsRemovalOfLastSavedPaymentMethod, final List? paymentMethodOrder, this.returnURL, this.billingDetailsCollectionConfiguration, this.removeSavedPaymentMethodMessage, @JsonKey(toJson: _cardBrandListToJson) final List? preferredNetworks, this.cardBrandAcceptance, this.customPaymentMethodConfiguration}): _paymentMethodOrder = paymentMethodOrder,_preferredNetworks = preferredNetworks; + factory _SetupParameters.fromJson(Map json) => _$SetupParametersFromJson(json); + +/// Whether or not to use a custom flow. +/// +/// If this value is true, the payment sheet will allow to select a payment method +/// and a later confirmation will be needed by calling [confirmPaymentSheetPayment] +/// By default, false. +@override@JsonKey() final bool customFlow; +/// The identifier of the Stripe Customer object. +/// See https://stripe.com/docs/api/customers/object#customer_object-id +@override final String? customerId; +/// The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents +@override final String? primaryButtonLabel; +///A temp key can be used for API operations that require a secret key. +@override final String? customerEphemeralKeySecret; +/// (Experimental) This parameter can be changed or removed at any time (use at your own risk). +/// The client secret of this Customer Session. Used on the client to set up secure access to the given customer. +@override final String? customerSessionClientSecret; +/// Secret used for client-side retrieval using a publishable key. +/// +/// If this value is null make sure to add a [setupIntentClientSecret] +@override final String? paymentIntentClientSecret; +/// The client secret of this SetupIntent +/// +/// If this value is null make sure to add a [paymentIntentClientSecret] +@override final String? setupIntentClientSecret; +/// Use this when you want to collect payment information before creating a +/// setupintent or payment intent. +@override final IntentConfiguration? intentConfiguration; +/// Display name of the merchant +@override final String? merchantDisplayName; +/// Configuration related to Apple Pay +/// If set, PaymentSheet displays Apple Pay as a payment option +@override final PaymentSheetApplePay? applePay; +/// iOS only style options for colors in PaymentSheet +/// +/// Parts can be overridden by [appearance]. +@override@JsonKey(toJson: UserInterfaceStyleKey.toJson) final ThemeMode? style; +/// Configuration related to Google Pay +/// If set, PaymentSheet displays Google Pay as a payment option +@override final PaymentSheetGooglePay? googlePay; +/// Configuration related to Link +@override final LinkDisplayParams? linkDisplayParams; +/// Flag that allows payment methods that do not move money at the send of the checkout. +/// +/// Defaul value is false. +@override@JsonKey() final bool allowsDelayedPaymentMethods; +/// Appearance of the paymentsheet. +/// +/// When no appearance defined it will fallback to [style] or Stripe default. +@override final PaymentSheetAppearance? appearance; +/// Default billing information of the customer. +/// +/// Use this field to already prefill the customers billingDetails in the payment sheet. +/// For example when you supply a country the country will be set on the payment sheet + +/// alternative localization options. This does not set the billingDetails on the +/// paymentIntent since the customer can change those. +@override@JsonKey(name: 'defaultBillingDetails') final BillingDetails? billingDetails; +///This is an experimental feature that may be removed at any time. +/// Defaults to true. If true, the customer can delete all saved payment methods. +/// If false, the customer can't delete if they only have one saved payment method remaining. +@override final bool? allowsRemovalOfLastSavedPaymentMethod; +/// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. +/// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. +/// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. +/// Example: ["card", "external_paypal", "klarna"] +/// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. + final List? _paymentMethodOrder; +/// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. +/// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. +/// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. +/// Example: ["card", "external_paypal", "klarna"] +/// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. +@override List? get paymentMethodOrder { + final value = _paymentMethodOrder; + if (value == null) return null; + if (_paymentMethodOrder is EqualUnmodifiableListView) return _paymentMethodOrder; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// Return URL is required for IDEAL, Klarna and few other payment methods +@override final String? returnURL; +/// Configuration for how billing details are collected during checkout. +@override final BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration; +/// Optional configuration to display a custom message when a saved payment method is removed. iOS only. +@override final String? removeSavedPaymentMethodMessage; +/// The list of preferred networks that should be used to process payments made with a co-branded card. +/// This value will only be used if your user hasn't selected a network themselves. + final List? _preferredNetworks; +/// The list of preferred networks that should be used to process payments made with a co-branded card. +/// This value will only be used if your user hasn't selected a network themselves. +@override@JsonKey(toJson: _cardBrandListToJson) List? get preferredNetworks { + final value = _preferredNetworks; + if (value == null) return null; + if (_preferredNetworks is EqualUnmodifiableListView) return _preferredNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// By default, PaymentSheet will accept all supported cards by Stripe. +/// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. +/// +/// Note: This is only a client-side solution. +///Note: Card brand filtering is not currently supported in Link. +@override final CardBrandAcceptance? cardBrandAcceptance; +/// Configuration for custom payment methods in PaymentSheet +@override final CustomPaymentMethodConfiguration? customPaymentMethodConfiguration; + +/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SetupParametersCopyWith<_SetupParameters> get copyWith => __$SetupParametersCopyWithImpl<_SetupParameters>(this, _$identity); + +@override +Map toJson() { + return _$SetupParametersToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SetupParameters&&(identical(other.customFlow, customFlow) || other.customFlow == customFlow)&&(identical(other.customerId, customerId) || other.customerId == customerId)&&(identical(other.primaryButtonLabel, primaryButtonLabel) || other.primaryButtonLabel == primaryButtonLabel)&&(identical(other.customerEphemeralKeySecret, customerEphemeralKeySecret) || other.customerEphemeralKeySecret == customerEphemeralKeySecret)&&(identical(other.customerSessionClientSecret, customerSessionClientSecret) || other.customerSessionClientSecret == customerSessionClientSecret)&&(identical(other.paymentIntentClientSecret, paymentIntentClientSecret) || other.paymentIntentClientSecret == paymentIntentClientSecret)&&(identical(other.setupIntentClientSecret, setupIntentClientSecret) || other.setupIntentClientSecret == setupIntentClientSecret)&&(identical(other.intentConfiguration, intentConfiguration) || other.intentConfiguration == intentConfiguration)&&(identical(other.merchantDisplayName, merchantDisplayName) || other.merchantDisplayName == merchantDisplayName)&&(identical(other.applePay, applePay) || other.applePay == applePay)&&(identical(other.style, style) || other.style == style)&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)&&(identical(other.linkDisplayParams, linkDisplayParams) || other.linkDisplayParams == linkDisplayParams)&&(identical(other.allowsDelayedPaymentMethods, allowsDelayedPaymentMethods) || other.allowsDelayedPaymentMethods == allowsDelayedPaymentMethods)&&(identical(other.appearance, appearance) || other.appearance == appearance)&&(identical(other.billingDetails, billingDetails) || other.billingDetails == billingDetails)&&(identical(other.allowsRemovalOfLastSavedPaymentMethod, allowsRemovalOfLastSavedPaymentMethod) || other.allowsRemovalOfLastSavedPaymentMethod == allowsRemovalOfLastSavedPaymentMethod)&&const DeepCollectionEquality().equals(other._paymentMethodOrder, _paymentMethodOrder)&&(identical(other.returnURL, returnURL) || other.returnURL == returnURL)&&(identical(other.billingDetailsCollectionConfiguration, billingDetailsCollectionConfiguration) || other.billingDetailsCollectionConfiguration == billingDetailsCollectionConfiguration)&&(identical(other.removeSavedPaymentMethodMessage, removeSavedPaymentMethodMessage) || other.removeSavedPaymentMethodMessage == removeSavedPaymentMethodMessage)&&const DeepCollectionEquality().equals(other._preferredNetworks, _preferredNetworks)&&(identical(other.cardBrandAcceptance, cardBrandAcceptance) || other.cardBrandAcceptance == cardBrandAcceptance)&&(identical(other.customPaymentMethodConfiguration, customPaymentMethodConfiguration) || other.customPaymentMethodConfiguration == customPaymentMethodConfiguration)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,customFlow,customerId,primaryButtonLabel,customerEphemeralKeySecret,customerSessionClientSecret,paymentIntentClientSecret,setupIntentClientSecret,intentConfiguration,merchantDisplayName,applePay,style,googlePay,linkDisplayParams,allowsDelayedPaymentMethods,appearance,billingDetails,allowsRemovalOfLastSavedPaymentMethod,const DeepCollectionEquality().hash(_paymentMethodOrder),returnURL,billingDetailsCollectionConfiguration,removeSavedPaymentMethodMessage,const DeepCollectionEquality().hash(_preferredNetworks),cardBrandAcceptance,customPaymentMethodConfiguration]); + +@override +String toString() { + return 'SetupPaymentSheetParameters(customFlow: $customFlow, customerId: $customerId, primaryButtonLabel: $primaryButtonLabel, customerEphemeralKeySecret: $customerEphemeralKeySecret, customerSessionClientSecret: $customerSessionClientSecret, paymentIntentClientSecret: $paymentIntentClientSecret, setupIntentClientSecret: $setupIntentClientSecret, intentConfiguration: $intentConfiguration, merchantDisplayName: $merchantDisplayName, applePay: $applePay, style: $style, googlePay: $googlePay, linkDisplayParams: $linkDisplayParams, allowsDelayedPaymentMethods: $allowsDelayedPaymentMethods, appearance: $appearance, billingDetails: $billingDetails, allowsRemovalOfLastSavedPaymentMethod: $allowsRemovalOfLastSavedPaymentMethod, paymentMethodOrder: $paymentMethodOrder, returnURL: $returnURL, billingDetailsCollectionConfiguration: $billingDetailsCollectionConfiguration, removeSavedPaymentMethodMessage: $removeSavedPaymentMethodMessage, preferredNetworks: $preferredNetworks, cardBrandAcceptance: $cardBrandAcceptance, customPaymentMethodConfiguration: $customPaymentMethodConfiguration)'; +} - /// Return URL is required for IDEAL, Klarna and few other payment methods - @override - final String? returnURL; - - /// Configuration for how billing details are collected during checkout. - @override - final BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration; - - /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. - @override - final String? removeSavedPaymentMethodMessage; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - final List? _preferredNetworks; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - @override - @JsonKey(toJson: _cardBrandListToJson) - List? get preferredNetworks { - final value = _preferredNetworks; - if (value == null) return null; - if (_preferredNetworks is EqualUnmodifiableListView) - return _preferredNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - /// By default, PaymentSheet will accept all supported cards by Stripe. - /// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. - /// - /// Note: This is only a client-side solution. - ///Note: Card brand filtering is not currently supported in Link. - @override - final CardBrandAcceptance? cardBrandAcceptance; - - @override - String toString() { - return 'SetupPaymentSheetParameters(customFlow: $customFlow, customerId: $customerId, primaryButtonLabel: $primaryButtonLabel, customerEphemeralKeySecret: $customerEphemeralKeySecret, customerSessionClientSecret: $customerSessionClientSecret, paymentIntentClientSecret: $paymentIntentClientSecret, setupIntentClientSecret: $setupIntentClientSecret, intentConfiguration: $intentConfiguration, merchantDisplayName: $merchantDisplayName, applePay: $applePay, style: $style, googlePay: $googlePay, allowsDelayedPaymentMethods: $allowsDelayedPaymentMethods, appearance: $appearance, billingDetails: $billingDetails, allowsRemovalOfLastSavedPaymentMethod: $allowsRemovalOfLastSavedPaymentMethod, paymentMethodOrder: $paymentMethodOrder, returnURL: $returnURL, billingDetailsCollectionConfiguration: $billingDetailsCollectionConfiguration, removeSavedPaymentMethodMessage: $removeSavedPaymentMethodMessage, preferredNetworks: $preferredNetworks, cardBrandAcceptance: $cardBrandAcceptance)'; - } +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SetupParametersImpl && - (identical(other.customFlow, customFlow) || - other.customFlow == customFlow) && - (identical(other.customerId, customerId) || - other.customerId == customerId) && - (identical(other.primaryButtonLabel, primaryButtonLabel) || - other.primaryButtonLabel == primaryButtonLabel) && - (identical(other.customerEphemeralKeySecret, customerEphemeralKeySecret) || - other.customerEphemeralKeySecret == - customerEphemeralKeySecret) && - (identical(other.customerSessionClientSecret, customerSessionClientSecret) || - other.customerSessionClientSecret == - customerSessionClientSecret) && - (identical(other.paymentIntentClientSecret, paymentIntentClientSecret) || - other.paymentIntentClientSecret == paymentIntentClientSecret) && - (identical(other.setupIntentClientSecret, setupIntentClientSecret) || - other.setupIntentClientSecret == setupIntentClientSecret) && - (identical(other.intentConfiguration, intentConfiguration) || - other.intentConfiguration == intentConfiguration) && - (identical(other.merchantDisplayName, merchantDisplayName) || - other.merchantDisplayName == merchantDisplayName) && - (identical(other.applePay, applePay) || - other.applePay == applePay) && - (identical(other.style, style) || other.style == style) && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay) && - (identical(other.allowsDelayedPaymentMethods, allowsDelayedPaymentMethods) || - other.allowsDelayedPaymentMethods == - allowsDelayedPaymentMethods) && - (identical(other.appearance, appearance) || - other.appearance == appearance) && - (identical(other.billingDetails, billingDetails) || - other.billingDetails == billingDetails) && - (identical(other.allowsRemovalOfLastSavedPaymentMethod, allowsRemovalOfLastSavedPaymentMethod) || - other.allowsRemovalOfLastSavedPaymentMethod == - allowsRemovalOfLastSavedPaymentMethod) && - const DeepCollectionEquality() - .equals(other._paymentMethodOrder, _paymentMethodOrder) && - (identical(other.returnURL, returnURL) || - other.returnURL == returnURL) && - (identical(other.billingDetailsCollectionConfiguration, billingDetailsCollectionConfiguration) || - other.billingDetailsCollectionConfiguration == - billingDetailsCollectionConfiguration) && - (identical(other.removeSavedPaymentMethodMessage, removeSavedPaymentMethodMessage) || other.removeSavedPaymentMethodMessage == removeSavedPaymentMethodMessage) && - const DeepCollectionEquality().equals(other._preferredNetworks, _preferredNetworks) && - (identical(other.cardBrandAcceptance, cardBrandAcceptance) || other.cardBrandAcceptance == cardBrandAcceptance)); - } +/// @nodoc +abstract mixin class _$SetupParametersCopyWith<$Res> implements $SetupPaymentSheetParametersCopyWith<$Res> { + factory _$SetupParametersCopyWith(_SetupParameters value, $Res Function(_SetupParameters) _then) = __$SetupParametersCopyWithImpl; +@override @useResult +$Res call({ + bool customFlow, String? customerId, String? primaryButtonLabel, String? customerEphemeralKeySecret, String? customerSessionClientSecret, String? paymentIntentClientSecret, String? setupIntentClientSecret, IntentConfiguration? intentConfiguration, String? merchantDisplayName, PaymentSheetApplePay? applePay,@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetGooglePay? googlePay, LinkDisplayParams? linkDisplayParams, bool allowsDelayedPaymentMethods, PaymentSheetAppearance? appearance,@JsonKey(name: 'defaultBillingDetails') BillingDetails? billingDetails, bool? allowsRemovalOfLastSavedPaymentMethod, List? paymentMethodOrder, String? returnURL, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? removeSavedPaymentMethodMessage,@JsonKey(toJson: _cardBrandListToJson) List? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, CustomPaymentMethodConfiguration? customPaymentMethodConfiguration +}); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hashAll([ - runtimeType, - customFlow, - customerId, - primaryButtonLabel, - customerEphemeralKeySecret, - customerSessionClientSecret, - paymentIntentClientSecret, - setupIntentClientSecret, - intentConfiguration, - merchantDisplayName, - applePay, - style, - googlePay, - allowsDelayedPaymentMethods, - appearance, - billingDetails, - allowsRemovalOfLastSavedPaymentMethod, - const DeepCollectionEquality().hash(_paymentMethodOrder), - returnURL, - billingDetailsCollectionConfiguration, - removeSavedPaymentMethodMessage, - const DeepCollectionEquality().hash(_preferredNetworks), - cardBrandAcceptance - ]); - - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SetupParametersImplCopyWith<_$SetupParametersImpl> get copyWith => - __$$SetupParametersImplCopyWithImpl<_$SetupParametersImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$SetupParametersImplToJson( - this, - ); - } -} -abstract class _SetupParameters implements SetupPaymentSheetParameters { - const factory _SetupParameters( - {final bool customFlow, - final String? customerId, - final String? primaryButtonLabel, - final String? customerEphemeralKeySecret, - final String? customerSessionClientSecret, - final String? paymentIntentClientSecret, - final String? setupIntentClientSecret, - final IntentConfiguration? intentConfiguration, - final String? merchantDisplayName, - final PaymentSheetApplePay? applePay, - @JsonKey(toJson: UserInterfaceStyleKey.toJson) final ThemeMode? style, - final PaymentSheetGooglePay? googlePay, - final bool allowsDelayedPaymentMethods, - final PaymentSheetAppearance? appearance, - @JsonKey(name: 'defaultBillingDetails') - final BillingDetails? billingDetails, - final bool? allowsRemovalOfLastSavedPaymentMethod, - final List? paymentMethodOrder, - final String? returnURL, - final BillingDetailsCollectionConfiguration? - billingDetailsCollectionConfiguration, - final String? removeSavedPaymentMethodMessage, - @JsonKey(toJson: _cardBrandListToJson) - final List? preferredNetworks, - final CardBrandAcceptance? cardBrandAcceptance}) = _$SetupParametersImpl; - - factory _SetupParameters.fromJson(Map json) = - _$SetupParametersImpl.fromJson; - - /// Whether or not to use a custom flow. - /// - /// If this value is true, the payment sheet will allow to select a payment method - /// and a later confirmation will be needed by calling [confirmPaymentSheetPayment] - /// By default, false. - @override - bool get customFlow; - - /// The identifier of the Stripe Customer object. - /// See https://stripe.com/docs/api/customers/object#customer_object-id - @override - String? get customerId; - - /// The label to use for the primary button. If not set, Payment Sheet will display suitable default labels for payment and setup intents - @override - String? get primaryButtonLabel; - - ///A temp key can be used for API operations that require a secret key. - @override - String? get customerEphemeralKeySecret; - - /// (Experimental) This parameter can be changed or removed at any time (use at your own risk). - /// The client secret of this Customer Session. Used on the client to set up secure access to the given customer. - @override - String? get customerSessionClientSecret; - - /// Secret used for client-side retrieval using a publishable key. - /// - /// If this value is null make sure to add a [setupIntentClientSecret] - @override - String? get paymentIntentClientSecret; - - /// The client secret of this SetupIntent - /// - /// If this value is null make sure to add a [paymentIntentClientSecret] - @override - String? get setupIntentClientSecret; - - /// Use this when you want to collect payment information before creating a - /// setupintent or payment intent. - @override - IntentConfiguration? get intentConfiguration; - - /// Display name of the merchant - @override - String? get merchantDisplayName; - - /// Configuration related to Apple Pay - /// If set, PaymentSheet displays Apple Pay as a payment option - @override - PaymentSheetApplePay? get applePay; - - /// iOS only style options for colors in PaymentSheet - /// - /// Parts can be overridden by [appearance]. - @override - @JsonKey(toJson: UserInterfaceStyleKey.toJson) - ThemeMode? get style; - - /// Configuration related to Google Pay - /// If set, PaymentSheet displays Google Pay as a payment option - @override - PaymentSheetGooglePay? get googlePay; - - /// Flag that allows payment methods that do not move money at the send of the checkout. - /// - /// Defaul value is false. - @override - bool get allowsDelayedPaymentMethods; - - /// Appearance of the paymentsheet. - /// - /// When no appearance defined it will fallback to [style] or Stripe default. - @override - PaymentSheetAppearance? get appearance; - - /// Default billing information of the customer. - /// - /// Use this field to already prefill the customers billingDetails in the payment sheet. - /// For example when you supply a country the country will be set on the payment sheet + - /// alternative localization options. This does not set the billingDetails on the - /// paymentIntent since the customer can change those. - @override - @JsonKey(name: 'defaultBillingDetails') - BillingDetails? get billingDetails; - - ///This is an experimental feature that may be removed at any time. - /// Defaults to true. If true, the customer can delete all saved payment methods. - /// If false, the customer can't delete if they only have one saved payment method remaining. - @override - bool? get allowsRemovalOfLastSavedPaymentMethod; - - /// By default, PaymentSheet will use a dynamic ordering that optimizes payment method display for the customer. - /// You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types. - /// See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods. - /// Example: ["card", "external_paypal", "klarna"] - /// If you omit payment methods from this list, they’ll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored. - @override - List? get paymentMethodOrder; - - /// Return URL is required for IDEAL, Klarna and few other payment methods - @override - String? get returnURL; - - /// Configuration for how billing details are collected during checkout. - @override - BillingDetailsCollectionConfiguration? - get billingDetailsCollectionConfiguration; - - /// Optional configuration to display a custom message when a saved payment method is removed. iOS only. - @override - String? get removeSavedPaymentMethodMessage; - - /// The list of preferred networks that should be used to process payments made with a co-branded card. - /// This value will only be used if your user hasn't selected a network themselves. - @override - @JsonKey(toJson: _cardBrandListToJson) - List? get preferredNetworks; - - /// By default, PaymentSheet will accept all supported cards by Stripe. - /// You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands. - /// - /// Note: This is only a client-side solution. - ///Note: Card brand filtering is not currently supported in Link. - @override - CardBrandAcceptance? get cardBrandAcceptance; - - /// Create a copy of SetupPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SetupParametersImplCopyWith<_$SetupParametersImpl> get copyWith => - throw _privateConstructorUsedError; -} - -IntentConfiguration _$IntentConfigurationFromJson(Map json) { - return _IntentConfiguration.fromJson(json); +@override $IntentConfigurationCopyWith<$Res>? get intentConfiguration;@override $PaymentSheetApplePayCopyWith<$Res>? get applePay;@override $PaymentSheetGooglePayCopyWith<$Res>? get googlePay;@override $LinkDisplayParamsCopyWith<$Res>? get linkDisplayParams;@override $PaymentSheetAppearanceCopyWith<$Res>? get appearance;@override $BillingDetailsCopyWith<$Res>? get billingDetails;@override $BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration;@override $CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance;@override $CustomPaymentMethodConfigurationCopyWith<$Res>? get customPaymentMethodConfiguration; + +} +/// @nodoc +class __$SetupParametersCopyWithImpl<$Res> + implements _$SetupParametersCopyWith<$Res> { + __$SetupParametersCopyWithImpl(this._self, this._then); + + final _SetupParameters _self; + final $Res Function(_SetupParameters) _then; + +/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? customFlow = null,Object? customerId = freezed,Object? primaryButtonLabel = freezed,Object? customerEphemeralKeySecret = freezed,Object? customerSessionClientSecret = freezed,Object? paymentIntentClientSecret = freezed,Object? setupIntentClientSecret = freezed,Object? intentConfiguration = freezed,Object? merchantDisplayName = freezed,Object? applePay = freezed,Object? style = freezed,Object? googlePay = freezed,Object? linkDisplayParams = freezed,Object? allowsDelayedPaymentMethods = null,Object? appearance = freezed,Object? billingDetails = freezed,Object? allowsRemovalOfLastSavedPaymentMethod = freezed,Object? paymentMethodOrder = freezed,Object? returnURL = freezed,Object? billingDetailsCollectionConfiguration = freezed,Object? removeSavedPaymentMethodMessage = freezed,Object? preferredNetworks = freezed,Object? cardBrandAcceptance = freezed,Object? customPaymentMethodConfiguration = freezed,}) { + return _then(_SetupParameters( +customFlow: null == customFlow ? _self.customFlow : customFlow // ignore: cast_nullable_to_non_nullable +as bool,customerId: freezed == customerId ? _self.customerId : customerId // ignore: cast_nullable_to_non_nullable +as String?,primaryButtonLabel: freezed == primaryButtonLabel ? _self.primaryButtonLabel : primaryButtonLabel // ignore: cast_nullable_to_non_nullable +as String?,customerEphemeralKeySecret: freezed == customerEphemeralKeySecret ? _self.customerEphemeralKeySecret : customerEphemeralKeySecret // ignore: cast_nullable_to_non_nullable +as String?,customerSessionClientSecret: freezed == customerSessionClientSecret ? _self.customerSessionClientSecret : customerSessionClientSecret // ignore: cast_nullable_to_non_nullable +as String?,paymentIntentClientSecret: freezed == paymentIntentClientSecret ? _self.paymentIntentClientSecret : paymentIntentClientSecret // ignore: cast_nullable_to_non_nullable +as String?,setupIntentClientSecret: freezed == setupIntentClientSecret ? _self.setupIntentClientSecret : setupIntentClientSecret // ignore: cast_nullable_to_non_nullable +as String?,intentConfiguration: freezed == intentConfiguration ? _self.intentConfiguration : intentConfiguration // ignore: cast_nullable_to_non_nullable +as IntentConfiguration?,merchantDisplayName: freezed == merchantDisplayName ? _self.merchantDisplayName : merchantDisplayName // ignore: cast_nullable_to_non_nullable +as String?,applePay: freezed == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as PaymentSheetApplePay?,style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as ThemeMode?,googlePay: freezed == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as PaymentSheetGooglePay?,linkDisplayParams: freezed == linkDisplayParams ? _self.linkDisplayParams : linkDisplayParams // ignore: cast_nullable_to_non_nullable +as LinkDisplayParams?,allowsDelayedPaymentMethods: null == allowsDelayedPaymentMethods ? _self.allowsDelayedPaymentMethods : allowsDelayedPaymentMethods // ignore: cast_nullable_to_non_nullable +as bool,appearance: freezed == appearance ? _self.appearance : appearance // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearance?,billingDetails: freezed == billingDetails ? _self.billingDetails : billingDetails // ignore: cast_nullable_to_non_nullable +as BillingDetails?,allowsRemovalOfLastSavedPaymentMethod: freezed == allowsRemovalOfLastSavedPaymentMethod ? _self.allowsRemovalOfLastSavedPaymentMethod : allowsRemovalOfLastSavedPaymentMethod // ignore: cast_nullable_to_non_nullable +as bool?,paymentMethodOrder: freezed == paymentMethodOrder ? _self._paymentMethodOrder : paymentMethodOrder // ignore: cast_nullable_to_non_nullable +as List?,returnURL: freezed == returnURL ? _self.returnURL : returnURL // ignore: cast_nullable_to_non_nullable +as String?,billingDetailsCollectionConfiguration: freezed == billingDetailsCollectionConfiguration ? _self.billingDetailsCollectionConfiguration : billingDetailsCollectionConfiguration // ignore: cast_nullable_to_non_nullable +as BillingDetailsCollectionConfiguration?,removeSavedPaymentMethodMessage: freezed == removeSavedPaymentMethodMessage ? _self.removeSavedPaymentMethodMessage : removeSavedPaymentMethodMessage // ignore: cast_nullable_to_non_nullable +as String?,preferredNetworks: freezed == preferredNetworks ? _self._preferredNetworks : preferredNetworks // ignore: cast_nullable_to_non_nullable +as List?,cardBrandAcceptance: freezed == cardBrandAcceptance ? _self.cardBrandAcceptance : cardBrandAcceptance // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptance?,customPaymentMethodConfiguration: freezed == customPaymentMethodConfiguration ? _self.customPaymentMethodConfiguration : customPaymentMethodConfiguration // ignore: cast_nullable_to_non_nullable +as CustomPaymentMethodConfiguration?, + )); +} + +/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IntentConfigurationCopyWith<$Res>? get intentConfiguration { + if (_self.intentConfiguration == null) { + return null; + } + + return $IntentConfigurationCopyWith<$Res>(_self.intentConfiguration!, (value) { + return _then(_self.copyWith(intentConfiguration: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetApplePayCopyWith<$Res>? get applePay { + if (_self.applePay == null) { + return null; + } + + return $PaymentSheetApplePayCopyWith<$Res>(_self.applePay!, (value) { + return _then(_self.copyWith(applePay: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetGooglePayCopyWith<$Res>? get googlePay { + if (_self.googlePay == null) { + return null; + } + + return $PaymentSheetGooglePayCopyWith<$Res>(_self.googlePay!, (value) { + return _then(_self.copyWith(googlePay: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LinkDisplayParamsCopyWith<$Res>? get linkDisplayParams { + if (_self.linkDisplayParams == null) { + return null; + } + + return $LinkDisplayParamsCopyWith<$Res>(_self.linkDisplayParams!, (value) { + return _then(_self.copyWith(linkDisplayParams: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith<$Res>? get appearance { + if (_self.appearance == null) { + return null; + } + + return $PaymentSheetAppearanceCopyWith<$Res>(_self.appearance!, (value) { + return _then(_self.copyWith(appearance: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCopyWith<$Res>? get billingDetails { + if (_self.billingDetails == null) { + return null; + } + + return $BillingDetailsCopyWith<$Res>(_self.billingDetails!, (value) { + return _then(_self.copyWith(billingDetails: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BillingDetailsCollectionConfigurationCopyWith<$Res>? get billingDetailsCollectionConfiguration { + if (_self.billingDetailsCollectionConfiguration == null) { + return null; + } + + return $BillingDetailsCollectionConfigurationCopyWith<$Res>(_self.billingDetailsCollectionConfiguration!, (value) { + return _then(_self.copyWith(billingDetailsCollectionConfiguration: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CardBrandAcceptanceCopyWith<$Res>? get cardBrandAcceptance { + if (_self.cardBrandAcceptance == null) { + return null; + } + + return $CardBrandAcceptanceCopyWith<$Res>(_self.cardBrandAcceptance!, (value) { + return _then(_self.copyWith(cardBrandAcceptance: value)); + }); +}/// Create a copy of SetupPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CustomPaymentMethodConfigurationCopyWith<$Res>? get customPaymentMethodConfiguration { + if (_self.customPaymentMethodConfiguration == null) { + return null; + } + + return $CustomPaymentMethodConfigurationCopyWith<$Res>(_self.customPaymentMethodConfiguration!, (value) { + return _then(_self.copyWith(customPaymentMethodConfiguration: value)); + }); +} } + /// @nodoc mixin _$IntentConfiguration { - /// Data related to the future payment intent - IntentMode get mode => throw _privateConstructorUsedError; - - /// The list of payment method types that the customer can use in the payment sheet. - /// - /// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. - List? get paymentMethodTypes => throw _privateConstructorUsedError; - /// Called when the customer confirms payment. Your implementation should create - /// a payment intent or setupintent on your server and call the intent creation callback with its client secret or an error if one occurred. - @JsonKey(includeFromJson: false, includeToJson: false) - ConfirmHandler? get confirmHandler => throw _privateConstructorUsedError; +/// Data related to the future payment intent + IntentMode get mode;/// The list of payment method types that the customer can use in the payment sheet. +/// +/// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. + List? get paymentMethodTypes;/// Called when the customer confirms payment. Your implementation should create +/// a payment intent or setupintent on your server and call the intent creation callback with its client secret or an error if one occurred. +@JsonKey(includeFromJson: false, includeToJson: false) ConfirmHandler? get confirmHandler; +/// Create a copy of IntentConfiguration +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IntentConfigurationCopyWith get copyWith => _$IntentConfigurationCopyWithImpl(this as IntentConfiguration, _$identity); /// Serializes this IntentConfiguration to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of IntentConfiguration - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IntentConfigurationCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IntentConfiguration&&(identical(other.mode, mode) || other.mode == mode)&&const DeepCollectionEquality().equals(other.paymentMethodTypes, paymentMethodTypes)&&(identical(other.confirmHandler, confirmHandler) || other.confirmHandler == confirmHandler)); } -/// @nodoc -abstract class $IntentConfigurationCopyWith<$Res> { - factory $IntentConfigurationCopyWith( - IntentConfiguration value, $Res Function(IntentConfiguration) then) = - _$IntentConfigurationCopyWithImpl<$Res, IntentConfiguration>; - @useResult - $Res call( - {IntentMode mode, - List? paymentMethodTypes, - @JsonKey(includeFromJson: false, includeToJson: false) - ConfirmHandler? confirmHandler}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,mode,const DeepCollectionEquality().hash(paymentMethodTypes),confirmHandler); - $IntentModeCopyWith<$Res> get mode; +@override +String toString() { + return 'IntentConfiguration(mode: $mode, paymentMethodTypes: $paymentMethodTypes, confirmHandler: $confirmHandler)'; } -/// @nodoc -class _$IntentConfigurationCopyWithImpl<$Res, $Val extends IntentConfiguration> - implements $IntentConfigurationCopyWith<$Res> { - _$IntentConfigurationCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of IntentConfiguration - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? mode = null, - Object? paymentMethodTypes = freezed, - Object? confirmHandler = freezed, - }) { - return _then(_value.copyWith( - mode: null == mode - ? _value.mode - : mode // ignore: cast_nullable_to_non_nullable - as IntentMode, - paymentMethodTypes: freezed == paymentMethodTypes - ? _value.paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List?, - confirmHandler: freezed == confirmHandler - ? _value.confirmHandler - : confirmHandler // ignore: cast_nullable_to_non_nullable - as ConfirmHandler?, - ) as $Val); - } - /// Create a copy of IntentConfiguration - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $IntentModeCopyWith<$Res> get mode { - return $IntentModeCopyWith<$Res>(_value.mode, (value) { - return _then(_value.copyWith(mode: value) as $Val); - }); - } } /// @nodoc -abstract class _$$IntentConfigurationImplCopyWith<$Res> +abstract mixin class $IntentConfigurationCopyWith<$Res> { + factory $IntentConfigurationCopyWith(IntentConfiguration value, $Res Function(IntentConfiguration) _then) = _$IntentConfigurationCopyWithImpl; +@useResult +$Res call({ + IntentMode mode, List? paymentMethodTypes,@JsonKey(includeFromJson: false, includeToJson: false) ConfirmHandler? confirmHandler +}); + + +$IntentModeCopyWith<$Res> get mode; + +} +/// @nodoc +class _$IntentConfigurationCopyWithImpl<$Res> implements $IntentConfigurationCopyWith<$Res> { - factory _$$IntentConfigurationImplCopyWith(_$IntentConfigurationImpl value, - $Res Function(_$IntentConfigurationImpl) then) = - __$$IntentConfigurationImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {IntentMode mode, - List? paymentMethodTypes, - @JsonKey(includeFromJson: false, includeToJson: false) - ConfirmHandler? confirmHandler}); - - @override - $IntentModeCopyWith<$Res> get mode; -} - -/// @nodoc -class __$$IntentConfigurationImplCopyWithImpl<$Res> - extends _$IntentConfigurationCopyWithImpl<$Res, _$IntentConfigurationImpl> - implements _$$IntentConfigurationImplCopyWith<$Res> { - __$$IntentConfigurationImplCopyWithImpl(_$IntentConfigurationImpl _value, - $Res Function(_$IntentConfigurationImpl) _then) - : super(_value, _then); - - /// Create a copy of IntentConfiguration - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? mode = null, - Object? paymentMethodTypes = freezed, - Object? confirmHandler = freezed, - }) { - return _then(_$IntentConfigurationImpl( - mode: null == mode - ? _value.mode - : mode // ignore: cast_nullable_to_non_nullable - as IntentMode, - paymentMethodTypes: freezed == paymentMethodTypes - ? _value._paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List?, - confirmHandler: freezed == confirmHandler - ? _value.confirmHandler - : confirmHandler // ignore: cast_nullable_to_non_nullable - as ConfirmHandler?, - )); - } + _$IntentConfigurationCopyWithImpl(this._self, this._then); + + final IntentConfiguration _self; + final $Res Function(IntentConfiguration) _then; + +/// Create a copy of IntentConfiguration +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? mode = null,Object? paymentMethodTypes = freezed,Object? confirmHandler = freezed,}) { + return _then(_self.copyWith( +mode: null == mode ? _self.mode : mode // ignore: cast_nullable_to_non_nullable +as IntentMode,paymentMethodTypes: freezed == paymentMethodTypes ? _self.paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List?,confirmHandler: freezed == confirmHandler ? _self.confirmHandler : confirmHandler // ignore: cast_nullable_to_non_nullable +as ConfirmHandler?, + )); +} +/// Create a copy of IntentConfiguration +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IntentModeCopyWith<$Res> get mode { + + return $IntentModeCopyWith<$Res>(_self.mode, (value) { + return _then(_self.copyWith(mode: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [IntentConfiguration]. +extension IntentConfigurationPatterns on IntentConfiguration { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IntentConfiguration value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IntentConfiguration() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IntentConfiguration value) $default,){ +final _that = this; +switch (_that) { +case _IntentConfiguration(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IntentConfiguration value)? $default,){ +final _that = this; +switch (_that) { +case _IntentConfiguration() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( IntentMode mode, List? paymentMethodTypes, @JsonKey(includeFromJson: false, includeToJson: false) ConfirmHandler? confirmHandler)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IntentConfiguration() when $default != null: +return $default(_that.mode,_that.paymentMethodTypes,_that.confirmHandler);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( IntentMode mode, List? paymentMethodTypes, @JsonKey(includeFromJson: false, includeToJson: false) ConfirmHandler? confirmHandler) $default,) {final _that = this; +switch (_that) { +case _IntentConfiguration(): +return $default(_that.mode,_that.paymentMethodTypes,_that.confirmHandler);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( IntentMode mode, List? paymentMethodTypes, @JsonKey(includeFromJson: false, includeToJson: false) ConfirmHandler? confirmHandler)? $default,) {final _that = this; +switch (_that) { +case _IntentConfiguration() when $default != null: +return $default(_that.mode,_that.paymentMethodTypes,_that.confirmHandler);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$IntentConfigurationImpl implements _IntentConfiguration { - const _$IntentConfigurationImpl( - {required this.mode, - final List? paymentMethodTypes, - @JsonKey(includeFromJson: false, includeToJson: false) - this.confirmHandler}) - : _paymentMethodTypes = paymentMethodTypes; - - factory _$IntentConfigurationImpl.fromJson(Map json) => - _$$IntentConfigurationImplFromJson(json); - - /// Data related to the future payment intent - @override - final IntentMode mode; - - /// The list of payment method types that the customer can use in the payment sheet. - /// - /// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. - final List? _paymentMethodTypes; - - /// The list of payment method types that the customer can use in the payment sheet. - /// - /// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. - @override - List? get paymentMethodTypes { - final value = _paymentMethodTypes; - if (value == null) return null; - if (_paymentMethodTypes is EqualUnmodifiableListView) - return _paymentMethodTypes; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _IntentConfiguration implements IntentConfiguration { + const _IntentConfiguration({required this.mode, final List? paymentMethodTypes, @JsonKey(includeFromJson: false, includeToJson: false) this.confirmHandler}): _paymentMethodTypes = paymentMethodTypes; + factory _IntentConfiguration.fromJson(Map json) => _$IntentConfigurationFromJson(json); - /// Called when the customer confirms payment. Your implementation should create - /// a payment intent or setupintent on your server and call the intent creation callback with its client secret or an error if one occurred. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - final ConfirmHandler? confirmHandler; +/// Data related to the future payment intent +@override final IntentMode mode; +/// The list of payment method types that the customer can use in the payment sheet. +/// +/// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. + final List? _paymentMethodTypes; +/// The list of payment method types that the customer can use in the payment sheet. +/// +/// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. +@override List? get paymentMethodTypes { + final value = _paymentMethodTypes; + if (value == null) return null; + if (_paymentMethodTypes is EqualUnmodifiableListView) return _paymentMethodTypes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - @override - String toString() { - return 'IntentConfiguration(mode: $mode, paymentMethodTypes: $paymentMethodTypes, confirmHandler: $confirmHandler)'; - } +/// Called when the customer confirms payment. Your implementation should create +/// a payment intent or setupintent on your server and call the intent creation callback with its client secret or an error if one occurred. +@override@JsonKey(includeFromJson: false, includeToJson: false) final ConfirmHandler? confirmHandler; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IntentConfigurationImpl && - (identical(other.mode, mode) || other.mode == mode) && - const DeepCollectionEquality() - .equals(other._paymentMethodTypes, _paymentMethodTypes) && - (identical(other.confirmHandler, confirmHandler) || - other.confirmHandler == confirmHandler)); - } +/// Create a copy of IntentConfiguration +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IntentConfigurationCopyWith<_IntentConfiguration> get copyWith => __$IntentConfigurationCopyWithImpl<_IntentConfiguration>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, mode, - const DeepCollectionEquality().hash(_paymentMethodTypes), confirmHandler); - - /// Create a copy of IntentConfiguration - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IntentConfigurationImplCopyWith<_$IntentConfigurationImpl> get copyWith => - __$$IntentConfigurationImplCopyWithImpl<_$IntentConfigurationImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$IntentConfigurationImplToJson( - this, - ); - } +@override +Map toJson() { + return _$IntentConfigurationToJson(this, ); } -abstract class _IntentConfiguration implements IntentConfiguration { - const factory _IntentConfiguration( - {required final IntentMode mode, - final List? paymentMethodTypes, - @JsonKey(includeFromJson: false, includeToJson: false) - final ConfirmHandler? confirmHandler}) = _$IntentConfigurationImpl; - - factory _IntentConfiguration.fromJson(Map json) = - _$IntentConfigurationImpl.fromJson; - - /// Data related to the future payment intent - @override - IntentMode get mode; - - /// The list of payment method types that the customer can use in the payment sheet. - /// - /// If not set, the payment sheet will display all the payment methods enabled in your Stripe dashboard. - @override - List? get paymentMethodTypes; - - /// Called when the customer confirms payment. Your implementation should create - /// a payment intent or setupintent on your server and call the intent creation callback with its client secret or an error if one occurred. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - ConfirmHandler? get confirmHandler; - - /// Create a copy of IntentConfiguration - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IntentConfigurationImplCopyWith<_$IntentConfigurationImpl> get copyWith => - throw _privateConstructorUsedError; -} - -IntentMode _$IntentModeFromJson(Map json) { - switch (json['runtimeType']) { - case 'paymentMode': - return _PaymentMode.fromJson(json); - case 'setupMode': - return _SetupMode.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'runtimeType', 'IntentMode', - 'Invalid union type "${json['runtimeType']}"!'); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IntentConfiguration&&(identical(other.mode, mode) || other.mode == mode)&&const DeepCollectionEquality().equals(other._paymentMethodTypes, _paymentMethodTypes)&&(identical(other.confirmHandler, confirmHandler) || other.confirmHandler == confirmHandler)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,mode,const DeepCollectionEquality().hash(_paymentMethodTypes),confirmHandler); + +@override +String toString() { + return 'IntentConfiguration(mode: $mode, paymentMethodTypes: $paymentMethodTypes, confirmHandler: $confirmHandler)'; +} + + +} + +/// @nodoc +abstract mixin class _$IntentConfigurationCopyWith<$Res> implements $IntentConfigurationCopyWith<$Res> { + factory _$IntentConfigurationCopyWith(_IntentConfiguration value, $Res Function(_IntentConfiguration) _then) = __$IntentConfigurationCopyWithImpl; +@override @useResult +$Res call({ + IntentMode mode, List? paymentMethodTypes,@JsonKey(includeFromJson: false, includeToJson: false) ConfirmHandler? confirmHandler +}); + + +@override $IntentModeCopyWith<$Res> get mode; + +} +/// @nodoc +class __$IntentConfigurationCopyWithImpl<$Res> + implements _$IntentConfigurationCopyWith<$Res> { + __$IntentConfigurationCopyWithImpl(this._self, this._then); + + final _IntentConfiguration _self; + final $Res Function(_IntentConfiguration) _then; + +/// Create a copy of IntentConfiguration +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? mode = null,Object? paymentMethodTypes = freezed,Object? confirmHandler = freezed,}) { + return _then(_IntentConfiguration( +mode: null == mode ? _self.mode : mode // ignore: cast_nullable_to_non_nullable +as IntentMode,paymentMethodTypes: freezed == paymentMethodTypes ? _self._paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List?,confirmHandler: freezed == confirmHandler ? _self.confirmHandler : confirmHandler // ignore: cast_nullable_to_non_nullable +as ConfirmHandler?, + )); +} + +/// Create a copy of IntentConfiguration +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$IntentModeCopyWith<$Res> get mode { + + return $IntentModeCopyWith<$Res>(_self.mode, (value) { + return _then(_self.copyWith(mode: value)); + }); +} +} + +IntentMode _$IntentModeFromJson( + Map json +) { + switch (json['runtimeType']) { + case 'paymentMode': + return _PaymentMode.fromJson( + json + ); + case 'setupMode': + return _SetupMode.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'runtimeType', + 'IntentMode', + 'Invalid union type "${json['runtimeType']}"!' +); + } + } /// @nodoc mixin _$IntentMode { - String? get currencyCode => throw _privateConstructorUsedError; - - /// Data related to the future payment intent - IntentFutureUsage? get setupFutureUsage => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod) - paymentMode, - required TResult Function( - String? currencyCode, IntentFutureUsage setupFutureUsage) - setupMode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod)? - paymentMode, - TResult? Function(String? currencyCode, IntentFutureUsage setupFutureUsage)? - setupMode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod)? - paymentMode, - TResult Function(String? currencyCode, IntentFutureUsage setupFutureUsage)? - setupMode, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMode value) paymentMode, - required TResult Function(_SetupMode value) setupMode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMode value)? paymentMode, - TResult? Function(_SetupMode value)? setupMode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMode value)? paymentMode, - TResult Function(_SetupMode value)? setupMode, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + + String? get currencyCode;/// Data related to the future payment intent + IntentFutureUsage? get setupFutureUsage; +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IntentModeCopyWith get copyWith => _$IntentModeCopyWithImpl(this as IntentMode, _$identity); /// Serializes this IntentMode to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IntentModeCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IntentMode&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); } -/// @nodoc -abstract class $IntentModeCopyWith<$Res> { - factory $IntentModeCopyWith( - IntentMode value, $Res Function(IntentMode) then) = - _$IntentModeCopyWithImpl<$Res, IntentMode>; - @useResult - $Res call({String currencyCode, IntentFutureUsage setupFutureUsage}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,currencyCode,setupFutureUsage); + +@override +String toString() { + return 'IntentMode(currencyCode: $currencyCode, setupFutureUsage: $setupFutureUsage)'; } -/// @nodoc -class _$IntentModeCopyWithImpl<$Res, $Val extends IntentMode> - implements $IntentModeCopyWith<$Res> { - _$IntentModeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currencyCode = null, - Object? setupFutureUsage = null, - }) { - return _then(_value.copyWith( - currencyCode: null == currencyCode - ? _value.currencyCode! - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - setupFutureUsage: null == setupFutureUsage - ? _value.setupFutureUsage! - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as IntentFutureUsage, - ) as $Val); - } + } /// @nodoc -abstract class _$$PaymentModeImplCopyWith<$Res> +abstract mixin class $IntentModeCopyWith<$Res> { + factory $IntentModeCopyWith(IntentMode value, $Res Function(IntentMode) _then) = _$IntentModeCopyWithImpl; +@useResult +$Res call({ + String currencyCode, IntentFutureUsage setupFutureUsage +}); + + + + +} +/// @nodoc +class _$IntentModeCopyWithImpl<$Res> implements $IntentModeCopyWith<$Res> { - factory _$$PaymentModeImplCopyWith( - _$PaymentModeImpl value, $Res Function(_$PaymentModeImpl) then) = - __$$PaymentModeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String currencyCode, - int amount, - IntentFutureUsage? setupFutureUsage, - CaptureMethod? captureMethod}); -} - -/// @nodoc -class __$$PaymentModeImplCopyWithImpl<$Res> - extends _$IntentModeCopyWithImpl<$Res, _$PaymentModeImpl> - implements _$$PaymentModeImplCopyWith<$Res> { - __$$PaymentModeImplCopyWithImpl( - _$PaymentModeImpl _value, $Res Function(_$PaymentModeImpl) _then) - : super(_value, _then); - - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currencyCode = null, - Object? amount = null, - Object? setupFutureUsage = freezed, - Object? captureMethod = freezed, - }) { - return _then(_$PaymentModeImpl( - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - setupFutureUsage: freezed == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as IntentFutureUsage?, - captureMethod: freezed == captureMethod - ? _value.captureMethod - : captureMethod // ignore: cast_nullable_to_non_nullable - as CaptureMethod?, - )); - } + _$IntentModeCopyWithImpl(this._self, this._then); + + final IntentMode _self; + final $Res Function(IntentMode) _then; + +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? currencyCode = null,Object? setupFutureUsage = null,}) { + return _then(_self.copyWith( +currencyCode: null == currencyCode ? _self.currencyCode! : currencyCode // ignore: cast_nullable_to_non_nullable +as String,setupFutureUsage: null == setupFutureUsage ? _self.setupFutureUsage! : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as IntentFutureUsage, + )); +} + +} + + +/// Adds pattern-matching-related methods to [IntentMode]. +extension IntentModePatterns on IntentMode { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _PaymentMode value)? paymentMode,TResult Function( _SetupMode value)? setupMode,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentMode() when paymentMode != null: +return paymentMode(_that);case _SetupMode() when setupMode != null: +return setupMode(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _PaymentMode value) paymentMode,required TResult Function( _SetupMode value) setupMode,}){ +final _that = this; +switch (_that) { +case _PaymentMode(): +return paymentMode(_that);case _SetupMode(): +return setupMode(_that);} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _PaymentMode value)? paymentMode,TResult? Function( _SetupMode value)? setupMode,}){ +final _that = this; +switch (_that) { +case _PaymentMode() when paymentMode != null: +return paymentMode(_that);case _SetupMode() when setupMode != null: +return setupMode(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( String currencyCode, int amount, IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod, PaymentMethodOptions? paymentMethodOptions)? paymentMode,TResult Function( String? currencyCode, IntentFutureUsage setupFutureUsage)? setupMode,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentMode() when paymentMode != null: +return paymentMode(_that.currencyCode,_that.amount,_that.setupFutureUsage,_that.captureMethod,_that.paymentMethodOptions);case _SetupMode() when setupMode != null: +return setupMode(_that.currencyCode,_that.setupFutureUsage);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( String currencyCode, int amount, IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod, PaymentMethodOptions? paymentMethodOptions) paymentMode,required TResult Function( String? currencyCode, IntentFutureUsage setupFutureUsage) setupMode,}) {final _that = this; +switch (_that) { +case _PaymentMode(): +return paymentMode(_that.currencyCode,_that.amount,_that.setupFutureUsage,_that.captureMethod,_that.paymentMethodOptions);case _SetupMode(): +return setupMode(_that.currencyCode,_that.setupFutureUsage);} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( String currencyCode, int amount, IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod, PaymentMethodOptions? paymentMethodOptions)? paymentMode,TResult? Function( String? currencyCode, IntentFutureUsage setupFutureUsage)? setupMode,}) {final _that = this; +switch (_that) { +case _PaymentMode() when paymentMode != null: +return paymentMode(_that.currencyCode,_that.amount,_that.setupFutureUsage,_that.captureMethod,_that.paymentMethodOptions);case _SetupMode() when setupMode != null: +return setupMode(_that.currencyCode,_that.setupFutureUsage);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true, includeIfNull: false) -class _$PaymentModeImpl implements _PaymentMode { - const _$PaymentModeImpl( - {required this.currencyCode, - required this.amount, - this.setupFutureUsage, - this.captureMethod, - final String? $type}) - : $type = $type ?? 'paymentMode'; - - factory _$PaymentModeImpl.fromJson(Map json) => - _$$PaymentModeImplFromJson(json); - - @override - final String currencyCode; - @override - final int amount; - - /// Data related to the future payment intent - @override - final IntentFutureUsage? setupFutureUsage; - - /// Capture method for the future payment intent - @override - final CaptureMethod? captureMethod; - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'IntentMode.paymentMode(currencyCode: $currencyCode, amount: $amount, setupFutureUsage: $setupFutureUsage, captureMethod: $captureMethod)'; - } +class _PaymentMode implements IntentMode { + const _PaymentMode({required this.currencyCode, required this.amount, this.setupFutureUsage, this.captureMethod, this.paymentMethodOptions, final String? $type}): $type = $type ?? 'paymentMode'; + factory _PaymentMode.fromJson(Map json) => _$PaymentModeFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentModeImpl && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage) && - (identical(other.captureMethod, captureMethod) || - other.captureMethod == captureMethod)); - } +@override final String currencyCode; + final int amount; +/// Data related to the future payment intent +@override final IntentFutureUsage? setupFutureUsage; +/// Capture method for the future payment intent + final CaptureMethod? captureMethod; +/// Payment method options + final PaymentMethodOptions? paymentMethodOptions; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, currencyCode, amount, setupFutureUsage, captureMethod); - - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentModeImplCopyWith<_$PaymentModeImpl> get copyWith => - __$$PaymentModeImplCopyWithImpl<_$PaymentModeImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod) - paymentMode, - required TResult Function( - String? currencyCode, IntentFutureUsage setupFutureUsage) - setupMode, - }) { - return paymentMode(currencyCode, amount, setupFutureUsage, captureMethod); - } +@JsonKey(name: 'runtimeType') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod)? - paymentMode, - TResult? Function(String? currencyCode, IntentFutureUsage setupFutureUsage)? - setupMode, - }) { - return paymentMode?.call( - currencyCode, amount, setupFutureUsage, captureMethod); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod)? - paymentMode, - TResult Function(String? currencyCode, IntentFutureUsage setupFutureUsage)? - setupMode, - required TResult orElse(), - }) { - if (paymentMode != null) { - return paymentMode(currencyCode, amount, setupFutureUsage, captureMethod); - } - return orElse(); - } +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentModeCopyWith<_PaymentMode> get copyWith => __$PaymentModeCopyWithImpl<_PaymentMode>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMode value) paymentMode, - required TResult Function(_SetupMode value) setupMode, - }) { - return paymentMode(this); - } +@override +Map toJson() { + return _$PaymentModeToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMode value)? paymentMode, - TResult? Function(_SetupMode value)? setupMode, - }) { - return paymentMode?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentMode&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)&&(identical(other.captureMethod, captureMethod) || other.captureMethod == captureMethod)&&(identical(other.paymentMethodOptions, paymentMethodOptions) || other.paymentMethodOptions == paymentMethodOptions)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMode value)? paymentMode, - TResult Function(_SetupMode value)? setupMode, - required TResult orElse(), - }) { - if (paymentMode != null) { - return paymentMode(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,currencyCode,amount,setupFutureUsage,captureMethod,paymentMethodOptions); - @override - Map toJson() { - return _$$PaymentModeImplToJson( - this, - ); - } +@override +String toString() { + return 'IntentMode.paymentMode(currencyCode: $currencyCode, amount: $amount, setupFutureUsage: $setupFutureUsage, captureMethod: $captureMethod, paymentMethodOptions: $paymentMethodOptions)'; } -abstract class _PaymentMode implements IntentMode { - const factory _PaymentMode( - {required final String currencyCode, - required final int amount, - final IntentFutureUsage? setupFutureUsage, - final CaptureMethod? captureMethod}) = _$PaymentModeImpl; - factory _PaymentMode.fromJson(Map json) = - _$PaymentModeImpl.fromJson; +} - @override - String get currencyCode; - int get amount; +/// @nodoc +abstract mixin class _$PaymentModeCopyWith<$Res> implements $IntentModeCopyWith<$Res> { + factory _$PaymentModeCopyWith(_PaymentMode value, $Res Function(_PaymentMode) _then) = __$PaymentModeCopyWithImpl; +@override @useResult +$Res call({ + String currencyCode, int amount, IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod, PaymentMethodOptions? paymentMethodOptions +}); - /// Data related to the future payment intent - @override - IntentFutureUsage? get setupFutureUsage; - /// Capture method for the future payment intent - CaptureMethod? get captureMethod; +$PaymentMethodOptionsCopyWith<$Res>? get paymentMethodOptions; - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentModeImplCopyWith<_$PaymentModeImpl> get copyWith => - throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$SetupModeImplCopyWith<$Res> - implements $IntentModeCopyWith<$Res> { - factory _$$SetupModeImplCopyWith( - _$SetupModeImpl value, $Res Function(_$SetupModeImpl) then) = - __$$SetupModeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? currencyCode, IntentFutureUsage setupFutureUsage}); -} - -/// @nodoc -class __$$SetupModeImplCopyWithImpl<$Res> - extends _$IntentModeCopyWithImpl<$Res, _$SetupModeImpl> - implements _$$SetupModeImplCopyWith<$Res> { - __$$SetupModeImplCopyWithImpl( - _$SetupModeImpl _value, $Res Function(_$SetupModeImpl) _then) - : super(_value, _then); - - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? currencyCode = freezed, - Object? setupFutureUsage = null, - }) { - return _then(_$SetupModeImpl( - currencyCode: freezed == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String?, - setupFutureUsage: null == setupFutureUsage - ? _value.setupFutureUsage - : setupFutureUsage // ignore: cast_nullable_to_non_nullable - as IntentFutureUsage, - )); +class __$PaymentModeCopyWithImpl<$Res> + implements _$PaymentModeCopyWith<$Res> { + __$PaymentModeCopyWithImpl(this._self, this._then); + + final _PaymentMode _self; + final $Res Function(_PaymentMode) _then; + +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? currencyCode = null,Object? amount = null,Object? setupFutureUsage = freezed,Object? captureMethod = freezed,Object? paymentMethodOptions = freezed,}) { + return _then(_PaymentMode( +currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int,setupFutureUsage: freezed == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as IntentFutureUsage?,captureMethod: freezed == captureMethod ? _self.captureMethod : captureMethod // ignore: cast_nullable_to_non_nullable +as CaptureMethod?,paymentMethodOptions: freezed == paymentMethodOptions ? _self.paymentMethodOptions : paymentMethodOptions // ignore: cast_nullable_to_non_nullable +as PaymentMethodOptions?, + )); +} + +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodOptionsCopyWith<$Res>? get paymentMethodOptions { + if (_self.paymentMethodOptions == null) { + return null; } + + return $PaymentMethodOptionsCopyWith<$Res>(_self.paymentMethodOptions!, (value) { + return _then(_self.copyWith(paymentMethodOptions: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$SetupModeImpl implements _SetupMode { - const _$SetupModeImpl( - {this.currencyCode, required this.setupFutureUsage, final String? $type}) - : $type = $type ?? 'setupMode'; +class _SetupMode implements IntentMode { + const _SetupMode({this.currencyCode, required this.setupFutureUsage, final String? $type}): $type = $type ?? 'setupMode'; + factory _SetupMode.fromJson(Map json) => _$SetupModeFromJson(json); - factory _$SetupModeImpl.fromJson(Map json) => - _$$SetupModeImplFromJson(json); +@override final String? currencyCode; +/// Data related to the future payment intent +@override final IntentFutureUsage setupFutureUsage; - @override - final String? currencyCode; +@JsonKey(name: 'runtimeType') +final String $type; - /// Data related to the future payment intent - @override - final IntentFutureUsage setupFutureUsage; - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'IntentMode.setupMode(currencyCode: $currencyCode, setupFutureUsage: $setupFutureUsage)'; - } +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SetupModeCopyWith<_SetupMode> get copyWith => __$SetupModeCopyWithImpl<_SetupMode>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SetupModeImpl && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode) && - (identical(other.setupFutureUsage, setupFutureUsage) || - other.setupFutureUsage == setupFutureUsage)); - } +@override +Map toJson() { + return _$SetupModeToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, currencyCode, setupFutureUsage); - - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SetupModeImplCopyWith<_$SetupModeImpl> get copyWith => - __$$SetupModeImplCopyWithImpl<_$SetupModeImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod) - paymentMode, - required TResult Function( - String? currencyCode, IntentFutureUsage setupFutureUsage) - setupMode, - }) { - return setupMode(currencyCode, setupFutureUsage); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SetupMode&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.setupFutureUsage, setupFutureUsage) || other.setupFutureUsage == setupFutureUsage)); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod)? - paymentMode, - TResult? Function(String? currencyCode, IntentFutureUsage setupFutureUsage)? - setupMode, - }) { - return setupMode?.call(currencyCode, setupFutureUsage); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,currencyCode,setupFutureUsage); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String currencyCode, int amount, - IntentFutureUsage? setupFutureUsage, CaptureMethod? captureMethod)? - paymentMode, - TResult Function(String? currencyCode, IntentFutureUsage setupFutureUsage)? - setupMode, - required TResult orElse(), - }) { - if (setupMode != null) { - return setupMode(currencyCode, setupFutureUsage); - } - return orElse(); - } +@override +String toString() { + return 'IntentMode.setupMode(currencyCode: $currencyCode, setupFutureUsage: $setupFutureUsage)'; +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentMode value) paymentMode, - required TResult Function(_SetupMode value) setupMode, - }) { - return setupMode(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentMode value)? paymentMode, - TResult? Function(_SetupMode value)? setupMode, - }) { - return setupMode?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentMode value)? paymentMode, - TResult Function(_SetupMode value)? setupMode, - required TResult orElse(), - }) { - if (setupMode != null) { - return setupMode(this); - } - return orElse(); - } +/// @nodoc +abstract mixin class _$SetupModeCopyWith<$Res> implements $IntentModeCopyWith<$Res> { + factory _$SetupModeCopyWith(_SetupMode value, $Res Function(_SetupMode) _then) = __$SetupModeCopyWithImpl; +@override @useResult +$Res call({ + String? currencyCode, IntentFutureUsage setupFutureUsage +}); - @override - Map toJson() { - return _$$SetupModeImplToJson( - this, - ); - } -} -abstract class _SetupMode implements IntentMode { - const factory _SetupMode( - {final String? currencyCode, - required final IntentFutureUsage setupFutureUsage}) = _$SetupModeImpl; - factory _SetupMode.fromJson(Map json) = - _$SetupModeImpl.fromJson; - @override - String? get currencyCode; +} +/// @nodoc +class __$SetupModeCopyWithImpl<$Res> + implements _$SetupModeCopyWith<$Res> { + __$SetupModeCopyWithImpl(this._self, this._then); - /// Data related to the future payment intent - @override - IntentFutureUsage get setupFutureUsage; + final _SetupMode _self; + final $Res Function(_SetupMode) _then; - /// Create a copy of IntentMode - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SetupModeImplCopyWith<_$SetupModeImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of IntentMode +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? currencyCode = freezed,Object? setupFutureUsage = null,}) { + return _then(_SetupMode( +currencyCode: freezed == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String?,setupFutureUsage: null == setupFutureUsage ? _self.setupFutureUsage : setupFutureUsage // ignore: cast_nullable_to_non_nullable +as IntentFutureUsage, + )); } -PaymentSheetApplePay _$PaymentSheetApplePayFromJson(Map json) { - return _PaymentSheetApplePay.fromJson(json); + } + /// @nodoc mixin _$PaymentSheetApplePay { - ///The two-letter ISO 3166 code of the country of your business, e.g. "US" - String get merchantCountryCode => throw _privateConstructorUsedError; - ///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent - /// for a recurring payment, you should set this to display the amount you intend to charge. - List? get cartItems => - throw _privateConstructorUsedError; +///The two-letter ISO 3166 code of the country of your business, e.g. "US" + String get merchantCountryCode;///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent +/// for a recurring payment, you should set this to display the amount you intend to charge. + List? get cartItems;/// Sets the the text displayed by the call to action button in the apple pay sheet. + PlatformButtonType? get buttonType;/// Use this for a different payment request than a one time request. + PaymentRequestType? get request;/// Callback function for setting the order details (retrieved from your server) to give users the +/// ability to track and manage their purchases in Wallet. Stripe calls your implementation after the +/// payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion` +/// function, or else the Apple Pay sheet will hang. +@JsonKey(includeFromJson: false, includeToJson: false) OnOrderTracking? get setOrderTracking; +/// Create a copy of PaymentSheetApplePay +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetApplePayCopyWith get copyWith => _$PaymentSheetApplePayCopyWithImpl(this as PaymentSheetApplePay, _$identity); + + /// Serializes this PaymentSheetApplePay to a JSON map. + Map toJson(); - /// Sets the the text displayed by the call to action button in the apple pay sheet. - PlatformButtonType? get buttonType => throw _privateConstructorUsedError; - /// Use this for a different payment request than a one time request. - PaymentRequestType? get request => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetApplePay&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&const DeepCollectionEquality().equals(other.cartItems, cartItems)&&(identical(other.buttonType, buttonType) || other.buttonType == buttonType)&&(identical(other.request, request) || other.request == request)&&(identical(other.setOrderTracking, setOrderTracking) || other.setOrderTracking == setOrderTracking)); +} - /// Callback function for setting the order details (retrieved from your server) to give users the - /// ability to track and manage their purchases in Wallet. Stripe calls your implementation after the - /// payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion` - /// function, or else the Apple Pay sheet will hang. - @JsonKey(includeFromJson: false, includeToJson: false) - OnOrderTracking? get setOrderTracking => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantCountryCode,const DeepCollectionEquality().hash(cartItems),buttonType,request,setOrderTracking); + +@override +String toString() { + return 'PaymentSheetApplePay(merchantCountryCode: $merchantCountryCode, cartItems: $cartItems, buttonType: $buttonType, request: $request, setOrderTracking: $setOrderTracking)'; +} - /// Serializes this PaymentSheetApplePay to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetApplePay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetApplePayCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentSheetApplePayCopyWith<$Res> { - factory $PaymentSheetApplePayCopyWith(PaymentSheetApplePay value, - $Res Function(PaymentSheetApplePay) then) = - _$PaymentSheetApplePayCopyWithImpl<$Res, PaymentSheetApplePay>; - @useResult - $Res call( - {String merchantCountryCode, - List? cartItems, - PlatformButtonType? buttonType, - PaymentRequestType? request, - @JsonKey(includeFromJson: false, includeToJson: false) - OnOrderTracking? setOrderTracking}); +abstract mixin class $PaymentSheetApplePayCopyWith<$Res> { + factory $PaymentSheetApplePayCopyWith(PaymentSheetApplePay value, $Res Function(PaymentSheetApplePay) _then) = _$PaymentSheetApplePayCopyWithImpl; +@useResult +$Res call({ + String merchantCountryCode, List? cartItems, PlatformButtonType? buttonType, PaymentRequestType? request,@JsonKey(includeFromJson: false, includeToJson: false) OnOrderTracking? setOrderTracking +}); - $PaymentRequestTypeCopyWith<$Res>? get request; -} +$PaymentRequestTypeCopyWith<$Res>? get request; + +} /// @nodoc -class _$PaymentSheetApplePayCopyWithImpl<$Res, - $Val extends PaymentSheetApplePay> +class _$PaymentSheetApplePayCopyWithImpl<$Res> implements $PaymentSheetApplePayCopyWith<$Res> { - _$PaymentSheetApplePayCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetApplePay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantCountryCode = null, - Object? cartItems = freezed, - Object? buttonType = freezed, - Object? request = freezed, - Object? setOrderTracking = freezed, - }) { - return _then(_value.copyWith( - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - cartItems: freezed == cartItems - ? _value.cartItems - : cartItems // ignore: cast_nullable_to_non_nullable - as List?, - buttonType: freezed == buttonType - ? _value.buttonType - : buttonType // ignore: cast_nullable_to_non_nullable - as PlatformButtonType?, - request: freezed == request - ? _value.request - : request // ignore: cast_nullable_to_non_nullable - as PaymentRequestType?, - setOrderTracking: freezed == setOrderTracking - ? _value.setOrderTracking - : setOrderTracking // ignore: cast_nullable_to_non_nullable - as OnOrderTracking?, - ) as $Val); - } + _$PaymentSheetApplePayCopyWithImpl(this._self, this._then); + + final PaymentSheetApplePay _self; + final $Res Function(PaymentSheetApplePay) _then; + +/// Create a copy of PaymentSheetApplePay +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? merchantCountryCode = null,Object? cartItems = freezed,Object? buttonType = freezed,Object? request = freezed,Object? setOrderTracking = freezed,}) { + return _then(_self.copyWith( +merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,cartItems: freezed == cartItems ? _self.cartItems : cartItems // ignore: cast_nullable_to_non_nullable +as List?,buttonType: freezed == buttonType ? _self.buttonType : buttonType // ignore: cast_nullable_to_non_nullable +as PlatformButtonType?,request: freezed == request ? _self.request : request // ignore: cast_nullable_to_non_nullable +as PaymentRequestType?,setOrderTracking: freezed == setOrderTracking ? _self.setOrderTracking : setOrderTracking // ignore: cast_nullable_to_non_nullable +as OnOrderTracking?, + )); +} +/// Create a copy of PaymentSheetApplePay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentRequestTypeCopyWith<$Res>? get request { + if (_self.request == null) { + return null; + } + + return $PaymentRequestTypeCopyWith<$Res>(_self.request!, (value) { + return _then(_self.copyWith(request: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetApplePay]. +extension PaymentSheetApplePayPatterns on PaymentSheetApplePay { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetApplePay value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetApplePay() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetApplePay value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetApplePay(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetApplePay value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetApplePay() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String merchantCountryCode, List? cartItems, PlatformButtonType? buttonType, PaymentRequestType? request, @JsonKey(includeFromJson: false, includeToJson: false) OnOrderTracking? setOrderTracking)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetApplePay() when $default != null: +return $default(_that.merchantCountryCode,_that.cartItems,_that.buttonType,_that.request,_that.setOrderTracking);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String merchantCountryCode, List? cartItems, PlatformButtonType? buttonType, PaymentRequestType? request, @JsonKey(includeFromJson: false, includeToJson: false) OnOrderTracking? setOrderTracking) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetApplePay(): +return $default(_that.merchantCountryCode,_that.cartItems,_that.buttonType,_that.request,_that.setOrderTracking);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String merchantCountryCode, List? cartItems, PlatformButtonType? buttonType, PaymentRequestType? request, @JsonKey(includeFromJson: false, includeToJson: false) OnOrderTracking? setOrderTracking)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetApplePay() when $default != null: +return $default(_that.merchantCountryCode,_that.cartItems,_that.buttonType,_that.request,_that.setOrderTracking);case _: + return null; - /// Create a copy of PaymentSheetApplePay - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentRequestTypeCopyWith<$Res>? get request { - if (_value.request == null) { - return null; - } - - return $PaymentRequestTypeCopyWith<$Res>(_value.request!, (value) { - return _then(_value.copyWith(request: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$PaymentSheetApplePayImplCopyWith<$Res> - implements $PaymentSheetApplePayCopyWith<$Res> { - factory _$$PaymentSheetApplePayImplCopyWith(_$PaymentSheetApplePayImpl value, - $Res Function(_$PaymentSheetApplePayImpl) then) = - __$$PaymentSheetApplePayImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String merchantCountryCode, - List? cartItems, - PlatformButtonType? buttonType, - PaymentRequestType? request, - @JsonKey(includeFromJson: false, includeToJson: false) - OnOrderTracking? setOrderTracking}); - - @override - $PaymentRequestTypeCopyWith<$Res>? get request; -} - -/// @nodoc -class __$$PaymentSheetApplePayImplCopyWithImpl<$Res> - extends _$PaymentSheetApplePayCopyWithImpl<$Res, _$PaymentSheetApplePayImpl> - implements _$$PaymentSheetApplePayImplCopyWith<$Res> { - __$$PaymentSheetApplePayImplCopyWithImpl(_$PaymentSheetApplePayImpl _value, - $Res Function(_$PaymentSheetApplePayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetApplePay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantCountryCode = null, - Object? cartItems = freezed, - Object? buttonType = freezed, - Object? request = freezed, - Object? setOrderTracking = freezed, - }) { - return _then(_$PaymentSheetApplePayImpl( - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - cartItems: freezed == cartItems - ? _value._cartItems - : cartItems // ignore: cast_nullable_to_non_nullable - as List?, - buttonType: freezed == buttonType - ? _value.buttonType - : buttonType // ignore: cast_nullable_to_non_nullable - as PlatformButtonType?, - request: freezed == request - ? _value.request - : request // ignore: cast_nullable_to_non_nullable - as PaymentRequestType?, - setOrderTracking: freezed == setOrderTracking - ? _value.setOrderTracking - : setOrderTracking // ignore: cast_nullable_to_non_nullable - as OnOrderTracking?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentSheetApplePayImpl implements _PaymentSheetApplePay { - const _$PaymentSheetApplePayImpl( - {required this.merchantCountryCode, - final List? cartItems, - this.buttonType, - this.request, - @JsonKey(includeFromJson: false, includeToJson: false) - this.setOrderTracking}) - : _cartItems = cartItems; - - factory _$PaymentSheetApplePayImpl.fromJson(Map json) => - _$$PaymentSheetApplePayImplFromJson(json); - - ///The two-letter ISO 3166 code of the country of your business, e.g. "US" - @override - final String merchantCountryCode; - - ///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent - /// for a recurring payment, you should set this to display the amount you intend to charge. - final List? _cartItems; - - ///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent - /// for a recurring payment, you should set this to display the amount you intend to charge. - @override - List? get cartItems { - final value = _cartItems; - if (value == null) return null; - if (_cartItems is EqualUnmodifiableListView) return _cartItems; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _PaymentSheetApplePay implements PaymentSheetApplePay { + const _PaymentSheetApplePay({required this.merchantCountryCode, final List? cartItems, this.buttonType, this.request, @JsonKey(includeFromJson: false, includeToJson: false) this.setOrderTracking}): _cartItems = cartItems; + factory _PaymentSheetApplePay.fromJson(Map json) => _$PaymentSheetApplePayFromJson(json); - /// Sets the the text displayed by the call to action button in the apple pay sheet. - @override - final PlatformButtonType? buttonType; - - /// Use this for a different payment request than a one time request. - @override - final PaymentRequestType? request; - - /// Callback function for setting the order details (retrieved from your server) to give users the - /// ability to track and manage their purchases in Wallet. Stripe calls your implementation after the - /// payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion` - /// function, or else the Apple Pay sheet will hang. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - final OnOrderTracking? setOrderTracking; - - @override - String toString() { - return 'PaymentSheetApplePay(merchantCountryCode: $merchantCountryCode, cartItems: $cartItems, buttonType: $buttonType, request: $request, setOrderTracking: $setOrderTracking)'; - } +///The two-letter ISO 3166 code of the country of your business, e.g. "US" +@override final String merchantCountryCode; +///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent +/// for a recurring payment, you should set this to display the amount you intend to charge. + final List? _cartItems; +///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent +/// for a recurring payment, you should set this to display the amount you intend to charge. +@override List? get cartItems { + final value = _cartItems; + if (value == null) return null; + if (_cartItems is EqualUnmodifiableListView) return _cartItems; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetApplePayImpl && - (identical(other.merchantCountryCode, merchantCountryCode) || - other.merchantCountryCode == merchantCountryCode) && - const DeepCollectionEquality() - .equals(other._cartItems, _cartItems) && - (identical(other.buttonType, buttonType) || - other.buttonType == buttonType) && - (identical(other.request, request) || other.request == request) && - (identical(other.setOrderTracking, setOrderTracking) || - other.setOrderTracking == setOrderTracking)); - } +/// Sets the the text displayed by the call to action button in the apple pay sheet. +@override final PlatformButtonType? buttonType; +/// Use this for a different payment request than a one time request. +@override final PaymentRequestType? request; +/// Callback function for setting the order details (retrieved from your server) to give users the +/// ability to track and manage their purchases in Wallet. Stripe calls your implementation after the +/// payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion` +/// function, or else the Apple Pay sheet will hang. +@override@JsonKey(includeFromJson: false, includeToJson: false) final OnOrderTracking? setOrderTracking; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - merchantCountryCode, - const DeepCollectionEquality().hash(_cartItems), - buttonType, - request, - setOrderTracking); - - /// Create a copy of PaymentSheetApplePay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetApplePayImplCopyWith<_$PaymentSheetApplePayImpl> - get copyWith => - __$$PaymentSheetApplePayImplCopyWithImpl<_$PaymentSheetApplePayImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetApplePayImplToJson( - this, - ); - } +/// Create a copy of PaymentSheetApplePay +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetApplePayCopyWith<_PaymentSheetApplePay> get copyWith => __$PaymentSheetApplePayCopyWithImpl<_PaymentSheetApplePay>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetApplePayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetApplePay&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&const DeepCollectionEquality().equals(other._cartItems, _cartItems)&&(identical(other.buttonType, buttonType) || other.buttonType == buttonType)&&(identical(other.request, request) || other.request == request)&&(identical(other.setOrderTracking, setOrderTracking) || other.setOrderTracking == setOrderTracking)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantCountryCode,const DeepCollectionEquality().hash(_cartItems),buttonType,request,setOrderTracking); + +@override +String toString() { + return 'PaymentSheetApplePay(merchantCountryCode: $merchantCountryCode, cartItems: $cartItems, buttonType: $buttonType, request: $request, setOrderTracking: $setOrderTracking)'; } -abstract class _PaymentSheetApplePay implements PaymentSheetApplePay { - const factory _PaymentSheetApplePay( - {required final String merchantCountryCode, - final List? cartItems, - final PlatformButtonType? buttonType, - final PaymentRequestType? request, - @JsonKey(includeFromJson: false, includeToJson: false) - final OnOrderTracking? setOrderTracking}) = _$PaymentSheetApplePayImpl; - factory _PaymentSheetApplePay.fromJson(Map json) = - _$PaymentSheetApplePayImpl.fromJson; +} - ///The two-letter ISO 3166 code of the country of your business, e.g. "US" - @override - String get merchantCountryCode; +/// @nodoc +abstract mixin class _$PaymentSheetApplePayCopyWith<$Res> implements $PaymentSheetApplePayCopyWith<$Res> { + factory _$PaymentSheetApplePayCopyWith(_PaymentSheetApplePay value, $Res Function(_PaymentSheetApplePay) _then) = __$PaymentSheetApplePayCopyWithImpl; +@override @useResult +$Res call({ + String merchantCountryCode, List? cartItems, PlatformButtonType? buttonType, PaymentRequestType? request,@JsonKey(includeFromJson: false, includeToJson: false) OnOrderTracking? setOrderTracking +}); - ///An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent - /// for a recurring payment, you should set this to display the amount you intend to charge. - @override - List? get cartItems; - /// Sets the the text displayed by the call to action button in the apple pay sheet. - @override - PlatformButtonType? get buttonType; +@override $PaymentRequestTypeCopyWith<$Res>? get request; - /// Use this for a different payment request than a one time request. - @override - PaymentRequestType? get request; +} +/// @nodoc +class __$PaymentSheetApplePayCopyWithImpl<$Res> + implements _$PaymentSheetApplePayCopyWith<$Res> { + __$PaymentSheetApplePayCopyWithImpl(this._self, this._then); - /// Callback function for setting the order details (retrieved from your server) to give users the - /// ability to track and manage their purchases in Wallet. Stripe calls your implementation after the - /// payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion` - /// function, or else the Apple Pay sheet will hang. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - OnOrderTracking? get setOrderTracking; + final _PaymentSheetApplePay _self; + final $Res Function(_PaymentSheetApplePay) _then; - /// Create a copy of PaymentSheetApplePay - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetApplePayImplCopyWith<_$PaymentSheetApplePayImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentSheetApplePay +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? merchantCountryCode = null,Object? cartItems = freezed,Object? buttonType = freezed,Object? request = freezed,Object? setOrderTracking = freezed,}) { + return _then(_PaymentSheetApplePay( +merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,cartItems: freezed == cartItems ? _self._cartItems : cartItems // ignore: cast_nullable_to_non_nullable +as List?,buttonType: freezed == buttonType ? _self.buttonType : buttonType // ignore: cast_nullable_to_non_nullable +as PlatformButtonType?,request: freezed == request ? _self.request : request // ignore: cast_nullable_to_non_nullable +as PaymentRequestType?,setOrderTracking: freezed == setOrderTracking ? _self.setOrderTracking : setOrderTracking // ignore: cast_nullable_to_non_nullable +as OnOrderTracking?, + )); } -PaymentSheetGooglePay _$PaymentSheetGooglePayFromJson( - Map json) { - return _PaymentSheetGooglePay.fromJson(json); +/// Create a copy of PaymentSheetApplePay +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentRequestTypeCopyWith<$Res>? get request { + if (_self.request == null) { + return null; + } + + return $PaymentRequestTypeCopyWith<$Res>(_self.request!, (value) { + return _then(_self.copyWith(request: value)); + }); } +} + /// @nodoc mixin _$PaymentSheetGooglePay { - ///The two-letter ISO 3166 code of the country of your business, e.g. "US" - String get merchantCountryCode => throw _privateConstructorUsedError; - /// The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. - String? get currencyCode => throw _privateConstructorUsedError; +///The two-letter ISO 3166 code of the country of your business, e.g. "US" + String get merchantCountryCode;/// The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. + String? get currencyCode;/// Whether or not to use the google pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. + bool get testEnv;/// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. + String? get label;/// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. + String? get amount;/// The Google Pay button type to use. Set to "Pay" by default. +@JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) PlatformButtonType? get buttonType; +/// Create a copy of PaymentSheetGooglePay +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetGooglePayCopyWith get copyWith => _$PaymentSheetGooglePayCopyWithImpl(this as PaymentSheetGooglePay, _$identity); + + /// Serializes this PaymentSheetGooglePay to a JSON map. + Map toJson(); - /// Whether or not to use the google pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. - bool get testEnv => throw _privateConstructorUsedError; - /// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. - String? get label => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetGooglePay&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.buttonType, buttonType) || other.buttonType == buttonType)); +} - /// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. - String? get amount => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantCountryCode,currencyCode,testEnv,label,amount,buttonType); - /// The Google Pay button type to use. Set to "Pay" by default. - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - PlatformButtonType? get buttonType => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetGooglePay(merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, testEnv: $testEnv, label: $label, amount: $amount, buttonType: $buttonType)'; +} - /// Serializes this PaymentSheetGooglePay to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetGooglePay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetGooglePayCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentSheetGooglePayCopyWith<$Res> { - factory $PaymentSheetGooglePayCopyWith(PaymentSheetGooglePay value, - $Res Function(PaymentSheetGooglePay) then) = - _$PaymentSheetGooglePayCopyWithImpl<$Res, PaymentSheetGooglePay>; - @useResult - $Res call( - {String merchantCountryCode, - String? currencyCode, - bool testEnv, - String? label, - String? amount, - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - PlatformButtonType? buttonType}); -} +abstract mixin class $PaymentSheetGooglePayCopyWith<$Res> { + factory $PaymentSheetGooglePayCopyWith(PaymentSheetGooglePay value, $Res Function(PaymentSheetGooglePay) _then) = _$PaymentSheetGooglePayCopyWithImpl; +@useResult +$Res call({ + String merchantCountryCode, String? currencyCode, bool testEnv, String? label, String? amount,@JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) PlatformButtonType? buttonType +}); + + + +} /// @nodoc -class _$PaymentSheetGooglePayCopyWithImpl<$Res, - $Val extends PaymentSheetGooglePay> +class _$PaymentSheetGooglePayCopyWithImpl<$Res> implements $PaymentSheetGooglePayCopyWith<$Res> { - _$PaymentSheetGooglePayCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetGooglePay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantCountryCode = null, - Object? currencyCode = freezed, - Object? testEnv = null, - Object? label = freezed, - Object? amount = freezed, - Object? buttonType = freezed, - }) { - return _then(_value.copyWith( - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - currencyCode: freezed == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String?, - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - label: freezed == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String?, - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String?, - buttonType: freezed == buttonType - ? _value.buttonType - : buttonType // ignore: cast_nullable_to_non_nullable - as PlatformButtonType?, - ) as $Val); - } + _$PaymentSheetGooglePayCopyWithImpl(this._self, this._then); + + final PaymentSheetGooglePay _self; + final $Res Function(PaymentSheetGooglePay) _then; + +/// Create a copy of PaymentSheetGooglePay +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? merchantCountryCode = null,Object? currencyCode = freezed,Object? testEnv = null,Object? label = freezed,Object? amount = freezed,Object? buttonType = freezed,}) { + return _then(_self.copyWith( +merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,currencyCode: freezed == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String?,testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String?,buttonType: freezed == buttonType ? _self.buttonType : buttonType // ignore: cast_nullable_to_non_nullable +as PlatformButtonType?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentSheetGooglePay]. +extension PaymentSheetGooglePayPatterns on PaymentSheetGooglePay { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetGooglePay value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetGooglePay() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetGooglePay value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetGooglePay(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetGooglePay value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetGooglePay() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String merchantCountryCode, String? currencyCode, bool testEnv, String? label, String? amount, @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) PlatformButtonType? buttonType)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetGooglePay() when $default != null: +return $default(_that.merchantCountryCode,_that.currencyCode,_that.testEnv,_that.label,_that.amount,_that.buttonType);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String merchantCountryCode, String? currencyCode, bool testEnv, String? label, String? amount, @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) PlatformButtonType? buttonType) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetGooglePay(): +return $default(_that.merchantCountryCode,_that.currencyCode,_that.testEnv,_that.label,_that.amount,_that.buttonType);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String merchantCountryCode, String? currencyCode, bool testEnv, String? label, String? amount, @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) PlatformButtonType? buttonType)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetGooglePay() when $default != null: +return $default(_that.merchantCountryCode,_that.currencyCode,_that.testEnv,_that.label,_that.amount,_that.buttonType);case _: + return null; + +} } -/// @nodoc -abstract class _$$PaymentSheetGooglePayImplCopyWith<$Res> - implements $PaymentSheetGooglePayCopyWith<$Res> { - factory _$$PaymentSheetGooglePayImplCopyWith( - _$PaymentSheetGooglePayImpl value, - $Res Function(_$PaymentSheetGooglePayImpl) then) = - __$$PaymentSheetGooglePayImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String merchantCountryCode, - String? currencyCode, - bool testEnv, - String? label, - String? amount, - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - PlatformButtonType? buttonType}); -} - -/// @nodoc -class __$$PaymentSheetGooglePayImplCopyWithImpl<$Res> - extends _$PaymentSheetGooglePayCopyWithImpl<$Res, - _$PaymentSheetGooglePayImpl> - implements _$$PaymentSheetGooglePayImplCopyWith<$Res> { - __$$PaymentSheetGooglePayImplCopyWithImpl(_$PaymentSheetGooglePayImpl _value, - $Res Function(_$PaymentSheetGooglePayImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetGooglePay - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantCountryCode = null, - Object? currencyCode = freezed, - Object? testEnv = null, - Object? label = freezed, - Object? amount = freezed, - Object? buttonType = freezed, - }) { - return _then(_$PaymentSheetGooglePayImpl( - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - currencyCode: freezed == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String?, - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - label: freezed == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String?, - amount: freezed == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String?, - buttonType: freezed == buttonType - ? _value.buttonType - : buttonType // ignore: cast_nullable_to_non_nullable - as PlatformButtonType?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentSheetGooglePayImpl implements _PaymentSheetGooglePay { - const _$PaymentSheetGooglePayImpl( - {required this.merchantCountryCode, - this.currencyCode, - this.testEnv = false, - this.label, - this.amount, - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - this.buttonType}); - - factory _$PaymentSheetGooglePayImpl.fromJson(Map json) => - _$$PaymentSheetGooglePayImplFromJson(json); - - ///The two-letter ISO 3166 code of the country of your business, e.g. "US" - @override - final String merchantCountryCode; - - /// The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. - @override - final String? currencyCode; - - /// Whether or not to use the google pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. - @override - @JsonKey() - final bool testEnv; - - /// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. - @override - final String? label; - - /// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. - @override - final String? amount; - - /// The Google Pay button type to use. Set to "Pay" by default. - @override - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - final PlatformButtonType? buttonType; - - @override - String toString() { - return 'PaymentSheetGooglePay(merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, testEnv: $testEnv, label: $label, amount: $amount, buttonType: $buttonType)'; - } +class _PaymentSheetGooglePay implements PaymentSheetGooglePay { + const _PaymentSheetGooglePay({required this.merchantCountryCode, this.currencyCode, this.testEnv = false, this.label, this.amount, @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) this.buttonType}); + factory _PaymentSheetGooglePay.fromJson(Map json) => _$PaymentSheetGooglePayFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetGooglePayImpl && - (identical(other.merchantCountryCode, merchantCountryCode) || - other.merchantCountryCode == merchantCountryCode) && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode) && - (identical(other.testEnv, testEnv) || other.testEnv == testEnv) && - (identical(other.label, label) || other.label == label) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.buttonType, buttonType) || - other.buttonType == buttonType)); - } +///The two-letter ISO 3166 code of the country of your business, e.g. "US" +@override final String merchantCountryCode; +/// The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. +@override final String? currencyCode; +/// Whether or not to use the google pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. +@override@JsonKey() final bool testEnv; +/// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. +@override final String? label; +/// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. +@override final String? amount; +/// The Google Pay button type to use. Set to "Pay" by default. +@override@JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) final PlatformButtonType? buttonType; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, merchantCountryCode, - currencyCode, testEnv, label, amount, buttonType); - - /// Create a copy of PaymentSheetGooglePay - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetGooglePayImplCopyWith<_$PaymentSheetGooglePayImpl> - get copyWith => __$$PaymentSheetGooglePayImplCopyWithImpl< - _$PaymentSheetGooglePayImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetGooglePayImplToJson( - this, - ); - } +/// Create a copy of PaymentSheetGooglePay +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetGooglePayCopyWith<_PaymentSheetGooglePay> get copyWith => __$PaymentSheetGooglePayCopyWithImpl<_PaymentSheetGooglePay>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetGooglePayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetGooglePay&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.label, label) || other.label == label)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.buttonType, buttonType) || other.buttonType == buttonType)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantCountryCode,currencyCode,testEnv,label,amount,buttonType); + +@override +String toString() { + return 'PaymentSheetGooglePay(merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, testEnv: $testEnv, label: $label, amount: $amount, buttonType: $buttonType)'; } -abstract class _PaymentSheetGooglePay implements PaymentSheetGooglePay { - const factory _PaymentSheetGooglePay( - {required final String merchantCountryCode, - final String? currencyCode, - final bool testEnv, - final String? label, - final String? amount, - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - final PlatformButtonType? buttonType}) = _$PaymentSheetGooglePayImpl; - factory _PaymentSheetGooglePay.fromJson(Map json) = - _$PaymentSheetGooglePayImpl.fromJson; +} - ///The two-letter ISO 3166 code of the country of your business, e.g. "US" - @override - String get merchantCountryCode; +/// @nodoc +abstract mixin class _$PaymentSheetGooglePayCopyWith<$Res> implements $PaymentSheetGooglePayCopyWith<$Res> { + factory _$PaymentSheetGooglePayCopyWith(_PaymentSheetGooglePay value, $Res Function(_PaymentSheetGooglePay) _then) = __$PaymentSheetGooglePayCopyWithImpl; +@override @useResult +$Res call({ + String merchantCountryCode, String? currencyCode, bool testEnv, String? label, String? amount,@JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) PlatformButtonType? buttonType +}); - /// The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. - @override - String? get currencyCode; - /// Whether or not to use the google pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. - @override - bool get testEnv; - /// An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. - @override - String? get label; - /// An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. - @override - String? get amount; +} +/// @nodoc +class __$PaymentSheetGooglePayCopyWithImpl<$Res> + implements _$PaymentSheetGooglePayCopyWith<$Res> { + __$PaymentSheetGooglePayCopyWithImpl(this._self, this._then); - /// The Google Pay button type to use. Set to "Pay" by default. - @override - @JsonKey(toJson: PaymentSheetGooglePay.platformButtonTypeToJson) - PlatformButtonType? get buttonType; + final _PaymentSheetGooglePay _self; + final $Res Function(_PaymentSheetGooglePay) _then; - /// Create a copy of PaymentSheetGooglePay - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetGooglePayImplCopyWith<_$PaymentSheetGooglePayImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentSheetGooglePay +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? merchantCountryCode = null,Object? currencyCode = freezed,Object? testEnv = null,Object? label = freezed,Object? amount = freezed,Object? buttonType = freezed,}) { + return _then(_PaymentSheetGooglePay( +merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,currencyCode: freezed == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String?,testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String?,buttonType: freezed == buttonType ? _self.buttonType : buttonType // ignore: cast_nullable_to_non_nullable +as PlatformButtonType?, + )); } -PaymentSheetAppearance _$PaymentSheetAppearanceFromJson( - Map json) { - return _PaymentSheetAppearance.fromJson(json); + } + /// @nodoc mixin _$PaymentSheetAppearance { - /// Color parameters - PaymentSheetAppearanceColors? get colors => - throw _privateConstructorUsedError; - /// Shapes parameters - PaymentSheetShape? get shapes => throw _privateConstructorUsedError; - - /// PaymentSheet appearance - PaymentSheetPrimaryButtonAppearance? get primaryButton => - throw _privateConstructorUsedError; +/// Color parameters + PaymentSheetAppearanceColors? get colors;/// Shapes parameters + PaymentSheetShape? get shapes;/// PaymentSheet appearance + PaymentSheetPrimaryButtonAppearance? get primaryButton;/// Describes the appearance of the Embedded Mobile Payment Element + EmbeddedPaymentElementAppearance? get embeddedPaymentElement;/// Describes the inset values applied to Mobile Payment Element forms + EdgeInsetsConfig? get formInsetValues; +/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceCopyWith get copyWith => _$PaymentSheetAppearanceCopyWithImpl(this as PaymentSheetAppearance, _$identity); /// Serializes this PaymentSheetAppearance to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetAppearanceCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetAppearance&&(identical(other.colors, colors) || other.colors == colors)&&(identical(other.shapes, shapes) || other.shapes == shapes)&&(identical(other.primaryButton, primaryButton) || other.primaryButton == primaryButton)&&(identical(other.embeddedPaymentElement, embeddedPaymentElement) || other.embeddedPaymentElement == embeddedPaymentElement)&&(identical(other.formInsetValues, formInsetValues) || other.formInsetValues == formInsetValues)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,colors,shapes,primaryButton,embeddedPaymentElement,formInsetValues); + +@override +String toString() { + return 'PaymentSheetAppearance(colors: $colors, shapes: $shapes, primaryButton: $primaryButton, embeddedPaymentElement: $embeddedPaymentElement, formInsetValues: $formInsetValues)'; } -/// @nodoc -abstract class $PaymentSheetAppearanceCopyWith<$Res> { - factory $PaymentSheetAppearanceCopyWith(PaymentSheetAppearance value, - $Res Function(PaymentSheetAppearance) then) = - _$PaymentSheetAppearanceCopyWithImpl<$Res, PaymentSheetAppearance>; - @useResult - $Res call( - {PaymentSheetAppearanceColors? colors, - PaymentSheetShape? shapes, - PaymentSheetPrimaryButtonAppearance? primaryButton}); - $PaymentSheetAppearanceColorsCopyWith<$Res>? get colors; - $PaymentSheetShapeCopyWith<$Res>? get shapes; - $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton; } /// @nodoc -class _$PaymentSheetAppearanceCopyWithImpl<$Res, - $Val extends PaymentSheetAppearance> - implements $PaymentSheetAppearanceCopyWith<$Res> { - _$PaymentSheetAppearanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? colors = freezed, - Object? shapes = freezed, - Object? primaryButton = freezed, - }) { - return _then(_value.copyWith( - colors: freezed == colors - ? _value.colors - : colors // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearanceColors?, - shapes: freezed == shapes - ? _value.shapes - : shapes // ignore: cast_nullable_to_non_nullable - as PaymentSheetShape?, - primaryButton: freezed == primaryButton - ? _value.primaryButton - : primaryButton // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonAppearance?, - ) as $Val); - } +abstract mixin class $PaymentSheetAppearanceCopyWith<$Res> { + factory $PaymentSheetAppearanceCopyWith(PaymentSheetAppearance value, $Res Function(PaymentSheetAppearance) _then) = _$PaymentSheetAppearanceCopyWithImpl; +@useResult +$Res call({ + PaymentSheetAppearanceColors? colors, PaymentSheetShape? shapes, PaymentSheetPrimaryButtonAppearance? primaryButton, EmbeddedPaymentElementAppearance? embeddedPaymentElement, EdgeInsetsConfig? formInsetValues +}); - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetAppearanceColorsCopyWith<$Res>? get colors { - if (_value.colors == null) { - return null; - } - - return $PaymentSheetAppearanceColorsCopyWith<$Res>(_value.colors!, (value) { - return _then(_value.copyWith(colors: value) as $Val); - }); - } - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetShapeCopyWith<$Res>? get shapes { - if (_value.shapes == null) { - return null; - } - - return $PaymentSheetShapeCopyWith<$Res>(_value.shapes!, (value) { - return _then(_value.copyWith(shapes: value) as $Val); - }); - } +$PaymentSheetAppearanceColorsCopyWith<$Res>? get colors;$PaymentSheetShapeCopyWith<$Res>? get shapes;$PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton;$EmbeddedPaymentElementAppearanceCopyWith<$Res>? get embeddedPaymentElement;$EdgeInsetsConfigCopyWith<$Res>? get formInsetValues; - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton { - if (_value.primaryButton == null) { - return null; - } - - return $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>( - _value.primaryButton!, (value) { - return _then(_value.copyWith(primaryButton: value) as $Val); - }); - } } - /// @nodoc -abstract class _$$PaymentSheetAppearanceImplCopyWith<$Res> +class _$PaymentSheetAppearanceCopyWithImpl<$Res> implements $PaymentSheetAppearanceCopyWith<$Res> { - factory _$$PaymentSheetAppearanceImplCopyWith( - _$PaymentSheetAppearanceImpl value, - $Res Function(_$PaymentSheetAppearanceImpl) then) = - __$$PaymentSheetAppearanceImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentSheetAppearanceColors? colors, - PaymentSheetShape? shapes, - PaymentSheetPrimaryButtonAppearance? primaryButton}); - - @override - $PaymentSheetAppearanceColorsCopyWith<$Res>? get colors; - @override - $PaymentSheetShapeCopyWith<$Res>? get shapes; - @override - $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton; -} - -/// @nodoc -class __$$PaymentSheetAppearanceImplCopyWithImpl<$Res> - extends _$PaymentSheetAppearanceCopyWithImpl<$Res, - _$PaymentSheetAppearanceImpl> - implements _$$PaymentSheetAppearanceImplCopyWith<$Res> { - __$$PaymentSheetAppearanceImplCopyWithImpl( - _$PaymentSheetAppearanceImpl _value, - $Res Function(_$PaymentSheetAppearanceImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? colors = freezed, - Object? shapes = freezed, - Object? primaryButton = freezed, - }) { - return _then(_$PaymentSheetAppearanceImpl( - colors: freezed == colors - ? _value.colors - : colors // ignore: cast_nullable_to_non_nullable - as PaymentSheetAppearanceColors?, - shapes: freezed == shapes - ? _value.shapes - : shapes // ignore: cast_nullable_to_non_nullable - as PaymentSheetShape?, - primaryButton: freezed == primaryButton - ? _value.primaryButton - : primaryButton // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonAppearance?, - )); - } + _$PaymentSheetAppearanceCopyWithImpl(this._self, this._then); + + final PaymentSheetAppearance _self; + final $Res Function(PaymentSheetAppearance) _then; + +/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? colors = freezed,Object? shapes = freezed,Object? primaryButton = freezed,Object? embeddedPaymentElement = freezed,Object? formInsetValues = freezed,}) { + return _then(_self.copyWith( +colors: freezed == colors ? _self.colors : colors // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearanceColors?,shapes: freezed == shapes ? _self.shapes : shapes // ignore: cast_nullable_to_non_nullable +as PaymentSheetShape?,primaryButton: freezed == primaryButton ? _self.primaryButton : primaryButton // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonAppearance?,embeddedPaymentElement: freezed == embeddedPaymentElement ? _self.embeddedPaymentElement : embeddedPaymentElement // ignore: cast_nullable_to_non_nullable +as EmbeddedPaymentElementAppearance?,formInsetValues: freezed == formInsetValues ? _self.formInsetValues : formInsetValues // ignore: cast_nullable_to_non_nullable +as EdgeInsetsConfig?, + )); +} +/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceColorsCopyWith<$Res>? get colors { + if (_self.colors == null) { + return null; + } + + return $PaymentSheetAppearanceColorsCopyWith<$Res>(_self.colors!, (value) { + return _then(_self.copyWith(colors: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShapeCopyWith<$Res>? get shapes { + if (_self.shapes == null) { + return null; + } + + return $PaymentSheetShapeCopyWith<$Res>(_self.shapes!, (value) { + return _then(_self.copyWith(shapes: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton { + if (_self.primaryButton == null) { + return null; + } + + return $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>(_self.primaryButton!, (value) { + return _then(_self.copyWith(primaryButton: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$EmbeddedPaymentElementAppearanceCopyWith<$Res>? get embeddedPaymentElement { + if (_self.embeddedPaymentElement == null) { + return null; + } + + return $EmbeddedPaymentElementAppearanceCopyWith<$Res>(_self.embeddedPaymentElement!, (value) { + return _then(_self.copyWith(embeddedPaymentElement: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$EdgeInsetsConfigCopyWith<$Res>? get formInsetValues { + if (_self.formInsetValues == null) { + return null; + } + + return $EdgeInsetsConfigCopyWith<$Res>(_self.formInsetValues!, (value) { + return _then(_self.copyWith(formInsetValues: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetAppearance]. +extension PaymentSheetAppearancePatterns on PaymentSheetAppearance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetAppearance value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetAppearance() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetAppearance value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetAppearance(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetAppearance value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetAppearance() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentSheetAppearanceColors? colors, PaymentSheetShape? shapes, PaymentSheetPrimaryButtonAppearance? primaryButton, EmbeddedPaymentElementAppearance? embeddedPaymentElement, EdgeInsetsConfig? formInsetValues)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetAppearance() when $default != null: +return $default(_that.colors,_that.shapes,_that.primaryButton,_that.embeddedPaymentElement,_that.formInsetValues);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentSheetAppearanceColors? colors, PaymentSheetShape? shapes, PaymentSheetPrimaryButtonAppearance? primaryButton, EmbeddedPaymentElementAppearance? embeddedPaymentElement, EdgeInsetsConfig? formInsetValues) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetAppearance(): +return $default(_that.colors,_that.shapes,_that.primaryButton,_that.embeddedPaymentElement,_that.formInsetValues);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentSheetAppearanceColors? colors, PaymentSheetShape? shapes, PaymentSheetPrimaryButtonAppearance? primaryButton, EmbeddedPaymentElementAppearance? embeddedPaymentElement, EdgeInsetsConfig? formInsetValues)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetAppearance() when $default != null: +return $default(_that.colors,_that.shapes,_that.primaryButton,_that.embeddedPaymentElement,_that.formInsetValues);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentSheetAppearanceImpl implements _PaymentSheetAppearance { - const _$PaymentSheetAppearanceImpl( - {this.colors, this.shapes, this.primaryButton}); - - factory _$PaymentSheetAppearanceImpl.fromJson(Map json) => - _$$PaymentSheetAppearanceImplFromJson(json); +class _PaymentSheetAppearance implements PaymentSheetAppearance { + const _PaymentSheetAppearance({this.colors, this.shapes, this.primaryButton, this.embeddedPaymentElement, this.formInsetValues}); + factory _PaymentSheetAppearance.fromJson(Map json) => _$PaymentSheetAppearanceFromJson(json); - /// Color parameters - @override - final PaymentSheetAppearanceColors? colors; +/// Color parameters +@override final PaymentSheetAppearanceColors? colors; +/// Shapes parameters +@override final PaymentSheetShape? shapes; +/// PaymentSheet appearance +@override final PaymentSheetPrimaryButtonAppearance? primaryButton; +/// Describes the appearance of the Embedded Mobile Payment Element +@override final EmbeddedPaymentElementAppearance? embeddedPaymentElement; +/// Describes the inset values applied to Mobile Payment Element forms +@override final EdgeInsetsConfig? formInsetValues; - /// Shapes parameters - @override - final PaymentSheetShape? shapes; +/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetAppearanceCopyWith<_PaymentSheetAppearance> get copyWith => __$PaymentSheetAppearanceCopyWithImpl<_PaymentSheetAppearance>(this, _$identity); - /// PaymentSheet appearance - @override - final PaymentSheetPrimaryButtonAppearance? primaryButton; +@override +Map toJson() { + return _$PaymentSheetAppearanceToJson(this, ); +} - @override - String toString() { - return 'PaymentSheetAppearance(colors: $colors, shapes: $shapes, primaryButton: $primaryButton)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetAppearance&&(identical(other.colors, colors) || other.colors == colors)&&(identical(other.shapes, shapes) || other.shapes == shapes)&&(identical(other.primaryButton, primaryButton) || other.primaryButton == primaryButton)&&(identical(other.embeddedPaymentElement, embeddedPaymentElement) || other.embeddedPaymentElement == embeddedPaymentElement)&&(identical(other.formInsetValues, formInsetValues) || other.formInsetValues == formInsetValues)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetAppearanceImpl && - (identical(other.colors, colors) || other.colors == colors) && - (identical(other.shapes, shapes) || other.shapes == shapes) && - (identical(other.primaryButton, primaryButton) || - other.primaryButton == primaryButton)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,colors,shapes,primaryButton,embeddedPaymentElement,formInsetValues); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, colors, shapes, primaryButton); - - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetAppearanceImplCopyWith<_$PaymentSheetAppearanceImpl> - get copyWith => __$$PaymentSheetAppearanceImplCopyWithImpl< - _$PaymentSheetAppearanceImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetAppearanceImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentSheetAppearance(colors: $colors, shapes: $shapes, primaryButton: $primaryButton, embeddedPaymentElement: $embeddedPaymentElement, formInsetValues: $formInsetValues)'; } -abstract class _PaymentSheetAppearance implements PaymentSheetAppearance { - const factory _PaymentSheetAppearance( - {final PaymentSheetAppearanceColors? colors, - final PaymentSheetShape? shapes, - final PaymentSheetPrimaryButtonAppearance? primaryButton}) = - _$PaymentSheetAppearanceImpl; - factory _PaymentSheetAppearance.fromJson(Map json) = - _$PaymentSheetAppearanceImpl.fromJson; +} - /// Color parameters - @override - PaymentSheetAppearanceColors? get colors; +/// @nodoc +abstract mixin class _$PaymentSheetAppearanceCopyWith<$Res> implements $PaymentSheetAppearanceCopyWith<$Res> { + factory _$PaymentSheetAppearanceCopyWith(_PaymentSheetAppearance value, $Res Function(_PaymentSheetAppearance) _then) = __$PaymentSheetAppearanceCopyWithImpl; +@override @useResult +$Res call({ + PaymentSheetAppearanceColors? colors, PaymentSheetShape? shapes, PaymentSheetPrimaryButtonAppearance? primaryButton, EmbeddedPaymentElementAppearance? embeddedPaymentElement, EdgeInsetsConfig? formInsetValues +}); - /// Shapes parameters - @override - PaymentSheetShape? get shapes; - /// PaymentSheet appearance - @override - PaymentSheetPrimaryButtonAppearance? get primaryButton; +@override $PaymentSheetAppearanceColorsCopyWith<$Res>? get colors;@override $PaymentSheetShapeCopyWith<$Res>? get shapes;@override $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton;@override $EmbeddedPaymentElementAppearanceCopyWith<$Res>? get embeddedPaymentElement;@override $EdgeInsetsConfigCopyWith<$Res>? get formInsetValues; - /// Create a copy of PaymentSheetAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetAppearanceImplCopyWith<_$PaymentSheetAppearanceImpl> - get copyWith => throw _privateConstructorUsedError; } - -PaymentSheetAppearanceColors _$PaymentSheetAppearanceColorsFromJson( - Map json) { - return _PaymentSheetAppearanceColors.fromJson(json); +/// @nodoc +class __$PaymentSheetAppearanceCopyWithImpl<$Res> + implements _$PaymentSheetAppearanceCopyWith<$Res> { + __$PaymentSheetAppearanceCopyWithImpl(this._self, this._then); + + final _PaymentSheetAppearance _self; + final $Res Function(_PaymentSheetAppearance) _then; + +/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? colors = freezed,Object? shapes = freezed,Object? primaryButton = freezed,Object? embeddedPaymentElement = freezed,Object? formInsetValues = freezed,}) { + return _then(_PaymentSheetAppearance( +colors: freezed == colors ? _self.colors : colors // ignore: cast_nullable_to_non_nullable +as PaymentSheetAppearanceColors?,shapes: freezed == shapes ? _self.shapes : shapes // ignore: cast_nullable_to_non_nullable +as PaymentSheetShape?,primaryButton: freezed == primaryButton ? _self.primaryButton : primaryButton // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonAppearance?,embeddedPaymentElement: freezed == embeddedPaymentElement ? _self.embeddedPaymentElement : embeddedPaymentElement // ignore: cast_nullable_to_non_nullable +as EmbeddedPaymentElementAppearance?,formInsetValues: freezed == formInsetValues ? _self.formInsetValues : formInsetValues // ignore: cast_nullable_to_non_nullable +as EdgeInsetsConfig?, + )); +} + +/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceColorsCopyWith<$Res>? get colors { + if (_self.colors == null) { + return null; + } + + return $PaymentSheetAppearanceColorsCopyWith<$Res>(_self.colors!, (value) { + return _then(_self.copyWith(colors: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShapeCopyWith<$Res>? get shapes { + if (_self.shapes == null) { + return null; + } + + return $PaymentSheetShapeCopyWith<$Res>(_self.shapes!, (value) { + return _then(_self.copyWith(shapes: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>? get primaryButton { + if (_self.primaryButton == null) { + return null; + } + + return $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res>(_self.primaryButton!, (value) { + return _then(_self.copyWith(primaryButton: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$EmbeddedPaymentElementAppearanceCopyWith<$Res>? get embeddedPaymentElement { + if (_self.embeddedPaymentElement == null) { + return null; + } + + return $EmbeddedPaymentElementAppearanceCopyWith<$Res>(_self.embeddedPaymentElement!, (value) { + return _then(_self.copyWith(embeddedPaymentElement: value)); + }); +}/// Create a copy of PaymentSheetAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$EdgeInsetsConfigCopyWith<$Res>? get formInsetValues { + if (_self.formInsetValues == null) { + return null; + } + + return $EdgeInsetsConfigCopyWith<$Res>(_self.formInsetValues!, (value) { + return _then(_self.copyWith(formInsetValues: value)); + }); } +} + /// @nodoc mixin _$PaymentSheetAppearanceColors { - /// Color of the button that represents the primary action on the payment sheet. - /// - /// Make sure there is enough contrast with [background]. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get primary => throw _privateConstructorUsedError; - - /// Background color of the payment sheet. - /// - /// Make sure there is enough contrast with [primary]. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get background => throw _privateConstructorUsedError; - - /// Background color of the payment sheet components. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentBackground => throw _privateConstructorUsedError; - - /// Border color of the payment sheet components. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentBorder => throw _privateConstructorUsedError; - - /// Divider color of the payment sheet components. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentDivider => throw _privateConstructorUsedError; - - /// Color of the entered text in the payment components. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentText => throw _privateConstructorUsedError; - - /// Primary text color. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get primaryText => throw _privateConstructorUsedError; - - /// Secondary text color. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get secondaryText => throw _privateConstructorUsedError; - - /// Place holder text color. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderText => throw _privateConstructorUsedError; - - /// Color of the displayed icons - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get icon => throw _privateConstructorUsedError; - - /// Color of the warning and error messages. - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get error => throw _privateConstructorUsedError; + +/// Color of the button that represents the primary action on the payment sheet. +/// +/// Make sure there is enough contrast with [background]. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get primary;/// Background color of the payment sheet. +/// +/// Make sure there is enough contrast with [primary]. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get background;/// Background color of the payment sheet components. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get componentBackground;/// Border color of the payment sheet components. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get componentBorder;/// Divider color of the payment sheet components. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get componentDivider;/// Color of the entered text in the payment components. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get componentText;/// Primary text color. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get primaryText;/// Secondary text color. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get secondaryText;/// Place holder text color. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get placeholderText;/// Color of the displayed icons +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get icon;/// Color of the warning and error messages. +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get error; +/// Create a copy of PaymentSheetAppearanceColors +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetAppearanceColorsCopyWith get copyWith => _$PaymentSheetAppearanceColorsCopyWithImpl(this as PaymentSheetAppearanceColors, _$identity); /// Serializes this PaymentSheetAppearanceColors to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of PaymentSheetAppearanceColors - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetAppearanceColorsCopyWith - get copyWith => throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $PaymentSheetAppearanceColorsCopyWith<$Res> { - factory $PaymentSheetAppearanceColorsCopyWith( - PaymentSheetAppearanceColors value, - $Res Function(PaymentSheetAppearanceColors) then) = - _$PaymentSheetAppearanceColorsCopyWithImpl<$Res, - PaymentSheetAppearanceColors>; - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primary, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBackground, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBorder, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentDivider, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? secondaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? icon, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? error}); -} - -/// @nodoc -class _$PaymentSheetAppearanceColorsCopyWithImpl<$Res, - $Val extends PaymentSheetAppearanceColors> - implements $PaymentSheetAppearanceColorsCopyWith<$Res> { - _$PaymentSheetAppearanceColorsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetAppearanceColors - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? primary = freezed, - Object? background = freezed, - Object? componentBackground = freezed, - Object? componentBorder = freezed, - Object? componentDivider = freezed, - Object? componentText = freezed, - Object? primaryText = freezed, - Object? secondaryText = freezed, - Object? placeholderText = freezed, - Object? icon = freezed, - Object? error = freezed, - }) { - return _then(_value.copyWith( - primary: freezed == primary - ? _value.primary - : primary // ignore: cast_nullable_to_non_nullable - as Color?, - background: freezed == background - ? _value.background - : background // ignore: cast_nullable_to_non_nullable - as Color?, - componentBackground: freezed == componentBackground - ? _value.componentBackground - : componentBackground // ignore: cast_nullable_to_non_nullable - as Color?, - componentBorder: freezed == componentBorder - ? _value.componentBorder - : componentBorder // ignore: cast_nullable_to_non_nullable - as Color?, - componentDivider: freezed == componentDivider - ? _value.componentDivider - : componentDivider // ignore: cast_nullable_to_non_nullable - as Color?, - componentText: freezed == componentText - ? _value.componentText - : componentText // ignore: cast_nullable_to_non_nullable - as Color?, - primaryText: freezed == primaryText - ? _value.primaryText - : primaryText // ignore: cast_nullable_to_non_nullable - as Color?, - secondaryText: freezed == secondaryText - ? _value.secondaryText - : secondaryText // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderText: freezed == placeholderText - ? _value.placeholderText - : placeholderText // ignore: cast_nullable_to_non_nullable - as Color?, - icon: freezed == icon - ? _value.icon - : icon // ignore: cast_nullable_to_non_nullable - as Color?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as Color?, - ) as $Val); - } -} + Map toJson(); -/// @nodoc -abstract class _$$PaymentSheetAppearanceColorsImplCopyWith<$Res> - implements $PaymentSheetAppearanceColorsCopyWith<$Res> { - factory _$$PaymentSheetAppearanceColorsImplCopyWith( - _$PaymentSheetAppearanceColorsImpl value, - $Res Function(_$PaymentSheetAppearanceColorsImpl) then) = - __$$PaymentSheetAppearanceColorsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primary, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBackground, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentBorder, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentDivider, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? componentText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? primaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? secondaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? placeholderText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? icon, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? error}); -} - -/// @nodoc -class __$$PaymentSheetAppearanceColorsImplCopyWithImpl<$Res> - extends _$PaymentSheetAppearanceColorsCopyWithImpl<$Res, - _$PaymentSheetAppearanceColorsImpl> - implements _$$PaymentSheetAppearanceColorsImplCopyWith<$Res> { - __$$PaymentSheetAppearanceColorsImplCopyWithImpl( - _$PaymentSheetAppearanceColorsImpl _value, - $Res Function(_$PaymentSheetAppearanceColorsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetAppearanceColors - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? primary = freezed, - Object? background = freezed, - Object? componentBackground = freezed, - Object? componentBorder = freezed, - Object? componentDivider = freezed, - Object? componentText = freezed, - Object? primaryText = freezed, - Object? secondaryText = freezed, - Object? placeholderText = freezed, - Object? icon = freezed, - Object? error = freezed, - }) { - return _then(_$PaymentSheetAppearanceColorsImpl( - primary: freezed == primary - ? _value.primary - : primary // ignore: cast_nullable_to_non_nullable - as Color?, - background: freezed == background - ? _value.background - : background // ignore: cast_nullable_to_non_nullable - as Color?, - componentBackground: freezed == componentBackground - ? _value.componentBackground - : componentBackground // ignore: cast_nullable_to_non_nullable - as Color?, - componentBorder: freezed == componentBorder - ? _value.componentBorder - : componentBorder // ignore: cast_nullable_to_non_nullable - as Color?, - componentDivider: freezed == componentDivider - ? _value.componentDivider - : componentDivider // ignore: cast_nullable_to_non_nullable - as Color?, - componentText: freezed == componentText - ? _value.componentText - : componentText // ignore: cast_nullable_to_non_nullable - as Color?, - primaryText: freezed == primaryText - ? _value.primaryText - : primaryText // ignore: cast_nullable_to_non_nullable - as Color?, - secondaryText: freezed == secondaryText - ? _value.secondaryText - : secondaryText // ignore: cast_nullable_to_non_nullable - as Color?, - placeholderText: freezed == placeholderText - ? _value.placeholderText - : placeholderText // ignore: cast_nullable_to_non_nullable - as Color?, - icon: freezed == icon - ? _value.icon - : icon // ignore: cast_nullable_to_non_nullable - as Color?, - error: freezed == error - ? _value.error - : error // ignore: cast_nullable_to_non_nullable - as Color?, - )); - } -} -/// @nodoc -@JsonSerializable() -class _$PaymentSheetAppearanceColorsImpl - implements _PaymentSheetAppearanceColors { - const _$PaymentSheetAppearanceColorsImpl( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.primary, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentBackground, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentBorder, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentDivider, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.componentText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.primaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.secondaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.placeholderText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.icon, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.error}); - - factory _$PaymentSheetAppearanceColorsImpl.fromJson( - Map json) => - _$$PaymentSheetAppearanceColorsImplFromJson(json); - - /// Color of the button that represents the primary action on the payment sheet. - /// - /// Make sure there is enough contrast with [background]. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? primary; - - /// Background color of the payment sheet. - /// - /// Make sure there is enough contrast with [primary]. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? background; - - /// Background color of the payment sheet components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentBackground; - - /// Border color of the payment sheet components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentBorder; - - /// Divider color of the payment sheet components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentDivider; - - /// Color of the entered text in the payment components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentText; - - /// Primary text color. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? primaryText; - - /// Secondary text color. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? secondaryText; - - /// Place holder text color. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderText; - - /// Color of the displayed icons - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? icon; - - /// Color of the warning and error messages. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? error; - - @override - String toString() { - return 'PaymentSheetAppearanceColors(primary: $primary, background: $background, componentBackground: $componentBackground, componentBorder: $componentBorder, componentDivider: $componentDivider, componentText: $componentText, primaryText: $primaryText, secondaryText: $secondaryText, placeholderText: $placeholderText, icon: $icon, error: $error)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetAppearanceColors&&(identical(other.primary, primary) || other.primary == primary)&&(identical(other.background, background) || other.background == background)&&(identical(other.componentBackground, componentBackground) || other.componentBackground == componentBackground)&&(identical(other.componentBorder, componentBorder) || other.componentBorder == componentBorder)&&(identical(other.componentDivider, componentDivider) || other.componentDivider == componentDivider)&&(identical(other.componentText, componentText) || other.componentText == componentText)&&(identical(other.primaryText, primaryText) || other.primaryText == primaryText)&&(identical(other.secondaryText, secondaryText) || other.secondaryText == secondaryText)&&(identical(other.placeholderText, placeholderText) || other.placeholderText == placeholderText)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.error, error) || other.error == error)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetAppearanceColorsImpl && - (identical(other.primary, primary) || other.primary == primary) && - (identical(other.background, background) || - other.background == background) && - (identical(other.componentBackground, componentBackground) || - other.componentBackground == componentBackground) && - (identical(other.componentBorder, componentBorder) || - other.componentBorder == componentBorder) && - (identical(other.componentDivider, componentDivider) || - other.componentDivider == componentDivider) && - (identical(other.componentText, componentText) || - other.componentText == componentText) && - (identical(other.primaryText, primaryText) || - other.primaryText == primaryText) && - (identical(other.secondaryText, secondaryText) || - other.secondaryText == secondaryText) && - (identical(other.placeholderText, placeholderText) || - other.placeholderText == placeholderText) && - (identical(other.icon, icon) || other.icon == icon) && - (identical(other.error, error) || other.error == error)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,primary,background,componentBackground,componentBorder,componentDivider,componentText,primaryText,secondaryText,placeholderText,icon,error); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - primary, - background, - componentBackground, - componentBorder, - componentDivider, - componentText, - primaryText, - secondaryText, - placeholderText, - icon, - error); - - /// Create a copy of PaymentSheetAppearanceColors - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetAppearanceColorsImplCopyWith< - _$PaymentSheetAppearanceColorsImpl> - get copyWith => __$$PaymentSheetAppearanceColorsImplCopyWithImpl< - _$PaymentSheetAppearanceColorsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetAppearanceColorsImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentSheetAppearanceColors(primary: $primary, background: $background, componentBackground: $componentBackground, componentBorder: $componentBorder, componentDivider: $componentDivider, componentText: $componentText, primaryText: $primaryText, secondaryText: $secondaryText, placeholderText: $placeholderText, icon: $icon, error: $error)'; } -abstract class _PaymentSheetAppearanceColors - implements PaymentSheetAppearanceColors { - const factory _PaymentSheetAppearanceColors( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? primary, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentBackground, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentBorder, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentDivider, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? componentText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? primaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? secondaryText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? placeholderText, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? icon, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? error}) = _$PaymentSheetAppearanceColorsImpl; - - factory _PaymentSheetAppearanceColors.fromJson(Map json) = - _$PaymentSheetAppearanceColorsImpl.fromJson; - - /// Color of the button that represents the primary action on the payment sheet. - /// - /// Make sure there is enough contrast with [background]. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get primary; - - /// Background color of the payment sheet. - /// - /// Make sure there is enough contrast with [primary]. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get background; - - /// Background color of the payment sheet components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentBackground; - - /// Border color of the payment sheet components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentBorder; - - /// Divider color of the payment sheet components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentDivider; - - /// Color of the entered text in the payment components. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get componentText; - - /// Primary text color. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get primaryText; - - /// Secondary text color. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get secondaryText; - - /// Place holder text color. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get placeholderText; - - /// Color of the displayed icons - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get icon; - - /// Color of the warning and error messages. - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get error; - - /// Create a copy of PaymentSheetAppearanceColors - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetAppearanceColorsImplCopyWith< - _$PaymentSheetAppearanceColorsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -PaymentSheetShape _$PaymentSheetShapeFromJson(Map json) { - return _PaymentSheetShape.fromJson(json); + } /// @nodoc -mixin _$PaymentSheetShape { - /// Borderradius for the paymentsheet corners - double? get borderRadius => throw _privateConstructorUsedError; +abstract mixin class $PaymentSheetAppearanceColorsCopyWith<$Res> { + factory $PaymentSheetAppearanceColorsCopyWith(PaymentSheetAppearanceColors value, $Res Function(PaymentSheetAppearanceColors) _then) = _$PaymentSheetAppearanceColorsCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primary,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBackground,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBorder,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentDivider,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primaryText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? secondaryText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? icon,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? error +}); - /// Borderwidth for the paymentsheet components - double? get borderWidth => throw _privateConstructorUsedError; - /// Appearance config of the payment sheet shadow - PaymentSheetShadowParams? get shadow => throw _privateConstructorUsedError; - /// Serializes this PaymentSheetShape to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetShape - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetShapeCopyWith get copyWith => - throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentSheetShapeCopyWith<$Res> { - factory $PaymentSheetShapeCopyWith( - PaymentSheetShape value, $Res Function(PaymentSheetShape) then) = - _$PaymentSheetShapeCopyWithImpl<$Res, PaymentSheetShape>; - @useResult - $Res call( - {double? borderRadius, - double? borderWidth, - PaymentSheetShadowParams? shadow}); +class _$PaymentSheetAppearanceColorsCopyWithImpl<$Res> + implements $PaymentSheetAppearanceColorsCopyWith<$Res> { + _$PaymentSheetAppearanceColorsCopyWithImpl(this._self, this._then); + + final PaymentSheetAppearanceColors _self; + final $Res Function(PaymentSheetAppearanceColors) _then; + +/// Create a copy of PaymentSheetAppearanceColors +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? primary = freezed,Object? background = freezed,Object? componentBackground = freezed,Object? componentBorder = freezed,Object? componentDivider = freezed,Object? componentText = freezed,Object? primaryText = freezed,Object? secondaryText = freezed,Object? placeholderText = freezed,Object? icon = freezed,Object? error = freezed,}) { + return _then(_self.copyWith( +primary: freezed == primary ? _self.primary : primary // ignore: cast_nullable_to_non_nullable +as Color?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable +as Color?,componentBackground: freezed == componentBackground ? _self.componentBackground : componentBackground // ignore: cast_nullable_to_non_nullable +as Color?,componentBorder: freezed == componentBorder ? _self.componentBorder : componentBorder // ignore: cast_nullable_to_non_nullable +as Color?,componentDivider: freezed == componentDivider ? _self.componentDivider : componentDivider // ignore: cast_nullable_to_non_nullable +as Color?,componentText: freezed == componentText ? _self.componentText : componentText // ignore: cast_nullable_to_non_nullable +as Color?,primaryText: freezed == primaryText ? _self.primaryText : primaryText // ignore: cast_nullable_to_non_nullable +as Color?,secondaryText: freezed == secondaryText ? _self.secondaryText : secondaryText // ignore: cast_nullable_to_non_nullable +as Color?,placeholderText: freezed == placeholderText ? _self.placeholderText : placeholderText // ignore: cast_nullable_to_non_nullable +as Color?,icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable +as Color?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentSheetAppearanceColors]. +extension PaymentSheetAppearanceColorsPatterns on PaymentSheetAppearanceColors { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetAppearanceColors value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetAppearanceColors() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetAppearanceColors value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetAppearanceColors(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetAppearanceColors value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetAppearanceColors() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? error)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetAppearanceColors() when $default != null: +return $default(_that.primary,_that.background,_that.componentBackground,_that.componentBorder,_that.componentDivider,_that.componentText,_that.primaryText,_that.secondaryText,_that.placeholderText,_that.icon,_that.error);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? error) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetAppearanceColors(): +return $default(_that.primary,_that.background,_that.componentBackground,_that.componentBorder,_that.componentDivider,_that.componentText,_that.primaryText,_that.secondaryText,_that.placeholderText,_that.icon,_that.error);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? error)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetAppearanceColors() when $default != null: +return $default(_that.primary,_that.background,_that.componentBackground,_that.componentBorder,_that.componentDivider,_that.componentText,_that.primaryText,_that.secondaryText,_that.placeholderText,_that.icon,_that.error);case _: + return null; + +} +} - $PaymentSheetShadowParamsCopyWith<$Res>? get shadow; } /// @nodoc -class _$PaymentSheetShapeCopyWithImpl<$Res, $Val extends PaymentSheetShape> - implements $PaymentSheetShapeCopyWith<$Res> { - _$PaymentSheetShapeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetShape - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? borderRadius = freezed, - Object? borderWidth = freezed, - Object? shadow = freezed, - }) { - return _then(_value.copyWith( - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as double?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as double?, - shadow: freezed == shadow - ? _value.shadow - : shadow // ignore: cast_nullable_to_non_nullable - as PaymentSheetShadowParams?, - ) as $Val); - } +@JsonSerializable() - /// Create a copy of PaymentSheetShape - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetShadowParamsCopyWith<$Res>? get shadow { - if (_value.shadow == null) { - return null; - } - - return $PaymentSheetShadowParamsCopyWith<$Res>(_value.shadow!, (value) { - return _then(_value.copyWith(shadow: value) as $Val); - }); - } +class _PaymentSheetAppearanceColors implements PaymentSheetAppearanceColors { + const _PaymentSheetAppearanceColors({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.primary, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.componentBackground, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.componentBorder, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.componentDivider, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.componentText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.primaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.secondaryText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.placeholderText, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.icon, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.error}); + factory _PaymentSheetAppearanceColors.fromJson(Map json) => _$PaymentSheetAppearanceColorsFromJson(json); + +/// Color of the button that represents the primary action on the payment sheet. +/// +/// Make sure there is enough contrast with [background]. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? primary; +/// Background color of the payment sheet. +/// +/// Make sure there is enough contrast with [primary]. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? background; +/// Background color of the payment sheet components. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? componentBackground; +/// Border color of the payment sheet components. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? componentBorder; +/// Divider color of the payment sheet components. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? componentDivider; +/// Color of the entered text in the payment components. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? componentText; +/// Primary text color. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? primaryText; +/// Secondary text color. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? secondaryText; +/// Place holder text color. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? placeholderText; +/// Color of the displayed icons +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? icon; +/// Color of the warning and error messages. +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? error; + +/// Create a copy of PaymentSheetAppearanceColors +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetAppearanceColorsCopyWith<_PaymentSheetAppearanceColors> get copyWith => __$PaymentSheetAppearanceColorsCopyWithImpl<_PaymentSheetAppearanceColors>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetAppearanceColorsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetAppearanceColors&&(identical(other.primary, primary) || other.primary == primary)&&(identical(other.background, background) || other.background == background)&&(identical(other.componentBackground, componentBackground) || other.componentBackground == componentBackground)&&(identical(other.componentBorder, componentBorder) || other.componentBorder == componentBorder)&&(identical(other.componentDivider, componentDivider) || other.componentDivider == componentDivider)&&(identical(other.componentText, componentText) || other.componentText == componentText)&&(identical(other.primaryText, primaryText) || other.primaryText == primaryText)&&(identical(other.secondaryText, secondaryText) || other.secondaryText == secondaryText)&&(identical(other.placeholderText, placeholderText) || other.placeholderText == placeholderText)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.error, error) || other.error == error)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,primary,background,componentBackground,componentBorder,componentDivider,componentText,primaryText,secondaryText,placeholderText,icon,error); + +@override +String toString() { + return 'PaymentSheetAppearanceColors(primary: $primary, background: $background, componentBackground: $componentBackground, componentBorder: $componentBorder, componentDivider: $componentDivider, componentText: $componentText, primaryText: $primaryText, secondaryText: $secondaryText, placeholderText: $placeholderText, icon: $icon, error: $error)'; } -/// @nodoc -abstract class _$$PaymentSheetShapeImplCopyWith<$Res> - implements $PaymentSheetShapeCopyWith<$Res> { - factory _$$PaymentSheetShapeImplCopyWith(_$PaymentSheetShapeImpl value, - $Res Function(_$PaymentSheetShapeImpl) then) = - __$$PaymentSheetShapeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {double? borderRadius, - double? borderWidth, - PaymentSheetShadowParams? shadow}); - - @override - $PaymentSheetShadowParamsCopyWith<$Res>? get shadow; -} - -/// @nodoc -class __$$PaymentSheetShapeImplCopyWithImpl<$Res> - extends _$PaymentSheetShapeCopyWithImpl<$Res, _$PaymentSheetShapeImpl> - implements _$$PaymentSheetShapeImplCopyWith<$Res> { - __$$PaymentSheetShapeImplCopyWithImpl(_$PaymentSheetShapeImpl _value, - $Res Function(_$PaymentSheetShapeImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetShape - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? borderRadius = freezed, - Object? borderWidth = freezed, - Object? shadow = freezed, - }) { - return _then(_$PaymentSheetShapeImpl( - borderRadius: freezed == borderRadius - ? _value.borderRadius - : borderRadius // ignore: cast_nullable_to_non_nullable - as double?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as double?, - shadow: freezed == shadow - ? _value.shadow - : shadow // ignore: cast_nullable_to_non_nullable - as PaymentSheetShadowParams?, - )); - } + } /// @nodoc +abstract mixin class _$PaymentSheetAppearanceColorsCopyWith<$Res> implements $PaymentSheetAppearanceColorsCopyWith<$Res> { + factory _$PaymentSheetAppearanceColorsCopyWith(_PaymentSheetAppearanceColors value, $Res Function(_PaymentSheetAppearanceColors) _then) = __$PaymentSheetAppearanceColorsCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primary,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBackground,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentBorder,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentDivider,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? componentText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? primaryText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? secondaryText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? placeholderText,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? icon,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? error +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentSheetShapeImpl implements _PaymentSheetShape { - const _$PaymentSheetShapeImpl( - {this.borderRadius, this.borderWidth, this.shadow}); - factory _$PaymentSheetShapeImpl.fromJson(Map json) => - _$$PaymentSheetShapeImplFromJson(json); - /// Borderradius for the paymentsheet corners - @override - final double? borderRadius; - /// Borderwidth for the paymentsheet components - @override - final double? borderWidth; +} +/// @nodoc +class __$PaymentSheetAppearanceColorsCopyWithImpl<$Res> + implements _$PaymentSheetAppearanceColorsCopyWith<$Res> { + __$PaymentSheetAppearanceColorsCopyWithImpl(this._self, this._then); - /// Appearance config of the payment sheet shadow - @override - final PaymentSheetShadowParams? shadow; + final _PaymentSheetAppearanceColors _self; + final $Res Function(_PaymentSheetAppearanceColors) _then; - @override - String toString() { - return 'PaymentSheetShape(borderRadius: $borderRadius, borderWidth: $borderWidth, shadow: $shadow)'; - } +/// Create a copy of PaymentSheetAppearanceColors +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? primary = freezed,Object? background = freezed,Object? componentBackground = freezed,Object? componentBorder = freezed,Object? componentDivider = freezed,Object? componentText = freezed,Object? primaryText = freezed,Object? secondaryText = freezed,Object? placeholderText = freezed,Object? icon = freezed,Object? error = freezed,}) { + return _then(_PaymentSheetAppearanceColors( +primary: freezed == primary ? _self.primary : primary // ignore: cast_nullable_to_non_nullable +as Color?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable +as Color?,componentBackground: freezed == componentBackground ? _self.componentBackground : componentBackground // ignore: cast_nullable_to_non_nullable +as Color?,componentBorder: freezed == componentBorder ? _self.componentBorder : componentBorder // ignore: cast_nullable_to_non_nullable +as Color?,componentDivider: freezed == componentDivider ? _self.componentDivider : componentDivider // ignore: cast_nullable_to_non_nullable +as Color?,componentText: freezed == componentText ? _self.componentText : componentText // ignore: cast_nullable_to_non_nullable +as Color?,primaryText: freezed == primaryText ? _self.primaryText : primaryText // ignore: cast_nullable_to_non_nullable +as Color?,secondaryText: freezed == secondaryText ? _self.secondaryText : secondaryText // ignore: cast_nullable_to_non_nullable +as Color?,placeholderText: freezed == placeholderText ? _self.placeholderText : placeholderText // ignore: cast_nullable_to_non_nullable +as Color?,icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable +as Color?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetShapeImpl && - (identical(other.borderRadius, borderRadius) || - other.borderRadius == borderRadius) && - (identical(other.borderWidth, borderWidth) || - other.borderWidth == borderWidth) && - (identical(other.shadow, shadow) || other.shadow == shadow)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, borderRadius, borderWidth, shadow); - - /// Create a copy of PaymentSheetShape - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetShapeImplCopyWith<_$PaymentSheetShapeImpl> get copyWith => - __$$PaymentSheetShapeImplCopyWithImpl<_$PaymentSheetShapeImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetShapeImplToJson( - this, - ); - } } -abstract class _PaymentSheetShape implements PaymentSheetShape { - const factory _PaymentSheetShape( - {final double? borderRadius, - final double? borderWidth, - final PaymentSheetShadowParams? shadow}) = _$PaymentSheetShapeImpl; - - factory _PaymentSheetShape.fromJson(Map json) = - _$PaymentSheetShapeImpl.fromJson; - /// Borderradius for the paymentsheet corners - @override - double? get borderRadius; +/// @nodoc +mixin _$PaymentSheetShape { - /// Borderwidth for the paymentsheet components - @override - double? get borderWidth; +/// Borderradius for the paymentsheet corners + double? get borderRadius;/// Borderwidth for the paymentsheet components + double? get borderWidth;/// Appearance config of the payment sheet shadow + PaymentSheetShadowParams? get shadow; +/// Create a copy of PaymentSheetShape +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetShapeCopyWith get copyWith => _$PaymentSheetShapeCopyWithImpl(this as PaymentSheetShape, _$identity); - /// Appearance config of the payment sheet shadow - @override - PaymentSheetShadowParams? get shadow; + /// Serializes this PaymentSheetShape to a JSON map. + Map toJson(); - /// Create a copy of PaymentSheetShape - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetShapeImplCopyWith<_$PaymentSheetShapeImpl> get copyWith => - throw _privateConstructorUsedError; -} -PaymentSheetShadowParams _$PaymentSheetShadowParamsFromJson( - Map json) { - return _PaymentSheetShadowParams.fromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetShape&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.shadow, shadow) || other.shadow == shadow)); } -/// @nodoc -mixin _$PaymentSheetShadowParams { - /// Shadow color - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get color => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,borderRadius,borderWidth,shadow); - /// Shadow opacity - double? get opacity => throw _privateConstructorUsedError; - - /// Shadow offset - PaymentSheetShadowOffset? get offset => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetShape(borderRadius: $borderRadius, borderWidth: $borderWidth, shadow: $shadow)'; +} - /// Serializes this PaymentSheetShadowParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetShadowParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetShadowParamsCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentSheetShadowParamsCopyWith<$Res> { - factory $PaymentSheetShadowParamsCopyWith(PaymentSheetShadowParams value, - $Res Function(PaymentSheetShadowParams) then) = - _$PaymentSheetShadowParamsCopyWithImpl<$Res, PaymentSheetShadowParams>; - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? color, - double? opacity, - PaymentSheetShadowOffset? offset}); +abstract mixin class $PaymentSheetShapeCopyWith<$Res> { + factory $PaymentSheetShapeCopyWith(PaymentSheetShape value, $Res Function(PaymentSheetShape) _then) = _$PaymentSheetShapeCopyWithImpl; +@useResult +$Res call({ + double? borderRadius, double? borderWidth, PaymentSheetShadowParams? shadow +}); - $PaymentSheetShadowOffsetCopyWith<$Res>? get offset; -} +$PaymentSheetShadowParamsCopyWith<$Res>? get shadow; + +} /// @nodoc -class _$PaymentSheetShadowParamsCopyWithImpl<$Res, - $Val extends PaymentSheetShadowParams> - implements $PaymentSheetShadowParamsCopyWith<$Res> { - _$PaymentSheetShadowParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetShadowParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? color = freezed, - Object? opacity = freezed, - Object? offset = freezed, - }) { - return _then(_value.copyWith( - color: freezed == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color?, - opacity: freezed == opacity - ? _value.opacity - : opacity // ignore: cast_nullable_to_non_nullable - as double?, - offset: freezed == offset - ? _value.offset - : offset // ignore: cast_nullable_to_non_nullable - as PaymentSheetShadowOffset?, - ) as $Val); - } +class _$PaymentSheetShapeCopyWithImpl<$Res> + implements $PaymentSheetShapeCopyWith<$Res> { + _$PaymentSheetShapeCopyWithImpl(this._self, this._then); + + final PaymentSheetShape _self; + final $Res Function(PaymentSheetShape) _then; + +/// Create a copy of PaymentSheetShape +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? borderRadius = freezed,Object? borderWidth = freezed,Object? shadow = freezed,}) { + return _then(_self.copyWith( +borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as double?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as double?,shadow: freezed == shadow ? _self.shadow : shadow // ignore: cast_nullable_to_non_nullable +as PaymentSheetShadowParams?, + )); +} +/// Create a copy of PaymentSheetShape +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShadowParamsCopyWith<$Res>? get shadow { + if (_self.shadow == null) { + return null; + } + + return $PaymentSheetShadowParamsCopyWith<$Res>(_self.shadow!, (value) { + return _then(_self.copyWith(shadow: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetShape]. +extension PaymentSheetShapePatterns on PaymentSheetShape { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetShape value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetShape() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetShape value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetShape(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetShape value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetShape() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? borderRadius, double? borderWidth, PaymentSheetShadowParams? shadow)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetShape() when $default != null: +return $default(_that.borderRadius,_that.borderWidth,_that.shadow);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? borderRadius, double? borderWidth, PaymentSheetShadowParams? shadow) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetShape(): +return $default(_that.borderRadius,_that.borderWidth,_that.shadow);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? borderRadius, double? borderWidth, PaymentSheetShadowParams? shadow)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetShape() when $default != null: +return $default(_that.borderRadius,_that.borderWidth,_that.shadow);case _: + return null; - /// Create a copy of PaymentSheetShadowParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetShadowOffsetCopyWith<$Res>? get offset { - if (_value.offset == null) { - return null; - } - - return $PaymentSheetShadowOffsetCopyWith<$Res>(_value.offset!, (value) { - return _then(_value.copyWith(offset: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$PaymentSheetShadowParamsImplCopyWith<$Res> - implements $PaymentSheetShadowParamsCopyWith<$Res> { - factory _$$PaymentSheetShadowParamsImplCopyWith( - _$PaymentSheetShadowParamsImpl value, - $Res Function(_$PaymentSheetShadowParamsImpl) then) = - __$$PaymentSheetShadowParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? color, - double? opacity, - PaymentSheetShadowOffset? offset}); - - @override - $PaymentSheetShadowOffsetCopyWith<$Res>? get offset; -} - -/// @nodoc -class __$$PaymentSheetShadowParamsImplCopyWithImpl<$Res> - extends _$PaymentSheetShadowParamsCopyWithImpl<$Res, - _$PaymentSheetShadowParamsImpl> - implements _$$PaymentSheetShadowParamsImplCopyWith<$Res> { - __$$PaymentSheetShadowParamsImplCopyWithImpl( - _$PaymentSheetShadowParamsImpl _value, - $Res Function(_$PaymentSheetShadowParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetShadowParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? color = freezed, - Object? opacity = freezed, - Object? offset = freezed, - }) { - return _then(_$PaymentSheetShadowParamsImpl( - color: freezed == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color?, - opacity: freezed == opacity - ? _value.opacity - : opacity // ignore: cast_nullable_to_non_nullable - as double?, - offset: freezed == offset - ? _value.offset - : offset // ignore: cast_nullable_to_non_nullable - as PaymentSheetShadowOffset?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentSheetShadowParamsImpl implements _PaymentSheetShadowParams { - const _$PaymentSheetShadowParamsImpl( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.color, - this.opacity, - this.offset}); - - factory _$PaymentSheetShadowParamsImpl.fromJson(Map json) => - _$$PaymentSheetShadowParamsImplFromJson(json); - - /// Shadow color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? color; - - /// Shadow opacity - @override - final double? opacity; - - /// Shadow offset - @override - final PaymentSheetShadowOffset? offset; - - @override - String toString() { - return 'PaymentSheetShadowParams(color: $color, opacity: $opacity, offset: $offset)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetShadowParamsImpl && - (identical(other.color, color) || other.color == color) && - (identical(other.opacity, opacity) || other.opacity == opacity) && - (identical(other.offset, offset) || other.offset == offset)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, color, opacity, offset); - - /// Create a copy of PaymentSheetShadowParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetShadowParamsImplCopyWith<_$PaymentSheetShadowParamsImpl> - get copyWith => __$$PaymentSheetShadowParamsImplCopyWithImpl< - _$PaymentSheetShadowParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetShadowParamsImplToJson( - this, - ); - } -} +class _PaymentSheetShape implements PaymentSheetShape { + const _PaymentSheetShape({this.borderRadius, this.borderWidth, this.shadow}); + factory _PaymentSheetShape.fromJson(Map json) => _$PaymentSheetShapeFromJson(json); -abstract class _PaymentSheetShadowParams implements PaymentSheetShadowParams { - const factory _PaymentSheetShadowParams( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? color, - final double? opacity, - final PaymentSheetShadowOffset? offset}) = _$PaymentSheetShadowParamsImpl; +/// Borderradius for the paymentsheet corners +@override final double? borderRadius; +/// Borderwidth for the paymentsheet components +@override final double? borderWidth; +/// Appearance config of the payment sheet shadow +@override final PaymentSheetShadowParams? shadow; - factory _PaymentSheetShadowParams.fromJson(Map json) = - _$PaymentSheetShadowParamsImpl.fromJson; +/// Create a copy of PaymentSheetShape +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetShapeCopyWith<_PaymentSheetShape> get copyWith => __$PaymentSheetShapeCopyWithImpl<_PaymentSheetShape>(this, _$identity); - /// Shadow color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get color; +@override +Map toJson() { + return _$PaymentSheetShapeToJson(this, ); +} - /// Shadow opacity - @override - double? get opacity; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetShape&&(identical(other.borderRadius, borderRadius) || other.borderRadius == borderRadius)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.shadow, shadow) || other.shadow == shadow)); +} - /// Shadow offset - @override - PaymentSheetShadowOffset? get offset; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,borderRadius,borderWidth,shadow); - /// Create a copy of PaymentSheetShadowParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetShadowParamsImplCopyWith<_$PaymentSheetShadowParamsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetShape(borderRadius: $borderRadius, borderWidth: $borderWidth, shadow: $shadow)'; } -PaymentSheetShadowOffset _$PaymentSheetShadowOffsetFromJson( - Map json) { - return _PaymentSheetShadowOffset.fromJson(json); + } /// @nodoc -mixin _$PaymentSheetShadowOffset { - /// X value - double? get x => throw _privateConstructorUsedError; +abstract mixin class _$PaymentSheetShapeCopyWith<$Res> implements $PaymentSheetShapeCopyWith<$Res> { + factory _$PaymentSheetShapeCopyWith(_PaymentSheetShape value, $Res Function(_PaymentSheetShape) _then) = __$PaymentSheetShapeCopyWithImpl; +@override @useResult +$Res call({ + double? borderRadius, double? borderWidth, PaymentSheetShadowParams? shadow +}); - /// Y value - double? get y => throw _privateConstructorUsedError; - /// Serializes this PaymentSheetShadowOffset to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override $PaymentSheetShadowParamsCopyWith<$Res>? get shadow; - /// Create a copy of PaymentSheetShadowOffset - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetShadowOffsetCopyWith get copyWith => - throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentSheetShadowOffsetCopyWith<$Res> { - factory $PaymentSheetShadowOffsetCopyWith(PaymentSheetShadowOffset value, - $Res Function(PaymentSheetShadowOffset) then) = - _$PaymentSheetShadowOffsetCopyWithImpl<$Res, PaymentSheetShadowOffset>; - @useResult - $Res call({double? x, double? y}); -} +class __$PaymentSheetShapeCopyWithImpl<$Res> + implements _$PaymentSheetShapeCopyWith<$Res> { + __$PaymentSheetShapeCopyWithImpl(this._self, this._then); -/// @nodoc -class _$PaymentSheetShadowOffsetCopyWithImpl<$Res, - $Val extends PaymentSheetShadowOffset> - implements $PaymentSheetShadowOffsetCopyWith<$Res> { - _$PaymentSheetShadowOffsetCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetShadowOffset - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? x = freezed, - Object? y = freezed, - }) { - return _then(_value.copyWith( - x: freezed == x - ? _value.x - : x // ignore: cast_nullable_to_non_nullable - as double?, - y: freezed == y - ? _value.y - : y // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); - } + final _PaymentSheetShape _self; + final $Res Function(_PaymentSheetShape) _then; + +/// Create a copy of PaymentSheetShape +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? borderRadius = freezed,Object? borderWidth = freezed,Object? shadow = freezed,}) { + return _then(_PaymentSheetShape( +borderRadius: freezed == borderRadius ? _self.borderRadius : borderRadius // ignore: cast_nullable_to_non_nullable +as double?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as double?,shadow: freezed == shadow ? _self.shadow : shadow // ignore: cast_nullable_to_non_nullable +as PaymentSheetShadowParams?, + )); } -/// @nodoc -abstract class _$$PaymentSheetShadowOffsetImplCopyWith<$Res> - implements $PaymentSheetShadowOffsetCopyWith<$Res> { - factory _$$PaymentSheetShadowOffsetImplCopyWith( - _$PaymentSheetShadowOffsetImpl value, - $Res Function(_$PaymentSheetShadowOffsetImpl) then) = - __$$PaymentSheetShadowOffsetImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({double? x, double? y}); -} - -/// @nodoc -class __$$PaymentSheetShadowOffsetImplCopyWithImpl<$Res> - extends _$PaymentSheetShadowOffsetCopyWithImpl<$Res, - _$PaymentSheetShadowOffsetImpl> - implements _$$PaymentSheetShadowOffsetImplCopyWith<$Res> { - __$$PaymentSheetShadowOffsetImplCopyWithImpl( - _$PaymentSheetShadowOffsetImpl _value, - $Res Function(_$PaymentSheetShadowOffsetImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetShadowOffset - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? x = freezed, - Object? y = freezed, - }) { - return _then(_$PaymentSheetShadowOffsetImpl( - x: freezed == x - ? _value.x - : x // ignore: cast_nullable_to_non_nullable - as double?, - y: freezed == y - ? _value.y - : y // ignore: cast_nullable_to_non_nullable - as double?, - )); +/// Create a copy of PaymentSheetShape +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShadowParamsCopyWith<$Res>? get shadow { + if (_self.shadow == null) { + return null; } + + return $PaymentSheetShadowParamsCopyWith<$Res>(_self.shadow!, (value) { + return _then(_self.copyWith(shadow: value)); + }); +} } + /// @nodoc +mixin _$PaymentSheetShadowParams { -@JsonSerializable(explicitToJson: true) -class _$PaymentSheetShadowOffsetImpl implements _PaymentSheetShadowOffset { - const _$PaymentSheetShadowOffsetImpl({this.x, this.y}); +/// Shadow color +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get color;/// Shadow opacity + double? get opacity;/// Shadow offset + PaymentSheetShadowOffset? get offset; +/// Create a copy of PaymentSheetShadowParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetShadowParamsCopyWith get copyWith => _$PaymentSheetShadowParamsCopyWithImpl(this as PaymentSheetShadowParams, _$identity); - factory _$PaymentSheetShadowOffsetImpl.fromJson(Map json) => - _$$PaymentSheetShadowOffsetImplFromJson(json); + /// Serializes this PaymentSheetShadowParams to a JSON map. + Map toJson(); - /// X value - @override - final double? x; - /// Y value - @override - final double? y; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetShadowParams&&(identical(other.color, color) || other.color == color)&&(identical(other.opacity, opacity) || other.opacity == opacity)&&(identical(other.offset, offset) || other.offset == offset)); +} - @override - String toString() { - return 'PaymentSheetShadowOffset(x: $x, y: $y)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,color,opacity,offset); + +@override +String toString() { + return 'PaymentSheetShadowParams(color: $color, opacity: $opacity, offset: $offset)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetShadowOffsetImpl && - (identical(other.x, x) || other.x == x) && - (identical(other.y, y) || other.y == y)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, x, y); - - /// Create a copy of PaymentSheetShadowOffset - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetShadowOffsetImplCopyWith<_$PaymentSheetShadowOffsetImpl> - get copyWith => __$$PaymentSheetShadowOffsetImplCopyWithImpl< - _$PaymentSheetShadowOffsetImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetShadowOffsetImplToJson( - this, - ); - } } -abstract class _PaymentSheetShadowOffset implements PaymentSheetShadowOffset { - const factory _PaymentSheetShadowOffset({final double? x, final double? y}) = - _$PaymentSheetShadowOffsetImpl; +/// @nodoc +abstract mixin class $PaymentSheetShadowParamsCopyWith<$Res> { + factory $PaymentSheetShadowParamsCopyWith(PaymentSheetShadowParams value, $Res Function(PaymentSheetShadowParams) _then) = _$PaymentSheetShadowParamsCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, double? opacity, PaymentSheetShadowOffset? offset +}); - factory _PaymentSheetShadowOffset.fromJson(Map json) = - _$PaymentSheetShadowOffsetImpl.fromJson; - /// X value - @override - double? get x; +$PaymentSheetShadowOffsetCopyWith<$Res>? get offset; - /// Y value - @override - double? get y; +} +/// @nodoc +class _$PaymentSheetShadowParamsCopyWithImpl<$Res> + implements $PaymentSheetShadowParamsCopyWith<$Res> { + _$PaymentSheetShadowParamsCopyWithImpl(this._self, this._then); + + final PaymentSheetShadowParams _self; + final $Res Function(PaymentSheetShadowParams) _then; + +/// Create a copy of PaymentSheetShadowParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? color = freezed,Object? opacity = freezed,Object? offset = freezed,}) { + return _then(_self.copyWith( +color: freezed == color ? _self.color : color // ignore: cast_nullable_to_non_nullable +as Color?,opacity: freezed == opacity ? _self.opacity : opacity // ignore: cast_nullable_to_non_nullable +as double?,offset: freezed == offset ? _self.offset : offset // ignore: cast_nullable_to_non_nullable +as PaymentSheetShadowOffset?, + )); +} +/// Create a copy of PaymentSheetShadowParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShadowOffsetCopyWith<$Res>? get offset { + if (_self.offset == null) { + return null; + } + + return $PaymentSheetShadowOffsetCopyWith<$Res>(_self.offset!, (value) { + return _then(_self.copyWith(offset: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetShadowParams]. +extension PaymentSheetShadowParamsPatterns on PaymentSheetShadowParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetShadowParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetShadowParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetShadowParams value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetShadowParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetShadowParams value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetShadowParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, double? opacity, PaymentSheetShadowOffset? offset)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetShadowParams() when $default != null: +return $default(_that.color,_that.opacity,_that.offset);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, double? opacity, PaymentSheetShadowOffset? offset) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetShadowParams(): +return $default(_that.color,_that.opacity,_that.offset);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, double? opacity, PaymentSheetShadowOffset? offset)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetShadowParams() when $default != null: +return $default(_that.color,_that.opacity,_that.offset);case _: + return null; - /// Create a copy of PaymentSheetShadowOffset - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetShadowOffsetImplCopyWith<_$PaymentSheetShadowOffsetImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentSheetPrimaryButtonAppearance - _$PaymentSheetPrimaryButtonAppearanceFromJson(Map json) { - return _PaymentSheetPrimaryButtonAppearance.fromJson(json); } /// @nodoc -mixin _$PaymentSheetPrimaryButtonAppearance { - /// color theme of the primary button - PaymentSheetPrimaryButtonTheme? get colors => - throw _privateConstructorUsedError; - - /// Shape params of the primary button - PaymentSheetPrimaryButtonShape? get shapes => - throw _privateConstructorUsedError; - /// Serializes this PaymentSheetPrimaryButtonAppearance to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentSheetShadowParams implements PaymentSheetShadowParams { + const _PaymentSheetShadowParams({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.color, this.opacity, this.offset}); + factory _PaymentSheetShadowParams.fromJson(Map json) => _$PaymentSheetShadowParamsFromJson(json); - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetPrimaryButtonAppearanceCopyWith< - PaymentSheetPrimaryButtonAppearance> - get copyWith => throw _privateConstructorUsedError; -} +/// Shadow color +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? color; +/// Shadow opacity +@override final double? opacity; +/// Shadow offset +@override final PaymentSheetShadowOffset? offset; -/// @nodoc -abstract class $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { - factory $PaymentSheetPrimaryButtonAppearanceCopyWith( - PaymentSheetPrimaryButtonAppearance value, - $Res Function(PaymentSheetPrimaryButtonAppearance) then) = - _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl<$Res, - PaymentSheetPrimaryButtonAppearance>; - @useResult - $Res call( - {PaymentSheetPrimaryButtonTheme? colors, - PaymentSheetPrimaryButtonShape? shapes}); +/// Create a copy of PaymentSheetShadowParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetShadowParamsCopyWith<_PaymentSheetShadowParams> get copyWith => __$PaymentSheetShadowParamsCopyWithImpl<_PaymentSheetShadowParams>(this, _$identity); - $PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors; - $PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes; +@override +Map toJson() { + return _$PaymentSheetShadowParamsToJson(this, ); } -/// @nodoc -class _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl<$Res, - $Val extends PaymentSheetPrimaryButtonAppearance> - implements $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { - _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? colors = freezed, - Object? shapes = freezed, - }) { - return _then(_value.copyWith( - colors: freezed == colors - ? _value.colors - : colors // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonTheme?, - shapes: freezed == shapes - ? _value.shapes - : shapes // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonShape?, - ) as $Val); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetShadowParams&&(identical(other.color, color) || other.color == color)&&(identical(other.opacity, opacity) || other.opacity == opacity)&&(identical(other.offset, offset) || other.offset == offset)); +} - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors { - if (_value.colors == null) { - return null; - } - - return $PaymentSheetPrimaryButtonThemeCopyWith<$Res>(_value.colors!, - (value) { - return _then(_value.copyWith(colors: value) as $Val); - }); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,color,opacity,offset); - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes { - if (_value.shapes == null) { - return null; - } - - return $PaymentSheetPrimaryButtonShapeCopyWith<$Res>(_value.shapes!, - (value) { - return _then(_value.copyWith(shapes: value) as $Val); - }); - } +@override +String toString() { + return 'PaymentSheetShadowParams(color: $color, opacity: $opacity, offset: $offset)'; } -/// @nodoc -abstract class _$$PaymentSheetPrimaryButtonAppearanceImplCopyWith<$Res> - implements $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { - factory _$$PaymentSheetPrimaryButtonAppearanceImplCopyWith( - _$PaymentSheetPrimaryButtonAppearanceImpl value, - $Res Function(_$PaymentSheetPrimaryButtonAppearanceImpl) then) = - __$$PaymentSheetPrimaryButtonAppearanceImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentSheetPrimaryButtonTheme? colors, - PaymentSheetPrimaryButtonShape? shapes}); - - @override - $PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors; - @override - $PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes; -} - -/// @nodoc -class __$$PaymentSheetPrimaryButtonAppearanceImplCopyWithImpl<$Res> - extends _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl<$Res, - _$PaymentSheetPrimaryButtonAppearanceImpl> - implements _$$PaymentSheetPrimaryButtonAppearanceImplCopyWith<$Res> { - __$$PaymentSheetPrimaryButtonAppearanceImplCopyWithImpl( - _$PaymentSheetPrimaryButtonAppearanceImpl _value, - $Res Function(_$PaymentSheetPrimaryButtonAppearanceImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? colors = freezed, - Object? shapes = freezed, - }) { - return _then(_$PaymentSheetPrimaryButtonAppearanceImpl( - colors: freezed == colors - ? _value.colors - : colors // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonTheme?, - shapes: freezed == shapes - ? _value.shapes - : shapes // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonShape?, - )); - } + } /// @nodoc +abstract mixin class _$PaymentSheetShadowParamsCopyWith<$Res> implements $PaymentSheetShadowParamsCopyWith<$Res> { + factory _$PaymentSheetShadowParamsCopyWith(_PaymentSheetShadowParams value, $Res Function(_PaymentSheetShadowParams) _then) = __$PaymentSheetShadowParamsCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color, double? opacity, PaymentSheetShadowOffset? offset +}); -@JsonSerializable(explicitToJson: true) -class _$PaymentSheetPrimaryButtonAppearanceImpl - implements _PaymentSheetPrimaryButtonAppearance { - const _$PaymentSheetPrimaryButtonAppearanceImpl({this.colors, this.shapes}); - factory _$PaymentSheetPrimaryButtonAppearanceImpl.fromJson( - Map json) => - _$$PaymentSheetPrimaryButtonAppearanceImplFromJson(json); +@override $PaymentSheetShadowOffsetCopyWith<$Res>? get offset; - /// color theme of the primary button - @override - final PaymentSheetPrimaryButtonTheme? colors; +} +/// @nodoc +class __$PaymentSheetShadowParamsCopyWithImpl<$Res> + implements _$PaymentSheetShadowParamsCopyWith<$Res> { + __$PaymentSheetShadowParamsCopyWithImpl(this._self, this._then); - /// Shape params of the primary button - @override - final PaymentSheetPrimaryButtonShape? shapes; + final _PaymentSheetShadowParams _self; + final $Res Function(_PaymentSheetShadowParams) _then; - @override - String toString() { - return 'PaymentSheetPrimaryButtonAppearance(colors: $colors, shapes: $shapes)'; - } +/// Create a copy of PaymentSheetShadowParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? color = freezed,Object? opacity = freezed,Object? offset = freezed,}) { + return _then(_PaymentSheetShadowParams( +color: freezed == color ? _self.color : color // ignore: cast_nullable_to_non_nullable +as Color?,opacity: freezed == opacity ? _self.opacity : opacity // ignore: cast_nullable_to_non_nullable +as double?,offset: freezed == offset ? _self.offset : offset // ignore: cast_nullable_to_non_nullable +as PaymentSheetShadowOffset?, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetPrimaryButtonAppearanceImpl && - (identical(other.colors, colors) || other.colors == colors) && - (identical(other.shapes, shapes) || other.shapes == shapes)); +/// Create a copy of PaymentSheetShadowParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShadowOffsetCopyWith<$Res>? get offset { + if (_self.offset == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, colors, shapes); - - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetPrimaryButtonAppearanceImplCopyWith< - _$PaymentSheetPrimaryButtonAppearanceImpl> - get copyWith => __$$PaymentSheetPrimaryButtonAppearanceImplCopyWithImpl< - _$PaymentSheetPrimaryButtonAppearanceImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetPrimaryButtonAppearanceImplToJson( - this, - ); - } + return $PaymentSheetShadowOffsetCopyWith<$Res>(_self.offset!, (value) { + return _then(_self.copyWith(offset: value)); + }); +} } -abstract class _PaymentSheetPrimaryButtonAppearance - implements PaymentSheetPrimaryButtonAppearance { - const factory _PaymentSheetPrimaryButtonAppearance( - {final PaymentSheetPrimaryButtonTheme? colors, - final PaymentSheetPrimaryButtonShape? shapes}) = - _$PaymentSheetPrimaryButtonAppearanceImpl; - factory _PaymentSheetPrimaryButtonAppearance.fromJson( - Map json) = - _$PaymentSheetPrimaryButtonAppearanceImpl.fromJson; +/// @nodoc +mixin _$PaymentSheetShadowOffset { - /// color theme of the primary button - @override - PaymentSheetPrimaryButtonTheme? get colors; +/// X value + double? get x;/// Y value + double? get y; +/// Create a copy of PaymentSheetShadowOffset +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetShadowOffsetCopyWith get copyWith => _$PaymentSheetShadowOffsetCopyWithImpl(this as PaymentSheetShadowOffset, _$identity); - /// Shape params of the primary button - @override - PaymentSheetPrimaryButtonShape? get shapes; + /// Serializes this PaymentSheetShadowOffset to a JSON map. + Map toJson(); - /// Create a copy of PaymentSheetPrimaryButtonAppearance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetPrimaryButtonAppearanceImplCopyWith< - _$PaymentSheetPrimaryButtonAppearanceImpl> - get copyWith => throw _privateConstructorUsedError; -} -PaymentSheetPrimaryButtonShape _$PaymentSheetPrimaryButtonShapeFromJson( - Map json) { - return _PaymentSheetPrimaryButtonShape.fromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetShadowOffset&&(identical(other.x, x) || other.x == x)&&(identical(other.y, y) || other.y == y)); } -/// @nodoc -mixin _$PaymentSheetPrimaryButtonShape { - /// Configuration of the primary button's shadow. - PaymentSheetShadowParams? get shadow => throw _privateConstructorUsedError; - - /// the blur radius of the button - double? get blurRadius => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,x,y); - /// border width of the primary button on the payment sheet - double? get borderWidth => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetShadowOffset(x: $x, y: $y)'; +} - /// Serializes this PaymentSheetPrimaryButtonShape to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetPrimaryButtonShape - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetPrimaryButtonShapeCopyWith - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $PaymentSheetPrimaryButtonShapeCopyWith<$Res> { - factory $PaymentSheetPrimaryButtonShapeCopyWith( - PaymentSheetPrimaryButtonShape value, - $Res Function(PaymentSheetPrimaryButtonShape) then) = - _$PaymentSheetPrimaryButtonShapeCopyWithImpl<$Res, - PaymentSheetPrimaryButtonShape>; - @useResult - $Res call( - {PaymentSheetShadowParams? shadow, - double? blurRadius, - double? borderWidth}); +abstract mixin class $PaymentSheetShadowOffsetCopyWith<$Res> { + factory $PaymentSheetShadowOffsetCopyWith(PaymentSheetShadowOffset value, $Res Function(PaymentSheetShadowOffset) _then) = _$PaymentSheetShadowOffsetCopyWithImpl; +@useResult +$Res call({ + double? x, double? y +}); - $PaymentSheetShadowParamsCopyWith<$Res>? get shadow; -} + + +} /// @nodoc -class _$PaymentSheetPrimaryButtonShapeCopyWithImpl<$Res, - $Val extends PaymentSheetPrimaryButtonShape> - implements $PaymentSheetPrimaryButtonShapeCopyWith<$Res> { - _$PaymentSheetPrimaryButtonShapeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetPrimaryButtonShape - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? shadow = freezed, - Object? blurRadius = freezed, - Object? borderWidth = freezed, - }) { - return _then(_value.copyWith( - shadow: freezed == shadow - ? _value.shadow - : shadow // ignore: cast_nullable_to_non_nullable - as PaymentSheetShadowParams?, - blurRadius: freezed == blurRadius - ? _value.blurRadius - : blurRadius // ignore: cast_nullable_to_non_nullable - as double?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); - } +class _$PaymentSheetShadowOffsetCopyWithImpl<$Res> + implements $PaymentSheetShadowOffsetCopyWith<$Res> { + _$PaymentSheetShadowOffsetCopyWithImpl(this._self, this._then); + + final PaymentSheetShadowOffset _self; + final $Res Function(PaymentSheetShadowOffset) _then; + +/// Create a copy of PaymentSheetShadowOffset +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? x = freezed,Object? y = freezed,}) { + return _then(_self.copyWith( +x: freezed == x ? _self.x : x // ignore: cast_nullable_to_non_nullable +as double?,y: freezed == y ? _self.y : y // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentSheetShadowOffset]. +extension PaymentSheetShadowOffsetPatterns on PaymentSheetShadowOffset { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetShadowOffset value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetShadowOffset() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetShadowOffset value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetShadowOffset(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetShadowOffset value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetShadowOffset() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? x, double? y)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetShadowOffset() when $default != null: +return $default(_that.x,_that.y);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? x, double? y) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetShadowOffset(): +return $default(_that.x,_that.y);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? x, double? y)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetShadowOffset() when $default != null: +return $default(_that.x,_that.y);case _: + return null; - /// Create a copy of PaymentSheetPrimaryButtonShape - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetShadowParamsCopyWith<$Res>? get shadow { - if (_value.shadow == null) { - return null; - } - - return $PaymentSheetShadowParamsCopyWith<$Res>(_value.shadow!, (value) { - return _then(_value.copyWith(shadow: value) as $Val); - }); - } +} } -/// @nodoc -abstract class _$$PaymentSheetPrimaryButtonShapeImplCopyWith<$Res> - implements $PaymentSheetPrimaryButtonShapeCopyWith<$Res> { - factory _$$PaymentSheetPrimaryButtonShapeImplCopyWith( - _$PaymentSheetPrimaryButtonShapeImpl value, - $Res Function(_$PaymentSheetPrimaryButtonShapeImpl) then) = - __$$PaymentSheetPrimaryButtonShapeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentSheetShadowParams? shadow, - double? blurRadius, - double? borderWidth}); - - @override - $PaymentSheetShadowParamsCopyWith<$Res>? get shadow; -} - -/// @nodoc -class __$$PaymentSheetPrimaryButtonShapeImplCopyWithImpl<$Res> - extends _$PaymentSheetPrimaryButtonShapeCopyWithImpl<$Res, - _$PaymentSheetPrimaryButtonShapeImpl> - implements _$$PaymentSheetPrimaryButtonShapeImplCopyWith<$Res> { - __$$PaymentSheetPrimaryButtonShapeImplCopyWithImpl( - _$PaymentSheetPrimaryButtonShapeImpl _value, - $Res Function(_$PaymentSheetPrimaryButtonShapeImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetPrimaryButtonShape - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? shadow = freezed, - Object? blurRadius = freezed, - Object? borderWidth = freezed, - }) { - return _then(_$PaymentSheetPrimaryButtonShapeImpl( - shadow: freezed == shadow - ? _value.shadow - : shadow // ignore: cast_nullable_to_non_nullable - as PaymentSheetShadowParams?, - blurRadius: freezed == blurRadius - ? _value.blurRadius - : blurRadius // ignore: cast_nullable_to_non_nullable - as double?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as double?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentSheetPrimaryButtonShapeImpl - implements _PaymentSheetPrimaryButtonShape { - const _$PaymentSheetPrimaryButtonShapeImpl( - {this.shadow, this.blurRadius, this.borderWidth}); - - factory _$PaymentSheetPrimaryButtonShapeImpl.fromJson( - Map json) => - _$$PaymentSheetPrimaryButtonShapeImplFromJson(json); - - /// Configuration of the primary button's shadow. - @override - final PaymentSheetShadowParams? shadow; - - /// the blur radius of the button - @override - final double? blurRadius; - - /// border width of the primary button on the payment sheet - @override - final double? borderWidth; - - @override - String toString() { - return 'PaymentSheetPrimaryButtonShape(shadow: $shadow, blurRadius: $blurRadius, borderWidth: $borderWidth)'; - } +class _PaymentSheetShadowOffset implements PaymentSheetShadowOffset { + const _PaymentSheetShadowOffset({this.x, this.y}); + factory _PaymentSheetShadowOffset.fromJson(Map json) => _$PaymentSheetShadowOffsetFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetPrimaryButtonShapeImpl && - (identical(other.shadow, shadow) || other.shadow == shadow) && - (identical(other.blurRadius, blurRadius) || - other.blurRadius == blurRadius) && - (identical(other.borderWidth, borderWidth) || - other.borderWidth == borderWidth)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, shadow, blurRadius, borderWidth); - - /// Create a copy of PaymentSheetPrimaryButtonShape - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetPrimaryButtonShapeImplCopyWith< - _$PaymentSheetPrimaryButtonShapeImpl> - get copyWith => __$$PaymentSheetPrimaryButtonShapeImplCopyWithImpl< - _$PaymentSheetPrimaryButtonShapeImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetPrimaryButtonShapeImplToJson( - this, - ); - } -} - -abstract class _PaymentSheetPrimaryButtonShape - implements PaymentSheetPrimaryButtonShape { - const factory _PaymentSheetPrimaryButtonShape( - {final PaymentSheetShadowParams? shadow, - final double? blurRadius, - final double? borderWidth}) = _$PaymentSheetPrimaryButtonShapeImpl; +/// X value +@override final double? x; +/// Y value +@override final double? y; - factory _PaymentSheetPrimaryButtonShape.fromJson(Map json) = - _$PaymentSheetPrimaryButtonShapeImpl.fromJson; +/// Create a copy of PaymentSheetShadowOffset +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetShadowOffsetCopyWith<_PaymentSheetShadowOffset> get copyWith => __$PaymentSheetShadowOffsetCopyWithImpl<_PaymentSheetShadowOffset>(this, _$identity); - /// Configuration of the primary button's shadow. - @override - PaymentSheetShadowParams? get shadow; +@override +Map toJson() { + return _$PaymentSheetShadowOffsetToJson(this, ); +} - /// the blur radius of the button - @override - double? get blurRadius; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetShadowOffset&&(identical(other.x, x) || other.x == x)&&(identical(other.y, y) || other.y == y)); +} - /// border width of the primary button on the payment sheet - @override - double? get borderWidth; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,x,y); - /// Create a copy of PaymentSheetPrimaryButtonShape - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetPrimaryButtonShapeImplCopyWith< - _$PaymentSheetPrimaryButtonShapeImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetShadowOffset(x: $x, y: $y)'; } -PaymentSheetPrimaryButtonTheme _$PaymentSheetPrimaryButtonThemeFromJson( - Map json) { - return _PaymentSheetPrimaryButtonTheme.fromJson(json); + } /// @nodoc -mixin _$PaymentSheetPrimaryButtonTheme { - /// Colors when displaying button in dark theme - PaymentSheetPrimaryButtonThemeColors? get dark => - throw _privateConstructorUsedError; +abstract mixin class _$PaymentSheetShadowOffsetCopyWith<$Res> implements $PaymentSheetShadowOffsetCopyWith<$Res> { + factory _$PaymentSheetShadowOffsetCopyWith(_PaymentSheetShadowOffset value, $Res Function(_PaymentSheetShadowOffset) _then) = __$PaymentSheetShadowOffsetCopyWithImpl; +@override @useResult +$Res call({ + double? x, double? y +}); - /// Colors when displaying button in light theme - PaymentSheetPrimaryButtonThemeColors? get light => - throw _privateConstructorUsedError; - - /// Serializes this PaymentSheetPrimaryButtonTheme to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetPrimaryButtonThemeCopyWith - get copyWith => throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $PaymentSheetPrimaryButtonThemeCopyWith<$Res> { - factory $PaymentSheetPrimaryButtonThemeCopyWith( - PaymentSheetPrimaryButtonTheme value, - $Res Function(PaymentSheetPrimaryButtonTheme) then) = - _$PaymentSheetPrimaryButtonThemeCopyWithImpl<$Res, - PaymentSheetPrimaryButtonTheme>; - @useResult - $Res call( - {PaymentSheetPrimaryButtonThemeColors? dark, - PaymentSheetPrimaryButtonThemeColors? light}); - $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark; - $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light; } - /// @nodoc -class _$PaymentSheetPrimaryButtonThemeCopyWithImpl<$Res, - $Val extends PaymentSheetPrimaryButtonTheme> - implements $PaymentSheetPrimaryButtonThemeCopyWith<$Res> { - _$PaymentSheetPrimaryButtonThemeCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? dark = freezed, - Object? light = freezed, - }) { - return _then(_value.copyWith( - dark: freezed == dark - ? _value.dark - : dark // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonThemeColors?, - light: freezed == light - ? _value.light - : light // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonThemeColors?, - ) as $Val); - } +class __$PaymentSheetShadowOffsetCopyWithImpl<$Res> + implements _$PaymentSheetShadowOffsetCopyWith<$Res> { + __$PaymentSheetShadowOffsetCopyWithImpl(this._self, this._then); - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark { - if (_value.dark == null) { - return null; - } - - return $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>(_value.dark!, - (value) { - return _then(_value.copyWith(dark: value) as $Val); - }); - } + final _PaymentSheetShadowOffset _self; + final $Res Function(_PaymentSheetShadowOffset) _then; - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light { - if (_value.light == null) { - return null; - } - - return $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>(_value.light!, - (value) { - return _then(_value.copyWith(light: value) as $Val); - }); - } +/// Create a copy of PaymentSheetShadowOffset +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? x = freezed,Object? y = freezed,}) { + return _then(_PaymentSheetShadowOffset( +x: freezed == x ? _self.x : x // ignore: cast_nullable_to_non_nullable +as double?,y: freezed == y ? _self.y : y // ignore: cast_nullable_to_non_nullable +as double?, + )); } -/// @nodoc -abstract class _$$PaymentSheetPrimaryButtonThemeImplCopyWith<$Res> - implements $PaymentSheetPrimaryButtonThemeCopyWith<$Res> { - factory _$$PaymentSheetPrimaryButtonThemeImplCopyWith( - _$PaymentSheetPrimaryButtonThemeImpl value, - $Res Function(_$PaymentSheetPrimaryButtonThemeImpl) then) = - __$$PaymentSheetPrimaryButtonThemeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentSheetPrimaryButtonThemeColors? dark, - PaymentSheetPrimaryButtonThemeColors? light}); - - @override - $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark; - @override - $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light; -} - -/// @nodoc -class __$$PaymentSheetPrimaryButtonThemeImplCopyWithImpl<$Res> - extends _$PaymentSheetPrimaryButtonThemeCopyWithImpl<$Res, - _$PaymentSheetPrimaryButtonThemeImpl> - implements _$$PaymentSheetPrimaryButtonThemeImplCopyWith<$Res> { - __$$PaymentSheetPrimaryButtonThemeImplCopyWithImpl( - _$PaymentSheetPrimaryButtonThemeImpl _value, - $Res Function(_$PaymentSheetPrimaryButtonThemeImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? dark = freezed, - Object? light = freezed, - }) { - return _then(_$PaymentSheetPrimaryButtonThemeImpl( - dark: freezed == dark - ? _value.dark - : dark // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonThemeColors?, - light: freezed == light - ? _value.light - : light // ignore: cast_nullable_to_non_nullable - as PaymentSheetPrimaryButtonThemeColors?, - )); - } + } + /// @nodoc +mixin _$PaymentSheetPrimaryButtonAppearance { -@JsonSerializable(explicitToJson: true) -class _$PaymentSheetPrimaryButtonThemeImpl - implements _PaymentSheetPrimaryButtonTheme { - const _$PaymentSheetPrimaryButtonThemeImpl({this.dark, this.light}); +/// color theme of the primary button + PaymentSheetPrimaryButtonTheme? get colors;/// Shape params of the primary button + PaymentSheetPrimaryButtonShape? get shapes; +/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonAppearanceCopyWith get copyWith => _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl(this as PaymentSheetPrimaryButtonAppearance, _$identity); - factory _$PaymentSheetPrimaryButtonThemeImpl.fromJson( - Map json) => - _$$PaymentSheetPrimaryButtonThemeImplFromJson(json); + /// Serializes this PaymentSheetPrimaryButtonAppearance to a JSON map. + Map toJson(); - /// Colors when displaying button in dark theme - @override - final PaymentSheetPrimaryButtonThemeColors? dark; - /// Colors when displaying button in light theme - @override - final PaymentSheetPrimaryButtonThemeColors? light; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetPrimaryButtonAppearance&&(identical(other.colors, colors) || other.colors == colors)&&(identical(other.shapes, shapes) || other.shapes == shapes)); +} - @override - String toString() { - return 'PaymentSheetPrimaryButtonTheme(dark: $dark, light: $light)'; - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,colors,shapes); + +@override +String toString() { + return 'PaymentSheetPrimaryButtonAppearance(colors: $colors, shapes: $shapes)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetPrimaryButtonThemeImpl && - (identical(other.dark, dark) || other.dark == dark) && - (identical(other.light, light) || other.light == light)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, dark, light); - - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetPrimaryButtonThemeImplCopyWith< - _$PaymentSheetPrimaryButtonThemeImpl> - get copyWith => __$$PaymentSheetPrimaryButtonThemeImplCopyWithImpl< - _$PaymentSheetPrimaryButtonThemeImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetPrimaryButtonThemeImplToJson( - this, - ); - } } -abstract class _PaymentSheetPrimaryButtonTheme - implements PaymentSheetPrimaryButtonTheme { - const factory _PaymentSheetPrimaryButtonTheme( - {final PaymentSheetPrimaryButtonThemeColors? dark, - final PaymentSheetPrimaryButtonThemeColors? light}) = - _$PaymentSheetPrimaryButtonThemeImpl; +/// @nodoc +abstract mixin class $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { + factory $PaymentSheetPrimaryButtonAppearanceCopyWith(PaymentSheetPrimaryButtonAppearance value, $Res Function(PaymentSheetPrimaryButtonAppearance) _then) = _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl; +@useResult +$Res call({ + PaymentSheetPrimaryButtonTheme? colors, PaymentSheetPrimaryButtonShape? shapes +}); - factory _PaymentSheetPrimaryButtonTheme.fromJson(Map json) = - _$PaymentSheetPrimaryButtonThemeImpl.fromJson; - /// Colors when displaying button in dark theme - @override - PaymentSheetPrimaryButtonThemeColors? get dark; +$PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors;$PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes; - /// Colors when displaying button in light theme - @override - PaymentSheetPrimaryButtonThemeColors? get light; +} +/// @nodoc +class _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl<$Res> + implements $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { + _$PaymentSheetPrimaryButtonAppearanceCopyWithImpl(this._self, this._then); + + final PaymentSheetPrimaryButtonAppearance _self; + final $Res Function(PaymentSheetPrimaryButtonAppearance) _then; + +/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? colors = freezed,Object? shapes = freezed,}) { + return _then(_self.copyWith( +colors: freezed == colors ? _self.colors : colors // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonTheme?,shapes: freezed == shapes ? _self.shapes : shapes // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonShape?, + )); +} +/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors { + if (_self.colors == null) { + return null; + } + + return $PaymentSheetPrimaryButtonThemeCopyWith<$Res>(_self.colors!, (value) { + return _then(_self.copyWith(colors: value)); + }); +}/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes { + if (_self.shapes == null) { + return null; + } + + return $PaymentSheetPrimaryButtonShapeCopyWith<$Res>(_self.shapes!, (value) { + return _then(_self.copyWith(shapes: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetPrimaryButtonAppearance]. +extension PaymentSheetPrimaryButtonAppearancePatterns on PaymentSheetPrimaryButtonAppearance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetPrimaryButtonAppearance value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonAppearance() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetPrimaryButtonAppearance value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonAppearance(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetPrimaryButtonAppearance value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonAppearance() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentSheetPrimaryButtonTheme? colors, PaymentSheetPrimaryButtonShape? shapes)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonAppearance() when $default != null: +return $default(_that.colors,_that.shapes);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentSheetPrimaryButtonTheme? colors, PaymentSheetPrimaryButtonShape? shapes) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonAppearance(): +return $default(_that.colors,_that.shapes);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentSheetPrimaryButtonTheme? colors, PaymentSheetPrimaryButtonShape? shapes)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonAppearance() when $default != null: +return $default(_that.colors,_that.shapes);case _: + return null; - /// Create a copy of PaymentSheetPrimaryButtonTheme - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetPrimaryButtonThemeImplCopyWith< - _$PaymentSheetPrimaryButtonThemeImpl> - get copyWith => throw _privateConstructorUsedError; +} } -PaymentSheetPrimaryButtonThemeColors - _$PaymentSheetPrimaryButtonThemeColorsFromJson(Map json) { - return _PaymentSheetPrimaryButtonThemeColors.fromJson(json); } /// @nodoc -mixin _$PaymentSheetPrimaryButtonThemeColors { - /// Primary button background color - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get background => throw _privateConstructorUsedError; - /// Primary button text color - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get text => throw _privateConstructorUsedError; +@JsonSerializable(explicitToJson: true) +class _PaymentSheetPrimaryButtonAppearance implements PaymentSheetPrimaryButtonAppearance { + const _PaymentSheetPrimaryButtonAppearance({this.colors, this.shapes}); + factory _PaymentSheetPrimaryButtonAppearance.fromJson(Map json) => _$PaymentSheetPrimaryButtonAppearanceFromJson(json); - /// Primary button border color - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get border => throw _privateConstructorUsedError; +/// color theme of the primary button +@override final PaymentSheetPrimaryButtonTheme? colors; +/// Shape params of the primary button +@override final PaymentSheetPrimaryButtonShape? shapes; - /// Serializes this PaymentSheetPrimaryButtonThemeColors to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetPrimaryButtonAppearanceCopyWith<_PaymentSheetPrimaryButtonAppearance> get copyWith => __$PaymentSheetPrimaryButtonAppearanceCopyWithImpl<_PaymentSheetPrimaryButtonAppearance>(this, _$identity); - /// Create a copy of PaymentSheetPrimaryButtonThemeColors - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetPrimaryButtonThemeColorsCopyWith< - PaymentSheetPrimaryButtonThemeColors> - get copyWith => throw _privateConstructorUsedError; +@override +Map toJson() { + return _$PaymentSheetPrimaryButtonAppearanceToJson(this, ); } -/// @nodoc -abstract class $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { - factory $PaymentSheetPrimaryButtonThemeColorsCopyWith( - PaymentSheetPrimaryButtonThemeColors value, - $Res Function(PaymentSheetPrimaryButtonThemeColors) then) = - _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl<$Res, - PaymentSheetPrimaryButtonThemeColors>; - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? text, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? border}); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetPrimaryButtonAppearance&&(identical(other.colors, colors) || other.colors == colors)&&(identical(other.shapes, shapes) || other.shapes == shapes)); } -/// @nodoc -class _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl<$Res, - $Val extends PaymentSheetPrimaryButtonThemeColors> - implements $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { - _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetPrimaryButtonThemeColors - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? background = freezed, - Object? text = freezed, - Object? border = freezed, - }) { - return _then(_value.copyWith( - background: freezed == background - ? _value.background - : background // ignore: cast_nullable_to_non_nullable - as Color?, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as Color?, - border: freezed == border - ? _value.border - : border // ignore: cast_nullable_to_non_nullable - as Color?, - ) as $Val); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,colors,shapes); + +@override +String toString() { + return 'PaymentSheetPrimaryButtonAppearance(colors: $colors, shapes: $shapes)'; } -/// @nodoc -abstract class _$$PaymentSheetPrimaryButtonThemeColorsImplCopyWith<$Res> - implements $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { - factory _$$PaymentSheetPrimaryButtonThemeColorsImplCopyWith( - _$PaymentSheetPrimaryButtonThemeColorsImpl value, - $Res Function(_$PaymentSheetPrimaryButtonThemeColorsImpl) then) = - __$$PaymentSheetPrimaryButtonThemeColorsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? text, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? border}); -} - -/// @nodoc -class __$$PaymentSheetPrimaryButtonThemeColorsImplCopyWithImpl<$Res> - extends _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl<$Res, - _$PaymentSheetPrimaryButtonThemeColorsImpl> - implements _$$PaymentSheetPrimaryButtonThemeColorsImplCopyWith<$Res> { - __$$PaymentSheetPrimaryButtonThemeColorsImplCopyWithImpl( - _$PaymentSheetPrimaryButtonThemeColorsImpl _value, - $Res Function(_$PaymentSheetPrimaryButtonThemeColorsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetPrimaryButtonThemeColors - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? background = freezed, - Object? text = freezed, - Object? border = freezed, - }) { - return _then(_$PaymentSheetPrimaryButtonThemeColorsImpl( - background: freezed == background - ? _value.background - : background // ignore: cast_nullable_to_non_nullable - as Color?, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as Color?, - border: freezed == border - ? _value.border - : border // ignore: cast_nullable_to_non_nullable - as Color?, - )); - } + } /// @nodoc -@JsonSerializable() -class _$PaymentSheetPrimaryButtonThemeColorsImpl - implements _PaymentSheetPrimaryButtonThemeColors { - const _$PaymentSheetPrimaryButtonThemeColorsImpl( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.text, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - this.border}); - - factory _$PaymentSheetPrimaryButtonThemeColorsImpl.fromJson( - Map json) => - _$$PaymentSheetPrimaryButtonThemeColorsImplFromJson(json); - - /// Primary button background color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? background; - - /// Primary button text color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? text; - - /// Primary button border color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? border; - - @override - String toString() { - return 'PaymentSheetPrimaryButtonThemeColors(background: $background, text: $text, border: $border)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetPrimaryButtonThemeColorsImpl && - (identical(other.background, background) || - other.background == background) && - (identical(other.text, text) || other.text == text) && - (identical(other.border, border) || other.border == border)); - } +abstract mixin class _$PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> implements $PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { + factory _$PaymentSheetPrimaryButtonAppearanceCopyWith(_PaymentSheetPrimaryButtonAppearance value, $Res Function(_PaymentSheetPrimaryButtonAppearance) _then) = __$PaymentSheetPrimaryButtonAppearanceCopyWithImpl; +@override @useResult +$Res call({ + PaymentSheetPrimaryButtonTheme? colors, PaymentSheetPrimaryButtonShape? shapes +}); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, background, text, border); - - /// Create a copy of PaymentSheetPrimaryButtonThemeColors - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetPrimaryButtonThemeColorsImplCopyWith< - _$PaymentSheetPrimaryButtonThemeColorsImpl> - get copyWith => __$$PaymentSheetPrimaryButtonThemeColorsImplCopyWithImpl< - _$PaymentSheetPrimaryButtonThemeColorsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetPrimaryButtonThemeColorsImplToJson( - this, - ); - } -} -abstract class _PaymentSheetPrimaryButtonThemeColors - implements PaymentSheetPrimaryButtonThemeColors { - const factory _PaymentSheetPrimaryButtonThemeColors( - {@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? background, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? text, - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - final Color? border}) = _$PaymentSheetPrimaryButtonThemeColorsImpl; - - factory _PaymentSheetPrimaryButtonThemeColors.fromJson( - Map json) = - _$PaymentSheetPrimaryButtonThemeColorsImpl.fromJson; - - /// Primary button background color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get background; - - /// Primary button text color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get text; - - /// Primary button border color - @override - @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) - Color? get border; - - /// Create a copy of PaymentSheetPrimaryButtonThemeColors - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetPrimaryButtonThemeColorsImplCopyWith< - _$PaymentSheetPrimaryButtonThemeColorsImpl> - get copyWith => throw _privateConstructorUsedError; -} +@override $PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors;@override $PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes; -PresentPaymentSheetParameters _$PresentPaymentSheetParametersFromJson( - Map json) { - return _PresentParameters.fromJson(json); } - /// @nodoc -mixin _$PresentPaymentSheetParameters { - /// Key used for client-side retrieval using a publishable key. - String get clientSecret => throw _privateConstructorUsedError; - - /// Flag that determines whether or not to present payment options or - /// directly goes to confirm payment. - /// - /// When value is `false` make sure [SetupPaymentSheetParameters.customFlow] - /// is set to `true` when initializing the payment sheet. - /// If value is set to `true` [SetupPaymentSheetParameters.customFlow] - /// has to be set to `false` when initializing the payment sheet. - bool get confirmPayment => throw _privateConstructorUsedError; - - /// Serializes this PresentPaymentSheetParameters to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +class __$PaymentSheetPrimaryButtonAppearanceCopyWithImpl<$Res> + implements _$PaymentSheetPrimaryButtonAppearanceCopyWith<$Res> { + __$PaymentSheetPrimaryButtonAppearanceCopyWithImpl(this._self, this._then); - /// Create a copy of PresentPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PresentPaymentSheetParametersCopyWith - get copyWith => throw _privateConstructorUsedError; -} + final _PaymentSheetPrimaryButtonAppearance _self; + final $Res Function(_PaymentSheetPrimaryButtonAppearance) _then; -/// @nodoc -abstract class $PresentPaymentSheetParametersCopyWith<$Res> { - factory $PresentPaymentSheetParametersCopyWith( - PresentPaymentSheetParameters value, - $Res Function(PresentPaymentSheetParameters) then) = - _$PresentPaymentSheetParametersCopyWithImpl<$Res, - PresentPaymentSheetParameters>; - @useResult - $Res call({String clientSecret, bool confirmPayment}); +/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? colors = freezed,Object? shapes = freezed,}) { + return _then(_PaymentSheetPrimaryButtonAppearance( +colors: freezed == colors ? _self.colors : colors // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonTheme?,shapes: freezed == shapes ? _self.shapes : shapes // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonShape?, + )); } -/// @nodoc -class _$PresentPaymentSheetParametersCopyWithImpl<$Res, - $Val extends PresentPaymentSheetParameters> - implements $PresentPaymentSheetParametersCopyWith<$Res> { - _$PresentPaymentSheetParametersCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PresentPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? clientSecret = null, - Object? confirmPayment = null, - }) { - return _then(_value.copyWith( - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - confirmPayment: null == confirmPayment - ? _value.confirmPayment - : confirmPayment // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); +/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeCopyWith<$Res>? get colors { + if (_self.colors == null) { + return null; } -} -/// @nodoc -abstract class _$$PresentParametersImplCopyWith<$Res> - implements $PresentPaymentSheetParametersCopyWith<$Res> { - factory _$$PresentParametersImplCopyWith(_$PresentParametersImpl value, - $Res Function(_$PresentParametersImpl) then) = - __$$PresentParametersImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String clientSecret, bool confirmPayment}); -} - -/// @nodoc -class __$$PresentParametersImplCopyWithImpl<$Res> - extends _$PresentPaymentSheetParametersCopyWithImpl<$Res, - _$PresentParametersImpl> - implements _$$PresentParametersImplCopyWith<$Res> { - __$$PresentParametersImplCopyWithImpl(_$PresentParametersImpl _value, - $Res Function(_$PresentParametersImpl) _then) - : super(_value, _then); - - /// Create a copy of PresentPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? clientSecret = null, - Object? confirmPayment = null, - }) { - return _then(_$PresentParametersImpl( - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - confirmPayment: null == confirmPayment - ? _value.confirmPayment - : confirmPayment // ignore: cast_nullable_to_non_nullable - as bool, - )); + return $PaymentSheetPrimaryButtonThemeCopyWith<$Res>(_self.colors!, (value) { + return _then(_self.copyWith(colors: value)); + }); +}/// Create a copy of PaymentSheetPrimaryButtonAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonShapeCopyWith<$Res>? get shapes { + if (_self.shapes == null) { + return null; } + + return $PaymentSheetPrimaryButtonShapeCopyWith<$Res>(_self.shapes!, (value) { + return _then(_self.copyWith(shapes: value)); + }); +} } -/// @nodoc -@JsonSerializable() -class _$PresentParametersImpl implements _PresentParameters { - const _$PresentParametersImpl( - {required this.clientSecret, this.confirmPayment = false}); - - factory _$PresentParametersImpl.fromJson(Map json) => - _$$PresentParametersImplFromJson(json); - - /// Key used for client-side retrieval using a publishable key. - @override - final String clientSecret; - - /// Flag that determines whether or not to present payment options or - /// directly goes to confirm payment. - /// - /// When value is `false` make sure [SetupPaymentSheetParameters.customFlow] - /// is set to `true` when initializing the payment sheet. - /// If value is set to `true` [SetupPaymentSheetParameters.customFlow] - /// has to be set to `false` when initializing the payment sheet. - @override - @JsonKey() - final bool confirmPayment; - - @override - String toString() { - return 'PresentPaymentSheetParameters(clientSecret: $clientSecret, confirmPayment: $confirmPayment)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PresentParametersImpl && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.confirmPayment, confirmPayment) || - other.confirmPayment == confirmPayment)); - } +/// @nodoc +mixin _$PaymentSheetPrimaryButtonShape { - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, clientSecret, confirmPayment); - - /// Create a copy of PresentPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PresentParametersImplCopyWith<_$PresentParametersImpl> get copyWith => - __$$PresentParametersImplCopyWithImpl<_$PresentParametersImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$PresentParametersImplToJson( - this, - ); - } -} +/// Configuration of the primary button's shadow. + PaymentSheetShadowParams? get shadow;/// the blur radius of the button + double? get blurRadius;/// border width of the primary button on the payment sheet + double? get borderWidth; +/// Create a copy of PaymentSheetPrimaryButtonShape +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonShapeCopyWith get copyWith => _$PaymentSheetPrimaryButtonShapeCopyWithImpl(this as PaymentSheetPrimaryButtonShape, _$identity); -abstract class _PresentParameters implements PresentPaymentSheetParameters { - const factory _PresentParameters( - {required final String clientSecret, - final bool confirmPayment}) = _$PresentParametersImpl; + /// Serializes this PaymentSheetPrimaryButtonShape to a JSON map. + Map toJson(); - factory _PresentParameters.fromJson(Map json) = - _$PresentParametersImpl.fromJson; - /// Key used for client-side retrieval using a publishable key. - @override - String get clientSecret; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetPrimaryButtonShape&&(identical(other.shadow, shadow) || other.shadow == shadow)&&(identical(other.blurRadius, blurRadius) || other.blurRadius == blurRadius)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)); +} - /// Flag that determines whether or not to present payment options or - /// directly goes to confirm payment. - /// - /// When value is `false` make sure [SetupPaymentSheetParameters.customFlow] - /// is set to `true` when initializing the payment sheet. - /// If value is set to `true` [SetupPaymentSheetParameters.customFlow] - /// has to be set to `false` when initializing the payment sheet. - @override - bool get confirmPayment; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,shadow,blurRadius,borderWidth); - /// Create a copy of PresentPaymentSheetParameters - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PresentParametersImplCopyWith<_$PresentParametersImpl> get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetPrimaryButtonShape(shadow: $shadow, blurRadius: $blurRadius, borderWidth: $borderWidth)'; } -PaymentSheetPresentOptions _$PaymentSheetPresentOptionsFromJson( - Map json) { - return _PaymentSheetPresentOptions.fromJson(json); + } /// @nodoc -mixin _$PaymentSheetPresentOptions { - /// The number of milliseconds (after presenting) before the Payment Sheet - /// closes automatically. - /// - /// At which point presentPaymentSheet` will resolve with an error. - int? get timeout => throw _privateConstructorUsedError; +abstract mixin class $PaymentSheetPrimaryButtonShapeCopyWith<$Res> { + factory $PaymentSheetPrimaryButtonShapeCopyWith(PaymentSheetPrimaryButtonShape value, $Res Function(PaymentSheetPrimaryButtonShape) _then) = _$PaymentSheetPrimaryButtonShapeCopyWithImpl; +@useResult +$Res call({ + PaymentSheetShadowParams? shadow, double? blurRadius, double? borderWidth +}); - /// Serializes this PaymentSheetPresentOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PaymentSheetPresentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetPresentOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; -} +$PaymentSheetShadowParamsCopyWith<$Res>? get shadow; -/// @nodoc -abstract class $PaymentSheetPresentOptionsCopyWith<$Res> { - factory $PaymentSheetPresentOptionsCopyWith(PaymentSheetPresentOptions value, - $Res Function(PaymentSheetPresentOptions) then) = - _$PaymentSheetPresentOptionsCopyWithImpl<$Res, - PaymentSheetPresentOptions>; - @useResult - $Res call({int? timeout}); } - /// @nodoc -class _$PaymentSheetPresentOptionsCopyWithImpl<$Res, - $Val extends PaymentSheetPresentOptions> - implements $PaymentSheetPresentOptionsCopyWith<$Res> { - _$PaymentSheetPresentOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetPresentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? timeout = freezed, - }) { - return _then(_value.copyWith( - timeout: freezed == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); - } +class _$PaymentSheetPrimaryButtonShapeCopyWithImpl<$Res> + implements $PaymentSheetPrimaryButtonShapeCopyWith<$Res> { + _$PaymentSheetPrimaryButtonShapeCopyWithImpl(this._self, this._then); + + final PaymentSheetPrimaryButtonShape _self; + final $Res Function(PaymentSheetPrimaryButtonShape) _then; + +/// Create a copy of PaymentSheetPrimaryButtonShape +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? shadow = freezed,Object? blurRadius = freezed,Object? borderWidth = freezed,}) { + return _then(_self.copyWith( +shadow: freezed == shadow ? _self.shadow : shadow // ignore: cast_nullable_to_non_nullable +as PaymentSheetShadowParams?,blurRadius: freezed == blurRadius ? _self.blurRadius : blurRadius // ignore: cast_nullable_to_non_nullable +as double?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as double?, + )); +} +/// Create a copy of PaymentSheetPrimaryButtonShape +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShadowParamsCopyWith<$Res>? get shadow { + if (_self.shadow == null) { + return null; + } + + return $PaymentSheetShadowParamsCopyWith<$Res>(_self.shadow!, (value) { + return _then(_self.copyWith(shadow: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetPrimaryButtonShape]. +extension PaymentSheetPrimaryButtonShapePatterns on PaymentSheetPrimaryButtonShape { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetPrimaryButtonShape value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonShape() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetPrimaryButtonShape value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonShape(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetPrimaryButtonShape value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonShape() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentSheetShadowParams? shadow, double? blurRadius, double? borderWidth)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonShape() when $default != null: +return $default(_that.shadow,_that.blurRadius,_that.borderWidth);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentSheetShadowParams? shadow, double? blurRadius, double? borderWidth) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonShape(): +return $default(_that.shadow,_that.blurRadius,_that.borderWidth);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentSheetShadowParams? shadow, double? blurRadius, double? borderWidth)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonShape() when $default != null: +return $default(_that.shadow,_that.blurRadius,_that.borderWidth);case _: + return null; + +} } -/// @nodoc -abstract class _$$PaymentSheetPresentOptionsImplCopyWith<$Res> - implements $PaymentSheetPresentOptionsCopyWith<$Res> { - factory _$$PaymentSheetPresentOptionsImplCopyWith( - _$PaymentSheetPresentOptionsImpl value, - $Res Function(_$PaymentSheetPresentOptionsImpl) then) = - __$$PaymentSheetPresentOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int? timeout}); -} - -/// @nodoc -class __$$PaymentSheetPresentOptionsImplCopyWithImpl<$Res> - extends _$PaymentSheetPresentOptionsCopyWithImpl<$Res, - _$PaymentSheetPresentOptionsImpl> - implements _$$PaymentSheetPresentOptionsImplCopyWith<$Res> { - __$$PaymentSheetPresentOptionsImplCopyWithImpl( - _$PaymentSheetPresentOptionsImpl _value, - $Res Function(_$PaymentSheetPresentOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetPresentOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? timeout = freezed, - }) { - return _then(_$PaymentSheetPresentOptionsImpl( - timeout: freezed == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as int?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentSheetPresentOptionsImpl implements _PaymentSheetPresentOptions { - const _$PaymentSheetPresentOptionsImpl({this.timeout}); - - factory _$PaymentSheetPresentOptionsImpl.fromJson( - Map json) => - _$$PaymentSheetPresentOptionsImplFromJson(json); - - /// The number of milliseconds (after presenting) before the Payment Sheet - /// closes automatically. - /// - /// At which point presentPaymentSheet` will resolve with an error. - @override - final int? timeout; - - @override - String toString() { - return 'PaymentSheetPresentOptions(timeout: $timeout)'; - } +class _PaymentSheetPrimaryButtonShape implements PaymentSheetPrimaryButtonShape { + const _PaymentSheetPrimaryButtonShape({this.shadow, this.blurRadius, this.borderWidth}); + factory _PaymentSheetPrimaryButtonShape.fromJson(Map json) => _$PaymentSheetPrimaryButtonShapeFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetPresentOptionsImpl && - (identical(other.timeout, timeout) || other.timeout == timeout)); - } +/// Configuration of the primary button's shadow. +@override final PaymentSheetShadowParams? shadow; +/// the blur radius of the button +@override final double? blurRadius; +/// border width of the primary button on the payment sheet +@override final double? borderWidth; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, timeout); - - /// Create a copy of PaymentSheetPresentOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetPresentOptionsImplCopyWith<_$PaymentSheetPresentOptionsImpl> - get copyWith => __$$PaymentSheetPresentOptionsImplCopyWithImpl< - _$PaymentSheetPresentOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetPresentOptionsImplToJson( - this, - ); - } -} +/// Create a copy of PaymentSheetPrimaryButtonShape +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetPrimaryButtonShapeCopyWith<_PaymentSheetPrimaryButtonShape> get copyWith => __$PaymentSheetPrimaryButtonShapeCopyWithImpl<_PaymentSheetPrimaryButtonShape>(this, _$identity); -abstract class _PaymentSheetPresentOptions - implements PaymentSheetPresentOptions { - const factory _PaymentSheetPresentOptions({final int? timeout}) = - _$PaymentSheetPresentOptionsImpl; +@override +Map toJson() { + return _$PaymentSheetPrimaryButtonShapeToJson(this, ); +} - factory _PaymentSheetPresentOptions.fromJson(Map json) = - _$PaymentSheetPresentOptionsImpl.fromJson; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetPrimaryButtonShape&&(identical(other.shadow, shadow) || other.shadow == shadow)&&(identical(other.blurRadius, blurRadius) || other.blurRadius == blurRadius)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)); +} - /// The number of milliseconds (after presenting) before the Payment Sheet - /// closes automatically. - /// - /// At which point presentPaymentSheet` will resolve with an error. - @override - int? get timeout; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,shadow,blurRadius,borderWidth); - /// Create a copy of PaymentSheetPresentOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetPresentOptionsImplCopyWith<_$PaymentSheetPresentOptionsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PaymentSheetPrimaryButtonShape(shadow: $shadow, blurRadius: $blurRadius, borderWidth: $borderWidth)'; } -PaymentSheetPaymentOption _$PaymentSheetPaymentOptionFromJson( - Map json) { - return _PaymentSheetPaymentOption.fromJson(json); + } /// @nodoc -mixin _$PaymentSheetPaymentOption { - /// The label of the payment option - String get label => throw _privateConstructorUsedError; +abstract mixin class _$PaymentSheetPrimaryButtonShapeCopyWith<$Res> implements $PaymentSheetPrimaryButtonShapeCopyWith<$Res> { + factory _$PaymentSheetPrimaryButtonShapeCopyWith(_PaymentSheetPrimaryButtonShape value, $Res Function(_PaymentSheetPrimaryButtonShape) _then) = __$PaymentSheetPrimaryButtonShapeCopyWithImpl; +@override @useResult +$Res call({ + PaymentSheetShadowParams? shadow, double? blurRadius, double? borderWidth +}); - /// String decoding of the image - String? get image => throw _privateConstructorUsedError; - /// Serializes this PaymentSheetPaymentOption to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override $PaymentSheetShadowParamsCopyWith<$Res>? get shadow; - /// Create a copy of PaymentSheetPaymentOption - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PaymentSheetPaymentOptionCopyWith get copyWith => - throw _privateConstructorUsedError; } - /// @nodoc -abstract class $PaymentSheetPaymentOptionCopyWith<$Res> { - factory $PaymentSheetPaymentOptionCopyWith(PaymentSheetPaymentOption value, - $Res Function(PaymentSheetPaymentOption) then) = - _$PaymentSheetPaymentOptionCopyWithImpl<$Res, PaymentSheetPaymentOption>; - @useResult - $Res call({String label, String? image}); -} +class __$PaymentSheetPrimaryButtonShapeCopyWithImpl<$Res> + implements _$PaymentSheetPrimaryButtonShapeCopyWith<$Res> { + __$PaymentSheetPrimaryButtonShapeCopyWithImpl(this._self, this._then); -/// @nodoc -class _$PaymentSheetPaymentOptionCopyWithImpl<$Res, - $Val extends PaymentSheetPaymentOption> - implements $PaymentSheetPaymentOptionCopyWith<$Res> { - _$PaymentSheetPaymentOptionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PaymentSheetPaymentOption - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? image = freezed, - }) { - return _then(_value.copyWith( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - image: freezed == image - ? _value.image - : image // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + final _PaymentSheetPrimaryButtonShape _self; + final $Res Function(_PaymentSheetPrimaryButtonShape) _then; + +/// Create a copy of PaymentSheetPrimaryButtonShape +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? shadow = freezed,Object? blurRadius = freezed,Object? borderWidth = freezed,}) { + return _then(_PaymentSheetPrimaryButtonShape( +shadow: freezed == shadow ? _self.shadow : shadow // ignore: cast_nullable_to_non_nullable +as PaymentSheetShadowParams?,blurRadius: freezed == blurRadius ? _self.blurRadius : blurRadius // ignore: cast_nullable_to_non_nullable +as double?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as double?, + )); } -/// @nodoc -abstract class _$$PaymentSheetPaymentOptionImplCopyWith<$Res> - implements $PaymentSheetPaymentOptionCopyWith<$Res> { - factory _$$PaymentSheetPaymentOptionImplCopyWith( - _$PaymentSheetPaymentOptionImpl value, - $Res Function(_$PaymentSheetPaymentOptionImpl) then) = - __$$PaymentSheetPaymentOptionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String label, String? image}); -} - -/// @nodoc -class __$$PaymentSheetPaymentOptionImplCopyWithImpl<$Res> - extends _$PaymentSheetPaymentOptionCopyWithImpl<$Res, - _$PaymentSheetPaymentOptionImpl> - implements _$$PaymentSheetPaymentOptionImplCopyWith<$Res> { - __$$PaymentSheetPaymentOptionImplCopyWithImpl( - _$PaymentSheetPaymentOptionImpl _value, - $Res Function(_$PaymentSheetPaymentOptionImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentSheetPaymentOption - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? label = null, - Object? image = freezed, - }) { - return _then(_$PaymentSheetPaymentOptionImpl( - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - image: freezed == image - ? _value.image - : image // ignore: cast_nullable_to_non_nullable - as String?, - )); +/// Create a copy of PaymentSheetPrimaryButtonShape +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetShadowParamsCopyWith<$Res>? get shadow { + if (_self.shadow == null) { + return null; } + + return $PaymentSheetShadowParamsCopyWith<$Res>(_self.shadow!, (value) { + return _then(_self.copyWith(shadow: value)); + }); +} } -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$PaymentSheetPaymentOptionImpl implements _PaymentSheetPaymentOption { - const _$PaymentSheetPaymentOptionImpl({required this.label, this.image}); +/// @nodoc +mixin _$PaymentSheetPrimaryButtonTheme { - factory _$PaymentSheetPaymentOptionImpl.fromJson(Map json) => - _$$PaymentSheetPaymentOptionImplFromJson(json); +/// Colors when displaying button in dark theme + PaymentSheetPrimaryButtonThemeColors? get dark;/// Colors when displaying button in light theme + PaymentSheetPrimaryButtonThemeColors? get light; +/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeCopyWith get copyWith => _$PaymentSheetPrimaryButtonThemeCopyWithImpl(this as PaymentSheetPrimaryButtonTheme, _$identity); - /// The label of the payment option - @override - final String label; + /// Serializes this PaymentSheetPrimaryButtonTheme to a JSON map. + Map toJson(); - /// String decoding of the image - @override - final String? image; - @override - String toString() { - return 'PaymentSheetPaymentOption(label: $label, image: $image)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetPrimaryButtonTheme&&(identical(other.dark, dark) || other.dark == dark)&&(identical(other.light, light) || other.light == light)); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentSheetPaymentOptionImpl && - (identical(other.label, label) || other.label == label) && - (identical(other.image, image) || other.image == image)); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,dark,light); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, label, image); - - /// Create a copy of PaymentSheetPaymentOption - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentSheetPaymentOptionImplCopyWith<_$PaymentSheetPaymentOptionImpl> - get copyWith => __$$PaymentSheetPaymentOptionImplCopyWithImpl< - _$PaymentSheetPaymentOptionImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentSheetPaymentOptionImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentSheetPrimaryButtonTheme(dark: $dark, light: $light)'; } -abstract class _PaymentSheetPaymentOption implements PaymentSheetPaymentOption { - const factory _PaymentSheetPaymentOption( - {required final String label, - final String? image}) = _$PaymentSheetPaymentOptionImpl; - factory _PaymentSheetPaymentOption.fromJson(Map json) = - _$PaymentSheetPaymentOptionImpl.fromJson; +} + +/// @nodoc +abstract mixin class $PaymentSheetPrimaryButtonThemeCopyWith<$Res> { + factory $PaymentSheetPrimaryButtonThemeCopyWith(PaymentSheetPrimaryButtonTheme value, $Res Function(PaymentSheetPrimaryButtonTheme) _then) = _$PaymentSheetPrimaryButtonThemeCopyWithImpl; +@useResult +$Res call({ + PaymentSheetPrimaryButtonThemeColors? dark, PaymentSheetPrimaryButtonThemeColors? light +}); + + +$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark;$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light; + +} +/// @nodoc +class _$PaymentSheetPrimaryButtonThemeCopyWithImpl<$Res> + implements $PaymentSheetPrimaryButtonThemeCopyWith<$Res> { + _$PaymentSheetPrimaryButtonThemeCopyWithImpl(this._self, this._then); + + final PaymentSheetPrimaryButtonTheme _self; + final $Res Function(PaymentSheetPrimaryButtonTheme) _then; + +/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? dark = freezed,Object? light = freezed,}) { + return _then(_self.copyWith( +dark: freezed == dark ? _self.dark : dark // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonThemeColors?,light: freezed == light ? _self.light : light // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonThemeColors?, + )); +} +/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark { + if (_self.dark == null) { + return null; + } + + return $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>(_self.dark!, (value) { + return _then(_self.copyWith(dark: value)); + }); +}/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light { + if (_self.light == null) { + return null; + } + + return $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>(_self.light!, (value) { + return _then(_self.copyWith(light: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PaymentSheetPrimaryButtonTheme]. +extension PaymentSheetPrimaryButtonThemePatterns on PaymentSheetPrimaryButtonTheme { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetPrimaryButtonTheme value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonTheme() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetPrimaryButtonTheme value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonTheme(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetPrimaryButtonTheme value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonTheme() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentSheetPrimaryButtonThemeColors? dark, PaymentSheetPrimaryButtonThemeColors? light)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonTheme() when $default != null: +return $default(_that.dark,_that.light);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentSheetPrimaryButtonThemeColors? dark, PaymentSheetPrimaryButtonThemeColors? light) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonTheme(): +return $default(_that.dark,_that.light);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentSheetPrimaryButtonThemeColors? dark, PaymentSheetPrimaryButtonThemeColors? light)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonTheme() when $default != null: +return $default(_that.dark,_that.light);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentSheetPrimaryButtonTheme implements PaymentSheetPrimaryButtonTheme { + const _PaymentSheetPrimaryButtonTheme({this.dark, this.light}); + factory _PaymentSheetPrimaryButtonTheme.fromJson(Map json) => _$PaymentSheetPrimaryButtonThemeFromJson(json); + +/// Colors when displaying button in dark theme +@override final PaymentSheetPrimaryButtonThemeColors? dark; +/// Colors when displaying button in light theme +@override final PaymentSheetPrimaryButtonThemeColors? light; + +/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetPrimaryButtonThemeCopyWith<_PaymentSheetPrimaryButtonTheme> get copyWith => __$PaymentSheetPrimaryButtonThemeCopyWithImpl<_PaymentSheetPrimaryButtonTheme>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetPrimaryButtonThemeToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetPrimaryButtonTheme&&(identical(other.dark, dark) || other.dark == dark)&&(identical(other.light, light) || other.light == light)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,dark,light); + +@override +String toString() { + return 'PaymentSheetPrimaryButtonTheme(dark: $dark, light: $light)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentSheetPrimaryButtonThemeCopyWith<$Res> implements $PaymentSheetPrimaryButtonThemeCopyWith<$Res> { + factory _$PaymentSheetPrimaryButtonThemeCopyWith(_PaymentSheetPrimaryButtonTheme value, $Res Function(_PaymentSheetPrimaryButtonTheme) _then) = __$PaymentSheetPrimaryButtonThemeCopyWithImpl; +@override @useResult +$Res call({ + PaymentSheetPrimaryButtonThemeColors? dark, PaymentSheetPrimaryButtonThemeColors? light +}); + + +@override $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark;@override $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light; + +} +/// @nodoc +class __$PaymentSheetPrimaryButtonThemeCopyWithImpl<$Res> + implements _$PaymentSheetPrimaryButtonThemeCopyWith<$Res> { + __$PaymentSheetPrimaryButtonThemeCopyWithImpl(this._self, this._then); + + final _PaymentSheetPrimaryButtonTheme _self; + final $Res Function(_PaymentSheetPrimaryButtonTheme) _then; + +/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? dark = freezed,Object? light = freezed,}) { + return _then(_PaymentSheetPrimaryButtonTheme( +dark: freezed == dark ? _self.dark : dark // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonThemeColors?,light: freezed == light ? _self.light : light // ignore: cast_nullable_to_non_nullable +as PaymentSheetPrimaryButtonThemeColors?, + )); +} + +/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get dark { + if (_self.dark == null) { + return null; + } + + return $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>(_self.dark!, (value) { + return _then(_self.copyWith(dark: value)); + }); +}/// Create a copy of PaymentSheetPrimaryButtonTheme +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>? get light { + if (_self.light == null) { + return null; + } + + return $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res>(_self.light!, (value) { + return _then(_self.copyWith(light: value)); + }); +} +} + + +/// @nodoc +mixin _$PaymentSheetPrimaryButtonThemeColors { + +/// Primary button background color +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get background;/// Primary button text color +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get text;/// Primary button border color +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get border; +/// Create a copy of PaymentSheetPrimaryButtonThemeColors +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetPrimaryButtonThemeColorsCopyWith get copyWith => _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl(this as PaymentSheetPrimaryButtonThemeColors, _$identity); + + /// Serializes this PaymentSheetPrimaryButtonThemeColors to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetPrimaryButtonThemeColors&&(identical(other.background, background) || other.background == background)&&(identical(other.text, text) || other.text == text)&&(identical(other.border, border) || other.border == border)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,background,text,border); + +@override +String toString() { + return 'PaymentSheetPrimaryButtonThemeColors(background: $background, text: $text, border: $border)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { + factory $PaymentSheetPrimaryButtonThemeColorsCopyWith(PaymentSheetPrimaryButtonThemeColors value, $Res Function(PaymentSheetPrimaryButtonThemeColors) _then) = _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? text,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? border +}); + + + + +} +/// @nodoc +class _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl<$Res> + implements $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { + _$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl(this._self, this._then); + + final PaymentSheetPrimaryButtonThemeColors _self; + final $Res Function(PaymentSheetPrimaryButtonThemeColors) _then; + +/// Create a copy of PaymentSheetPrimaryButtonThemeColors +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? background = freezed,Object? text = freezed,Object? border = freezed,}) { + return _then(_self.copyWith( +background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable +as Color?,text: freezed == text ? _self.text : text // ignore: cast_nullable_to_non_nullable +as Color?,border: freezed == border ? _self.border : border // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentSheetPrimaryButtonThemeColors]. +extension PaymentSheetPrimaryButtonThemeColorsPatterns on PaymentSheetPrimaryButtonThemeColors { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetPrimaryButtonThemeColors value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonThemeColors() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetPrimaryButtonThemeColors value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonThemeColors(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetPrimaryButtonThemeColors value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonThemeColors() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? border)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonThemeColors() when $default != null: +return $default(_that.background,_that.text,_that.border);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? border) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonThemeColors(): +return $default(_that.background,_that.text,_that.border);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? border)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPrimaryButtonThemeColors() when $default != null: +return $default(_that.background,_that.text,_that.border);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PaymentSheetPrimaryButtonThemeColors implements PaymentSheetPrimaryButtonThemeColors { + const _PaymentSheetPrimaryButtonThemeColors({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.background, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.text, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.border}); + factory _PaymentSheetPrimaryButtonThemeColors.fromJson(Map json) => _$PaymentSheetPrimaryButtonThemeColorsFromJson(json); + +/// Primary button background color +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? background; +/// Primary button text color +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? text; +/// Primary button border color +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? border; + +/// Create a copy of PaymentSheetPrimaryButtonThemeColors +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetPrimaryButtonThemeColorsCopyWith<_PaymentSheetPrimaryButtonThemeColors> get copyWith => __$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl<_PaymentSheetPrimaryButtonThemeColors>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetPrimaryButtonThemeColorsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetPrimaryButtonThemeColors&&(identical(other.background, background) || other.background == background)&&(identical(other.text, text) || other.text == text)&&(identical(other.border, border) || other.border == border)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,background,text,border); + +@override +String toString() { + return 'PaymentSheetPrimaryButtonThemeColors(background: $background, text: $text, border: $border)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> implements $PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { + factory _$PaymentSheetPrimaryButtonThemeColorsCopyWith(_PaymentSheetPrimaryButtonThemeColors value, $Res Function(_PaymentSheetPrimaryButtonThemeColors) _then) = __$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? background,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? text,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? border +}); + + + + +} +/// @nodoc +class __$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl<$Res> + implements _$PaymentSheetPrimaryButtonThemeColorsCopyWith<$Res> { + __$PaymentSheetPrimaryButtonThemeColorsCopyWithImpl(this._self, this._then); + + final _PaymentSheetPrimaryButtonThemeColors _self; + final $Res Function(_PaymentSheetPrimaryButtonThemeColors) _then; + +/// Create a copy of PaymentSheetPrimaryButtonThemeColors +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? background = freezed,Object? text = freezed,Object? border = freezed,}) { + return _then(_PaymentSheetPrimaryButtonThemeColors( +background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable +as Color?,text: freezed == text ? _self.text : text // ignore: cast_nullable_to_non_nullable +as Color?,border: freezed == border ? _self.border : border // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + + +} + +PresentPaymentSheetParameters _$PresentPaymentSheetParametersFromJson( + Map json +) { + return _PresentParameters.fromJson( + json + ); +} + +/// @nodoc +mixin _$PresentPaymentSheetParameters { + +/// Key used for client-side retrieval using a publishable key. + String get clientSecret;/// Flag that determines whether or not to present payment options or +/// directly goes to confirm payment. +/// +/// When value is `false` make sure [SetupPaymentSheetParameters.customFlow] +/// is set to `true` when initializing the payment sheet. +/// If value is set to `true` [SetupPaymentSheetParameters.customFlow] +/// has to be set to `false` when initializing the payment sheet. + bool get confirmPayment; +/// Create a copy of PresentPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PresentPaymentSheetParametersCopyWith get copyWith => _$PresentPaymentSheetParametersCopyWithImpl(this as PresentPaymentSheetParameters, _$identity); + + /// Serializes this PresentPaymentSheetParameters to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PresentPaymentSheetParameters&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.confirmPayment, confirmPayment) || other.confirmPayment == confirmPayment)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,clientSecret,confirmPayment); + +@override +String toString() { + return 'PresentPaymentSheetParameters(clientSecret: $clientSecret, confirmPayment: $confirmPayment)'; +} + + +} + +/// @nodoc +abstract mixin class $PresentPaymentSheetParametersCopyWith<$Res> { + factory $PresentPaymentSheetParametersCopyWith(PresentPaymentSheetParameters value, $Res Function(PresentPaymentSheetParameters) _then) = _$PresentPaymentSheetParametersCopyWithImpl; +@useResult +$Res call({ + String clientSecret, bool confirmPayment +}); + + + + +} +/// @nodoc +class _$PresentPaymentSheetParametersCopyWithImpl<$Res> + implements $PresentPaymentSheetParametersCopyWith<$Res> { + _$PresentPaymentSheetParametersCopyWithImpl(this._self, this._then); + + final PresentPaymentSheetParameters _self; + final $Res Function(PresentPaymentSheetParameters) _then; + +/// Create a copy of PresentPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? clientSecret = null,Object? confirmPayment = null,}) { + return _then(_self.copyWith( +clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,confirmPayment: null == confirmPayment ? _self.confirmPayment : confirmPayment // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PresentPaymentSheetParameters]. +extension PresentPaymentSheetParametersPatterns on PresentPaymentSheetParameters { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PresentParameters value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PresentParameters() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PresentParameters value) $default,){ +final _that = this; +switch (_that) { +case _PresentParameters(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PresentParameters value)? $default,){ +final _that = this; +switch (_that) { +case _PresentParameters() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String clientSecret, bool confirmPayment)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PresentParameters() when $default != null: +return $default(_that.clientSecret,_that.confirmPayment);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String clientSecret, bool confirmPayment) $default,) {final _that = this; +switch (_that) { +case _PresentParameters(): +return $default(_that.clientSecret,_that.confirmPayment);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String clientSecret, bool confirmPayment)? $default,) {final _that = this; +switch (_that) { +case _PresentParameters() when $default != null: +return $default(_that.clientSecret,_that.confirmPayment);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _PresentParameters implements PresentPaymentSheetParameters { + const _PresentParameters({required this.clientSecret, this.confirmPayment = false}); + factory _PresentParameters.fromJson(Map json) => _$PresentParametersFromJson(json); + +/// Key used for client-side retrieval using a publishable key. +@override final String clientSecret; +/// Flag that determines whether or not to present payment options or +/// directly goes to confirm payment. +/// +/// When value is `false` make sure [SetupPaymentSheetParameters.customFlow] +/// is set to `true` when initializing the payment sheet. +/// If value is set to `true` [SetupPaymentSheetParameters.customFlow] +/// has to be set to `false` when initializing the payment sheet. +@override@JsonKey() final bool confirmPayment; + +/// Create a copy of PresentPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PresentParametersCopyWith<_PresentParameters> get copyWith => __$PresentParametersCopyWithImpl<_PresentParameters>(this, _$identity); + +@override +Map toJson() { + return _$PresentParametersToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PresentParameters&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.confirmPayment, confirmPayment) || other.confirmPayment == confirmPayment)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,clientSecret,confirmPayment); + +@override +String toString() { + return 'PresentPaymentSheetParameters(clientSecret: $clientSecret, confirmPayment: $confirmPayment)'; +} + + +} + +/// @nodoc +abstract mixin class _$PresentParametersCopyWith<$Res> implements $PresentPaymentSheetParametersCopyWith<$Res> { + factory _$PresentParametersCopyWith(_PresentParameters value, $Res Function(_PresentParameters) _then) = __$PresentParametersCopyWithImpl; +@override @useResult +$Res call({ + String clientSecret, bool confirmPayment +}); + + + + +} +/// @nodoc +class __$PresentParametersCopyWithImpl<$Res> + implements _$PresentParametersCopyWith<$Res> { + __$PresentParametersCopyWithImpl(this._self, this._then); + + final _PresentParameters _self; + final $Res Function(_PresentParameters) _then; + +/// Create a copy of PresentPaymentSheetParameters +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? clientSecret = null,Object? confirmPayment = null,}) { + return _then(_PresentParameters( +clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,confirmPayment: null == confirmPayment ? _self.confirmPayment : confirmPayment // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentSheetPresentOptions { + +/// The number of milliseconds (after presenting) before the Payment Sheet +/// closes automatically. +/// +/// At which point presentPaymentSheet` will resolve with an error. + int? get timeout; +/// Create a copy of PaymentSheetPresentOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetPresentOptionsCopyWith get copyWith => _$PaymentSheetPresentOptionsCopyWithImpl(this as PaymentSheetPresentOptions, _$identity); + + /// Serializes this PaymentSheetPresentOptions to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetPresentOptions&&(identical(other.timeout, timeout) || other.timeout == timeout)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,timeout); + +@override +String toString() { + return 'PaymentSheetPresentOptions(timeout: $timeout)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentSheetPresentOptionsCopyWith<$Res> { + factory $PaymentSheetPresentOptionsCopyWith(PaymentSheetPresentOptions value, $Res Function(PaymentSheetPresentOptions) _then) = _$PaymentSheetPresentOptionsCopyWithImpl; +@useResult +$Res call({ + int? timeout +}); + + + + +} +/// @nodoc +class _$PaymentSheetPresentOptionsCopyWithImpl<$Res> + implements $PaymentSheetPresentOptionsCopyWith<$Res> { + _$PaymentSheetPresentOptionsCopyWithImpl(this._self, this._then); + + final PaymentSheetPresentOptions _self; + final $Res Function(PaymentSheetPresentOptions) _then; + +/// Create a copy of PaymentSheetPresentOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? timeout = freezed,}) { + return _then(_self.copyWith( +timeout: freezed == timeout ? _self.timeout : timeout // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentSheetPresentOptions]. +extension PaymentSheetPresentOptionsPatterns on PaymentSheetPresentOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetPresentOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetPresentOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetPresentOptions value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPresentOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetPresentOptions value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPresentOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( int? timeout)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetPresentOptions() when $default != null: +return $default(_that.timeout);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( int? timeout) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPresentOptions(): +return $default(_that.timeout);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? timeout)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPresentOptions() when $default != null: +return $default(_that.timeout);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentSheetPresentOptions implements PaymentSheetPresentOptions { + const _PaymentSheetPresentOptions({this.timeout}); + factory _PaymentSheetPresentOptions.fromJson(Map json) => _$PaymentSheetPresentOptionsFromJson(json); + +/// The number of milliseconds (after presenting) before the Payment Sheet +/// closes automatically. +/// +/// At which point presentPaymentSheet` will resolve with an error. +@override final int? timeout; + +/// Create a copy of PaymentSheetPresentOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetPresentOptionsCopyWith<_PaymentSheetPresentOptions> get copyWith => __$PaymentSheetPresentOptionsCopyWithImpl<_PaymentSheetPresentOptions>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetPresentOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetPresentOptions&&(identical(other.timeout, timeout) || other.timeout == timeout)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,timeout); + +@override +String toString() { + return 'PaymentSheetPresentOptions(timeout: $timeout)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentSheetPresentOptionsCopyWith<$Res> implements $PaymentSheetPresentOptionsCopyWith<$Res> { + factory _$PaymentSheetPresentOptionsCopyWith(_PaymentSheetPresentOptions value, $Res Function(_PaymentSheetPresentOptions) _then) = __$PaymentSheetPresentOptionsCopyWithImpl; +@override @useResult +$Res call({ + int? timeout +}); + + + + +} +/// @nodoc +class __$PaymentSheetPresentOptionsCopyWithImpl<$Res> + implements _$PaymentSheetPresentOptionsCopyWith<$Res> { + __$PaymentSheetPresentOptionsCopyWithImpl(this._self, this._then); + + final _PaymentSheetPresentOptions _self; + final $Res Function(_PaymentSheetPresentOptions) _then; + +/// Create a copy of PaymentSheetPresentOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? timeout = freezed,}) { + return _then(_PaymentSheetPresentOptions( +timeout: freezed == timeout ? _self.timeout : timeout // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + + +/// @nodoc +mixin _$PaymentSheetPaymentOption { + +/// The label of the payment option + String get label;/// String decoding of the image + String? get image; +/// Create a copy of PaymentSheetPaymentOption +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PaymentSheetPaymentOptionCopyWith get copyWith => _$PaymentSheetPaymentOptionCopyWithImpl(this as PaymentSheetPaymentOption, _$identity); + + /// Serializes this PaymentSheetPaymentOption to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentSheetPaymentOption&&(identical(other.label, label) || other.label == label)&&(identical(other.image, image) || other.image == image)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,image); + +@override +String toString() { + return 'PaymentSheetPaymentOption(label: $label, image: $image)'; +} + + +} + +/// @nodoc +abstract mixin class $PaymentSheetPaymentOptionCopyWith<$Res> { + factory $PaymentSheetPaymentOptionCopyWith(PaymentSheetPaymentOption value, $Res Function(PaymentSheetPaymentOption) _then) = _$PaymentSheetPaymentOptionCopyWithImpl; +@useResult +$Res call({ + String label, String? image +}); + + + + +} +/// @nodoc +class _$PaymentSheetPaymentOptionCopyWithImpl<$Res> + implements $PaymentSheetPaymentOptionCopyWith<$Res> { + _$PaymentSheetPaymentOptionCopyWithImpl(this._self, this._then); + + final PaymentSheetPaymentOption _self; + final $Res Function(PaymentSheetPaymentOption) _then; + +/// Create a copy of PaymentSheetPaymentOption +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? label = null,Object? image = freezed,}) { + return _then(_self.copyWith( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PaymentSheetPaymentOption]. +extension PaymentSheetPaymentOptionPatterns on PaymentSheetPaymentOption { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentSheetPaymentOption value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentSheetPaymentOption() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentSheetPaymentOption value) $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPaymentOption(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentSheetPaymentOption value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentSheetPaymentOption() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String label, String? image)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentSheetPaymentOption() when $default != null: +return $default(_that.label,_that.image);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String label, String? image) $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPaymentOption(): +return $default(_that.label,_that.image);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String label, String? image)? $default,) {final _that = this; +switch (_that) { +case _PaymentSheetPaymentOption() when $default != null: +return $default(_that.label,_that.image);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _PaymentSheetPaymentOption implements PaymentSheetPaymentOption { + const _PaymentSheetPaymentOption({required this.label, this.image}); + factory _PaymentSheetPaymentOption.fromJson(Map json) => _$PaymentSheetPaymentOptionFromJson(json); + +/// The label of the payment option +@override final String label; +/// String decoding of the image +@override final String? image; + +/// Create a copy of PaymentSheetPaymentOption +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentSheetPaymentOptionCopyWith<_PaymentSheetPaymentOption> get copyWith => __$PaymentSheetPaymentOptionCopyWithImpl<_PaymentSheetPaymentOption>(this, _$identity); + +@override +Map toJson() { + return _$PaymentSheetPaymentOptionToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentSheetPaymentOption&&(identical(other.label, label) || other.label == label)&&(identical(other.image, image) || other.image == image)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,label,image); + +@override +String toString() { + return 'PaymentSheetPaymentOption(label: $label, image: $image)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentSheetPaymentOptionCopyWith<$Res> implements $PaymentSheetPaymentOptionCopyWith<$Res> { + factory _$PaymentSheetPaymentOptionCopyWith(_PaymentSheetPaymentOption value, $Res Function(_PaymentSheetPaymentOption) _then) = __$PaymentSheetPaymentOptionCopyWithImpl; +@override @useResult +$Res call({ + String label, String? image +}); + + + + +} +/// @nodoc +class __$PaymentSheetPaymentOptionCopyWithImpl<$Res> + implements _$PaymentSheetPaymentOptionCopyWith<$Res> { + __$PaymentSheetPaymentOptionCopyWithImpl(this._self, this._then); + + final _PaymentSheetPaymentOption _self; + final $Res Function(_PaymentSheetPaymentOption) _then; + +/// Create a copy of PaymentSheetPaymentOption +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? label = null,Object? image = freezed,}) { + return _then(_PaymentSheetPaymentOption( +label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$BillingDetailsCollectionConfiguration { + +/// How to collect the name field. +/// +/// Defaults to `CollectionMode.automatic`. + CollectionMode? get name;/// How to collect the phone field. +/// +/// Defaults to `CollectionMode.automatic`. + CollectionMode? get phone;/// How to collect the email field. +/// +/// Defaults to `CollectionMode.automatic`. + CollectionMode? get email;/// How to collect the billing address. +/// +/// Defaults to `CollectionMode.automatic`. + AddressCollectionMode? get address;/// Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. +/// +/// If `false` (the default), those values will only be used to prefill the corresponding fields in the form. + bool? get attachDefaultsToPaymentMethod; +/// Create a copy of BillingDetailsCollectionConfiguration +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BillingDetailsCollectionConfigurationCopyWith get copyWith => _$BillingDetailsCollectionConfigurationCopyWithImpl(this as BillingDetailsCollectionConfiguration, _$identity); + + /// Serializes this BillingDetailsCollectionConfiguration to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BillingDetailsCollectionConfiguration&&(identical(other.name, name) || other.name == name)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.attachDefaultsToPaymentMethod, attachDefaultsToPaymentMethod) || other.attachDefaultsToPaymentMethod == attachDefaultsToPaymentMethod)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,phone,email,address,attachDefaultsToPaymentMethod); + +@override +String toString() { + return 'BillingDetailsCollectionConfiguration(name: $name, phone: $phone, email: $email, address: $address, attachDefaultsToPaymentMethod: $attachDefaultsToPaymentMethod)'; +} + + +} + +/// @nodoc +abstract mixin class $BillingDetailsCollectionConfigurationCopyWith<$Res> { + factory $BillingDetailsCollectionConfigurationCopyWith(BillingDetailsCollectionConfiguration value, $Res Function(BillingDetailsCollectionConfiguration) _then) = _$BillingDetailsCollectionConfigurationCopyWithImpl; +@useResult +$Res call({ + CollectionMode? name, CollectionMode? phone, CollectionMode? email, AddressCollectionMode? address, bool? attachDefaultsToPaymentMethod +}); + + + + +} +/// @nodoc +class _$BillingDetailsCollectionConfigurationCopyWithImpl<$Res> + implements $BillingDetailsCollectionConfigurationCopyWith<$Res> { + _$BillingDetailsCollectionConfigurationCopyWithImpl(this._self, this._then); + + final BillingDetailsCollectionConfiguration _self; + final $Res Function(BillingDetailsCollectionConfiguration) _then; + +/// Create a copy of BillingDetailsCollectionConfiguration +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? phone = freezed,Object? email = freezed,Object? address = freezed,Object? attachDefaultsToPaymentMethod = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as CollectionMode?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as CollectionMode?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as CollectionMode?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as AddressCollectionMode?,attachDefaultsToPaymentMethod: freezed == attachDefaultsToPaymentMethod ? _self.attachDefaultsToPaymentMethod : attachDefaultsToPaymentMethod // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BillingDetailsCollectionConfiguration]. +extension BillingDetailsCollectionConfigurationPatterns on BillingDetailsCollectionConfiguration { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BillingDetailsCollectionConfiguration value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BillingDetailsCollectionConfiguration() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BillingDetailsCollectionConfiguration value) $default,){ +final _that = this; +switch (_that) { +case _BillingDetailsCollectionConfiguration(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BillingDetailsCollectionConfiguration value)? $default,){ +final _that = this; +switch (_that) { +case _BillingDetailsCollectionConfiguration() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( CollectionMode? name, CollectionMode? phone, CollectionMode? email, AddressCollectionMode? address, bool? attachDefaultsToPaymentMethod)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BillingDetailsCollectionConfiguration() when $default != null: +return $default(_that.name,_that.phone,_that.email,_that.address,_that.attachDefaultsToPaymentMethod);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( CollectionMode? name, CollectionMode? phone, CollectionMode? email, AddressCollectionMode? address, bool? attachDefaultsToPaymentMethod) $default,) {final _that = this; +switch (_that) { +case _BillingDetailsCollectionConfiguration(): +return $default(_that.name,_that.phone,_that.email,_that.address,_that.attachDefaultsToPaymentMethod);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( CollectionMode? name, CollectionMode? phone, CollectionMode? email, AddressCollectionMode? address, bool? attachDefaultsToPaymentMethod)? $default,) {final _that = this; +switch (_that) { +case _BillingDetailsCollectionConfiguration() when $default != null: +return $default(_that.name,_that.phone,_that.email,_that.address,_that.attachDefaultsToPaymentMethod);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _BillingDetailsCollectionConfiguration implements BillingDetailsCollectionConfiguration { + const _BillingDetailsCollectionConfiguration({this.name, this.phone, this.email, this.address, this.attachDefaultsToPaymentMethod}); + factory _BillingDetailsCollectionConfiguration.fromJson(Map json) => _$BillingDetailsCollectionConfigurationFromJson(json); + +/// How to collect the name field. +/// +/// Defaults to `CollectionMode.automatic`. +@override final CollectionMode? name; +/// How to collect the phone field. +/// +/// Defaults to `CollectionMode.automatic`. +@override final CollectionMode? phone; +/// How to collect the email field. +/// +/// Defaults to `CollectionMode.automatic`. +@override final CollectionMode? email; +/// How to collect the billing address. +/// +/// Defaults to `CollectionMode.automatic`. +@override final AddressCollectionMode? address; +/// Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. +/// +/// If `false` (the default), those values will only be used to prefill the corresponding fields in the form. +@override final bool? attachDefaultsToPaymentMethod; + +/// Create a copy of BillingDetailsCollectionConfiguration +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BillingDetailsCollectionConfigurationCopyWith<_BillingDetailsCollectionConfiguration> get copyWith => __$BillingDetailsCollectionConfigurationCopyWithImpl<_BillingDetailsCollectionConfiguration>(this, _$identity); + +@override +Map toJson() { + return _$BillingDetailsCollectionConfigurationToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BillingDetailsCollectionConfiguration&&(identical(other.name, name) || other.name == name)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.email, email) || other.email == email)&&(identical(other.address, address) || other.address == address)&&(identical(other.attachDefaultsToPaymentMethod, attachDefaultsToPaymentMethod) || other.attachDefaultsToPaymentMethod == attachDefaultsToPaymentMethod)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,phone,email,address,attachDefaultsToPaymentMethod); + +@override +String toString() { + return 'BillingDetailsCollectionConfiguration(name: $name, phone: $phone, email: $email, address: $address, attachDefaultsToPaymentMethod: $attachDefaultsToPaymentMethod)'; +} + + +} + +/// @nodoc +abstract mixin class _$BillingDetailsCollectionConfigurationCopyWith<$Res> implements $BillingDetailsCollectionConfigurationCopyWith<$Res> { + factory _$BillingDetailsCollectionConfigurationCopyWith(_BillingDetailsCollectionConfiguration value, $Res Function(_BillingDetailsCollectionConfiguration) _then) = __$BillingDetailsCollectionConfigurationCopyWithImpl; +@override @useResult +$Res call({ + CollectionMode? name, CollectionMode? phone, CollectionMode? email, AddressCollectionMode? address, bool? attachDefaultsToPaymentMethod +}); + + + + +} +/// @nodoc +class __$BillingDetailsCollectionConfigurationCopyWithImpl<$Res> + implements _$BillingDetailsCollectionConfigurationCopyWith<$Res> { + __$BillingDetailsCollectionConfigurationCopyWithImpl(this._self, this._then); + + final _BillingDetailsCollectionConfiguration _self; + final $Res Function(_BillingDetailsCollectionConfiguration) _then; + +/// Create a copy of BillingDetailsCollectionConfiguration +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? phone = freezed,Object? email = freezed,Object? address = freezed,Object? attachDefaultsToPaymentMethod = freezed,}) { + return _then(_BillingDetailsCollectionConfiguration( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as CollectionMode?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as CollectionMode?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable +as CollectionMode?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable +as AddressCollectionMode?,attachDefaultsToPaymentMethod: freezed == attachDefaultsToPaymentMethod ? _self.attachDefaultsToPaymentMethod : attachDefaultsToPaymentMethod // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +CardBrandAcceptance _$CardBrandAcceptanceFromJson( + Map json +) { + switch (json['runtimeType']) { + case 'all': + return _CardBrandAcceptanceAll.fromJson( + json + ); + case 'allowed': + return _CardBrandAcceptanceAllowed.fromJson( + json + ); + case 'disallowed': + return _CardBrandAcceptanceDisallowed.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'runtimeType', + 'CardBrandAcceptance', + 'Invalid union type "${json['runtimeType']}"!' +); + } + +} + +/// @nodoc +mixin _$CardBrandAcceptance { + + CardBrandAcceptanceFilter get filter; +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CardBrandAcceptanceCopyWith get copyWith => _$CardBrandAcceptanceCopyWithImpl(this as CardBrandAcceptance, _$identity); + + /// Serializes this CardBrandAcceptance to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CardBrandAcceptance&&(identical(other.filter, filter) || other.filter == filter)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,filter); + +@override +String toString() { + return 'CardBrandAcceptance(filter: $filter)'; +} + + +} + +/// @nodoc +abstract mixin class $CardBrandAcceptanceCopyWith<$Res> { + factory $CardBrandAcceptanceCopyWith(CardBrandAcceptance value, $Res Function(CardBrandAcceptance) _then) = _$CardBrandAcceptanceCopyWithImpl; +@useResult +$Res call({ + CardBrandAcceptanceFilter filter +}); + + + + +} +/// @nodoc +class _$CardBrandAcceptanceCopyWithImpl<$Res> + implements $CardBrandAcceptanceCopyWith<$Res> { + _$CardBrandAcceptanceCopyWithImpl(this._self, this._then); + + final CardBrandAcceptance _self; + final $Res Function(CardBrandAcceptance) _then; + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? filter = null,}) { + return _then(_self.copyWith( +filter: null == filter ? _self.filter : filter // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptanceFilter, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CardBrandAcceptance]. +extension CardBrandAcceptancePatterns on CardBrandAcceptance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _CardBrandAcceptanceAll value)? all,TResult Function( _CardBrandAcceptanceAllowed value)? allowed,TResult Function( _CardBrandAcceptanceDisallowed value)? disallowed,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CardBrandAcceptanceAll() when all != null: +return all(_that);case _CardBrandAcceptanceAllowed() when allowed != null: +return allowed(_that);case _CardBrandAcceptanceDisallowed() when disallowed != null: +return disallowed(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _CardBrandAcceptanceAll value) all,required TResult Function( _CardBrandAcceptanceAllowed value) allowed,required TResult Function( _CardBrandAcceptanceDisallowed value) disallowed,}){ +final _that = this; +switch (_that) { +case _CardBrandAcceptanceAll(): +return all(_that);case _CardBrandAcceptanceAllowed(): +return allowed(_that);case _CardBrandAcceptanceDisallowed(): +return disallowed(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _CardBrandAcceptanceAll value)? all,TResult? Function( _CardBrandAcceptanceAllowed value)? allowed,TResult? Function( _CardBrandAcceptanceDisallowed value)? disallowed,}){ +final _that = this; +switch (_that) { +case _CardBrandAcceptanceAll() when all != null: +return all(_that);case _CardBrandAcceptanceAllowed() when allowed != null: +return allowed(_that);case _CardBrandAcceptanceDisallowed() when disallowed != null: +return disallowed(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( CardBrandAcceptanceFilter filter)? all,TResult Function( CardBrandAcceptanceFilter filter, List brands)? allowed,TResult Function( CardBrandAcceptanceFilter filter, List brands)? disallowed,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CardBrandAcceptanceAll() when all != null: +return all(_that.filter);case _CardBrandAcceptanceAllowed() when allowed != null: +return allowed(_that.filter,_that.brands);case _CardBrandAcceptanceDisallowed() when disallowed != null: +return disallowed(_that.filter,_that.brands);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( CardBrandAcceptanceFilter filter) all,required TResult Function( CardBrandAcceptanceFilter filter, List brands) allowed,required TResult Function( CardBrandAcceptanceFilter filter, List brands) disallowed,}) {final _that = this; +switch (_that) { +case _CardBrandAcceptanceAll(): +return all(_that.filter);case _CardBrandAcceptanceAllowed(): +return allowed(_that.filter,_that.brands);case _CardBrandAcceptanceDisallowed(): +return disallowed(_that.filter,_that.brands);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( CardBrandAcceptanceFilter filter)? all,TResult? Function( CardBrandAcceptanceFilter filter, List brands)? allowed,TResult? Function( CardBrandAcceptanceFilter filter, List brands)? disallowed,}) {final _that = this; +switch (_that) { +case _CardBrandAcceptanceAll() when all != null: +return all(_that.filter);case _CardBrandAcceptanceAllowed() when allowed != null: +return allowed(_that.filter,_that.brands);case _CardBrandAcceptanceDisallowed() when disallowed != null: +return disallowed(_that.filter,_that.brands);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CardBrandAcceptanceAll implements CardBrandAcceptance { + const _CardBrandAcceptanceAll({this.filter = CardBrandAcceptanceFilter.all, final String? $type}): $type = $type ?? 'all'; + factory _CardBrandAcceptanceAll.fromJson(Map json) => _$CardBrandAcceptanceAllFromJson(json); + +@override@JsonKey() final CardBrandAcceptanceFilter filter; + +@JsonKey(name: 'runtimeType') +final String $type; + + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardBrandAcceptanceAllCopyWith<_CardBrandAcceptanceAll> get copyWith => __$CardBrandAcceptanceAllCopyWithImpl<_CardBrandAcceptanceAll>(this, _$identity); + +@override +Map toJson() { + return _$CardBrandAcceptanceAllToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardBrandAcceptanceAll&&(identical(other.filter, filter) || other.filter == filter)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,filter); + +@override +String toString() { + return 'CardBrandAcceptance.all(filter: $filter)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardBrandAcceptanceAllCopyWith<$Res> implements $CardBrandAcceptanceCopyWith<$Res> { + factory _$CardBrandAcceptanceAllCopyWith(_CardBrandAcceptanceAll value, $Res Function(_CardBrandAcceptanceAll) _then) = __$CardBrandAcceptanceAllCopyWithImpl; +@override @useResult +$Res call({ + CardBrandAcceptanceFilter filter +}); + + + + +} +/// @nodoc +class __$CardBrandAcceptanceAllCopyWithImpl<$Res> + implements _$CardBrandAcceptanceAllCopyWith<$Res> { + __$CardBrandAcceptanceAllCopyWithImpl(this._self, this._then); + + final _CardBrandAcceptanceAll _self; + final $Res Function(_CardBrandAcceptanceAll) _then; + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? filter = null,}) { + return _then(_CardBrandAcceptanceAll( +filter: null == filter ? _self.filter : filter // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptanceFilter, + )); +} + + +} + +/// @nodoc +@JsonSerializable() + +class _CardBrandAcceptanceAllowed implements CardBrandAcceptance { + const _CardBrandAcceptanceAllowed({this.filter = CardBrandAcceptanceFilter.allowed, required final List brands, final String? $type}): _brands = brands,$type = $type ?? 'allowed'; + factory _CardBrandAcceptanceAllowed.fromJson(Map json) => _$CardBrandAcceptanceAllowedFromJson(json); + +@override@JsonKey() final CardBrandAcceptanceFilter filter; + final List _brands; + List get brands { + if (_brands is EqualUnmodifiableListView) return _brands; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_brands); +} + + +@JsonKey(name: 'runtimeType') +final String $type; + + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardBrandAcceptanceAllowedCopyWith<_CardBrandAcceptanceAllowed> get copyWith => __$CardBrandAcceptanceAllowedCopyWithImpl<_CardBrandAcceptanceAllowed>(this, _$identity); + +@override +Map toJson() { + return _$CardBrandAcceptanceAllowedToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardBrandAcceptanceAllowed&&(identical(other.filter, filter) || other.filter == filter)&&const DeepCollectionEquality().equals(other._brands, _brands)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,filter,const DeepCollectionEquality().hash(_brands)); + +@override +String toString() { + return 'CardBrandAcceptance.allowed(filter: $filter, brands: $brands)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardBrandAcceptanceAllowedCopyWith<$Res> implements $CardBrandAcceptanceCopyWith<$Res> { + factory _$CardBrandAcceptanceAllowedCopyWith(_CardBrandAcceptanceAllowed value, $Res Function(_CardBrandAcceptanceAllowed) _then) = __$CardBrandAcceptanceAllowedCopyWithImpl; +@override @useResult +$Res call({ + CardBrandAcceptanceFilter filter, List brands +}); + + + + +} +/// @nodoc +class __$CardBrandAcceptanceAllowedCopyWithImpl<$Res> + implements _$CardBrandAcceptanceAllowedCopyWith<$Res> { + __$CardBrandAcceptanceAllowedCopyWithImpl(this._self, this._then); + + final _CardBrandAcceptanceAllowed _self; + final $Res Function(_CardBrandAcceptanceAllowed) _then; + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? filter = null,Object? brands = null,}) { + return _then(_CardBrandAcceptanceAllowed( +filter: null == filter ? _self.filter : filter // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptanceFilter,brands: null == brands ? _self._brands : brands // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + +/// @nodoc +@JsonSerializable() + +class _CardBrandAcceptanceDisallowed implements CardBrandAcceptance { + const _CardBrandAcceptanceDisallowed({this.filter = CardBrandAcceptanceFilter.disallowed, required final List brands, final String? $type}): _brands = brands,$type = $type ?? 'disallowed'; + factory _CardBrandAcceptanceDisallowed.fromJson(Map json) => _$CardBrandAcceptanceDisallowedFromJson(json); + +@override@JsonKey() final CardBrandAcceptanceFilter filter; + final List _brands; + List get brands { + if (_brands is EqualUnmodifiableListView) return _brands; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_brands); +} + + +@JsonKey(name: 'runtimeType') +final String $type; + + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CardBrandAcceptanceDisallowedCopyWith<_CardBrandAcceptanceDisallowed> get copyWith => __$CardBrandAcceptanceDisallowedCopyWithImpl<_CardBrandAcceptanceDisallowed>(this, _$identity); + +@override +Map toJson() { + return _$CardBrandAcceptanceDisallowedToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CardBrandAcceptanceDisallowed&&(identical(other.filter, filter) || other.filter == filter)&&const DeepCollectionEquality().equals(other._brands, _brands)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,filter,const DeepCollectionEquality().hash(_brands)); + +@override +String toString() { + return 'CardBrandAcceptance.disallowed(filter: $filter, brands: $brands)'; +} + + +} + +/// @nodoc +abstract mixin class _$CardBrandAcceptanceDisallowedCopyWith<$Res> implements $CardBrandAcceptanceCopyWith<$Res> { + factory _$CardBrandAcceptanceDisallowedCopyWith(_CardBrandAcceptanceDisallowed value, $Res Function(_CardBrandAcceptanceDisallowed) _then) = __$CardBrandAcceptanceDisallowedCopyWithImpl; +@override @useResult +$Res call({ + CardBrandAcceptanceFilter filter, List brands +}); + + + + +} +/// @nodoc +class __$CardBrandAcceptanceDisallowedCopyWithImpl<$Res> + implements _$CardBrandAcceptanceDisallowedCopyWith<$Res> { + __$CardBrandAcceptanceDisallowedCopyWithImpl(this._self, this._then); + + final _CardBrandAcceptanceDisallowed _self; + final $Res Function(_CardBrandAcceptanceDisallowed) _then; + +/// Create a copy of CardBrandAcceptance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? filter = null,Object? brands = null,}) { + return _then(_CardBrandAcceptanceDisallowed( +filter: null == filter ? _self.filter : filter // ignore: cast_nullable_to_non_nullable +as CardBrandAcceptanceFilter,brands: null == brands ? _self._brands : brands // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + + +/// @nodoc +mixin _$LinkDisplayParams { + +/// Display configuration for Link + LinkDisplay get linkDisplay; +/// Create a copy of LinkDisplayParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LinkDisplayParamsCopyWith get copyWith => _$LinkDisplayParamsCopyWithImpl(this as LinkDisplayParams, _$identity); + + /// Serializes this LinkDisplayParams to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LinkDisplayParams&&(identical(other.linkDisplay, linkDisplay) || other.linkDisplay == linkDisplay)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,linkDisplay); + +@override +String toString() { + return 'LinkDisplayParams(linkDisplay: $linkDisplay)'; +} + + +} + +/// @nodoc +abstract mixin class $LinkDisplayParamsCopyWith<$Res> { + factory $LinkDisplayParamsCopyWith(LinkDisplayParams value, $Res Function(LinkDisplayParams) _then) = _$LinkDisplayParamsCopyWithImpl; +@useResult +$Res call({ + LinkDisplay linkDisplay +}); + + + + +} +/// @nodoc +class _$LinkDisplayParamsCopyWithImpl<$Res> + implements $LinkDisplayParamsCopyWith<$Res> { + _$LinkDisplayParamsCopyWithImpl(this._self, this._then); + + final LinkDisplayParams _self; + final $Res Function(LinkDisplayParams) _then; + +/// Create a copy of LinkDisplayParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? linkDisplay = null,}) { + return _then(_self.copyWith( +linkDisplay: null == linkDisplay ? _self.linkDisplay : linkDisplay // ignore: cast_nullable_to_non_nullable +as LinkDisplay, + )); +} + +} + + +/// Adds pattern-matching-related methods to [LinkDisplayParams]. +extension LinkDisplayParamsPatterns on LinkDisplayParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LinkDisplayParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LinkDisplayParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LinkDisplayParams value) $default,){ +final _that = this; +switch (_that) { +case _LinkDisplayParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LinkDisplayParams value)? $default,){ +final _that = this; +switch (_that) { +case _LinkDisplayParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( LinkDisplay linkDisplay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LinkDisplayParams() when $default != null: +return $default(_that.linkDisplay);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( LinkDisplay linkDisplay) $default,) {final _that = this; +switch (_that) { +case _LinkDisplayParams(): +return $default(_that.linkDisplay);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( LinkDisplay linkDisplay)? $default,) {final _that = this; +switch (_that) { +case _LinkDisplayParams() when $default != null: +return $default(_that.linkDisplay);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _LinkDisplayParams implements LinkDisplayParams { + const _LinkDisplayParams({required this.linkDisplay}); + factory _LinkDisplayParams.fromJson(Map json) => _$LinkDisplayParamsFromJson(json); + +/// Display configuration for Link +@override final LinkDisplay linkDisplay; + +/// Create a copy of LinkDisplayParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LinkDisplayParamsCopyWith<_LinkDisplayParams> get copyWith => __$LinkDisplayParamsCopyWithImpl<_LinkDisplayParams>(this, _$identity); + +@override +Map toJson() { + return _$LinkDisplayParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LinkDisplayParams&&(identical(other.linkDisplay, linkDisplay) || other.linkDisplay == linkDisplay)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,linkDisplay); + +@override +String toString() { + return 'LinkDisplayParams(linkDisplay: $linkDisplay)'; +} + + +} + +/// @nodoc +abstract mixin class _$LinkDisplayParamsCopyWith<$Res> implements $LinkDisplayParamsCopyWith<$Res> { + factory _$LinkDisplayParamsCopyWith(_LinkDisplayParams value, $Res Function(_LinkDisplayParams) _then) = __$LinkDisplayParamsCopyWithImpl; +@override @useResult +$Res call({ + LinkDisplay linkDisplay +}); + + + + +} +/// @nodoc +class __$LinkDisplayParamsCopyWithImpl<$Res> + implements _$LinkDisplayParamsCopyWith<$Res> { + __$LinkDisplayParamsCopyWithImpl(this._self, this._then); + + final _LinkDisplayParams _self; + final $Res Function(_LinkDisplayParams) _then; + +/// Create a copy of LinkDisplayParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? linkDisplay = null,}) { + return _then(_LinkDisplayParams( +linkDisplay: null == linkDisplay ? _self.linkDisplay : linkDisplay // ignore: cast_nullable_to_non_nullable +as LinkDisplay, + )); +} + + +} + + +/// @nodoc +mixin _$EdgeInsetsConfig { + + double? get top; double? get bottom; double? get left; double? get right; +/// Create a copy of EdgeInsetsConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$EdgeInsetsConfigCopyWith get copyWith => _$EdgeInsetsConfigCopyWithImpl(this as EdgeInsetsConfig, _$identity); + + /// Serializes this EdgeInsetsConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is EdgeInsetsConfig&&(identical(other.top, top) || other.top == top)&&(identical(other.bottom, bottom) || other.bottom == bottom)&&(identical(other.left, left) || other.left == left)&&(identical(other.right, right) || other.right == right)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,top,bottom,left,right); + +@override +String toString() { + return 'EdgeInsetsConfig(top: $top, bottom: $bottom, left: $left, right: $right)'; +} + + +} + +/// @nodoc +abstract mixin class $EdgeInsetsConfigCopyWith<$Res> { + factory $EdgeInsetsConfigCopyWith(EdgeInsetsConfig value, $Res Function(EdgeInsetsConfig) _then) = _$EdgeInsetsConfigCopyWithImpl; +@useResult +$Res call({ + double? top, double? bottom, double? left, double? right +}); + + + + +} +/// @nodoc +class _$EdgeInsetsConfigCopyWithImpl<$Res> + implements $EdgeInsetsConfigCopyWith<$Res> { + _$EdgeInsetsConfigCopyWithImpl(this._self, this._then); + + final EdgeInsetsConfig _self; + final $Res Function(EdgeInsetsConfig) _then; + +/// Create a copy of EdgeInsetsConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? top = freezed,Object? bottom = freezed,Object? left = freezed,Object? right = freezed,}) { + return _then(_self.copyWith( +top: freezed == top ? _self.top : top // ignore: cast_nullable_to_non_nullable +as double?,bottom: freezed == bottom ? _self.bottom : bottom // ignore: cast_nullable_to_non_nullable +as double?,left: freezed == left ? _self.left : left // ignore: cast_nullable_to_non_nullable +as double?,right: freezed == right ? _self.right : right // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [EdgeInsetsConfig]. +extension EdgeInsetsConfigPatterns on EdgeInsetsConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _EdgeInsetsConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _EdgeInsetsConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _EdgeInsetsConfig value) $default,){ +final _that = this; +switch (_that) { +case _EdgeInsetsConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _EdgeInsetsConfig value)? $default,){ +final _that = this; +switch (_that) { +case _EdgeInsetsConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? top, double? bottom, double? left, double? right)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _EdgeInsetsConfig() when $default != null: +return $default(_that.top,_that.bottom,_that.left,_that.right);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? top, double? bottom, double? left, double? right) $default,) {final _that = this; +switch (_that) { +case _EdgeInsetsConfig(): +return $default(_that.top,_that.bottom,_that.left,_that.right);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? top, double? bottom, double? left, double? right)? $default,) {final _that = this; +switch (_that) { +case _EdgeInsetsConfig() when $default != null: +return $default(_that.top,_that.bottom,_that.left,_that.right);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _EdgeInsetsConfig implements EdgeInsetsConfig { + const _EdgeInsetsConfig({this.top, this.bottom, this.left, this.right}); + factory _EdgeInsetsConfig.fromJson(Map json) => _$EdgeInsetsConfigFromJson(json); + +@override final double? top; +@override final double? bottom; +@override final double? left; +@override final double? right; + +/// Create a copy of EdgeInsetsConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$EdgeInsetsConfigCopyWith<_EdgeInsetsConfig> get copyWith => __$EdgeInsetsConfigCopyWithImpl<_EdgeInsetsConfig>(this, _$identity); + +@override +Map toJson() { + return _$EdgeInsetsConfigToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _EdgeInsetsConfig&&(identical(other.top, top) || other.top == top)&&(identical(other.bottom, bottom) || other.bottom == bottom)&&(identical(other.left, left) || other.left == left)&&(identical(other.right, right) || other.right == right)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,top,bottom,left,right); + +@override +String toString() { + return 'EdgeInsetsConfig(top: $top, bottom: $bottom, left: $left, right: $right)'; +} + + +} + +/// @nodoc +abstract mixin class _$EdgeInsetsConfigCopyWith<$Res> implements $EdgeInsetsConfigCopyWith<$Res> { + factory _$EdgeInsetsConfigCopyWith(_EdgeInsetsConfig value, $Res Function(_EdgeInsetsConfig) _then) = __$EdgeInsetsConfigCopyWithImpl; +@override @useResult +$Res call({ + double? top, double? bottom, double? left, double? right +}); + + + + +} +/// @nodoc +class __$EdgeInsetsConfigCopyWithImpl<$Res> + implements _$EdgeInsetsConfigCopyWith<$Res> { + __$EdgeInsetsConfigCopyWithImpl(this._self, this._then); + + final _EdgeInsetsConfig _self; + final $Res Function(_EdgeInsetsConfig) _then; + +/// Create a copy of EdgeInsetsConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? top = freezed,Object? bottom = freezed,Object? left = freezed,Object? right = freezed,}) { + return _then(_EdgeInsetsConfig( +top: freezed == top ? _self.top : top // ignore: cast_nullable_to_non_nullable +as double?,bottom: freezed == bottom ? _self.bottom : bottom // ignore: cast_nullable_to_non_nullable +as double?,left: freezed == left ? _self.left : left // ignore: cast_nullable_to_non_nullable +as double?,right: freezed == right ? _self.right : right // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + + +/// @nodoc +mixin _$RadioConfig { + +/// The color of the radio button when selected, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.primary +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get selectedColor;/// The color of the radio button when unselected, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.componentBorder +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get unselectedColor; +/// Create a copy of RadioConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RadioConfigCopyWith get copyWith => _$RadioConfigCopyWithImpl(this as RadioConfig, _$identity); + + /// Serializes this RadioConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RadioConfig&&(identical(other.selectedColor, selectedColor) || other.selectedColor == selectedColor)&&(identical(other.unselectedColor, unselectedColor) || other.unselectedColor == unselectedColor)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,selectedColor,unselectedColor); + +@override +String toString() { + return 'RadioConfig(selectedColor: $selectedColor, unselectedColor: $unselectedColor)'; +} + + +} + +/// @nodoc +abstract mixin class $RadioConfigCopyWith<$Res> { + factory $RadioConfigCopyWith(RadioConfig value, $Res Function(RadioConfig) _then) = _$RadioConfigCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? selectedColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? unselectedColor +}); + + + + +} +/// @nodoc +class _$RadioConfigCopyWithImpl<$Res> + implements $RadioConfigCopyWith<$Res> { + _$RadioConfigCopyWithImpl(this._self, this._then); + + final RadioConfig _self; + final $Res Function(RadioConfig) _then; + +/// Create a copy of RadioConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? selectedColor = freezed,Object? unselectedColor = freezed,}) { + return _then(_self.copyWith( +selectedColor: freezed == selectedColor ? _self.selectedColor : selectedColor // ignore: cast_nullable_to_non_nullable +as Color?,unselectedColor: freezed == unselectedColor ? _self.unselectedColor : unselectedColor // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [RadioConfig]. +extension RadioConfigPatterns on RadioConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _RadioConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _RadioConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _RadioConfig value) $default,){ +final _that = this; +switch (_that) { +case _RadioConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _RadioConfig value)? $default,){ +final _that = this; +switch (_that) { +case _RadioConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? selectedColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? unselectedColor)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _RadioConfig() when $default != null: +return $default(_that.selectedColor,_that.unselectedColor);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? selectedColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? unselectedColor) $default,) {final _that = this; +switch (_that) { +case _RadioConfig(): +return $default(_that.selectedColor,_that.unselectedColor);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? selectedColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? unselectedColor)? $default,) {final _that = this; +switch (_that) { +case _RadioConfig() when $default != null: +return $default(_that.selectedColor,_that.unselectedColor);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _RadioConfig implements RadioConfig { + const _RadioConfig({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.selectedColor, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.unselectedColor}); + factory _RadioConfig.fromJson(Map json) => _$RadioConfigFromJson(json); + +/// The color of the radio button when selected, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.primary +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? selectedColor; +/// The color of the radio button when unselected, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.componentBorder +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? unselectedColor; + +/// Create a copy of RadioConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RadioConfigCopyWith<_RadioConfig> get copyWith => __$RadioConfigCopyWithImpl<_RadioConfig>(this, _$identity); + +@override +Map toJson() { + return _$RadioConfigToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RadioConfig&&(identical(other.selectedColor, selectedColor) || other.selectedColor == selectedColor)&&(identical(other.unselectedColor, unselectedColor) || other.unselectedColor == unselectedColor)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,selectedColor,unselectedColor); + +@override +String toString() { + return 'RadioConfig(selectedColor: $selectedColor, unselectedColor: $unselectedColor)'; +} + + +} + +/// @nodoc +abstract mixin class _$RadioConfigCopyWith<$Res> implements $RadioConfigCopyWith<$Res> { + factory _$RadioConfigCopyWith(_RadioConfig value, $Res Function(_RadioConfig) _then) = __$RadioConfigCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? selectedColor,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? unselectedColor +}); + + + + +} +/// @nodoc +class __$RadioConfigCopyWithImpl<$Res> + implements _$RadioConfigCopyWith<$Res> { + __$RadioConfigCopyWithImpl(this._self, this._then); + + final _RadioConfig _self; + final $Res Function(_RadioConfig) _then; + +/// Create a copy of RadioConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? selectedColor = freezed,Object? unselectedColor = freezed,}) { + return _then(_RadioConfig( +selectedColor: freezed == selectedColor ? _self.selectedColor : selectedColor // ignore: cast_nullable_to_non_nullable +as Color?,unselectedColor: freezed == unselectedColor ? _self.unselectedColor : unselectedColor // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + + +} + + +/// @nodoc +mixin _$CheckmarkConfig { + +/// The color of the checkmark when selected, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.primary +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get color; +/// Create a copy of CheckmarkConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CheckmarkConfigCopyWith get copyWith => _$CheckmarkConfigCopyWithImpl(this as CheckmarkConfig, _$identity); + + /// Serializes this CheckmarkConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CheckmarkConfig&&(identical(other.color, color) || other.color == color)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,color); + +@override +String toString() { + return 'CheckmarkConfig(color: $color)'; +} + + +} + +/// @nodoc +abstract mixin class $CheckmarkConfigCopyWith<$Res> { + factory $CheckmarkConfigCopyWith(CheckmarkConfig value, $Res Function(CheckmarkConfig) _then) = _$CheckmarkConfigCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color +}); + + + + +} +/// @nodoc +class _$CheckmarkConfigCopyWithImpl<$Res> + implements $CheckmarkConfigCopyWith<$Res> { + _$CheckmarkConfigCopyWithImpl(this._self, this._then); + + final CheckmarkConfig _self; + final $Res Function(CheckmarkConfig) _then; + +/// Create a copy of CheckmarkConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? color = freezed,}) { + return _then(_self.copyWith( +color: freezed == color ? _self.color : color // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CheckmarkConfig]. +extension CheckmarkConfigPatterns on CheckmarkConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CheckmarkConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CheckmarkConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CheckmarkConfig value) $default,){ +final _that = this; +switch (_that) { +case _CheckmarkConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CheckmarkConfig value)? $default,){ +final _that = this; +switch (_that) { +case _CheckmarkConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CheckmarkConfig() when $default != null: +return $default(_that.color);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color) $default,) {final _that = this; +switch (_that) { +case _CheckmarkConfig(): +return $default(_that.color);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color)? $default,) {final _that = this; +switch (_that) { +case _CheckmarkConfig() when $default != null: +return $default(_that.color);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CheckmarkConfig implements CheckmarkConfig { + const _CheckmarkConfig({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.color}); + factory _CheckmarkConfig.fromJson(Map json) => _$CheckmarkConfigFromJson(json); + +/// The color of the checkmark when selected, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.primary +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? color; + +/// Create a copy of CheckmarkConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CheckmarkConfigCopyWith<_CheckmarkConfig> get copyWith => __$CheckmarkConfigCopyWithImpl<_CheckmarkConfig>(this, _$identity); + +@override +Map toJson() { + return _$CheckmarkConfigToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CheckmarkConfig&&(identical(other.color, color) || other.color == color)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,color); + +@override +String toString() { + return 'CheckmarkConfig(color: $color)'; +} + + +} + +/// @nodoc +abstract mixin class _$CheckmarkConfigCopyWith<$Res> implements $CheckmarkConfigCopyWith<$Res> { + factory _$CheckmarkConfigCopyWith(_CheckmarkConfig value, $Res Function(_CheckmarkConfig) _then) = __$CheckmarkConfigCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color +}); + + + + +} +/// @nodoc +class __$CheckmarkConfigCopyWithImpl<$Res> + implements _$CheckmarkConfigCopyWith<$Res> { + __$CheckmarkConfigCopyWithImpl(this._self, this._then); + + final _CheckmarkConfig _self; + final $Res Function(_CheckmarkConfig) _then; + +/// Create a copy of CheckmarkConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? color = freezed,}) { + return _then(_CheckmarkConfig( +color: freezed == color ? _self.color : color // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + + +} + + +/// @nodoc +mixin _$ChevronConfig { + +/// The color of the chevron, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The iOS or Android system gray color +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get color; +/// Create a copy of ChevronConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ChevronConfigCopyWith get copyWith => _$ChevronConfigCopyWithImpl(this as ChevronConfig, _$identity); + + /// Serializes this ChevronConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ChevronConfig&&(identical(other.color, color) || other.color == color)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,color); + +@override +String toString() { + return 'ChevronConfig(color: $color)'; +} + + +} + +/// @nodoc +abstract mixin class $ChevronConfigCopyWith<$Res> { + factory $ChevronConfigCopyWith(ChevronConfig value, $Res Function(ChevronConfig) _then) = _$ChevronConfigCopyWithImpl; +@useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color +}); + + + + +} +/// @nodoc +class _$ChevronConfigCopyWithImpl<$Res> + implements $ChevronConfigCopyWith<$Res> { + _$ChevronConfigCopyWithImpl(this._self, this._then); + + final ChevronConfig _self; + final $Res Function(ChevronConfig) _then; + +/// Create a copy of ChevronConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? color = freezed,}) { + return _then(_self.copyWith( +color: freezed == color ? _self.color : color // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ChevronConfig]. +extension ChevronConfigPatterns on ChevronConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ChevronConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ChevronConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ChevronConfig value) $default,){ +final _that = this; +switch (_that) { +case _ChevronConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ChevronConfig value)? $default,){ +final _that = this; +switch (_that) { +case _ChevronConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ChevronConfig() when $default != null: +return $default(_that.color);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color) $default,) {final _that = this; +switch (_that) { +case _ChevronConfig(): +return $default(_that.color);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color)? $default,) {final _that = this; +switch (_that) { +case _ChevronConfig() when $default != null: +return $default(_that.color);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ChevronConfig implements ChevronConfig { + const _ChevronConfig({@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.color}); + factory _ChevronConfig.fromJson(Map json) => _$ChevronConfigFromJson(json); + +/// The color of the chevron, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The iOS or Android system gray color +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? color; + +/// Create a copy of ChevronConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ChevronConfigCopyWith<_ChevronConfig> get copyWith => __$ChevronConfigCopyWithImpl<_ChevronConfig>(this, _$identity); + +@override +Map toJson() { + return _$ChevronConfigToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChevronConfig&&(identical(other.color, color) || other.color == color)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,color); + +@override +String toString() { + return 'ChevronConfig(color: $color)'; +} + + +} + +/// @nodoc +abstract mixin class _$ChevronConfigCopyWith<$Res> implements $ChevronConfigCopyWith<$Res> { + factory _$ChevronConfigCopyWith(_ChevronConfig value, $Res Function(_ChevronConfig) _then) = __$ChevronConfigCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? color +}); + + + + +} +/// @nodoc +class __$ChevronConfigCopyWithImpl<$Res> + implements _$ChevronConfigCopyWith<$Res> { + __$ChevronConfigCopyWithImpl(this._self, this._then); + + final _ChevronConfig _self; + final $Res Function(_ChevronConfig) _then; + +/// Create a copy of ChevronConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? color = freezed,}) { + return _then(_ChevronConfig( +color: freezed == color ? _self.color : color // ignore: cast_nullable_to_non_nullable +as Color?, + )); +} + + +} + + +/// @nodoc +mixin _$FlatConfig { + +/// The thickness of the separator line between rows. +/// @default 1.0 + double? get separatorThickness;/// The color of the separator line between rows, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.componentBorder +@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? get separatorColor;/// The insets of the separator line between rows. +/// @default { top: 0, left: 30, bottom: 0, right: 0 } for RowStyle.FlatWithRadio +/// @default { top: 0, left: 0, bottom: 0, right: 0 } for RowStyle.FlatWithCheckmark, RowStyle.FlatWithChevron, and RowStyle.FloatingButton + EdgeInsetsConfig? get separatorInsets;/// Determines if the top separator is visible at the top of the Element. +/// @default true + bool? get topSeparatorEnabled;/// Determines if the bottom separator is visible at the bottom of the Element. +/// @default true + bool? get bottomSeparatorEnabled;/// Appearance settings for the radio button (used when RowStyle is FlatWithRadio) + RadioConfig? get radio;/// Appearance settings for the checkmark (used when RowStyle is FlatWithCheckmark) + CheckmarkConfig? get checkmark;/// Appearance settings for the chevron (used when RowStyle is FlatWithChevron) + ChevronConfig? get chevron; +/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FlatConfigCopyWith get copyWith => _$FlatConfigCopyWithImpl(this as FlatConfig, _$identity); + + /// Serializes this FlatConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FlatConfig&&(identical(other.separatorThickness, separatorThickness) || other.separatorThickness == separatorThickness)&&(identical(other.separatorColor, separatorColor) || other.separatorColor == separatorColor)&&(identical(other.separatorInsets, separatorInsets) || other.separatorInsets == separatorInsets)&&(identical(other.topSeparatorEnabled, topSeparatorEnabled) || other.topSeparatorEnabled == topSeparatorEnabled)&&(identical(other.bottomSeparatorEnabled, bottomSeparatorEnabled) || other.bottomSeparatorEnabled == bottomSeparatorEnabled)&&(identical(other.radio, radio) || other.radio == radio)&&(identical(other.checkmark, checkmark) || other.checkmark == checkmark)&&(identical(other.chevron, chevron) || other.chevron == chevron)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,separatorThickness,separatorColor,separatorInsets,topSeparatorEnabled,bottomSeparatorEnabled,radio,checkmark,chevron); + +@override +String toString() { + return 'FlatConfig(separatorThickness: $separatorThickness, separatorColor: $separatorColor, separatorInsets: $separatorInsets, topSeparatorEnabled: $topSeparatorEnabled, bottomSeparatorEnabled: $bottomSeparatorEnabled, radio: $radio, checkmark: $checkmark, chevron: $chevron)'; +} + + +} + +/// @nodoc +abstract mixin class $FlatConfigCopyWith<$Res> { + factory $FlatConfigCopyWith(FlatConfig value, $Res Function(FlatConfig) _then) = _$FlatConfigCopyWithImpl; +@useResult +$Res call({ + double? separatorThickness,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? separatorColor, EdgeInsetsConfig? separatorInsets, bool? topSeparatorEnabled, bool? bottomSeparatorEnabled, RadioConfig? radio, CheckmarkConfig? checkmark, ChevronConfig? chevron +}); + + +$EdgeInsetsConfigCopyWith<$Res>? get separatorInsets;$RadioConfigCopyWith<$Res>? get radio;$CheckmarkConfigCopyWith<$Res>? get checkmark;$ChevronConfigCopyWith<$Res>? get chevron; + +} +/// @nodoc +class _$FlatConfigCopyWithImpl<$Res> + implements $FlatConfigCopyWith<$Res> { + _$FlatConfigCopyWithImpl(this._self, this._then); + + final FlatConfig _self; + final $Res Function(FlatConfig) _then; + +/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? separatorThickness = freezed,Object? separatorColor = freezed,Object? separatorInsets = freezed,Object? topSeparatorEnabled = freezed,Object? bottomSeparatorEnabled = freezed,Object? radio = freezed,Object? checkmark = freezed,Object? chevron = freezed,}) { + return _then(_self.copyWith( +separatorThickness: freezed == separatorThickness ? _self.separatorThickness : separatorThickness // ignore: cast_nullable_to_non_nullable +as double?,separatorColor: freezed == separatorColor ? _self.separatorColor : separatorColor // ignore: cast_nullable_to_non_nullable +as Color?,separatorInsets: freezed == separatorInsets ? _self.separatorInsets : separatorInsets // ignore: cast_nullable_to_non_nullable +as EdgeInsetsConfig?,topSeparatorEnabled: freezed == topSeparatorEnabled ? _self.topSeparatorEnabled : topSeparatorEnabled // ignore: cast_nullable_to_non_nullable +as bool?,bottomSeparatorEnabled: freezed == bottomSeparatorEnabled ? _self.bottomSeparatorEnabled : bottomSeparatorEnabled // ignore: cast_nullable_to_non_nullable +as bool?,radio: freezed == radio ? _self.radio : radio // ignore: cast_nullable_to_non_nullable +as RadioConfig?,checkmark: freezed == checkmark ? _self.checkmark : checkmark // ignore: cast_nullable_to_non_nullable +as CheckmarkConfig?,chevron: freezed == chevron ? _self.chevron : chevron // ignore: cast_nullable_to_non_nullable +as ChevronConfig?, + )); +} +/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$EdgeInsetsConfigCopyWith<$Res>? get separatorInsets { + if (_self.separatorInsets == null) { + return null; + } + + return $EdgeInsetsConfigCopyWith<$Res>(_self.separatorInsets!, (value) { + return _then(_self.copyWith(separatorInsets: value)); + }); +}/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RadioConfigCopyWith<$Res>? get radio { + if (_self.radio == null) { + return null; + } + + return $RadioConfigCopyWith<$Res>(_self.radio!, (value) { + return _then(_self.copyWith(radio: value)); + }); +}/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CheckmarkConfigCopyWith<$Res>? get checkmark { + if (_self.checkmark == null) { + return null; + } + + return $CheckmarkConfigCopyWith<$Res>(_self.checkmark!, (value) { + return _then(_self.copyWith(checkmark: value)); + }); +}/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ChevronConfigCopyWith<$Res>? get chevron { + if (_self.chevron == null) { + return null; + } + + return $ChevronConfigCopyWith<$Res>(_self.chevron!, (value) { + return _then(_self.copyWith(chevron: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [FlatConfig]. +extension FlatConfigPatterns on FlatConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FlatConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FlatConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FlatConfig value) $default,){ +final _that = this; +switch (_that) { +case _FlatConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FlatConfig value)? $default,){ +final _that = this; +switch (_that) { +case _FlatConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? separatorThickness, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? separatorColor, EdgeInsetsConfig? separatorInsets, bool? topSeparatorEnabled, bool? bottomSeparatorEnabled, RadioConfig? radio, CheckmarkConfig? checkmark, ChevronConfig? chevron)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FlatConfig() when $default != null: +return $default(_that.separatorThickness,_that.separatorColor,_that.separatorInsets,_that.topSeparatorEnabled,_that.bottomSeparatorEnabled,_that.radio,_that.checkmark,_that.chevron);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? separatorThickness, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? separatorColor, EdgeInsetsConfig? separatorInsets, bool? topSeparatorEnabled, bool? bottomSeparatorEnabled, RadioConfig? radio, CheckmarkConfig? checkmark, ChevronConfig? chevron) $default,) {final _that = this; +switch (_that) { +case _FlatConfig(): +return $default(_that.separatorThickness,_that.separatorColor,_that.separatorInsets,_that.topSeparatorEnabled,_that.bottomSeparatorEnabled,_that.radio,_that.checkmark,_that.chevron);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? separatorThickness, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? separatorColor, EdgeInsetsConfig? separatorInsets, bool? topSeparatorEnabled, bool? bottomSeparatorEnabled, RadioConfig? radio, CheckmarkConfig? checkmark, ChevronConfig? chevron)? $default,) {final _that = this; +switch (_that) { +case _FlatConfig() when $default != null: +return $default(_that.separatorThickness,_that.separatorColor,_that.separatorInsets,_that.topSeparatorEnabled,_that.bottomSeparatorEnabled,_that.radio,_that.checkmark,_that.chevron);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _FlatConfig implements FlatConfig { + const _FlatConfig({this.separatorThickness, @JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) this.separatorColor, this.separatorInsets, this.topSeparatorEnabled, this.bottomSeparatorEnabled, this.radio, this.checkmark, this.chevron}); + factory _FlatConfig.fromJson(Map json) => _$FlatConfigFromJson(json); + +/// The thickness of the separator line between rows. +/// @default 1.0 +@override final double? separatorThickness; +/// The color of the separator line between rows, represented as a hex string #AARRGGBB or #RRGGBB. +/// @default The root appearance.colors.componentBorder +@override@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) final Color? separatorColor; +/// The insets of the separator line between rows. +/// @default { top: 0, left: 30, bottom: 0, right: 0 } for RowStyle.FlatWithRadio +/// @default { top: 0, left: 0, bottom: 0, right: 0 } for RowStyle.FlatWithCheckmark, RowStyle.FlatWithChevron, and RowStyle.FloatingButton +@override final EdgeInsetsConfig? separatorInsets; +/// Determines if the top separator is visible at the top of the Element. +/// @default true +@override final bool? topSeparatorEnabled; +/// Determines if the bottom separator is visible at the bottom of the Element. +/// @default true +@override final bool? bottomSeparatorEnabled; +/// Appearance settings for the radio button (used when RowStyle is FlatWithRadio) +@override final RadioConfig? radio; +/// Appearance settings for the checkmark (used when RowStyle is FlatWithCheckmark) +@override final CheckmarkConfig? checkmark; +/// Appearance settings for the chevron (used when RowStyle is FlatWithChevron) +@override final ChevronConfig? chevron; + +/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FlatConfigCopyWith<_FlatConfig> get copyWith => __$FlatConfigCopyWithImpl<_FlatConfig>(this, _$identity); - /// The label of the payment option - @override - String get label; +@override +Map toJson() { + return _$FlatConfigToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FlatConfig&&(identical(other.separatorThickness, separatorThickness) || other.separatorThickness == separatorThickness)&&(identical(other.separatorColor, separatorColor) || other.separatorColor == separatorColor)&&(identical(other.separatorInsets, separatorInsets) || other.separatorInsets == separatorInsets)&&(identical(other.topSeparatorEnabled, topSeparatorEnabled) || other.topSeparatorEnabled == topSeparatorEnabled)&&(identical(other.bottomSeparatorEnabled, bottomSeparatorEnabled) || other.bottomSeparatorEnabled == bottomSeparatorEnabled)&&(identical(other.radio, radio) || other.radio == radio)&&(identical(other.checkmark, checkmark) || other.checkmark == checkmark)&&(identical(other.chevron, chevron) || other.chevron == chevron)); +} - /// String decoding of the image - @override - String? get image; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,separatorThickness,separatorColor,separatorInsets,topSeparatorEnabled,bottomSeparatorEnabled,radio,checkmark,chevron); - /// Create a copy of PaymentSheetPaymentOption - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentSheetPaymentOptionImplCopyWith<_$PaymentSheetPaymentOptionImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'FlatConfig(separatorThickness: $separatorThickness, separatorColor: $separatorColor, separatorInsets: $separatorInsets, topSeparatorEnabled: $topSeparatorEnabled, bottomSeparatorEnabled: $bottomSeparatorEnabled, radio: $radio, checkmark: $checkmark, chevron: $chevron)'; } -BillingDetailsCollectionConfiguration - _$BillingDetailsCollectionConfigurationFromJson(Map json) { - return _BillingDetailsCollectionConfiguration.fromJson(json); + } /// @nodoc -mixin _$BillingDetailsCollectionConfiguration { - /// How to collect the name field. - /// - /// Defaults to `CollectionMode.automatic`. - CollectionMode? get name => throw _privateConstructorUsedError; - - /// How to collect the phone field. - /// - /// Defaults to `CollectionMode.automatic`. - CollectionMode? get phone => throw _privateConstructorUsedError; - - /// How to collect the email field. - /// - /// Defaults to `CollectionMode.automatic`. - CollectionMode? get email => throw _privateConstructorUsedError; - - /// How to collect the billing address. - /// - /// Defaults to `CollectionMode.automatic`. - AddressCollectionMode? get address => throw _privateConstructorUsedError; - - /// Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. - /// - /// If `false` (the default), those values will only be used to prefill the corresponding fields in the form. - bool? get attachDefaultsToPaymentMethod => throw _privateConstructorUsedError; +abstract mixin class _$FlatConfigCopyWith<$Res> implements $FlatConfigCopyWith<$Res> { + factory _$FlatConfigCopyWith(_FlatConfig value, $Res Function(_FlatConfig) _then) = __$FlatConfigCopyWithImpl; +@override @useResult +$Res call({ + double? separatorThickness,@JsonKey(toJson: ColorKey.toJson, fromJson: ColorKey.fromJson) Color? separatorColor, EdgeInsetsConfig? separatorInsets, bool? topSeparatorEnabled, bool? bottomSeparatorEnabled, RadioConfig? radio, CheckmarkConfig? checkmark, ChevronConfig? chevron +}); - /// Serializes this BillingDetailsCollectionConfiguration to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of BillingDetailsCollectionConfiguration - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BillingDetailsCollectionConfigurationCopyWith< - BillingDetailsCollectionConfiguration> - get copyWith => throw _privateConstructorUsedError; -} +@override $EdgeInsetsConfigCopyWith<$Res>? get separatorInsets;@override $RadioConfigCopyWith<$Res>? get radio;@override $CheckmarkConfigCopyWith<$Res>? get checkmark;@override $ChevronConfigCopyWith<$Res>? get chevron; +} /// @nodoc -abstract class $BillingDetailsCollectionConfigurationCopyWith<$Res> { - factory $BillingDetailsCollectionConfigurationCopyWith( - BillingDetailsCollectionConfiguration value, - $Res Function(BillingDetailsCollectionConfiguration) then) = - _$BillingDetailsCollectionConfigurationCopyWithImpl<$Res, - BillingDetailsCollectionConfiguration>; - @useResult - $Res call( - {CollectionMode? name, - CollectionMode? phone, - CollectionMode? email, - AddressCollectionMode? address, - bool? attachDefaultsToPaymentMethod}); +class __$FlatConfigCopyWithImpl<$Res> + implements _$FlatConfigCopyWith<$Res> { + __$FlatConfigCopyWithImpl(this._self, this._then); + + final _FlatConfig _self; + final $Res Function(_FlatConfig) _then; + +/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? separatorThickness = freezed,Object? separatorColor = freezed,Object? separatorInsets = freezed,Object? topSeparatorEnabled = freezed,Object? bottomSeparatorEnabled = freezed,Object? radio = freezed,Object? checkmark = freezed,Object? chevron = freezed,}) { + return _then(_FlatConfig( +separatorThickness: freezed == separatorThickness ? _self.separatorThickness : separatorThickness // ignore: cast_nullable_to_non_nullable +as double?,separatorColor: freezed == separatorColor ? _self.separatorColor : separatorColor // ignore: cast_nullable_to_non_nullable +as Color?,separatorInsets: freezed == separatorInsets ? _self.separatorInsets : separatorInsets // ignore: cast_nullable_to_non_nullable +as EdgeInsetsConfig?,topSeparatorEnabled: freezed == topSeparatorEnabled ? _self.topSeparatorEnabled : topSeparatorEnabled // ignore: cast_nullable_to_non_nullable +as bool?,bottomSeparatorEnabled: freezed == bottomSeparatorEnabled ? _self.bottomSeparatorEnabled : bottomSeparatorEnabled // ignore: cast_nullable_to_non_nullable +as bool?,radio: freezed == radio ? _self.radio : radio // ignore: cast_nullable_to_non_nullable +as RadioConfig?,checkmark: freezed == checkmark ? _self.checkmark : checkmark // ignore: cast_nullable_to_non_nullable +as CheckmarkConfig?,chevron: freezed == chevron ? _self.chevron : chevron // ignore: cast_nullable_to_non_nullable +as ChevronConfig?, + )); +} + +/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$EdgeInsetsConfigCopyWith<$Res>? get separatorInsets { + if (_self.separatorInsets == null) { + return null; + } + + return $EdgeInsetsConfigCopyWith<$Res>(_self.separatorInsets!, (value) { + return _then(_self.copyWith(separatorInsets: value)); + }); +}/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RadioConfigCopyWith<$Res>? get radio { + if (_self.radio == null) { + return null; + } + + return $RadioConfigCopyWith<$Res>(_self.radio!, (value) { + return _then(_self.copyWith(radio: value)); + }); +}/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CheckmarkConfigCopyWith<$Res>? get checkmark { + if (_self.checkmark == null) { + return null; + } + + return $CheckmarkConfigCopyWith<$Res>(_self.checkmark!, (value) { + return _then(_self.copyWith(checkmark: value)); + }); +}/// Create a copy of FlatConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ChevronConfigCopyWith<$Res>? get chevron { + if (_self.chevron == null) { + return null; + } + + return $ChevronConfigCopyWith<$Res>(_self.chevron!, (value) { + return _then(_self.copyWith(chevron: value)); + }); } +} + /// @nodoc -class _$BillingDetailsCollectionConfigurationCopyWithImpl<$Res, - $Val extends BillingDetailsCollectionConfiguration> - implements $BillingDetailsCollectionConfigurationCopyWith<$Res> { - _$BillingDetailsCollectionConfigurationCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BillingDetailsCollectionConfiguration - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? phone = freezed, - Object? email = freezed, - Object? address = freezed, - Object? attachDefaultsToPaymentMethod = freezed, - }) { - return _then(_value.copyWith( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as CollectionMode?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as CollectionMode?, - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as CollectionMode?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as AddressCollectionMode?, - attachDefaultsToPaymentMethod: freezed == attachDefaultsToPaymentMethod - ? _value.attachDefaultsToPaymentMethod - : attachDefaultsToPaymentMethod // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } +mixin _$FloatingConfig { + +/// The spacing between payment method rows. + double? get spacing; +/// Create a copy of FloatingConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$FloatingConfigCopyWith get copyWith => _$FloatingConfigCopyWithImpl(this as FloatingConfig, _$identity); + + /// Serializes this FloatingConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is FloatingConfig&&(identical(other.spacing, spacing) || other.spacing == spacing)); } -/// @nodoc -abstract class _$$BillingDetailsCollectionConfigurationImplCopyWith<$Res> - implements $BillingDetailsCollectionConfigurationCopyWith<$Res> { - factory _$$BillingDetailsCollectionConfigurationImplCopyWith( - _$BillingDetailsCollectionConfigurationImpl value, - $Res Function(_$BillingDetailsCollectionConfigurationImpl) then) = - __$$BillingDetailsCollectionConfigurationImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {CollectionMode? name, - CollectionMode? phone, - CollectionMode? email, - AddressCollectionMode? address, - bool? attachDefaultsToPaymentMethod}); -} - -/// @nodoc -class __$$BillingDetailsCollectionConfigurationImplCopyWithImpl<$Res> - extends _$BillingDetailsCollectionConfigurationCopyWithImpl<$Res, - _$BillingDetailsCollectionConfigurationImpl> - implements _$$BillingDetailsCollectionConfigurationImplCopyWith<$Res> { - __$$BillingDetailsCollectionConfigurationImplCopyWithImpl( - _$BillingDetailsCollectionConfigurationImpl _value, - $Res Function(_$BillingDetailsCollectionConfigurationImpl) _then) - : super(_value, _then); - - /// Create a copy of BillingDetailsCollectionConfiguration - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? name = freezed, - Object? phone = freezed, - Object? email = freezed, - Object? address = freezed, - Object? attachDefaultsToPaymentMethod = freezed, - }) { - return _then(_$BillingDetailsCollectionConfigurationImpl( - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as CollectionMode?, - phone: freezed == phone - ? _value.phone - : phone // ignore: cast_nullable_to_non_nullable - as CollectionMode?, - email: freezed == email - ? _value.email - : email // ignore: cast_nullable_to_non_nullable - as CollectionMode?, - address: freezed == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as AddressCollectionMode?, - attachDefaultsToPaymentMethod: freezed == attachDefaultsToPaymentMethod - ? _value.attachDefaultsToPaymentMethod - : attachDefaultsToPaymentMethod // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,spacing); + +@override +String toString() { + return 'FloatingConfig(spacing: $spacing)'; +} + + } /// @nodoc +abstract mixin class $FloatingConfigCopyWith<$Res> { + factory $FloatingConfigCopyWith(FloatingConfig value, $Res Function(FloatingConfig) _then) = _$FloatingConfigCopyWithImpl; +@useResult +$Res call({ + double? spacing +}); + -@JsonSerializable(explicitToJson: true) -class _$BillingDetailsCollectionConfigurationImpl - implements _BillingDetailsCollectionConfiguration { - const _$BillingDetailsCollectionConfigurationImpl( - {this.name, - this.phone, - this.email, - this.address, - this.attachDefaultsToPaymentMethod}); - - factory _$BillingDetailsCollectionConfigurationImpl.fromJson( - Map json) => - _$$BillingDetailsCollectionConfigurationImplFromJson(json); - - /// How to collect the name field. - /// - /// Defaults to `CollectionMode.automatic`. - @override - final CollectionMode? name; - - /// How to collect the phone field. - /// - /// Defaults to `CollectionMode.automatic`. - @override - final CollectionMode? phone; - - /// How to collect the email field. - /// - /// Defaults to `CollectionMode.automatic`. - @override - final CollectionMode? email; - - /// How to collect the billing address. - /// - /// Defaults to `CollectionMode.automatic`. - @override - final AddressCollectionMode? address; - - /// Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. - /// - /// If `false` (the default), those values will only be used to prefill the corresponding fields in the form. - @override - final bool? attachDefaultsToPaymentMethod; - - @override - String toString() { - return 'BillingDetailsCollectionConfiguration(name: $name, phone: $phone, email: $email, address: $address, attachDefaultsToPaymentMethod: $attachDefaultsToPaymentMethod)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BillingDetailsCollectionConfigurationImpl && - (identical(other.name, name) || other.name == name) && - (identical(other.phone, phone) || other.phone == phone) && - (identical(other.email, email) || other.email == email) && - (identical(other.address, address) || other.address == address) && - (identical(other.attachDefaultsToPaymentMethod, - attachDefaultsToPaymentMethod) || - other.attachDefaultsToPaymentMethod == - attachDefaultsToPaymentMethod)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, name, phone, email, address, attachDefaultsToPaymentMethod); - - /// Create a copy of BillingDetailsCollectionConfiguration - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BillingDetailsCollectionConfigurationImplCopyWith< - _$BillingDetailsCollectionConfigurationImpl> - get copyWith => __$$BillingDetailsCollectionConfigurationImplCopyWithImpl< - _$BillingDetailsCollectionConfigurationImpl>(this, _$identity); - - @override - Map toJson() { - return _$$BillingDetailsCollectionConfigurationImplToJson( - this, - ); - } +} +/// @nodoc +class _$FloatingConfigCopyWithImpl<$Res> + implements $FloatingConfigCopyWith<$Res> { + _$FloatingConfigCopyWithImpl(this._self, this._then); + + final FloatingConfig _self; + final $Res Function(FloatingConfig) _then; + +/// Create a copy of FloatingConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? spacing = freezed,}) { + return _then(_self.copyWith( +spacing: freezed == spacing ? _self.spacing : spacing // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [FloatingConfig]. +extension FloatingConfigPatterns on FloatingConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _FloatingConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _FloatingConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _FloatingConfig value) $default,){ +final _that = this; +switch (_that) { +case _FloatingConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _FloatingConfig value)? $default,){ +final _that = this; +switch (_that) { +case _FloatingConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( double? spacing)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _FloatingConfig() when $default != null: +return $default(_that.spacing);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( double? spacing) $default,) {final _that = this; +switch (_that) { +case _FloatingConfig(): +return $default(_that.spacing);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( double? spacing)? $default,) {final _that = this; +switch (_that) { +case _FloatingConfig() when $default != null: +return $default(_that.spacing);case _: + return null; + +} } -abstract class _BillingDetailsCollectionConfiguration - implements BillingDetailsCollectionConfiguration { - const factory _BillingDetailsCollectionConfiguration( - {final CollectionMode? name, - final CollectionMode? phone, - final CollectionMode? email, - final AddressCollectionMode? address, - final bool? attachDefaultsToPaymentMethod}) = - _$BillingDetailsCollectionConfigurationImpl; - - factory _BillingDetailsCollectionConfiguration.fromJson( - Map json) = - _$BillingDetailsCollectionConfigurationImpl.fromJson; - - /// How to collect the name field. - /// - /// Defaults to `CollectionMode.automatic`. - @override - CollectionMode? get name; - - /// How to collect the phone field. - /// - /// Defaults to `CollectionMode.automatic`. - @override - CollectionMode? get phone; - - /// How to collect the email field. - /// - /// Defaults to `CollectionMode.automatic`. - @override - CollectionMode? get email; - - /// How to collect the billing address. - /// - /// Defaults to `CollectionMode.automatic`. - @override - AddressCollectionMode? get address; - - /// Whether the values included in `Configuration.defaultBillingDetails` should be attached to the payment method, this includes fields that aren't displayed in the form. - /// - /// If `false` (the default), those values will only be used to prefill the corresponding fields in the form. - @override - bool? get attachDefaultsToPaymentMethod; - - /// Create a copy of BillingDetailsCollectionConfiguration - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BillingDetailsCollectionConfigurationImplCopyWith< - _$BillingDetailsCollectionConfigurationImpl> - get copyWith => throw _privateConstructorUsedError; -} - -CardBrandAcceptance _$CardBrandAcceptanceFromJson(Map json) { - switch (json['runtimeType']) { - case 'all': - return _CardBrandAcceptanceAll.fromJson(json); - case 'allowed': - return _CardBrandAcceptanceAllowed.fromJson(json); - case 'disallowed': - return _CardBrandAcceptanceDisallowed.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'runtimeType', 'CardBrandAcceptance', - 'Invalid union type "${json['runtimeType']}"!'); - } } /// @nodoc -mixin _$CardBrandAcceptance { - CardBrandAcceptanceFilter get filter => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(CardBrandAcceptanceFilter filter) all, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - allowed, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - disallowed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(CardBrandAcceptanceFilter filter)? all, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(CardBrandAcceptanceFilter filter)? all, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_CardBrandAcceptanceAll value) all, - required TResult Function(_CardBrandAcceptanceAllowed value) allowed, - required TResult Function(_CardBrandAcceptanceDisallowed value) disallowed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_CardBrandAcceptanceAll value)? all, - TResult? Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult? Function(_CardBrandAcceptanceDisallowed value)? disallowed, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_CardBrandAcceptanceAll value)? all, - TResult Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult Function(_CardBrandAcceptanceDisallowed value)? disallowed, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; +@JsonSerializable() - /// Serializes this CardBrandAcceptance to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +class _FloatingConfig implements FloatingConfig { + const _FloatingConfig({this.spacing}); + factory _FloatingConfig.fromJson(Map json) => _$FloatingConfigFromJson(json); + +/// The spacing between payment method rows. +@override final double? spacing; + +/// Create a copy of FloatingConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FloatingConfigCopyWith<_FloatingConfig> get copyWith => __$FloatingConfigCopyWithImpl<_FloatingConfig>(this, _$identity); + +@override +Map toJson() { + return _$FloatingConfigToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FloatingConfig&&(identical(other.spacing, spacing) || other.spacing == spacing)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,spacing); - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CardBrandAcceptanceCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'FloatingConfig(spacing: $spacing)'; } + +} + +/// @nodoc +abstract mixin class _$FloatingConfigCopyWith<$Res> implements $FloatingConfigCopyWith<$Res> { + factory _$FloatingConfigCopyWith(_FloatingConfig value, $Res Function(_FloatingConfig) _then) = __$FloatingConfigCopyWithImpl; +@override @useResult +$Res call({ + double? spacing +}); + + + + +} /// @nodoc -abstract class $CardBrandAcceptanceCopyWith<$Res> { - factory $CardBrandAcceptanceCopyWith( - CardBrandAcceptance value, $Res Function(CardBrandAcceptance) then) = - _$CardBrandAcceptanceCopyWithImpl<$Res, CardBrandAcceptance>; - @useResult - $Res call({CardBrandAcceptanceFilter filter}); +class __$FloatingConfigCopyWithImpl<$Res> + implements _$FloatingConfigCopyWith<$Res> { + __$FloatingConfigCopyWithImpl(this._self, this._then); + + final _FloatingConfig _self; + final $Res Function(_FloatingConfig) _then; + +/// Create a copy of FloatingConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? spacing = freezed,}) { + return _then(_FloatingConfig( +spacing: freezed == spacing ? _self.spacing : spacing // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + } + /// @nodoc -class _$CardBrandAcceptanceCopyWithImpl<$Res, $Val extends CardBrandAcceptance> - implements $CardBrandAcceptanceCopyWith<$Res> { - _$CardBrandAcceptanceCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? filter = null, - }) { - return _then(_value.copyWith( - filter: null == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptanceFilter, - ) as $Val); - } +mixin _$RowConfig { + +/// The display style of the row. + RowStyle? get style;/// Additional vertical insets applied to a payment method row. +/// Increasing this value increases the height of each row. +/// @default 6.0 + double? get additionalInsets;/// Appearance settings for the flat style row + FlatConfig? get flat;/// Appearance settings for the floating button style row + FloatingConfig? get floating; +/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RowConfigCopyWith get copyWith => _$RowConfigCopyWithImpl(this as RowConfig, _$identity); + + /// Serializes this RowConfig to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RowConfig&&(identical(other.style, style) || other.style == style)&&(identical(other.additionalInsets, additionalInsets) || other.additionalInsets == additionalInsets)&&(identical(other.flat, flat) || other.flat == flat)&&(identical(other.floating, floating) || other.floating == floating)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,style,additionalInsets,flat,floating); + +@override +String toString() { + return 'RowConfig(style: $style, additionalInsets: $additionalInsets, flat: $flat, floating: $floating)'; +} + + } /// @nodoc -abstract class _$$CardBrandAcceptanceAllImplCopyWith<$Res> - implements $CardBrandAcceptanceCopyWith<$Res> { - factory _$$CardBrandAcceptanceAllImplCopyWith( - _$CardBrandAcceptanceAllImpl value, - $Res Function(_$CardBrandAcceptanceAllImpl) then) = - __$$CardBrandAcceptanceAllImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({CardBrandAcceptanceFilter filter}); -} - -/// @nodoc -class __$$CardBrandAcceptanceAllImplCopyWithImpl<$Res> - extends _$CardBrandAcceptanceCopyWithImpl<$Res, - _$CardBrandAcceptanceAllImpl> - implements _$$CardBrandAcceptanceAllImplCopyWith<$Res> { - __$$CardBrandAcceptanceAllImplCopyWithImpl( - _$CardBrandAcceptanceAllImpl _value, - $Res Function(_$CardBrandAcceptanceAllImpl) _then) - : super(_value, _then); - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? filter = null, - }) { - return _then(_$CardBrandAcceptanceAllImpl( - filter: null == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptanceFilter, - )); - } +abstract mixin class $RowConfigCopyWith<$Res> { + factory $RowConfigCopyWith(RowConfig value, $Res Function(RowConfig) _then) = _$RowConfigCopyWithImpl; +@useResult +$Res call({ + RowStyle? style, double? additionalInsets, FlatConfig? flat, FloatingConfig? floating +}); + + +$FlatConfigCopyWith<$Res>? get flat;$FloatingConfigCopyWith<$Res>? get floating; + +} +/// @nodoc +class _$RowConfigCopyWithImpl<$Res> + implements $RowConfigCopyWith<$Res> { + _$RowConfigCopyWithImpl(this._self, this._then); + + final RowConfig _self; + final $Res Function(RowConfig) _then; + +/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? style = freezed,Object? additionalInsets = freezed,Object? flat = freezed,Object? floating = freezed,}) { + return _then(_self.copyWith( +style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as RowStyle?,additionalInsets: freezed == additionalInsets ? _self.additionalInsets : additionalInsets // ignore: cast_nullable_to_non_nullable +as double?,flat: freezed == flat ? _self.flat : flat // ignore: cast_nullable_to_non_nullable +as FlatConfig?,floating: freezed == floating ? _self.floating : floating // ignore: cast_nullable_to_non_nullable +as FloatingConfig?, + )); +} +/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FlatConfigCopyWith<$Res>? get flat { + if (_self.flat == null) { + return null; + } + + return $FlatConfigCopyWith<$Res>(_self.flat!, (value) { + return _then(_self.copyWith(flat: value)); + }); +}/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FloatingConfigCopyWith<$Res>? get floating { + if (_self.floating == null) { + return null; + } + + return $FloatingConfigCopyWith<$Res>(_self.floating!, (value) { + return _then(_self.copyWith(floating: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [RowConfig]. +extension RowConfigPatterns on RowConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _RowConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _RowConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _RowConfig value) $default,){ +final _that = this; +switch (_that) { +case _RowConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _RowConfig value)? $default,){ +final _that = this; +switch (_that) { +case _RowConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( RowStyle? style, double? additionalInsets, FlatConfig? flat, FloatingConfig? floating)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _RowConfig() when $default != null: +return $default(_that.style,_that.additionalInsets,_that.flat,_that.floating);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( RowStyle? style, double? additionalInsets, FlatConfig? flat, FloatingConfig? floating) $default,) {final _that = this; +switch (_that) { +case _RowConfig(): +return $default(_that.style,_that.additionalInsets,_that.flat,_that.floating);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( RowStyle? style, double? additionalInsets, FlatConfig? flat, FloatingConfig? floating)? $default,) {final _that = this; +switch (_that) { +case _RowConfig() when $default != null: +return $default(_that.style,_that.additionalInsets,_that.flat,_that.floating);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() -class _$CardBrandAcceptanceAllImpl implements _CardBrandAcceptanceAll { - const _$CardBrandAcceptanceAllImpl( - {this.filter = CardBrandAcceptanceFilter.all, final String? $type}) - : $type = $type ?? 'all'; - factory _$CardBrandAcceptanceAllImpl.fromJson(Map json) => - _$$CardBrandAcceptanceAllImplFromJson(json); +class _RowConfig implements RowConfig { + const _RowConfig({this.style, this.additionalInsets, this.flat, this.floating}); + factory _RowConfig.fromJson(Map json) => _$RowConfigFromJson(json); - @override - @JsonKey() - final CardBrandAcceptanceFilter filter; +/// The display style of the row. +@override final RowStyle? style; +/// Additional vertical insets applied to a payment method row. +/// Increasing this value increases the height of each row. +/// @default 6.0 +@override final double? additionalInsets; +/// Appearance settings for the flat style row +@override final FlatConfig? flat; +/// Appearance settings for the floating button style row +@override final FloatingConfig? floating; - @JsonKey(name: 'runtimeType') - final String $type; +/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RowConfigCopyWith<_RowConfig> get copyWith => __$RowConfigCopyWithImpl<_RowConfig>(this, _$identity); - @override - String toString() { - return 'CardBrandAcceptance.all(filter: $filter)'; - } +@override +Map toJson() { + return _$RowConfigToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardBrandAcceptanceAllImpl && - (identical(other.filter, filter) || other.filter == filter)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RowConfig&&(identical(other.style, style) || other.style == style)&&(identical(other.additionalInsets, additionalInsets) || other.additionalInsets == additionalInsets)&&(identical(other.flat, flat) || other.flat == flat)&&(identical(other.floating, floating) || other.floating == floating)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, filter); - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardBrandAcceptanceAllImplCopyWith<_$CardBrandAcceptanceAllImpl> - get copyWith => __$$CardBrandAcceptanceAllImplCopyWithImpl< - _$CardBrandAcceptanceAllImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(CardBrandAcceptanceFilter filter) all, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - allowed, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - disallowed, - }) { - return all(filter); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,style,additionalInsets,flat,floating); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(CardBrandAcceptanceFilter filter)? all, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - }) { - return all?.call(filter); - } +@override +String toString() { + return 'RowConfig(style: $style, additionalInsets: $additionalInsets, flat: $flat, floating: $floating)'; +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(CardBrandAcceptanceFilter filter)? all, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - required TResult orElse(), - }) { - if (all != null) { - return all(filter); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_CardBrandAcceptanceAll value) all, - required TResult Function(_CardBrandAcceptanceAllowed value) allowed, - required TResult Function(_CardBrandAcceptanceDisallowed value) disallowed, - }) { - return all(this); - } +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_CardBrandAcceptanceAll value)? all, - TResult? Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult? Function(_CardBrandAcceptanceDisallowed value)? disallowed, - }) { - return all?.call(this); - } +/// @nodoc +abstract mixin class _$RowConfigCopyWith<$Res> implements $RowConfigCopyWith<$Res> { + factory _$RowConfigCopyWith(_RowConfig value, $Res Function(_RowConfig) _then) = __$RowConfigCopyWithImpl; +@override @useResult +$Res call({ + RowStyle? style, double? additionalInsets, FlatConfig? flat, FloatingConfig? floating +}); + + +@override $FlatConfigCopyWith<$Res>? get flat;@override $FloatingConfigCopyWith<$Res>? get floating; - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_CardBrandAcceptanceAll value)? all, - TResult Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult Function(_CardBrandAcceptanceDisallowed value)? disallowed, - required TResult orElse(), - }) { - if (all != null) { - return all(this); - } - return orElse(); +} +/// @nodoc +class __$RowConfigCopyWithImpl<$Res> + implements _$RowConfigCopyWith<$Res> { + __$RowConfigCopyWithImpl(this._self, this._then); + + final _RowConfig _self; + final $Res Function(_RowConfig) _then; + +/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? style = freezed,Object? additionalInsets = freezed,Object? flat = freezed,Object? floating = freezed,}) { + return _then(_RowConfig( +style: freezed == style ? _self.style : style // ignore: cast_nullable_to_non_nullable +as RowStyle?,additionalInsets: freezed == additionalInsets ? _self.additionalInsets : additionalInsets // ignore: cast_nullable_to_non_nullable +as double?,flat: freezed == flat ? _self.flat : flat // ignore: cast_nullable_to_non_nullable +as FlatConfig?,floating: freezed == floating ? _self.floating : floating // ignore: cast_nullable_to_non_nullable +as FloatingConfig?, + )); +} + +/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FlatConfigCopyWith<$Res>? get flat { + if (_self.flat == null) { + return null; } - @override - Map toJson() { - return _$$CardBrandAcceptanceAllImplToJson( - this, - ); + return $FlatConfigCopyWith<$Res>(_self.flat!, (value) { + return _then(_self.copyWith(flat: value)); + }); +}/// Create a copy of RowConfig +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$FloatingConfigCopyWith<$Res>? get floating { + if (_self.floating == null) { + return null; } + + return $FloatingConfigCopyWith<$Res>(_self.floating!, (value) { + return _then(_self.copyWith(floating: value)); + }); +} +} + + +/// @nodoc +mixin _$EmbeddedPaymentElementAppearance { + + RowConfig? get row; +/// Create a copy of EmbeddedPaymentElementAppearance +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$EmbeddedPaymentElementAppearanceCopyWith get copyWith => _$EmbeddedPaymentElementAppearanceCopyWithImpl(this as EmbeddedPaymentElementAppearance, _$identity); + + /// Serializes this EmbeddedPaymentElementAppearance to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is EmbeddedPaymentElementAppearance&&(identical(other.row, row) || other.row == row)); } -abstract class _CardBrandAcceptanceAll implements CardBrandAcceptance { - const factory _CardBrandAcceptanceAll( - {final CardBrandAcceptanceFilter filter}) = _$CardBrandAcceptanceAllImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,row); - factory _CardBrandAcceptanceAll.fromJson(Map json) = - _$CardBrandAcceptanceAllImpl.fromJson; +@override +String toString() { + return 'EmbeddedPaymentElementAppearance(row: $row)'; +} - @override - CardBrandAcceptanceFilter get filter; - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardBrandAcceptanceAllImplCopyWith<_$CardBrandAcceptanceAllImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$CardBrandAcceptanceAllowedImplCopyWith<$Res> - implements $CardBrandAcceptanceCopyWith<$Res> { - factory _$$CardBrandAcceptanceAllowedImplCopyWith( - _$CardBrandAcceptanceAllowedImpl value, - $Res Function(_$CardBrandAcceptanceAllowedImpl) then) = - __$$CardBrandAcceptanceAllowedImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({CardBrandAcceptanceFilter filter, List brands}); -} - -/// @nodoc -class __$$CardBrandAcceptanceAllowedImplCopyWithImpl<$Res> - extends _$CardBrandAcceptanceCopyWithImpl<$Res, - _$CardBrandAcceptanceAllowedImpl> - implements _$$CardBrandAcceptanceAllowedImplCopyWith<$Res> { - __$$CardBrandAcceptanceAllowedImplCopyWithImpl( - _$CardBrandAcceptanceAllowedImpl _value, - $Res Function(_$CardBrandAcceptanceAllowedImpl) _then) - : super(_value, _then); - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? filter = null, - Object? brands = null, - }) { - return _then(_$CardBrandAcceptanceAllowedImpl( - filter: null == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptanceFilter, - brands: null == brands - ? _value._brands - : brands // ignore: cast_nullable_to_non_nullable - as List, - )); - } +abstract mixin class $EmbeddedPaymentElementAppearanceCopyWith<$Res> { + factory $EmbeddedPaymentElementAppearanceCopyWith(EmbeddedPaymentElementAppearance value, $Res Function(EmbeddedPaymentElementAppearance) _then) = _$EmbeddedPaymentElementAppearanceCopyWithImpl; +@useResult +$Res call({ + RowConfig? row +}); + + +$RowConfigCopyWith<$Res>? get row; + +} +/// @nodoc +class _$EmbeddedPaymentElementAppearanceCopyWithImpl<$Res> + implements $EmbeddedPaymentElementAppearanceCopyWith<$Res> { + _$EmbeddedPaymentElementAppearanceCopyWithImpl(this._self, this._then); + + final EmbeddedPaymentElementAppearance _self; + final $Res Function(EmbeddedPaymentElementAppearance) _then; + +/// Create a copy of EmbeddedPaymentElementAppearance +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? row = freezed,}) { + return _then(_self.copyWith( +row: freezed == row ? _self.row : row // ignore: cast_nullable_to_non_nullable +as RowConfig?, + )); +} +/// Create a copy of EmbeddedPaymentElementAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RowConfigCopyWith<$Res>? get row { + if (_self.row == null) { + return null; + } + + return $RowConfigCopyWith<$Res>(_self.row!, (value) { + return _then(_self.copyWith(row: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [EmbeddedPaymentElementAppearance]. +extension EmbeddedPaymentElementAppearancePatterns on EmbeddedPaymentElementAppearance { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _EmbeddedPaymentElementAppearance value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _EmbeddedPaymentElementAppearance() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _EmbeddedPaymentElementAppearance value) $default,){ +final _that = this; +switch (_that) { +case _EmbeddedPaymentElementAppearance(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _EmbeddedPaymentElementAppearance value)? $default,){ +final _that = this; +switch (_that) { +case _EmbeddedPaymentElementAppearance() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( RowConfig? row)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _EmbeddedPaymentElementAppearance() when $default != null: +return $default(_that.row);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( RowConfig? row) $default,) {final _that = this; +switch (_that) { +case _EmbeddedPaymentElementAppearance(): +return $default(_that.row);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( RowConfig? row)? $default,) {final _that = this; +switch (_that) { +case _EmbeddedPaymentElementAppearance() when $default != null: +return $default(_that.row);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable() -class _$CardBrandAcceptanceAllowedImpl implements _CardBrandAcceptanceAllowed { - const _$CardBrandAcceptanceAllowedImpl( - {this.filter = CardBrandAcceptanceFilter.allowed, - required final List brands, - final String? $type}) - : _brands = brands, - $type = $type ?? 'allowed'; - - factory _$CardBrandAcceptanceAllowedImpl.fromJson( - Map json) => - _$$CardBrandAcceptanceAllowedImplFromJson(json); - - @override - @JsonKey() - final CardBrandAcceptanceFilter filter; - final List _brands; - @override - List get brands { - if (_brands is EqualUnmodifiableListView) return _brands; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_brands); - } - @JsonKey(name: 'runtimeType') - final String $type; +class _EmbeddedPaymentElementAppearance implements EmbeddedPaymentElementAppearance { + const _EmbeddedPaymentElementAppearance({this.row}); + factory _EmbeddedPaymentElementAppearance.fromJson(Map json) => _$EmbeddedPaymentElementAppearanceFromJson(json); - @override - String toString() { - return 'CardBrandAcceptance.allowed(filter: $filter, brands: $brands)'; - } +@override final RowConfig? row; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardBrandAcceptanceAllowedImpl && - (identical(other.filter, filter) || other.filter == filter) && - const DeepCollectionEquality().equals(other._brands, _brands)); - } +/// Create a copy of EmbeddedPaymentElementAppearance +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$EmbeddedPaymentElementAppearanceCopyWith<_EmbeddedPaymentElementAppearance> get copyWith => __$EmbeddedPaymentElementAppearanceCopyWithImpl<_EmbeddedPaymentElementAppearance>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, filter, const DeepCollectionEquality().hash(_brands)); - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardBrandAcceptanceAllowedImplCopyWith<_$CardBrandAcceptanceAllowedImpl> - get copyWith => __$$CardBrandAcceptanceAllowedImplCopyWithImpl< - _$CardBrandAcceptanceAllowedImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(CardBrandAcceptanceFilter filter) all, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - allowed, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - disallowed, - }) { - return allowed(filter, brands); - } +@override +Map toJson() { + return _$EmbeddedPaymentElementAppearanceToJson(this, ); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(CardBrandAcceptanceFilter filter)? all, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - }) { - return allowed?.call(filter, brands); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _EmbeddedPaymentElementAppearance&&(identical(other.row, row) || other.row == row)); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(CardBrandAcceptanceFilter filter)? all, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - required TResult orElse(), - }) { - if (allowed != null) { - return allowed(filter, brands); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,row); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_CardBrandAcceptanceAll value) all, - required TResult Function(_CardBrandAcceptanceAllowed value) allowed, - required TResult Function(_CardBrandAcceptanceDisallowed value) disallowed, - }) { - return allowed(this); - } +@override +String toString() { + return 'EmbeddedPaymentElementAppearance(row: $row)'; +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_CardBrandAcceptanceAll value)? all, - TResult? Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult? Function(_CardBrandAcceptanceDisallowed value)? disallowed, - }) { - return allowed?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_CardBrandAcceptanceAll value)? all, - TResult Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult Function(_CardBrandAcceptanceDisallowed value)? disallowed, - required TResult orElse(), - }) { - if (allowed != null) { - return allowed(this); - } - return orElse(); - } +} - @override - Map toJson() { - return _$$CardBrandAcceptanceAllowedImplToJson( - this, - ); +/// @nodoc +abstract mixin class _$EmbeddedPaymentElementAppearanceCopyWith<$Res> implements $EmbeddedPaymentElementAppearanceCopyWith<$Res> { + factory _$EmbeddedPaymentElementAppearanceCopyWith(_EmbeddedPaymentElementAppearance value, $Res Function(_EmbeddedPaymentElementAppearance) _then) = __$EmbeddedPaymentElementAppearanceCopyWithImpl; +@override @useResult +$Res call({ + RowConfig? row +}); + + +@override $RowConfigCopyWith<$Res>? get row; + +} +/// @nodoc +class __$EmbeddedPaymentElementAppearanceCopyWithImpl<$Res> + implements _$EmbeddedPaymentElementAppearanceCopyWith<$Res> { + __$EmbeddedPaymentElementAppearanceCopyWithImpl(this._self, this._then); + + final _EmbeddedPaymentElementAppearance _self; + final $Res Function(_EmbeddedPaymentElementAppearance) _then; + +/// Create a copy of EmbeddedPaymentElementAppearance +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? row = freezed,}) { + return _then(_EmbeddedPaymentElementAppearance( +row: freezed == row ? _self.row : row // ignore: cast_nullable_to_non_nullable +as RowConfig?, + )); +} + +/// Create a copy of EmbeddedPaymentElementAppearance +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RowConfigCopyWith<$Res>? get row { + if (_self.row == null) { + return null; } + + return $RowConfigCopyWith<$Res>(_self.row!, (value) { + return _then(_self.copyWith(row: value)); + }); +} +} + + +/// @nodoc +mixin _$CustomPaymentMethod { + +/// The custom payment method ID (beginning with `cpmt_`) as created in your Stripe Dashboard. + String get id;/// Optional subtitle to display beneath the custom payment method name. + String? get subtitle;/// Whether to disable billing detail collection for this custom payment method. Defaults to true. + bool? get disableBillingDetailCollection; +/// Create a copy of CustomPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CustomPaymentMethodCopyWith get copyWith => _$CustomPaymentMethodCopyWithImpl(this as CustomPaymentMethod, _$identity); + + /// Serializes this CustomPaymentMethod to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomPaymentMethod&&(identical(other.id, id) || other.id == id)&&(identical(other.subtitle, subtitle) || other.subtitle == subtitle)&&(identical(other.disableBillingDetailCollection, disableBillingDetailCollection) || other.disableBillingDetailCollection == disableBillingDetailCollection)); } -abstract class _CardBrandAcceptanceAllowed implements CardBrandAcceptance { - const factory _CardBrandAcceptanceAllowed( - {final CardBrandAcceptanceFilter filter, - required final List brands}) = - _$CardBrandAcceptanceAllowedImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,subtitle,disableBillingDetailCollection); - factory _CardBrandAcceptanceAllowed.fromJson(Map json) = - _$CardBrandAcceptanceAllowedImpl.fromJson; +@override +String toString() { + return 'CustomPaymentMethod(id: $id, subtitle: $subtitle, disableBillingDetailCollection: $disableBillingDetailCollection)'; +} - @override - CardBrandAcceptanceFilter get filter; - List get brands; - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardBrandAcceptanceAllowedImplCopyWith<_$CardBrandAcceptanceAllowedImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$CardBrandAcceptanceDisallowedImplCopyWith<$Res> - implements $CardBrandAcceptanceCopyWith<$Res> { - factory _$$CardBrandAcceptanceDisallowedImplCopyWith( - _$CardBrandAcceptanceDisallowedImpl value, - $Res Function(_$CardBrandAcceptanceDisallowedImpl) then) = - __$$CardBrandAcceptanceDisallowedImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({CardBrandAcceptanceFilter filter, List brands}); -} - -/// @nodoc -class __$$CardBrandAcceptanceDisallowedImplCopyWithImpl<$Res> - extends _$CardBrandAcceptanceCopyWithImpl<$Res, - _$CardBrandAcceptanceDisallowedImpl> - implements _$$CardBrandAcceptanceDisallowedImplCopyWith<$Res> { - __$$CardBrandAcceptanceDisallowedImplCopyWithImpl( - _$CardBrandAcceptanceDisallowedImpl _value, - $Res Function(_$CardBrandAcceptanceDisallowedImpl) _then) - : super(_value, _then); - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? filter = null, - Object? brands = null, - }) { - return _then(_$CardBrandAcceptanceDisallowedImpl( - filter: null == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as CardBrandAcceptanceFilter, - brands: null == brands - ? _value._brands - : brands // ignore: cast_nullable_to_non_nullable - as List, - )); - } +abstract mixin class $CustomPaymentMethodCopyWith<$Res> { + factory $CustomPaymentMethodCopyWith(CustomPaymentMethod value, $Res Function(CustomPaymentMethod) _then) = _$CustomPaymentMethodCopyWithImpl; +@useResult +$Res call({ + String id, String? subtitle, bool? disableBillingDetailCollection +}); + + + + +} +/// @nodoc +class _$CustomPaymentMethodCopyWithImpl<$Res> + implements $CustomPaymentMethodCopyWith<$Res> { + _$CustomPaymentMethodCopyWithImpl(this._self, this._then); + + final CustomPaymentMethod _self; + final $Res Function(CustomPaymentMethod) _then; + +/// Create a copy of CustomPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? subtitle = freezed,Object? disableBillingDetailCollection = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,subtitle: freezed == subtitle ? _self.subtitle : subtitle // ignore: cast_nullable_to_non_nullable +as String?,disableBillingDetailCollection: freezed == disableBillingDetailCollection ? _self.disableBillingDetailCollection : disableBillingDetailCollection // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CustomPaymentMethod]. +extension CustomPaymentMethodPatterns on CustomPaymentMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CustomPaymentMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CustomPaymentMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CustomPaymentMethod value) $default,){ +final _that = this; +switch (_that) { +case _CustomPaymentMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CustomPaymentMethod value)? $default,){ +final _that = this; +switch (_that) { +case _CustomPaymentMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String? subtitle, bool? disableBillingDetailCollection)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CustomPaymentMethod() when $default != null: +return $default(_that.id,_that.subtitle,_that.disableBillingDetailCollection);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String? subtitle, bool? disableBillingDetailCollection) $default,) {final _that = this; +switch (_that) { +case _CustomPaymentMethod(): +return $default(_that.id,_that.subtitle,_that.disableBillingDetailCollection);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String? subtitle, bool? disableBillingDetailCollection)? $default,) {final _that = this; +switch (_that) { +case _CustomPaymentMethod() when $default != null: +return $default(_that.id,_that.subtitle,_that.disableBillingDetailCollection);case _: + return null; + +} +} + } /// @nodoc -@JsonSerializable() -class _$CardBrandAcceptanceDisallowedImpl - implements _CardBrandAcceptanceDisallowed { - const _$CardBrandAcceptanceDisallowedImpl( - {this.filter = CardBrandAcceptanceFilter.disallowed, - required final List brands, - final String? $type}) - : _brands = brands, - $type = $type ?? 'disallowed'; - - factory _$CardBrandAcceptanceDisallowedImpl.fromJson( - Map json) => - _$$CardBrandAcceptanceDisallowedImplFromJson(json); - - @override - @JsonKey() - final CardBrandAcceptanceFilter filter; - final List _brands; - @override - List get brands { - if (_brands is EqualUnmodifiableListView) return _brands; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_brands); - } - @JsonKey(name: 'runtimeType') - final String $type; +@JsonSerializable(explicitToJson: true) +class _CustomPaymentMethod implements CustomPaymentMethod { + const _CustomPaymentMethod({required this.id, this.subtitle, this.disableBillingDetailCollection}); + factory _CustomPaymentMethod.fromJson(Map json) => _$CustomPaymentMethodFromJson(json); - @override - String toString() { - return 'CardBrandAcceptance.disallowed(filter: $filter, brands: $brands)'; - } +/// The custom payment method ID (beginning with `cpmt_`) as created in your Stripe Dashboard. +@override final String id; +/// Optional subtitle to display beneath the custom payment method name. +@override final String? subtitle; +/// Whether to disable billing detail collection for this custom payment method. Defaults to true. +@override final bool? disableBillingDetailCollection; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CardBrandAcceptanceDisallowedImpl && - (identical(other.filter, filter) || other.filter == filter) && - const DeepCollectionEquality().equals(other._brands, _brands)); - } +/// Create a copy of CustomPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CustomPaymentMethodCopyWith<_CustomPaymentMethod> get copyWith => __$CustomPaymentMethodCopyWithImpl<_CustomPaymentMethod>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, filter, const DeepCollectionEquality().hash(_brands)); - - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CardBrandAcceptanceDisallowedImplCopyWith< - _$CardBrandAcceptanceDisallowedImpl> - get copyWith => __$$CardBrandAcceptanceDisallowedImplCopyWithImpl< - _$CardBrandAcceptanceDisallowedImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(CardBrandAcceptanceFilter filter) all, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - allowed, - required TResult Function( - CardBrandAcceptanceFilter filter, List brands) - disallowed, - }) { - return disallowed(filter, brands); - } +@override +Map toJson() { + return _$CustomPaymentMethodToJson(this, ); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(CardBrandAcceptanceFilter filter)? all, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult? Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - }) { - return disallowed?.call(filter, brands); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CustomPaymentMethod&&(identical(other.id, id) || other.id == id)&&(identical(other.subtitle, subtitle) || other.subtitle == subtitle)&&(identical(other.disableBillingDetailCollection, disableBillingDetailCollection) || other.disableBillingDetailCollection == disableBillingDetailCollection)); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(CardBrandAcceptanceFilter filter)? all, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - allowed, - TResult Function( - CardBrandAcceptanceFilter filter, List brands)? - disallowed, - required TResult orElse(), - }) { - if (disallowed != null) { - return disallowed(filter, brands); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,subtitle,disableBillingDetailCollection); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_CardBrandAcceptanceAll value) all, - required TResult Function(_CardBrandAcceptanceAllowed value) allowed, - required TResult Function(_CardBrandAcceptanceDisallowed value) disallowed, - }) { - return disallowed(this); - } +@override +String toString() { + return 'CustomPaymentMethod(id: $id, subtitle: $subtitle, disableBillingDetailCollection: $disableBillingDetailCollection)'; +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_CardBrandAcceptanceAll value)? all, - TResult? Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult? Function(_CardBrandAcceptanceDisallowed value)? disallowed, - }) { - return disallowed?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_CardBrandAcceptanceAll value)? all, - TResult Function(_CardBrandAcceptanceAllowed value)? allowed, - TResult Function(_CardBrandAcceptanceDisallowed value)? disallowed, - required TResult orElse(), - }) { - if (disallowed != null) { - return disallowed(this); - } - return orElse(); - } +} - @override - Map toJson() { - return _$$CardBrandAcceptanceDisallowedImplToJson( - this, - ); - } +/// @nodoc +abstract mixin class _$CustomPaymentMethodCopyWith<$Res> implements $CustomPaymentMethodCopyWith<$Res> { + factory _$CustomPaymentMethodCopyWith(_CustomPaymentMethod value, $Res Function(_CustomPaymentMethod) _then) = __$CustomPaymentMethodCopyWithImpl; +@override @useResult +$Res call({ + String id, String? subtitle, bool? disableBillingDetailCollection +}); + + + + +} +/// @nodoc +class __$CustomPaymentMethodCopyWithImpl<$Res> + implements _$CustomPaymentMethodCopyWith<$Res> { + __$CustomPaymentMethodCopyWithImpl(this._self, this._then); + + final _CustomPaymentMethod _self; + final $Res Function(_CustomPaymentMethod) _then; + +/// Create a copy of CustomPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? subtitle = freezed,Object? disableBillingDetailCollection = freezed,}) { + return _then(_CustomPaymentMethod( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,subtitle: freezed == subtitle ? _self.subtitle : subtitle // ignore: cast_nullable_to_non_nullable +as String?,disableBillingDetailCollection: freezed == disableBillingDetailCollection ? _self.disableBillingDetailCollection : disableBillingDetailCollection // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + + +/// @nodoc +mixin _$CustomPaymentMethodConfiguration { + +/// Array of custom payment methods to display in the Payment Sheet +@JsonKey(name: 'customPaymentMethods') List get customPaymentMethods;/// Callback function to handle custom payment method confirmation +@JsonKey(includeFromJson: false, includeToJson: false) ConfirmCustomPaymentMethodCallback? get confirmCustomPaymentMethodCallback; +/// Create a copy of CustomPaymentMethodConfiguration +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CustomPaymentMethodConfigurationCopyWith get copyWith => _$CustomPaymentMethodConfigurationCopyWithImpl(this as CustomPaymentMethodConfiguration, _$identity); + + /// Serializes this CustomPaymentMethodConfiguration to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomPaymentMethodConfiguration&&const DeepCollectionEquality().equals(other.customPaymentMethods, customPaymentMethods)&&(identical(other.confirmCustomPaymentMethodCallback, confirmCustomPaymentMethodCallback) || other.confirmCustomPaymentMethodCallback == confirmCustomPaymentMethodCallback)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(customPaymentMethods),confirmCustomPaymentMethodCallback); + +@override +String toString() { + return 'CustomPaymentMethodConfiguration(customPaymentMethods: $customPaymentMethods, confirmCustomPaymentMethodCallback: $confirmCustomPaymentMethodCallback)'; +} + + +} + +/// @nodoc +abstract mixin class $CustomPaymentMethodConfigurationCopyWith<$Res> { + factory $CustomPaymentMethodConfigurationCopyWith(CustomPaymentMethodConfiguration value, $Res Function(CustomPaymentMethodConfiguration) _then) = _$CustomPaymentMethodConfigurationCopyWithImpl; +@useResult +$Res call({ +@JsonKey(name: 'customPaymentMethods') List customPaymentMethods,@JsonKey(includeFromJson: false, includeToJson: false) ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback +}); + + + + +} +/// @nodoc +class _$CustomPaymentMethodConfigurationCopyWithImpl<$Res> + implements $CustomPaymentMethodConfigurationCopyWith<$Res> { + _$CustomPaymentMethodConfigurationCopyWithImpl(this._self, this._then); + + final CustomPaymentMethodConfiguration _self; + final $Res Function(CustomPaymentMethodConfiguration) _then; + +/// Create a copy of CustomPaymentMethodConfiguration +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? customPaymentMethods = null,Object? confirmCustomPaymentMethodCallback = freezed,}) { + return _then(_self.copyWith( +customPaymentMethods: null == customPaymentMethods ? _self.customPaymentMethods : customPaymentMethods // ignore: cast_nullable_to_non_nullable +as List,confirmCustomPaymentMethodCallback: freezed == confirmCustomPaymentMethodCallback ? _self.confirmCustomPaymentMethodCallback : confirmCustomPaymentMethodCallback // ignore: cast_nullable_to_non_nullable +as ConfirmCustomPaymentMethodCallback?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CustomPaymentMethodConfiguration]. +extension CustomPaymentMethodConfigurationPatterns on CustomPaymentMethodConfiguration { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CustomPaymentMethodConfiguration value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CustomPaymentMethodConfiguration() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CustomPaymentMethodConfiguration value) $default,){ +final _that = this; +switch (_that) { +case _CustomPaymentMethodConfiguration(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CustomPaymentMethodConfiguration value)? $default,){ +final _that = this; +switch (_that) { +case _CustomPaymentMethodConfiguration() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function(@JsonKey(name: 'customPaymentMethods') List customPaymentMethods, @JsonKey(includeFromJson: false, includeToJson: false) ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CustomPaymentMethodConfiguration() when $default != null: +return $default(_that.customPaymentMethods,_that.confirmCustomPaymentMethodCallback);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function(@JsonKey(name: 'customPaymentMethods') List customPaymentMethods, @JsonKey(includeFromJson: false, includeToJson: false) ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback) $default,) {final _that = this; +switch (_that) { +case _CustomPaymentMethodConfiguration(): +return $default(_that.customPaymentMethods,_that.confirmCustomPaymentMethodCallback);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function(@JsonKey(name: 'customPaymentMethods') List customPaymentMethods, @JsonKey(includeFromJson: false, includeToJson: false) ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback)? $default,) {final _that = this; +switch (_that) { +case _CustomPaymentMethodConfiguration() when $default != null: +return $default(_that.customPaymentMethods,_that.confirmCustomPaymentMethodCallback);case _: + return null; + +} +} + +} + +/// @nodoc + +@JsonSerializable(explicitToJson: true) +class _CustomPaymentMethodConfiguration implements CustomPaymentMethodConfiguration { + const _CustomPaymentMethodConfiguration({@JsonKey(name: 'customPaymentMethods') required final List customPaymentMethods, @JsonKey(includeFromJson: false, includeToJson: false) this.confirmCustomPaymentMethodCallback}): _customPaymentMethods = customPaymentMethods; + factory _CustomPaymentMethodConfiguration.fromJson(Map json) => _$CustomPaymentMethodConfigurationFromJson(json); + +/// Array of custom payment methods to display in the Payment Sheet + final List _customPaymentMethods; +/// Array of custom payment methods to display in the Payment Sheet +@override@JsonKey(name: 'customPaymentMethods') List get customPaymentMethods { + if (_customPaymentMethods is EqualUnmodifiableListView) return _customPaymentMethods; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_customPaymentMethods); +} + +/// Callback function to handle custom payment method confirmation +@override@JsonKey(includeFromJson: false, includeToJson: false) final ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback; + +/// Create a copy of CustomPaymentMethodConfiguration +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CustomPaymentMethodConfigurationCopyWith<_CustomPaymentMethodConfiguration> get copyWith => __$CustomPaymentMethodConfigurationCopyWithImpl<_CustomPaymentMethodConfiguration>(this, _$identity); + +@override +Map toJson() { + return _$CustomPaymentMethodConfigurationToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CustomPaymentMethodConfiguration&&const DeepCollectionEquality().equals(other._customPaymentMethods, _customPaymentMethods)&&(identical(other.confirmCustomPaymentMethodCallback, confirmCustomPaymentMethodCallback) || other.confirmCustomPaymentMethodCallback == confirmCustomPaymentMethodCallback)); } -abstract class _CardBrandAcceptanceDisallowed implements CardBrandAcceptance { - const factory _CardBrandAcceptanceDisallowed( - {final CardBrandAcceptanceFilter filter, - required final List brands}) = - _$CardBrandAcceptanceDisallowedImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_customPaymentMethods),confirmCustomPaymentMethodCallback); + +@override +String toString() { + return 'CustomPaymentMethodConfiguration(customPaymentMethods: $customPaymentMethods, confirmCustomPaymentMethodCallback: $confirmCustomPaymentMethodCallback)'; +} + + +} + +/// @nodoc +abstract mixin class _$CustomPaymentMethodConfigurationCopyWith<$Res> implements $CustomPaymentMethodConfigurationCopyWith<$Res> { + factory _$CustomPaymentMethodConfigurationCopyWith(_CustomPaymentMethodConfiguration value, $Res Function(_CustomPaymentMethodConfiguration) _then) = __$CustomPaymentMethodConfigurationCopyWithImpl; +@override @useResult +$Res call({ +@JsonKey(name: 'customPaymentMethods') List customPaymentMethods,@JsonKey(includeFromJson: false, includeToJson: false) ConfirmCustomPaymentMethodCallback? confirmCustomPaymentMethodCallback +}); + - factory _CardBrandAcceptanceDisallowed.fromJson(Map json) = - _$CardBrandAcceptanceDisallowedImpl.fromJson; - @override - CardBrandAcceptanceFilter get filter; - List get brands; - /// Create a copy of CardBrandAcceptance - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CardBrandAcceptanceDisallowedImplCopyWith< - _$CardBrandAcceptanceDisallowedImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$CustomPaymentMethodConfigurationCopyWithImpl<$Res> + implements _$CustomPaymentMethodConfigurationCopyWith<$Res> { + __$CustomPaymentMethodConfigurationCopyWithImpl(this._self, this._then); + + final _CustomPaymentMethodConfiguration _self; + final $Res Function(_CustomPaymentMethodConfiguration) _then; + +/// Create a copy of CustomPaymentMethodConfiguration +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? customPaymentMethods = null,Object? confirmCustomPaymentMethodCallback = freezed,}) { + return _then(_CustomPaymentMethodConfiguration( +customPaymentMethods: null == customPaymentMethods ? _self._customPaymentMethods : customPaymentMethods // ignore: cast_nullable_to_non_nullable +as List,confirmCustomPaymentMethodCallback: freezed == confirmCustomPaymentMethodCallback ? _self.confirmCustomPaymentMethodCallback : confirmCustomPaymentMethodCallback // ignore: cast_nullable_to_non_nullable +as ConfirmCustomPaymentMethodCallback?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/payment_sheet.g.dart b/packages/stripe_platform_interface/lib/src/models/payment_sheet.g.dart index f0675ae03..11be97c9a 100644 --- a/packages/stripe_platform_interface/lib/src/models/payment_sheet.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/payment_sheet.g.dart @@ -6,93 +6,110 @@ part of 'payment_sheet.dart'; // JsonSerializableGenerator // ************************************************************************** -_$SetupParametersImpl _$$SetupParametersImplFromJson( - Map json) => - _$SetupParametersImpl( - customFlow: json['customFlow'] as bool? ?? false, - customerId: json['customerId'] as String?, - primaryButtonLabel: json['primaryButtonLabel'] as String?, - customerEphemeralKeySecret: json['customerEphemeralKeySecret'] as String?, - customerSessionClientSecret: - json['customerSessionClientSecret'] as String?, - paymentIntentClientSecret: json['paymentIntentClientSecret'] as String?, - setupIntentClientSecret: json['setupIntentClientSecret'] as String?, - intentConfiguration: json['intentConfiguration'] == null - ? null - : IntentConfiguration.fromJson( - json['intentConfiguration'] as Map), - merchantDisplayName: json['merchantDisplayName'] as String?, - applePay: json['applePay'] == null - ? null - : PaymentSheetApplePay.fromJson( - json['applePay'] as Map), - style: $enumDecodeNullable(_$ThemeModeEnumMap, json['style']), - googlePay: json['googlePay'] == null - ? null - : PaymentSheetGooglePay.fromJson( - json['googlePay'] as Map), - allowsDelayedPaymentMethods: - json['allowsDelayedPaymentMethods'] as bool? ?? false, - appearance: json['appearance'] == null - ? null - : PaymentSheetAppearance.fromJson( - json['appearance'] as Map), - billingDetails: json['defaultBillingDetails'] == null - ? null - : BillingDetails.fromJson( - json['defaultBillingDetails'] as Map), - allowsRemovalOfLastSavedPaymentMethod: - json['allowsRemovalOfLastSavedPaymentMethod'] as bool?, - paymentMethodOrder: (json['paymentMethodOrder'] as List?) - ?.map((e) => e as String) - .toList(), - returnURL: json['returnURL'] as String?, - billingDetailsCollectionConfiguration: - json['billingDetailsCollectionConfiguration'] == null - ? null - : BillingDetailsCollectionConfiguration.fromJson( - json['billingDetailsCollectionConfiguration'] - as Map), - removeSavedPaymentMethodMessage: - json['removeSavedPaymentMethodMessage'] as String?, - preferredNetworks: (json['preferredNetworks'] as List?) - ?.map((e) => $enumDecode(_$CardBrandEnumMap, e)) - .toList(), - cardBrandAcceptance: json['cardBrandAcceptance'] == null - ? null - : CardBrandAcceptance.fromJson( - json['cardBrandAcceptance'] as Map), - ); - -Map _$$SetupParametersImplToJson( - _$SetupParametersImpl instance) => - { - 'customFlow': instance.customFlow, - 'customerId': instance.customerId, - 'primaryButtonLabel': instance.primaryButtonLabel, - 'customerEphemeralKeySecret': instance.customerEphemeralKeySecret, - 'customerSessionClientSecret': instance.customerSessionClientSecret, - 'paymentIntentClientSecret': instance.paymentIntentClientSecret, - 'setupIntentClientSecret': instance.setupIntentClientSecret, - 'intentConfiguration': instance.intentConfiguration?.toJson(), - 'merchantDisplayName': instance.merchantDisplayName, - 'applePay': instance.applePay?.toJson(), - 'style': UserInterfaceStyleKey.toJson(instance.style), - 'googlePay': instance.googlePay?.toJson(), - 'allowsDelayedPaymentMethods': instance.allowsDelayedPaymentMethods, - 'appearance': instance.appearance?.toJson(), - 'defaultBillingDetails': instance.billingDetails?.toJson(), - 'allowsRemovalOfLastSavedPaymentMethod': - instance.allowsRemovalOfLastSavedPaymentMethod, - 'paymentMethodOrder': instance.paymentMethodOrder, - 'returnURL': instance.returnURL, - 'billingDetailsCollectionConfiguration': - instance.billingDetailsCollectionConfiguration?.toJson(), - 'removeSavedPaymentMethodMessage': - instance.removeSavedPaymentMethodMessage, - 'preferredNetworks': _cardBrandListToJson(instance.preferredNetworks), - 'cardBrandAcceptance': instance.cardBrandAcceptance?.toJson(), - }; +_SetupParameters _$SetupParametersFromJson( + Map json, +) => _SetupParameters( + customFlow: json['customFlow'] as bool? ?? false, + customerId: json['customerId'] as String?, + primaryButtonLabel: json['primaryButtonLabel'] as String?, + customerEphemeralKeySecret: json['customerEphemeralKeySecret'] as String?, + customerSessionClientSecret: json['customerSessionClientSecret'] as String?, + paymentIntentClientSecret: json['paymentIntentClientSecret'] as String?, + setupIntentClientSecret: json['setupIntentClientSecret'] as String?, + intentConfiguration: json['intentConfiguration'] == null + ? null + : IntentConfiguration.fromJson( + json['intentConfiguration'] as Map, + ), + merchantDisplayName: json['merchantDisplayName'] as String?, + applePay: json['applePay'] == null + ? null + : PaymentSheetApplePay.fromJson(json['applePay'] as Map), + style: $enumDecodeNullable(_$ThemeModeEnumMap, json['style']), + googlePay: json['googlePay'] == null + ? null + : PaymentSheetGooglePay.fromJson( + json['googlePay'] as Map, + ), + linkDisplayParams: json['linkDisplayParams'] == null + ? null + : LinkDisplayParams.fromJson( + json['linkDisplayParams'] as Map, + ), + allowsDelayedPaymentMethods: + json['allowsDelayedPaymentMethods'] as bool? ?? false, + appearance: json['appearance'] == null + ? null + : PaymentSheetAppearance.fromJson( + json['appearance'] as Map, + ), + billingDetails: json['defaultBillingDetails'] == null + ? null + : BillingDetails.fromJson( + json['defaultBillingDetails'] as Map, + ), + allowsRemovalOfLastSavedPaymentMethod: + json['allowsRemovalOfLastSavedPaymentMethod'] as bool?, + paymentMethodOrder: (json['paymentMethodOrder'] as List?) + ?.map((e) => e as String) + .toList(), + returnURL: json['returnURL'] as String?, + billingDetailsCollectionConfiguration: + json['billingDetailsCollectionConfiguration'] == null + ? null + : BillingDetailsCollectionConfiguration.fromJson( + json['billingDetailsCollectionConfiguration'] as Map, + ), + removeSavedPaymentMethodMessage: + json['removeSavedPaymentMethodMessage'] as String?, + preferredNetworks: (json['preferredNetworks'] as List?) + ?.map((e) => $enumDecode(_$CardBrandEnumMap, e)) + .toList(), + cardBrandAcceptance: json['cardBrandAcceptance'] == null + ? null + : CardBrandAcceptance.fromJson( + json['cardBrandAcceptance'] as Map, + ), + customPaymentMethodConfiguration: + json['customPaymentMethodConfiguration'] == null + ? null + : CustomPaymentMethodConfiguration.fromJson( + json['customPaymentMethodConfiguration'] as Map, + ), +); + +Map _$SetupParametersToJson( + _SetupParameters instance, +) => { + 'customFlow': instance.customFlow, + 'customerId': instance.customerId, + 'primaryButtonLabel': instance.primaryButtonLabel, + 'customerEphemeralKeySecret': instance.customerEphemeralKeySecret, + 'customerSessionClientSecret': instance.customerSessionClientSecret, + 'paymentIntentClientSecret': instance.paymentIntentClientSecret, + 'setupIntentClientSecret': instance.setupIntentClientSecret, + 'intentConfiguration': instance.intentConfiguration?.toJson(), + 'merchantDisplayName': instance.merchantDisplayName, + 'applePay': instance.applePay?.toJson(), + 'style': UserInterfaceStyleKey.toJson(instance.style), + 'googlePay': instance.googlePay?.toJson(), + 'linkDisplayParams': instance.linkDisplayParams?.toJson(), + 'allowsDelayedPaymentMethods': instance.allowsDelayedPaymentMethods, + 'appearance': instance.appearance?.toJson(), + 'defaultBillingDetails': instance.billingDetails?.toJson(), + 'allowsRemovalOfLastSavedPaymentMethod': + instance.allowsRemovalOfLastSavedPaymentMethod, + 'paymentMethodOrder': instance.paymentMethodOrder, + 'returnURL': instance.returnURL, + 'billingDetailsCollectionConfiguration': instance + .billingDetailsCollectionConfiguration + ?.toJson(), + 'removeSavedPaymentMethodMessage': instance.removeSavedPaymentMethodMessage, + 'preferredNetworks': _cardBrandListToJson(instance.preferredNetworks), + 'cardBrandAcceptance': instance.cardBrandAcceptance?.toJson(), + 'customPaymentMethodConfiguration': instance.customPaymentMethodConfiguration + ?.toJson(), +}; const _$ThemeModeEnumMap = { ThemeMode.system: 'system', @@ -112,44 +129,50 @@ const _$CardBrandEnumMap = { CardBrand.Unknown: 'Unknown', }; -_$IntentConfigurationImpl _$$IntentConfigurationImplFromJson( - Map json) => - _$IntentConfigurationImpl( +_IntentConfiguration _$IntentConfigurationFromJson(Map json) => + _IntentConfiguration( mode: IntentMode.fromJson(json['mode'] as Map), paymentMethodTypes: (json['paymentMethodTypes'] as List?) ?.map((e) => e as String) .toList(), ); -Map _$$IntentConfigurationImplToJson( - _$IntentConfigurationImpl instance) => - { - 'mode': instance.mode.toJson(), - 'paymentMethodTypes': instance.paymentMethodTypes, - }; - -_$PaymentModeImpl _$$PaymentModeImplFromJson(Map json) => - _$PaymentModeImpl( - currencyCode: json['currencyCode'] as String, - amount: (json['amount'] as num).toInt(), - setupFutureUsage: $enumDecodeNullable( - _$IntentFutureUsageEnumMap, json['setupFutureUsage']), - captureMethod: - $enumDecodeNullable(_$CaptureMethodEnumMap, json['captureMethod']), - $type: json['runtimeType'] as String?, - ); +Map _$IntentConfigurationToJson( + _IntentConfiguration instance, +) => { + 'mode': instance.mode.toJson(), + 'paymentMethodTypes': instance.paymentMethodTypes, +}; -Map _$$PaymentModeImplToJson(_$PaymentModeImpl instance) => - { - 'currencyCode': instance.currencyCode, - 'amount': instance.amount, - if (_$IntentFutureUsageEnumMap[instance.setupFutureUsage] - case final value?) - 'setupFutureUsage': value, - if (_$CaptureMethodEnumMap[instance.captureMethod] case final value?) - 'captureMethod': value, - 'runtimeType': instance.$type, - }; +_PaymentMode _$PaymentModeFromJson(Map json) => _PaymentMode( + currencyCode: json['currencyCode'] as String, + amount: (json['amount'] as num).toInt(), + setupFutureUsage: $enumDecodeNullable( + _$IntentFutureUsageEnumMap, + json['setupFutureUsage'], + ), + captureMethod: $enumDecodeNullable( + _$CaptureMethodEnumMap, + json['captureMethod'], + ), + paymentMethodOptions: json['paymentMethodOptions'] == null + ? null + : PaymentMethodOptions.fromJson( + json['paymentMethodOptions'] as Map, + ), + $type: json['runtimeType'] as String?, +); + +Map _$PaymentModeToJson( + _PaymentMode instance, +) => { + 'currencyCode': instance.currencyCode, + 'amount': instance.amount, + 'setupFutureUsage': ?_$IntentFutureUsageEnumMap[instance.setupFutureUsage], + 'captureMethod': ?_$CaptureMethodEnumMap[instance.captureMethod], + 'paymentMethodOptions': ?instance.paymentMethodOptions?.toJson(), + 'runtimeType': instance.$type, +}; const _$IntentFutureUsageEnumMap = { IntentFutureUsage.OffSession: 'OffSession', @@ -163,46 +186,47 @@ const _$CaptureMethodEnumMap = { CaptureMethod.Unknown: 'Unknown', }; -_$SetupModeImpl _$$SetupModeImplFromJson(Map json) => - _$SetupModeImpl( - currencyCode: json['currencyCode'] as String?, - setupFutureUsage: - $enumDecode(_$IntentFutureUsageEnumMap, json['setupFutureUsage']), - $type: json['runtimeType'] as String?, - ); - -Map _$$SetupModeImplToJson(_$SetupModeImpl instance) => - { - 'currencyCode': instance.currencyCode, - 'setupFutureUsage': - _$IntentFutureUsageEnumMap[instance.setupFutureUsage]!, - 'runtimeType': instance.$type, - }; - -_$PaymentSheetApplePayImpl _$$PaymentSheetApplePayImplFromJson( - Map json) => - _$PaymentSheetApplePayImpl( - merchantCountryCode: json['merchantCountryCode'] as String, - cartItems: (json['cartItems'] as List?) - ?.map((e) => - ApplePayCartSummaryItem.fromJson(e as Map)) - .toList(), - buttonType: - $enumDecodeNullable(_$PlatformButtonTypeEnumMap, json['buttonType']), - request: json['request'] == null - ? null - : PaymentRequestType.fromJson( - json['request'] as Map), - ); +_SetupMode _$SetupModeFromJson(Map json) => _SetupMode( + currencyCode: json['currencyCode'] as String?, + setupFutureUsage: $enumDecode( + _$IntentFutureUsageEnumMap, + json['setupFutureUsage'], + ), + $type: json['runtimeType'] as String?, +); + +Map _$SetupModeToJson( + _SetupMode instance, +) => { + 'currencyCode': instance.currencyCode, + 'setupFutureUsage': _$IntentFutureUsageEnumMap[instance.setupFutureUsage]!, + 'runtimeType': instance.$type, +}; -Map _$$PaymentSheetApplePayImplToJson( - _$PaymentSheetApplePayImpl instance) => - { - 'merchantCountryCode': instance.merchantCountryCode, - 'cartItems': instance.cartItems?.map((e) => e.toJson()).toList(), - 'buttonType': _$PlatformButtonTypeEnumMap[instance.buttonType], - 'request': instance.request?.toJson(), - }; +_PaymentSheetApplePay _$PaymentSheetApplePayFromJson( + Map json, +) => _PaymentSheetApplePay( + merchantCountryCode: json['merchantCountryCode'] as String, + cartItems: (json['cartItems'] as List?) + ?.map((e) => ApplePayCartSummaryItem.fromJson(e as Map)) + .toList(), + buttonType: $enumDecodeNullable( + _$PlatformButtonTypeEnumMap, + json['buttonType'], + ), + request: json['request'] == null + ? null + : PaymentRequestType.fromJson(json['request'] as Map), +); + +Map _$PaymentSheetApplePayToJson( + _PaymentSheetApplePay instance, +) => { + 'merchantCountryCode': instance.merchantCountryCode, + 'cartItems': instance.cartItems?.map((e) => e.toJson()).toList(), + 'buttonType': _$PlatformButtonTypeEnumMap[instance.buttonType], + 'request': instance.request?.toJson(), +}; const _$PlatformButtonTypeEnumMap = { PlatformButtonType.plain: 'plain', @@ -226,277 +250,283 @@ const _$PlatformButtonTypeEnumMap = { PlatformButtonType.googlePayMark: 'googlePayMark', }; -_$PaymentSheetGooglePayImpl _$$PaymentSheetGooglePayImplFromJson( - Map json) => - _$PaymentSheetGooglePayImpl( - merchantCountryCode: json['merchantCountryCode'] as String, - currencyCode: json['currencyCode'] as String?, - testEnv: json['testEnv'] as bool? ?? false, - label: json['label'] as String?, - amount: json['amount'] as String?, - buttonType: - $enumDecodeNullable(_$PlatformButtonTypeEnumMap, json['buttonType']), - ); - -Map _$$PaymentSheetGooglePayImplToJson( - _$PaymentSheetGooglePayImpl instance) => - { - 'merchantCountryCode': instance.merchantCountryCode, - 'currencyCode': instance.currencyCode, - 'testEnv': instance.testEnv, - 'label': instance.label, - 'amount': instance.amount, - 'buttonType': - PaymentSheetGooglePay.platformButtonTypeToJson(instance.buttonType), - }; - -_$PaymentSheetAppearanceImpl _$$PaymentSheetAppearanceImplFromJson( - Map json) => - _$PaymentSheetAppearanceImpl( - colors: json['colors'] == null - ? null - : PaymentSheetAppearanceColors.fromJson( - json['colors'] as Map), - shapes: json['shapes'] == null - ? null - : PaymentSheetShape.fromJson(json['shapes'] as Map), - primaryButton: json['primaryButton'] == null - ? null - : PaymentSheetPrimaryButtonAppearance.fromJson( - json['primaryButton'] as Map), - ); - -Map _$$PaymentSheetAppearanceImplToJson( - _$PaymentSheetAppearanceImpl instance) => - { - 'colors': instance.colors?.toJson(), - 'shapes': instance.shapes?.toJson(), - 'primaryButton': instance.primaryButton?.toJson(), - }; +_PaymentSheetGooglePay _$PaymentSheetGooglePayFromJson( + Map json, +) => _PaymentSheetGooglePay( + merchantCountryCode: json['merchantCountryCode'] as String, + currencyCode: json['currencyCode'] as String?, + testEnv: json['testEnv'] as bool? ?? false, + label: json['label'] as String?, + amount: json['amount'] as String?, + buttonType: $enumDecodeNullable( + _$PlatformButtonTypeEnumMap, + json['buttonType'], + ), +); + +Map _$PaymentSheetGooglePayToJson( + _PaymentSheetGooglePay instance, +) => { + 'merchantCountryCode': instance.merchantCountryCode, + 'currencyCode': instance.currencyCode, + 'testEnv': instance.testEnv, + 'label': instance.label, + 'amount': instance.amount, + 'buttonType': PaymentSheetGooglePay.platformButtonTypeToJson( + instance.buttonType, + ), +}; -_$PaymentSheetAppearanceColorsImpl _$$PaymentSheetAppearanceColorsImplFromJson( - Map json) => - _$PaymentSheetAppearanceColorsImpl( - primary: ColorKey.fromJson(json['primary']), - background: ColorKey.fromJson(json['background']), - componentBackground: ColorKey.fromJson(json['componentBackground']), - componentBorder: ColorKey.fromJson(json['componentBorder']), - componentDivider: ColorKey.fromJson(json['componentDivider']), - componentText: ColorKey.fromJson(json['componentText']), - primaryText: ColorKey.fromJson(json['primaryText']), - secondaryText: ColorKey.fromJson(json['secondaryText']), - placeholderText: ColorKey.fromJson(json['placeholderText']), - icon: ColorKey.fromJson(json['icon']), - error: ColorKey.fromJson(json['error']), - ); +_PaymentSheetAppearance _$PaymentSheetAppearanceFromJson( + Map json, +) => _PaymentSheetAppearance( + colors: json['colors'] == null + ? null + : PaymentSheetAppearanceColors.fromJson( + json['colors'] as Map, + ), + shapes: json['shapes'] == null + ? null + : PaymentSheetShape.fromJson(json['shapes'] as Map), + primaryButton: json['primaryButton'] == null + ? null + : PaymentSheetPrimaryButtonAppearance.fromJson( + json['primaryButton'] as Map, + ), + embeddedPaymentElement: json['embeddedPaymentElement'] == null + ? null + : EmbeddedPaymentElementAppearance.fromJson( + json['embeddedPaymentElement'] as Map, + ), + formInsetValues: json['formInsetValues'] == null + ? null + : EdgeInsetsConfig.fromJson( + json['formInsetValues'] as Map, + ), +); + +Map _$PaymentSheetAppearanceToJson( + _PaymentSheetAppearance instance, +) => { + 'colors': instance.colors?.toJson(), + 'shapes': instance.shapes?.toJson(), + 'primaryButton': instance.primaryButton?.toJson(), + 'embeddedPaymentElement': instance.embeddedPaymentElement?.toJson(), + 'formInsetValues': instance.formInsetValues?.toJson(), +}; -Map _$$PaymentSheetAppearanceColorsImplToJson( - _$PaymentSheetAppearanceColorsImpl instance) => - { - 'primary': ColorKey.toJson(instance.primary), - 'background': ColorKey.toJson(instance.background), - 'componentBackground': ColorKey.toJson(instance.componentBackground), - 'componentBorder': ColorKey.toJson(instance.componentBorder), - 'componentDivider': ColorKey.toJson(instance.componentDivider), - 'componentText': ColorKey.toJson(instance.componentText), - 'primaryText': ColorKey.toJson(instance.primaryText), - 'secondaryText': ColorKey.toJson(instance.secondaryText), - 'placeholderText': ColorKey.toJson(instance.placeholderText), - 'icon': ColorKey.toJson(instance.icon), - 'error': ColorKey.toJson(instance.error), - }; +_PaymentSheetAppearanceColors _$PaymentSheetAppearanceColorsFromJson( + Map json, +) => _PaymentSheetAppearanceColors( + primary: ColorKey.fromJson(json['primary']), + background: ColorKey.fromJson(json['background']), + componentBackground: ColorKey.fromJson(json['componentBackground']), + componentBorder: ColorKey.fromJson(json['componentBorder']), + componentDivider: ColorKey.fromJson(json['componentDivider']), + componentText: ColorKey.fromJson(json['componentText']), + primaryText: ColorKey.fromJson(json['primaryText']), + secondaryText: ColorKey.fromJson(json['secondaryText']), + placeholderText: ColorKey.fromJson(json['placeholderText']), + icon: ColorKey.fromJson(json['icon']), + error: ColorKey.fromJson(json['error']), +); + +Map _$PaymentSheetAppearanceColorsToJson( + _PaymentSheetAppearanceColors instance, +) => { + 'primary': ColorKey.toJson(instance.primary), + 'background': ColorKey.toJson(instance.background), + 'componentBackground': ColorKey.toJson(instance.componentBackground), + 'componentBorder': ColorKey.toJson(instance.componentBorder), + 'componentDivider': ColorKey.toJson(instance.componentDivider), + 'componentText': ColorKey.toJson(instance.componentText), + 'primaryText': ColorKey.toJson(instance.primaryText), + 'secondaryText': ColorKey.toJson(instance.secondaryText), + 'placeholderText': ColorKey.toJson(instance.placeholderText), + 'icon': ColorKey.toJson(instance.icon), + 'error': ColorKey.toJson(instance.error), +}; -_$PaymentSheetShapeImpl _$$PaymentSheetShapeImplFromJson( - Map json) => - _$PaymentSheetShapeImpl( +_PaymentSheetShape _$PaymentSheetShapeFromJson(Map json) => + _PaymentSheetShape( borderRadius: (json['borderRadius'] as num?)?.toDouble(), borderWidth: (json['borderWidth'] as num?)?.toDouble(), shadow: json['shadow'] == null ? null : PaymentSheetShadowParams.fromJson( - json['shadow'] as Map), + json['shadow'] as Map, + ), ); -Map _$$PaymentSheetShapeImplToJson( - _$PaymentSheetShapeImpl instance) => +Map _$PaymentSheetShapeToJson(_PaymentSheetShape instance) => { 'borderRadius': instance.borderRadius, 'borderWidth': instance.borderWidth, 'shadow': instance.shadow?.toJson(), }; -_$PaymentSheetShadowParamsImpl _$$PaymentSheetShadowParamsImplFromJson( - Map json) => - _$PaymentSheetShadowParamsImpl( - color: ColorKey.fromJson(json['color']), - opacity: (json['opacity'] as num?)?.toDouble(), - offset: json['offset'] == null - ? null - : PaymentSheetShadowOffset.fromJson( - json['offset'] as Map), - ); +_PaymentSheetShadowParams _$PaymentSheetShadowParamsFromJson( + Map json, +) => _PaymentSheetShadowParams( + color: ColorKey.fromJson(json['color']), + opacity: (json['opacity'] as num?)?.toDouble(), + offset: json['offset'] == null + ? null + : PaymentSheetShadowOffset.fromJson( + json['offset'] as Map, + ), +); + +Map _$PaymentSheetShadowParamsToJson( + _PaymentSheetShadowParams instance, +) => { + 'color': ColorKey.toJson(instance.color), + 'opacity': instance.opacity, + 'offset': instance.offset?.toJson(), +}; -Map _$$PaymentSheetShadowParamsImplToJson( - _$PaymentSheetShadowParamsImpl instance) => - { - 'color': ColorKey.toJson(instance.color), - 'opacity': instance.opacity, - 'offset': instance.offset?.toJson(), - }; +_PaymentSheetShadowOffset _$PaymentSheetShadowOffsetFromJson( + Map json, +) => _PaymentSheetShadowOffset( + x: (json['x'] as num?)?.toDouble(), + y: (json['y'] as num?)?.toDouble(), +); -_$PaymentSheetShadowOffsetImpl _$$PaymentSheetShadowOffsetImplFromJson( - Map json) => - _$PaymentSheetShadowOffsetImpl( - x: (json['x'] as num?)?.toDouble(), - y: (json['y'] as num?)?.toDouble(), +Map _$PaymentSheetShadowOffsetToJson( + _PaymentSheetShadowOffset instance, +) => {'x': instance.x, 'y': instance.y}; + +_PaymentSheetPrimaryButtonAppearance +_$PaymentSheetPrimaryButtonAppearanceFromJson(Map json) => + _PaymentSheetPrimaryButtonAppearance( + colors: json['colors'] == null + ? null + : PaymentSheetPrimaryButtonTheme.fromJson( + json['colors'] as Map, + ), + shapes: json['shapes'] == null + ? null + : PaymentSheetPrimaryButtonShape.fromJson( + json['shapes'] as Map, + ), ); -Map _$$PaymentSheetShadowOffsetImplToJson( - _$PaymentSheetShadowOffsetImpl instance) => - { - 'x': instance.x, - 'y': instance.y, - }; +Map _$PaymentSheetPrimaryButtonAppearanceToJson( + _PaymentSheetPrimaryButtonAppearance instance, +) => { + 'colors': instance.colors?.toJson(), + 'shapes': instance.shapes?.toJson(), +}; -_$PaymentSheetPrimaryButtonAppearanceImpl - _$$PaymentSheetPrimaryButtonAppearanceImplFromJson( - Map json) => - _$PaymentSheetPrimaryButtonAppearanceImpl( - colors: json['colors'] == null - ? null - : PaymentSheetPrimaryButtonTheme.fromJson( - json['colors'] as Map), - shapes: json['shapes'] == null - ? null - : PaymentSheetPrimaryButtonShape.fromJson( - json['shapes'] as Map), - ); - -Map _$$PaymentSheetPrimaryButtonAppearanceImplToJson( - _$PaymentSheetPrimaryButtonAppearanceImpl instance) => - { - 'colors': instance.colors?.toJson(), - 'shapes': instance.shapes?.toJson(), - }; +_PaymentSheetPrimaryButtonShape _$PaymentSheetPrimaryButtonShapeFromJson( + Map json, +) => _PaymentSheetPrimaryButtonShape( + shadow: json['shadow'] == null + ? null + : PaymentSheetShadowParams.fromJson( + json['shadow'] as Map, + ), + blurRadius: (json['blurRadius'] as num?)?.toDouble(), + borderWidth: (json['borderWidth'] as num?)?.toDouble(), +); + +Map _$PaymentSheetPrimaryButtonShapeToJson( + _PaymentSheetPrimaryButtonShape instance, +) => { + 'shadow': instance.shadow?.toJson(), + 'blurRadius': instance.blurRadius, + 'borderWidth': instance.borderWidth, +}; -_$PaymentSheetPrimaryButtonShapeImpl - _$$PaymentSheetPrimaryButtonShapeImplFromJson(Map json) => - _$PaymentSheetPrimaryButtonShapeImpl( - shadow: json['shadow'] == null - ? null - : PaymentSheetShadowParams.fromJson( - json['shadow'] as Map), - blurRadius: (json['blurRadius'] as num?)?.toDouble(), - borderWidth: (json['borderWidth'] as num?)?.toDouble(), - ); - -Map _$$PaymentSheetPrimaryButtonShapeImplToJson( - _$PaymentSheetPrimaryButtonShapeImpl instance) => - { - 'shadow': instance.shadow?.toJson(), - 'blurRadius': instance.blurRadius, - 'borderWidth': instance.borderWidth, - }; +_PaymentSheetPrimaryButtonTheme _$PaymentSheetPrimaryButtonThemeFromJson( + Map json, +) => _PaymentSheetPrimaryButtonTheme( + dark: json['dark'] == null + ? null + : PaymentSheetPrimaryButtonThemeColors.fromJson( + json['dark'] as Map, + ), + light: json['light'] == null + ? null + : PaymentSheetPrimaryButtonThemeColors.fromJson( + json['light'] as Map, + ), +); + +Map _$PaymentSheetPrimaryButtonThemeToJson( + _PaymentSheetPrimaryButtonTheme instance, +) => { + 'dark': instance.dark?.toJson(), + 'light': instance.light?.toJson(), +}; -_$PaymentSheetPrimaryButtonThemeImpl - _$$PaymentSheetPrimaryButtonThemeImplFromJson(Map json) => - _$PaymentSheetPrimaryButtonThemeImpl( - dark: json['dark'] == null - ? null - : PaymentSheetPrimaryButtonThemeColors.fromJson( - json['dark'] as Map), - light: json['light'] == null - ? null - : PaymentSheetPrimaryButtonThemeColors.fromJson( - json['light'] as Map), - ); - -Map _$$PaymentSheetPrimaryButtonThemeImplToJson( - _$PaymentSheetPrimaryButtonThemeImpl instance) => - { - 'dark': instance.dark?.toJson(), - 'light': instance.light?.toJson(), - }; +_PaymentSheetPrimaryButtonThemeColors +_$PaymentSheetPrimaryButtonThemeColorsFromJson(Map json) => + _PaymentSheetPrimaryButtonThemeColors( + background: ColorKey.fromJson(json['background']), + text: ColorKey.fromJson(json['text']), + border: ColorKey.fromJson(json['border']), + ); -_$PaymentSheetPrimaryButtonThemeColorsImpl - _$$PaymentSheetPrimaryButtonThemeColorsImplFromJson( - Map json) => - _$PaymentSheetPrimaryButtonThemeColorsImpl( - background: ColorKey.fromJson(json['background']), - text: ColorKey.fromJson(json['text']), - border: ColorKey.fromJson(json['border']), - ); - -Map _$$PaymentSheetPrimaryButtonThemeColorsImplToJson( - _$PaymentSheetPrimaryButtonThemeColorsImpl instance) => - { - 'background': ColorKey.toJson(instance.background), - 'text': ColorKey.toJson(instance.text), - 'border': ColorKey.toJson(instance.border), - }; +Map _$PaymentSheetPrimaryButtonThemeColorsToJson( + _PaymentSheetPrimaryButtonThemeColors instance, +) => { + 'background': ColorKey.toJson(instance.background), + 'text': ColorKey.toJson(instance.text), + 'border': ColorKey.toJson(instance.border), +}; -_$PresentParametersImpl _$$PresentParametersImplFromJson( - Map json) => - _$PresentParametersImpl( +_PresentParameters _$PresentParametersFromJson(Map json) => + _PresentParameters( clientSecret: json['clientSecret'] as String, confirmPayment: json['confirmPayment'] as bool? ?? false, ); -Map _$$PresentParametersImplToJson( - _$PresentParametersImpl instance) => +Map _$PresentParametersToJson(_PresentParameters instance) => { 'clientSecret': instance.clientSecret, 'confirmPayment': instance.confirmPayment, }; -_$PaymentSheetPresentOptionsImpl _$$PaymentSheetPresentOptionsImplFromJson( - Map json) => - _$PaymentSheetPresentOptionsImpl( - timeout: (json['timeout'] as num?)?.toInt(), - ); - -Map _$$PaymentSheetPresentOptionsImplToJson( - _$PaymentSheetPresentOptionsImpl instance) => - { - 'timeout': instance.timeout, - }; - -_$PaymentSheetPaymentOptionImpl _$$PaymentSheetPaymentOptionImplFromJson( - Map json) => - _$PaymentSheetPaymentOptionImpl( - label: json['label'] as String, - image: json['image'] as String?, - ); - -Map _$$PaymentSheetPaymentOptionImplToJson( - _$PaymentSheetPaymentOptionImpl instance) => - { - 'label': instance.label, - 'image': instance.image, - }; - -_$BillingDetailsCollectionConfigurationImpl - _$$BillingDetailsCollectionConfigurationImplFromJson( - Map json) => - _$BillingDetailsCollectionConfigurationImpl( - name: $enumDecodeNullable(_$CollectionModeEnumMap, json['name']), - phone: $enumDecodeNullable(_$CollectionModeEnumMap, json['phone']), - email: $enumDecodeNullable(_$CollectionModeEnumMap, json['email']), - address: $enumDecodeNullable( - _$AddressCollectionModeEnumMap, json['address']), - attachDefaultsToPaymentMethod: - json['attachDefaultsToPaymentMethod'] as bool?, - ); - -Map _$$BillingDetailsCollectionConfigurationImplToJson( - _$BillingDetailsCollectionConfigurationImpl instance) => - { - 'name': _$CollectionModeEnumMap[instance.name], - 'phone': _$CollectionModeEnumMap[instance.phone], - 'email': _$CollectionModeEnumMap[instance.email], - 'address': _$AddressCollectionModeEnumMap[instance.address], - 'attachDefaultsToPaymentMethod': instance.attachDefaultsToPaymentMethod, - }; +_PaymentSheetPresentOptions _$PaymentSheetPresentOptionsFromJson( + Map json, +) => _PaymentSheetPresentOptions(timeout: (json['timeout'] as num?)?.toInt()); + +Map _$PaymentSheetPresentOptionsToJson( + _PaymentSheetPresentOptions instance, +) => {'timeout': instance.timeout}; + +_PaymentSheetPaymentOption _$PaymentSheetPaymentOptionFromJson( + Map json, +) => _PaymentSheetPaymentOption( + label: json['label'] as String, + image: json['image'] as String?, +); + +Map _$PaymentSheetPaymentOptionToJson( + _PaymentSheetPaymentOption instance, +) => {'label': instance.label, 'image': instance.image}; + +_BillingDetailsCollectionConfiguration +_$BillingDetailsCollectionConfigurationFromJson( + Map json, +) => _BillingDetailsCollectionConfiguration( + name: $enumDecodeNullable(_$CollectionModeEnumMap, json['name']), + phone: $enumDecodeNullable(_$CollectionModeEnumMap, json['phone']), + email: $enumDecodeNullable(_$CollectionModeEnumMap, json['email']), + address: $enumDecodeNullable(_$AddressCollectionModeEnumMap, json['address']), + attachDefaultsToPaymentMethod: json['attachDefaultsToPaymentMethod'] as bool?, +); + +Map _$BillingDetailsCollectionConfigurationToJson( + _BillingDetailsCollectionConfiguration instance, +) => { + 'name': _$CollectionModeEnumMap[instance.name], + 'phone': _$CollectionModeEnumMap[instance.phone], + 'email': _$CollectionModeEnumMap[instance.email], + 'address': _$AddressCollectionModeEnumMap[instance.address], + 'attachDefaultsToPaymentMethod': instance.attachDefaultsToPaymentMethod, +}; const _$CollectionModeEnumMap = { CollectionMode.automatic: 'automatic', @@ -510,21 +540,21 @@ const _$AddressCollectionModeEnumMap = { AddressCollectionMode.full: 'full', }; -_$CardBrandAcceptanceAllImpl _$$CardBrandAcceptanceAllImplFromJson( - Map json) => - _$CardBrandAcceptanceAllImpl( - filter: $enumDecodeNullable( - _$CardBrandAcceptanceFilterEnumMap, json['filter']) ?? - CardBrandAcceptanceFilter.all, - $type: json['runtimeType'] as String?, - ); - -Map _$$CardBrandAcceptanceAllImplToJson( - _$CardBrandAcceptanceAllImpl instance) => - { - 'filter': _$CardBrandAcceptanceFilterEnumMap[instance.filter]!, - 'runtimeType': instance.$type, - }; +_CardBrandAcceptanceAll _$CardBrandAcceptanceAllFromJson( + Map json, +) => _CardBrandAcceptanceAll( + filter: + $enumDecodeNullable(_$CardBrandAcceptanceFilterEnumMap, json['filter']) ?? + CardBrandAcceptanceFilter.all, + $type: json['runtimeType'] as String?, +); + +Map _$CardBrandAcceptanceAllToJson( + _CardBrandAcceptanceAll instance, +) => { + 'filter': _$CardBrandAcceptanceFilterEnumMap[instance.filter]!, + 'runtimeType': instance.$type, +}; const _$CardBrandAcceptanceFilterEnumMap = { CardBrandAcceptanceFilter.all: 'all', @@ -532,26 +562,25 @@ const _$CardBrandAcceptanceFilterEnumMap = { CardBrandAcceptanceFilter.disallowed: 'disallowed', }; -_$CardBrandAcceptanceAllowedImpl _$$CardBrandAcceptanceAllowedImplFromJson( - Map json) => - _$CardBrandAcceptanceAllowedImpl( - filter: $enumDecodeNullable( - _$CardBrandAcceptanceFilterEnumMap, json['filter']) ?? - CardBrandAcceptanceFilter.allowed, - brands: (json['brands'] as List) - .map((e) => $enumDecode(_$CardBrandCategoryEnumMap, e)) - .toList(), - $type: json['runtimeType'] as String?, - ); - -Map _$$CardBrandAcceptanceAllowedImplToJson( - _$CardBrandAcceptanceAllowedImpl instance) => - { - 'filter': _$CardBrandAcceptanceFilterEnumMap[instance.filter]!, - 'brands': - instance.brands.map((e) => _$CardBrandCategoryEnumMap[e]!).toList(), - 'runtimeType': instance.$type, - }; +_CardBrandAcceptanceAllowed _$CardBrandAcceptanceAllowedFromJson( + Map json, +) => _CardBrandAcceptanceAllowed( + filter: + $enumDecodeNullable(_$CardBrandAcceptanceFilterEnumMap, json['filter']) ?? + CardBrandAcceptanceFilter.allowed, + brands: (json['brands'] as List) + .map((e) => $enumDecode(_$CardBrandCategoryEnumMap, e)) + .toList(), + $type: json['runtimeType'] as String?, +); + +Map _$CardBrandAcceptanceAllowedToJson( + _CardBrandAcceptanceAllowed instance, +) => { + 'filter': _$CardBrandAcceptanceFilterEnumMap[instance.filter]!, + 'brands': instance.brands.map((e) => _$CardBrandCategoryEnumMap[e]!).toList(), + 'runtimeType': instance.$type, +}; const _$CardBrandCategoryEnumMap = { CardBrandCategory.visa: 'visa', @@ -560,23 +589,185 @@ const _$CardBrandCategoryEnumMap = { CardBrandCategory.discover: 'discover', }; -_$CardBrandAcceptanceDisallowedImpl - _$$CardBrandAcceptanceDisallowedImplFromJson(Map json) => - _$CardBrandAcceptanceDisallowedImpl( - filter: $enumDecodeNullable( - _$CardBrandAcceptanceFilterEnumMap, json['filter']) ?? - CardBrandAcceptanceFilter.disallowed, - brands: (json['brands'] as List) - .map((e) => $enumDecode(_$CardBrandCategoryEnumMap, e)) - .toList(), - $type: json['runtimeType'] as String?, - ); - -Map _$$CardBrandAcceptanceDisallowedImplToJson( - _$CardBrandAcceptanceDisallowedImpl instance) => +_CardBrandAcceptanceDisallowed _$CardBrandAcceptanceDisallowedFromJson( + Map json, +) => _CardBrandAcceptanceDisallowed( + filter: + $enumDecodeNullable(_$CardBrandAcceptanceFilterEnumMap, json['filter']) ?? + CardBrandAcceptanceFilter.disallowed, + brands: (json['brands'] as List) + .map((e) => $enumDecode(_$CardBrandCategoryEnumMap, e)) + .toList(), + $type: json['runtimeType'] as String?, +); + +Map _$CardBrandAcceptanceDisallowedToJson( + _CardBrandAcceptanceDisallowed instance, +) => { + 'filter': _$CardBrandAcceptanceFilterEnumMap[instance.filter]!, + 'brands': instance.brands.map((e) => _$CardBrandCategoryEnumMap[e]!).toList(), + 'runtimeType': instance.$type, +}; + +_LinkDisplayParams _$LinkDisplayParamsFromJson(Map json) => + _LinkDisplayParams( + linkDisplay: $enumDecode(_$LinkDisplayEnumMap, json['linkDisplay']), + ); + +Map _$LinkDisplayParamsToJson(_LinkDisplayParams instance) => + { + 'linkDisplay': _$LinkDisplayEnumMap[instance.linkDisplay]!, + }; + +const _$LinkDisplayEnumMap = { + LinkDisplay.automatic: 'automatic', + LinkDisplay.manual: 'manual', +}; + +_EdgeInsetsConfig _$EdgeInsetsConfigFromJson(Map json) => + _EdgeInsetsConfig( + top: (json['top'] as num?)?.toDouble(), + bottom: (json['bottom'] as num?)?.toDouble(), + left: (json['left'] as num?)?.toDouble(), + right: (json['right'] as num?)?.toDouble(), + ); + +Map _$EdgeInsetsConfigToJson(_EdgeInsetsConfig instance) => + { + 'top': instance.top, + 'bottom': instance.bottom, + 'left': instance.left, + 'right': instance.right, + }; + +_RadioConfig _$RadioConfigFromJson(Map json) => _RadioConfig( + selectedColor: ColorKey.fromJson(json['selectedColor']), + unselectedColor: ColorKey.fromJson(json['unselectedColor']), +); + +Map _$RadioConfigToJson(_RadioConfig instance) => { - 'filter': _$CardBrandAcceptanceFilterEnumMap[instance.filter]!, - 'brands': - instance.brands.map((e) => _$CardBrandCategoryEnumMap[e]!).toList(), - 'runtimeType': instance.$type, + 'selectedColor': ColorKey.toJson(instance.selectedColor), + 'unselectedColor': ColorKey.toJson(instance.unselectedColor), }; + +_CheckmarkConfig _$CheckmarkConfigFromJson(Map json) => + _CheckmarkConfig(color: ColorKey.fromJson(json['color'])); + +Map _$CheckmarkConfigToJson(_CheckmarkConfig instance) => + {'color': ColorKey.toJson(instance.color)}; + +_ChevronConfig _$ChevronConfigFromJson(Map json) => + _ChevronConfig(color: ColorKey.fromJson(json['color'])); + +Map _$ChevronConfigToJson(_ChevronConfig instance) => + {'color': ColorKey.toJson(instance.color)}; + +_FlatConfig _$FlatConfigFromJson(Map json) => _FlatConfig( + separatorThickness: (json['separatorThickness'] as num?)?.toDouble(), + separatorColor: ColorKey.fromJson(json['separatorColor']), + separatorInsets: json['separatorInsets'] == null + ? null + : EdgeInsetsConfig.fromJson( + json['separatorInsets'] as Map, + ), + topSeparatorEnabled: json['topSeparatorEnabled'] as bool?, + bottomSeparatorEnabled: json['bottomSeparatorEnabled'] as bool?, + radio: json['radio'] == null + ? null + : RadioConfig.fromJson(json['radio'] as Map), + checkmark: json['checkmark'] == null + ? null + : CheckmarkConfig.fromJson(json['checkmark'] as Map), + chevron: json['chevron'] == null + ? null + : ChevronConfig.fromJson(json['chevron'] as Map), +); + +Map _$FlatConfigToJson(_FlatConfig instance) => + { + 'separatorThickness': instance.separatorThickness, + 'separatorColor': ColorKey.toJson(instance.separatorColor), + 'separatorInsets': instance.separatorInsets, + 'topSeparatorEnabled': instance.topSeparatorEnabled, + 'bottomSeparatorEnabled': instance.bottomSeparatorEnabled, + 'radio': instance.radio, + 'checkmark': instance.checkmark, + 'chevron': instance.chevron, + }; + +_FloatingConfig _$FloatingConfigFromJson(Map json) => + _FloatingConfig(spacing: (json['spacing'] as num?)?.toDouble()); + +Map _$FloatingConfigToJson(_FloatingConfig instance) => + {'spacing': instance.spacing}; + +_RowConfig _$RowConfigFromJson(Map json) => _RowConfig( + style: $enumDecodeNullable(_$RowStyleEnumMap, json['style']), + additionalInsets: (json['additionalInsets'] as num?)?.toDouble(), + flat: json['flat'] == null + ? null + : FlatConfig.fromJson(json['flat'] as Map), + floating: json['floating'] == null + ? null + : FloatingConfig.fromJson(json['floating'] as Map), +); + +Map _$RowConfigToJson(_RowConfig instance) => + { + 'style': _$RowStyleEnumMap[instance.style], + 'additionalInsets': instance.additionalInsets, + 'flat': instance.flat, + 'floating': instance.floating, + }; + +const _$RowStyleEnumMap = { + RowStyle.flatWithRadio: 'flatWithRadio', + RowStyle.floatingButton: 'floatingButton', + RowStyle.flatWithCheckmark: 'flatWithCheckmark', + RowStyle.flatWithChevron: 'flatWithChevron', +}; + +_EmbeddedPaymentElementAppearance _$EmbeddedPaymentElementAppearanceFromJson( + Map json, +) => _EmbeddedPaymentElementAppearance( + row: json['row'] == null + ? null + : RowConfig.fromJson(json['row'] as Map), +); + +Map _$EmbeddedPaymentElementAppearanceToJson( + _EmbeddedPaymentElementAppearance instance, +) => {'row': instance.row}; + +_CustomPaymentMethod _$CustomPaymentMethodFromJson(Map json) => + _CustomPaymentMethod( + id: json['id'] as String, + subtitle: json['subtitle'] as String?, + disableBillingDetailCollection: + json['disableBillingDetailCollection'] as bool?, + ); + +Map _$CustomPaymentMethodToJson( + _CustomPaymentMethod instance, +) => { + 'id': instance.id, + 'subtitle': instance.subtitle, + 'disableBillingDetailCollection': instance.disableBillingDetailCollection, +}; + +_CustomPaymentMethodConfiguration _$CustomPaymentMethodConfigurationFromJson( + Map json, +) => _CustomPaymentMethodConfiguration( + customPaymentMethods: (json['customPaymentMethods'] as List) + .map((e) => CustomPaymentMethod.fromJson(e as Map)) + .toList(), +); + +Map _$CustomPaymentMethodConfigurationToJson( + _CustomPaymentMethodConfiguration instance, +) => { + 'customPaymentMethods': instance.customPaymentMethods + .map((e) => e.toJson()) + .toList(), +}; diff --git a/packages/stripe_platform_interface/lib/src/models/platform_pay.dart b/packages/stripe_platform_interface/lib/src/models/platform_pay.dart index a8fee3721..d7dc9f251 100644 --- a/packages/stripe_platform_interface/lib/src/models/platform_pay.dart +++ b/packages/stripe_platform_interface/lib/src/models/platform_pay.dart @@ -10,9 +10,8 @@ part 'platform_pay.freezed.dart'; part 'platform_pay.g.dart'; @freezed - /// Result object when creating a payment method through apple pay or google pay. -class PlatformPayPaymentMethod with _$PlatformPayPaymentMethod { +abstract class PlatformPayPaymentMethod with _$PlatformPayPaymentMethod { @JsonSerializable(explicitToJson: true) const factory PlatformPayPaymentMethod({ /// The payment method @@ -27,11 +26,11 @@ class PlatformPayPaymentMethod with _$PlatformPayPaymentMethod { } @freezed - ///Parameters related to updating the platform pay sheet /// /// At this moment only Apple pay is supported -class PlatformPaySheetUpdateParams with _$PlatformPaySheetUpdateParams { +abstract class PlatformPaySheetUpdateParams + with _$PlatformPaySheetUpdateParams { @JsonSerializable(explicitToJson: true) const factory PlatformPaySheetUpdateParams.applePay({ /// list of updated summary items @@ -49,43 +48,39 @@ class PlatformPaySheetUpdateParams with _$PlatformPaySheetUpdateParams { } @Freezed(unionKey: 'errorType') -class ApplePaySheetError with _$ApplePaySheetError { +abstract class ApplePaySheetError with _$ApplePaySheetError { @FreezedUnionValue('InvalidShippingAddress') @JsonSerializable(explicitToJson: true) - /// Use this in case the shipping address is invalid - const factory ApplePaySheetError.invalidShippingField( - { - // Field that will be marked as invalid - required InvalidShippingField field, - // message that needs to be displayed on the sheet - String? message}) = _ApplePaySheetErrorInvalidShipping; + const factory ApplePaySheetError.invalidShippingField({ + // Field that will be marked as invalid + required InvalidShippingField field, + // message that needs to be displayed on the sheet + String? message, + }) = _ApplePaySheetErrorInvalidShipping; @FreezedUnionValue('UnserviceableShippingAddress') @JsonSerializable(explicitToJson: true) - /// Use this in case you cannot deliver to the shipping address - const factory ApplePaySheetError.unserviceableShippingAddress( - { - // message that needs to be displayed on the sheet - String? message}) = _ApplePaySheetErrorUnserviceableShipping; + const factory ApplePaySheetError.unserviceableShippingAddress({ + // message that needs to be displayed on the sheet + String? message, + }) = _ApplePaySheetErrorUnserviceableShipping; @FreezedUnionValue('InvalidCouponCode') - /// Use this in case the entered coupon code is wrong - const factory ApplePaySheetError.invalidCouponCode( - { - // message that needs to be displayed on the sheet - String? message}) = _ApplePaySheetErrorInvalidCouponCode; + const factory ApplePaySheetError.invalidCouponCode({ + // message that needs to be displayed on the sheet + String? message, + }) = _ApplePaySheetErrorInvalidCouponCode; @FreezedUnionValue('ExpiredCouponCode') @JsonSerializable(explicitToJson: true) - /// Use this in case the entered coupon code has expired - const factory ApplePaySheetError.expiredCouponCode( - { - // message that needs to be displayed on the sheet - String? message}) = _ApplePaySheetErrorExpiredCouponCode; + const factory ApplePaySheetError.expiredCouponCode({ + // message that needs to be displayed on the sheet + String? message, + }) = _ApplePaySheetErrorExpiredCouponCode; factory ApplePaySheetError.fromJson(Map json) => _$ApplePaySheetErrorFromJson(json); @@ -104,7 +99,8 @@ enum InvalidShippingField { } @freezed -class PlatformPayPaymentMethodParams with _$PlatformPayPaymentMethodParams { +sealed class PlatformPayPaymentMethodParams + with _$PlatformPayPaymentMethodParams { @JsonSerializable(explicitToJson: true) const factory PlatformPayPaymentMethodParams.googlePay({ required GooglePayParams googlePayParams, @@ -123,7 +119,7 @@ class PlatformPayPaymentMethodParams with _$PlatformPayPaymentMethodParams { } @freezed -class PlatformPayConfirmParams with _$PlatformPayConfirmParams { +abstract class PlatformPayConfirmParams with _$PlatformPayConfirmParams { @JsonSerializable(explicitToJson: true) const factory PlatformPayConfirmParams.googlePay({ required GooglePayParams googlePay, @@ -144,9 +140,8 @@ class PlatformPayConfirmParams with _$PlatformPayConfirmParams { } @freezed - /// Entered Shipping contact data -class PlatformPayShippingContact with _$PlatformPayShippingContact { +abstract class PlatformPayShippingContact with _$PlatformPayShippingContact { @JsonSerializable(explicitToJson: true) const factory PlatformPayShippingContact({ /// Email address of the shipping contact @@ -167,7 +162,7 @@ class PlatformPayShippingContact with _$PlatformPayShippingContact { } @freezed -class ApplePayParams with _$ApplePayParams { +abstract class ApplePayParams with _$ApplePayParams { @JsonSerializable(explicitToJson: true) const factory ApplePayParams({ /// ISO 3166-1 alpha-2 country code where the transaction is processed. @@ -221,10 +216,10 @@ class ApplePayParams with _$ApplePayParams { } @freezed -class GooglePayParams with _$GooglePayParams { +abstract class GooglePayParams with _$GooglePayParams { @JsonSerializable(explicitToJson: true) const factory GooglePayParams({ -/** + /** * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK. - Does not require the application to be uploaded to the Google Play Store. - Does not require a Google Pay Developer Profile. @@ -261,9 +256,9 @@ class GooglePayParams with _$GooglePayParams { } @freezed - /// Payment method parameters for google pay -class GooglePayPaymentMethodParams with _$GooglePayPaymentMethodParams { +abstract class GooglePayPaymentMethodParams + with _$GooglePayPaymentMethodParams { @JsonSerializable(explicitToJson: true) const factory GooglePayPaymentMethodParams({ /// If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. @@ -287,7 +282,8 @@ class GooglePayPaymentMethodParams with _$GooglePayPaymentMethodParams { } @freezed -class GooglePayBillingAddressConfig with _$GooglePayBillingAddressConfig { +abstract class GooglePayBillingAddressConfig + with _$GooglePayBillingAddressConfig { @JsonSerializable(explicitToJson: true) const factory GooglePayBillingAddressConfig({ /// Set to true if billing address is required for payment. @@ -311,7 +307,8 @@ class GooglePayBillingAddressConfig with _$GooglePayBillingAddressConfig { } @freezed -class GooglePayShippingAddressConfig with _$GooglePayShippingAddressConfig { +abstract class GooglePayShippingAddressConfig + with _$GooglePayShippingAddressConfig { @JsonSerializable(explicitToJson: true) const factory GooglePayShippingAddressConfig({ /// Set to true if shipping address is required for payment. @@ -339,10 +336,9 @@ class GooglePayShippingAddressConfig with _$GooglePayShippingAddressConfig { /// To support different types of payments request include a payment request type. ///Only supported on iOS 16 and higher. @Freezed(unionKey: 'type') -class PaymentRequestType with _$PaymentRequestType { +abstract class PaymentRequestType with _$PaymentRequestType { @JsonSerializable(explicitToJson: true) @FreezedUnionValue('Recurring') - /// Use this for a recurring payment /// /// For example a subscription @@ -371,7 +367,6 @@ class PaymentRequestType with _$PaymentRequestType { }) = _PaymentRequestTypeRecurring; @FreezedUnionValue('AutomaticReload') - /// Use this for a reload or refill payment /// /// For example a store card top up @@ -403,7 +398,6 @@ class PaymentRequestType with _$PaymentRequestType { }) = _PaymentRequestTypeReload; @FreezedUnionValue('MultiMerchant') - /// Use this to indicate payments for multiple merchants. const factory PaymentRequestType.multiMerchant({ required List merchants, @@ -414,9 +408,8 @@ class PaymentRequestType with _$PaymentRequestType { } @freezed - /// Data record for multimerchant payment -class ApplePayMultiMerchant with _$ApplePayMultiMerchant { +abstract class ApplePayMultiMerchant with _$ApplePayMultiMerchant { @JsonSerializable(explicitToJson: true) const factory ApplePayMultiMerchant({ /// The apple pay merchant identifier @@ -440,13 +433,12 @@ class ApplePayMultiMerchant with _$ApplePayMultiMerchant { } @freezed - /// Parameters related to order details with Apple pay /// /// At this moment only Apple pay is supported. /// Similar to [KPaymentOrderDetails] /// See https://stripe.com/docs/apple-pay?platform=ios&locale=es-ES#order-tracking -class PlatformPayOrderDetails with _$PlatformPayOrderDetails { +abstract class PlatformPayOrderDetails with _$PlatformPayOrderDetails { @JsonSerializable(explicitToJson: true) const factory PlatformPayOrderDetails.applePay({ /// eg: "com.myapp.order" @@ -466,15 +458,10 @@ class PlatformPayOrderDetails with _$PlatformPayOrderDetails { _$PlatformPayOrderDetailsFromJson(json); } -enum PlatformPayWebWalletType { - applePay, - googlePay, - link, - browserCard, -} +enum PlatformPayWebWalletType { applePay, googlePay, link, browserCard } @freezed -class PlatformPayWebPaymentRequestCreateOptions +abstract class PlatformPayWebPaymentRequestCreateOptions with _$PlatformPayWebPaymentRequestCreateOptions { @JsonSerializable(explicitToJson: true) const factory PlatformPayWebPaymentRequestCreateOptions({ @@ -520,21 +507,19 @@ class PlatformPayWebPaymentRequestCreateOptions }) = _PaymentRequestCreateOptions; factory PlatformPayWebPaymentRequestCreateOptions.fromJson( - Map json) => - _$PlatformPayWebPaymentRequestCreateOptionsFromJson(json); + Map json, + ) => _$PlatformPayWebPaymentRequestCreateOptionsFromJson(json); static const defaultOptions = PlatformPayWebPaymentRequestCreateOptions( country: 'US', currency: 'usd', - total: PlatformPayWebPaymentItem( - amount: 0, - label: 'Payment', - ), + total: PlatformPayWebPaymentItem(amount: 0, label: 'Payment'), ); } @freezed -class PlatformPayWebShippingOption with _$PlatformPayWebShippingOption { +abstract class PlatformPayWebShippingOption + with _$PlatformPayWebShippingOption { @JsonSerializable(explicitToJson: true) const factory PlatformPayWebShippingOption({ /// A unique ID you create to keep track of this shipping option. You’ll be told the ID of the selected option @@ -557,7 +542,7 @@ class PlatformPayWebShippingOption with _$PlatformPayWebShippingOption { } @freezed -class PlatformPayWebPaymentItem with _$PlatformPayWebPaymentItem { +abstract class PlatformPayWebPaymentItem with _$PlatformPayWebPaymentItem { @JsonSerializable(explicitToJson: true) const factory PlatformPayWebPaymentItem({ /// The amount in the currency's subunit (e.g. cents, yen, etc.) diff --git a/packages/stripe_platform_interface/lib/src/models/platform_pay.freezed.dart b/packages/stripe_platform_interface/lib/src/models/platform_pay.freezed.dart index 30d548ec3..14f17ba99 100644 --- a/packages/stripe_platform_interface/lib/src/models/platform_pay.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/platform_pay.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,3780 +9,2759 @@ part of 'platform_pay.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -PlatformPayPaymentMethod _$PlatformPayPaymentMethodFromJson( - Map json) { - return _PlatformPayPaymentMethod.fromJson(json); -} - /// @nodoc mixin _$PlatformPayPaymentMethod { - /// The payment method - PaymentMethod get paymentMethod => throw _privateConstructorUsedError; - /// shipping contact of the user - PlatformPayShippingContact? get shippingContact => - throw _privateConstructorUsedError; +/// The payment method + PaymentMethod get paymentMethod;/// shipping contact of the user + PlatformPayShippingContact? get shippingContact; +/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayPaymentMethodCopyWith get copyWith => _$PlatformPayPaymentMethodCopyWithImpl(this as PlatformPayPaymentMethod, _$identity); /// Serializes this PlatformPayPaymentMethod to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPayPaymentMethodCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayPaymentMethod&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.shippingContact, shippingContact) || other.shippingContact == shippingContact)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,shippingContact); + +@override +String toString() { + return 'PlatformPayPaymentMethod(paymentMethod: $paymentMethod, shippingContact: $shippingContact)'; } -/// @nodoc -abstract class $PlatformPayPaymentMethodCopyWith<$Res> { - factory $PlatformPayPaymentMethodCopyWith(PlatformPayPaymentMethod value, - $Res Function(PlatformPayPaymentMethod) then) = - _$PlatformPayPaymentMethodCopyWithImpl<$Res, PlatformPayPaymentMethod>; - @useResult - $Res call( - {PaymentMethod paymentMethod, - PlatformPayShippingContact? shippingContact}); - $PaymentMethodCopyWith<$Res> get paymentMethod; - $PlatformPayShippingContactCopyWith<$Res>? get shippingContact; } /// @nodoc -class _$PlatformPayPaymentMethodCopyWithImpl<$Res, - $Val extends PlatformPayPaymentMethod> - implements $PlatformPayPaymentMethodCopyWith<$Res> { - _$PlatformPayPaymentMethodCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = null, - Object? shippingContact = freezed, - }) { - return _then(_value.copyWith( - paymentMethod: null == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as PaymentMethod, - shippingContact: freezed == shippingContact - ? _value.shippingContact - : shippingContact // ignore: cast_nullable_to_non_nullable - as PlatformPayShippingContact?, - ) as $Val); - } +abstract mixin class $PlatformPayPaymentMethodCopyWith<$Res> { + factory $PlatformPayPaymentMethodCopyWith(PlatformPayPaymentMethod value, $Res Function(PlatformPayPaymentMethod) _then) = _$PlatformPayPaymentMethodCopyWithImpl; +@useResult +$Res call({ + PaymentMethod paymentMethod, PlatformPayShippingContact? shippingContact +}); - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentMethodCopyWith<$Res> get paymentMethod { - return $PaymentMethodCopyWith<$Res>(_value.paymentMethod, (value) { - return _then(_value.copyWith(paymentMethod: value) as $Val); - }); - } - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PlatformPayShippingContactCopyWith<$Res>? get shippingContact { - if (_value.shippingContact == null) { - return null; - } - - return $PlatformPayShippingContactCopyWith<$Res>(_value.shippingContact!, - (value) { - return _then(_value.copyWith(shippingContact: value) as $Val); - }); - } -} +$PaymentMethodCopyWith<$Res> get paymentMethod;$PlatformPayShippingContactCopyWith<$Res>? get shippingContact; +} /// @nodoc -abstract class _$$PlatformPayPaymentMethodImplCopyWith<$Res> +class _$PlatformPayPaymentMethodCopyWithImpl<$Res> implements $PlatformPayPaymentMethodCopyWith<$Res> { - factory _$$PlatformPayPaymentMethodImplCopyWith( - _$PlatformPayPaymentMethodImpl value, - $Res Function(_$PlatformPayPaymentMethodImpl) then) = - __$$PlatformPayPaymentMethodImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {PaymentMethod paymentMethod, - PlatformPayShippingContact? shippingContact}); - - @override - $PaymentMethodCopyWith<$Res> get paymentMethod; - @override - $PlatformPayShippingContactCopyWith<$Res>? get shippingContact; + _$PlatformPayPaymentMethodCopyWithImpl(this._self, this._then); + + final PlatformPayPaymentMethod _self; + final $Res Function(PlatformPayPaymentMethod) _then; + +/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? paymentMethod = null,Object? shippingContact = freezed,}) { + return _then(_self.copyWith( +paymentMethod: null == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as PaymentMethod,shippingContact: freezed == shippingContact ? _self.shippingContact : shippingContact // ignore: cast_nullable_to_non_nullable +as PlatformPayShippingContact?, + )); +} +/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith<$Res> get paymentMethod { + + return $PaymentMethodCopyWith<$Res>(_self.paymentMethod, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PlatformPayShippingContactCopyWith<$Res>? get shippingContact { + if (_self.shippingContact == null) { + return null; + } + + return $PlatformPayShippingContactCopyWith<$Res>(_self.shippingContact!, (value) { + return _then(_self.copyWith(shippingContact: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PlatformPayPaymentMethod]. +extension PlatformPayPaymentMethodPatterns on PlatformPayPaymentMethod { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PlatformPayPaymentMethod value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PlatformPayPaymentMethod() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PlatformPayPaymentMethod value) $default,){ +final _that = this; +switch (_that) { +case _PlatformPayPaymentMethod(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PlatformPayPaymentMethod value)? $default,){ +final _that = this; +switch (_that) { +case _PlatformPayPaymentMethod() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( PaymentMethod paymentMethod, PlatformPayShippingContact? shippingContact)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PlatformPayPaymentMethod() when $default != null: +return $default(_that.paymentMethod,_that.shippingContact);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( PaymentMethod paymentMethod, PlatformPayShippingContact? shippingContact) $default,) {final _that = this; +switch (_that) { +case _PlatformPayPaymentMethod(): +return $default(_that.paymentMethod,_that.shippingContact);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( PaymentMethod paymentMethod, PlatformPayShippingContact? shippingContact)? $default,) {final _that = this; +switch (_that) { +case _PlatformPayPaymentMethod() when $default != null: +return $default(_that.paymentMethod,_that.shippingContact);case _: + return null; + +} } -/// @nodoc -class __$$PlatformPayPaymentMethodImplCopyWithImpl<$Res> - extends _$PlatformPayPaymentMethodCopyWithImpl<$Res, - _$PlatformPayPaymentMethodImpl> - implements _$$PlatformPayPaymentMethodImplCopyWith<$Res> { - __$$PlatformPayPaymentMethodImplCopyWithImpl( - _$PlatformPayPaymentMethodImpl _value, - $Res Function(_$PlatformPayPaymentMethodImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? paymentMethod = null, - Object? shippingContact = freezed, - }) { - return _then(_$PlatformPayPaymentMethodImpl( - paymentMethod: null == paymentMethod - ? _value.paymentMethod - : paymentMethod // ignore: cast_nullable_to_non_nullable - as PaymentMethod, - shippingContact: freezed == shippingContact - ? _value.shippingContact - : shippingContact // ignore: cast_nullable_to_non_nullable - as PlatformPayShippingContact?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PlatformPayPaymentMethodImpl implements _PlatformPayPaymentMethod { - const _$PlatformPayPaymentMethodImpl( - {required this.paymentMethod, this.shippingContact}); +class _PlatformPayPaymentMethod implements PlatformPayPaymentMethod { + const _PlatformPayPaymentMethod({required this.paymentMethod, this.shippingContact}); + factory _PlatformPayPaymentMethod.fromJson(Map json) => _$PlatformPayPaymentMethodFromJson(json); - factory _$PlatformPayPaymentMethodImpl.fromJson(Map json) => - _$$PlatformPayPaymentMethodImplFromJson(json); +/// The payment method +@override final PaymentMethod paymentMethod; +/// shipping contact of the user +@override final PlatformPayShippingContact? shippingContact; - /// The payment method - @override - final PaymentMethod paymentMethod; +/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PlatformPayPaymentMethodCopyWith<_PlatformPayPaymentMethod> get copyWith => __$PlatformPayPaymentMethodCopyWithImpl<_PlatformPayPaymentMethod>(this, _$identity); - /// shipping contact of the user - @override - final PlatformPayShippingContact? shippingContact; +@override +Map toJson() { + return _$PlatformPayPaymentMethodToJson(this, ); +} - @override - String toString() { - return 'PlatformPayPaymentMethod(paymentMethod: $paymentMethod, shippingContact: $shippingContact)'; - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PlatformPayPaymentMethod&&(identical(other.paymentMethod, paymentMethod) || other.paymentMethod == paymentMethod)&&(identical(other.shippingContact, shippingContact) || other.shippingContact == shippingContact)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,paymentMethod,shippingContact); + +@override +String toString() { + return 'PlatformPayPaymentMethod(paymentMethod: $paymentMethod, shippingContact: $shippingContact)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayPaymentMethodImpl && - (identical(other.paymentMethod, paymentMethod) || - other.paymentMethod == paymentMethod) && - (identical(other.shippingContact, shippingContact) || - other.shippingContact == shippingContact)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, paymentMethod, shippingContact); - - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayPaymentMethodImplCopyWith<_$PlatformPayPaymentMethodImpl> - get copyWith => __$$PlatformPayPaymentMethodImplCopyWithImpl< - _$PlatformPayPaymentMethodImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PlatformPayPaymentMethodImplToJson( - this, - ); - } } -abstract class _PlatformPayPaymentMethod implements PlatformPayPaymentMethod { - const factory _PlatformPayPaymentMethod( - {required final PaymentMethod paymentMethod, - final PlatformPayShippingContact? shippingContact}) = - _$PlatformPayPaymentMethodImpl; +/// @nodoc +abstract mixin class _$PlatformPayPaymentMethodCopyWith<$Res> implements $PlatformPayPaymentMethodCopyWith<$Res> { + factory _$PlatformPayPaymentMethodCopyWith(_PlatformPayPaymentMethod value, $Res Function(_PlatformPayPaymentMethod) _then) = __$PlatformPayPaymentMethodCopyWithImpl; +@override @useResult +$Res call({ + PaymentMethod paymentMethod, PlatformPayShippingContact? shippingContact +}); + - factory _PlatformPayPaymentMethod.fromJson(Map json) = - _$PlatformPayPaymentMethodImpl.fromJson; +@override $PaymentMethodCopyWith<$Res> get paymentMethod;@override $PlatformPayShippingContactCopyWith<$Res>? get shippingContact; - /// The payment method - @override - PaymentMethod get paymentMethod; +} +/// @nodoc +class __$PlatformPayPaymentMethodCopyWithImpl<$Res> + implements _$PlatformPayPaymentMethodCopyWith<$Res> { + __$PlatformPayPaymentMethodCopyWithImpl(this._self, this._then); - /// shipping contact of the user - @override - PlatformPayShippingContact? get shippingContact; + final _PlatformPayPaymentMethod _self; + final $Res Function(_PlatformPayPaymentMethod) _then; - /// Create a copy of PlatformPayPaymentMethod - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayPaymentMethodImplCopyWith<_$PlatformPayPaymentMethodImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? paymentMethod = null,Object? shippingContact = freezed,}) { + return _then(_PlatformPayPaymentMethod( +paymentMethod: null == paymentMethod ? _self.paymentMethod : paymentMethod // ignore: cast_nullable_to_non_nullable +as PaymentMethod,shippingContact: freezed == shippingContact ? _self.shippingContact : shippingContact // ignore: cast_nullable_to_non_nullable +as PlatformPayShippingContact?, + )); } -PlatformPaySheetUpdateParams _$PlatformPaySheetUpdateParamsFromJson( - Map json) { - return _PlatformPaySheetUpdateParams.fromJson(json); +/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentMethodCopyWith<$Res> get paymentMethod { + + return $PaymentMethodCopyWith<$Res>(_self.paymentMethod, (value) { + return _then(_self.copyWith(paymentMethod: value)); + }); +}/// Create a copy of PlatformPayPaymentMethod +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PlatformPayShippingContactCopyWith<$Res>? get shippingContact { + if (_self.shippingContact == null) { + return null; + } + + return $PlatformPayShippingContactCopyWith<$Res>(_self.shippingContact!, (value) { + return _then(_self.copyWith(shippingContact: value)); + }); } +} + /// @nodoc mixin _$PlatformPaySheetUpdateParams { - /// list of updated summary items - List get summaryItems => - throw _privateConstructorUsedError; - - /// list of updated shipping methods - List get shippingMethods => - throw _privateConstructorUsedError; - - /// In case user input is wrong use this to display the errors in the apple pay sheet. - List? get errors => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function( - List summaryItems, - List shippingMethods, - List? errors) - applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - List summaryItems, - List shippingMethods, - List? errors)? - applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - List summaryItems, - List shippingMethods, - List? errors)? - applePay, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_PlatformPaySheetUpdateParams value) applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PlatformPaySheetUpdateParams value)? applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PlatformPaySheetUpdateParams value)? applePay, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + +/// list of updated summary items + List get summaryItems;/// list of updated shipping methods + List get shippingMethods;/// In case user input is wrong use this to display the errors in the apple pay sheet. + List? get errors; +/// Create a copy of PlatformPaySheetUpdateParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPaySheetUpdateParamsCopyWith get copyWith => _$PlatformPaySheetUpdateParamsCopyWithImpl(this as PlatformPaySheetUpdateParams, _$identity); /// Serializes this PlatformPaySheetUpdateParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PlatformPaySheetUpdateParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPaySheetUpdateParamsCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPaySheetUpdateParams&&const DeepCollectionEquality().equals(other.summaryItems, summaryItems)&&const DeepCollectionEquality().equals(other.shippingMethods, shippingMethods)&&const DeepCollectionEquality().equals(other.errors, errors)); } -/// @nodoc -abstract class $PlatformPaySheetUpdateParamsCopyWith<$Res> { - factory $PlatformPaySheetUpdateParamsCopyWith( - PlatformPaySheetUpdateParams value, - $Res Function(PlatformPaySheetUpdateParams) then) = - _$PlatformPaySheetUpdateParamsCopyWithImpl<$Res, - PlatformPaySheetUpdateParams>; - @useResult - $Res call( - {List summaryItems, - List shippingMethods, - List? errors}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(summaryItems),const DeepCollectionEquality().hash(shippingMethods),const DeepCollectionEquality().hash(errors)); + +@override +String toString() { + return 'PlatformPaySheetUpdateParams(summaryItems: $summaryItems, shippingMethods: $shippingMethods, errors: $errors)'; } -/// @nodoc -class _$PlatformPaySheetUpdateParamsCopyWithImpl<$Res, - $Val extends PlatformPaySheetUpdateParams> - implements $PlatformPaySheetUpdateParamsCopyWith<$Res> { - _$PlatformPaySheetUpdateParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPaySheetUpdateParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? summaryItems = null, - Object? shippingMethods = null, - Object? errors = freezed, - }) { - return _then(_value.copyWith( - summaryItems: null == summaryItems - ? _value.summaryItems - : summaryItems // ignore: cast_nullable_to_non_nullable - as List, - shippingMethods: null == shippingMethods - ? _value.shippingMethods - : shippingMethods // ignore: cast_nullable_to_non_nullable - as List, - errors: freezed == errors - ? _value.errors - : errors // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); - } + } /// @nodoc -abstract class _$$PlatformPaySheetUpdateParamsImplCopyWith<$Res> +abstract mixin class $PlatformPaySheetUpdateParamsCopyWith<$Res> { + factory $PlatformPaySheetUpdateParamsCopyWith(PlatformPaySheetUpdateParams value, $Res Function(PlatformPaySheetUpdateParams) _then) = _$PlatformPaySheetUpdateParamsCopyWithImpl; +@useResult +$Res call({ + List summaryItems, List shippingMethods, List? errors +}); + + + + +} +/// @nodoc +class _$PlatformPaySheetUpdateParamsCopyWithImpl<$Res> implements $PlatformPaySheetUpdateParamsCopyWith<$Res> { - factory _$$PlatformPaySheetUpdateParamsImplCopyWith( - _$PlatformPaySheetUpdateParamsImpl value, - $Res Function(_$PlatformPaySheetUpdateParamsImpl) then) = - __$$PlatformPaySheetUpdateParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {List summaryItems, - List shippingMethods, - List? errors}); + _$PlatformPaySheetUpdateParamsCopyWithImpl(this._self, this._then); + + final PlatformPaySheetUpdateParams _self; + final $Res Function(PlatformPaySheetUpdateParams) _then; + +/// Create a copy of PlatformPaySheetUpdateParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? summaryItems = null,Object? shippingMethods = null,Object? errors = freezed,}) { + return _then(_self.copyWith( +summaryItems: null == summaryItems ? _self.summaryItems : summaryItems // ignore: cast_nullable_to_non_nullable +as List,shippingMethods: null == shippingMethods ? _self.shippingMethods : shippingMethods // ignore: cast_nullable_to_non_nullable +as List,errors: freezed == errors ? _self.errors : errors // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PlatformPaySheetUpdateParams]. +extension PlatformPaySheetUpdateParamsPatterns on PlatformPaySheetUpdateParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _PlatformPaySheetUpdateParams value)? applePay,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PlatformPaySheetUpdateParams() when applePay != null: +return applePay(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _PlatformPaySheetUpdateParams value) applePay,}){ +final _that = this; +switch (_that) { +case _PlatformPaySheetUpdateParams(): +return applePay(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _PlatformPaySheetUpdateParams value)? applePay,}){ +final _that = this; +switch (_that) { +case _PlatformPaySheetUpdateParams() when applePay != null: +return applePay(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( List summaryItems, List shippingMethods, List? errors)? applePay,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PlatformPaySheetUpdateParams() when applePay != null: +return applePay(_that.summaryItems,_that.shippingMethods,_that.errors);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( List summaryItems, List shippingMethods, List? errors) applePay,}) {final _that = this; +switch (_that) { +case _PlatformPaySheetUpdateParams(): +return applePay(_that.summaryItems,_that.shippingMethods,_that.errors);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( List summaryItems, List shippingMethods, List? errors)? applePay,}) {final _that = this; +switch (_that) { +case _PlatformPaySheetUpdateParams() when applePay != null: +return applePay(_that.summaryItems,_that.shippingMethods,_that.errors);case _: + return null; + +} } -/// @nodoc -class __$$PlatformPaySheetUpdateParamsImplCopyWithImpl<$Res> - extends _$PlatformPaySheetUpdateParamsCopyWithImpl<$Res, - _$PlatformPaySheetUpdateParamsImpl> - implements _$$PlatformPaySheetUpdateParamsImplCopyWith<$Res> { - __$$PlatformPaySheetUpdateParamsImplCopyWithImpl( - _$PlatformPaySheetUpdateParamsImpl _value, - $Res Function(_$PlatformPaySheetUpdateParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPaySheetUpdateParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? summaryItems = null, - Object? shippingMethods = null, - Object? errors = freezed, - }) { - return _then(_$PlatformPaySheetUpdateParamsImpl( - summaryItems: null == summaryItems - ? _value._summaryItems - : summaryItems // ignore: cast_nullable_to_non_nullable - as List, - shippingMethods: null == shippingMethods - ? _value._shippingMethods - : shippingMethods // ignore: cast_nullable_to_non_nullable - as List, - errors: freezed == errors - ? _value._errors - : errors // ignore: cast_nullable_to_non_nullable - as List?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PlatformPaySheetUpdateParamsImpl - implements _PlatformPaySheetUpdateParams { - const _$PlatformPaySheetUpdateParamsImpl( - {required final List summaryItems, - required final List shippingMethods, - final List? errors}) - : _summaryItems = summaryItems, - _shippingMethods = shippingMethods, - _errors = errors; - - factory _$PlatformPaySheetUpdateParamsImpl.fromJson( - Map json) => - _$$PlatformPaySheetUpdateParamsImplFromJson(json); - - /// list of updated summary items - final List _summaryItems; - - /// list of updated summary items - @override - List get summaryItems { - if (_summaryItems is EqualUnmodifiableListView) return _summaryItems; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_summaryItems); - } +class _PlatformPaySheetUpdateParams implements PlatformPaySheetUpdateParams { + const _PlatformPaySheetUpdateParams({required final List summaryItems, required final List shippingMethods, final List? errors}): _summaryItems = summaryItems,_shippingMethods = shippingMethods,_errors = errors; + factory _PlatformPaySheetUpdateParams.fromJson(Map json) => _$PlatformPaySheetUpdateParamsFromJson(json); - /// list of updated shipping methods - final List _shippingMethods; +/// list of updated summary items + final List _summaryItems; +/// list of updated summary items +@override List get summaryItems { + if (_summaryItems is EqualUnmodifiableListView) return _summaryItems; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_summaryItems); +} - /// list of updated shipping methods - @override - List get shippingMethods { - if (_shippingMethods is EqualUnmodifiableListView) return _shippingMethods; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_shippingMethods); - } +/// list of updated shipping methods + final List _shippingMethods; +/// list of updated shipping methods +@override List get shippingMethods { + if (_shippingMethods is EqualUnmodifiableListView) return _shippingMethods; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_shippingMethods); +} - /// In case user input is wrong use this to display the errors in the apple pay sheet. - final List? _errors; - - /// In case user input is wrong use this to display the errors in the apple pay sheet. - @override - List? get errors { - final value = _errors; - if (value == null) return null; - if (_errors is EqualUnmodifiableListView) return _errors; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +/// In case user input is wrong use this to display the errors in the apple pay sheet. + final List? _errors; +/// In case user input is wrong use this to display the errors in the apple pay sheet. +@override List? get errors { + final value = _errors; + if (value == null) return null; + if (_errors is EqualUnmodifiableListView) return _errors; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - @override - String toString() { - return 'PlatformPaySheetUpdateParams.applePay(summaryItems: $summaryItems, shippingMethods: $shippingMethods, errors: $errors)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPaySheetUpdateParamsImpl && - const DeepCollectionEquality() - .equals(other._summaryItems, _summaryItems) && - const DeepCollectionEquality() - .equals(other._shippingMethods, _shippingMethods) && - const DeepCollectionEquality().equals(other._errors, _errors)); - } +/// Create a copy of PlatformPaySheetUpdateParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PlatformPaySheetUpdateParamsCopyWith<_PlatformPaySheetUpdateParams> get copyWith => __$PlatformPaySheetUpdateParamsCopyWithImpl<_PlatformPaySheetUpdateParams>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_summaryItems), - const DeepCollectionEquality().hash(_shippingMethods), - const DeepCollectionEquality().hash(_errors)); - - /// Create a copy of PlatformPaySheetUpdateParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPaySheetUpdateParamsImplCopyWith< - _$PlatformPaySheetUpdateParamsImpl> - get copyWith => __$$PlatformPaySheetUpdateParamsImplCopyWithImpl< - _$PlatformPaySheetUpdateParamsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - List summaryItems, - List shippingMethods, - List? errors) - applePay, - }) { - return applePay(summaryItems, shippingMethods, errors); - } +@override +Map toJson() { + return _$PlatformPaySheetUpdateParamsToJson(this, ); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - List summaryItems, - List shippingMethods, - List? errors)? - applePay, - }) { - return applePay?.call(summaryItems, shippingMethods, errors); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PlatformPaySheetUpdateParams&&const DeepCollectionEquality().equals(other._summaryItems, _summaryItems)&&const DeepCollectionEquality().equals(other._shippingMethods, _shippingMethods)&&const DeepCollectionEquality().equals(other._errors, _errors)); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - List summaryItems, - List shippingMethods, - List? errors)? - applePay, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(summaryItems, shippingMethods, errors); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_summaryItems),const DeepCollectionEquality().hash(_shippingMethods),const DeepCollectionEquality().hash(_errors)); + +@override +String toString() { + return 'PlatformPaySheetUpdateParams.applePay(summaryItems: $summaryItems, shippingMethods: $shippingMethods, errors: $errors)'; +} + + +} + +/// @nodoc +abstract mixin class _$PlatformPaySheetUpdateParamsCopyWith<$Res> implements $PlatformPaySheetUpdateParamsCopyWith<$Res> { + factory _$PlatformPaySheetUpdateParamsCopyWith(_PlatformPaySheetUpdateParams value, $Res Function(_PlatformPaySheetUpdateParams) _then) = __$PlatformPaySheetUpdateParamsCopyWithImpl; +@override @useResult +$Res call({ + List summaryItems, List shippingMethods, List? errors +}); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PlatformPaySheetUpdateParams value) applePay, - }) { - return applePay(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PlatformPaySheetUpdateParams value)? applePay, - }) { - return applePay?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PlatformPaySheetUpdateParams value)? applePay, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PlatformPaySheetUpdateParamsImplToJson( - this, - ); - } } +/// @nodoc +class __$PlatformPaySheetUpdateParamsCopyWithImpl<$Res> + implements _$PlatformPaySheetUpdateParamsCopyWith<$Res> { + __$PlatformPaySheetUpdateParamsCopyWithImpl(this._self, this._then); + + final _PlatformPaySheetUpdateParams _self; + final $Res Function(_PlatformPaySheetUpdateParams) _then; + +/// Create a copy of PlatformPaySheetUpdateParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? summaryItems = null,Object? shippingMethods = null,Object? errors = freezed,}) { + return _then(_PlatformPaySheetUpdateParams( +summaryItems: null == summaryItems ? _self._summaryItems : summaryItems // ignore: cast_nullable_to_non_nullable +as List,shippingMethods: null == shippingMethods ? _self._shippingMethods : shippingMethods // ignore: cast_nullable_to_non_nullable +as List,errors: freezed == errors ? _self._errors : errors // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + -abstract class _PlatformPaySheetUpdateParams - implements PlatformPaySheetUpdateParams { - const factory _PlatformPaySheetUpdateParams( - {required final List summaryItems, - required final List shippingMethods, - final List? errors}) = - _$PlatformPaySheetUpdateParamsImpl; - - factory _PlatformPaySheetUpdateParams.fromJson(Map json) = - _$PlatformPaySheetUpdateParamsImpl.fromJson; - - /// list of updated summary items - @override - List get summaryItems; - - /// list of updated shipping methods - @override - List get shippingMethods; - - /// In case user input is wrong use this to display the errors in the apple pay sheet. - @override - List? get errors; - - /// Create a copy of PlatformPaySheetUpdateParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPaySheetUpdateParamsImplCopyWith< - _$PlatformPaySheetUpdateParamsImpl> - get copyWith => throw _privateConstructorUsedError; -} - -ApplePaySheetError _$ApplePaySheetErrorFromJson(Map json) { - switch (json['errorType']) { - case 'InvalidShippingAddress': - return _ApplePaySheetErrorInvalidShipping.fromJson(json); - case 'UnserviceableShippingAddress': - return _ApplePaySheetErrorUnserviceableShipping.fromJson(json); - case 'InvalidCouponCode': - return _ApplePaySheetErrorInvalidCouponCode.fromJson(json); - case 'ExpiredCouponCode': - return _ApplePaySheetErrorExpiredCouponCode.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'errorType', 'ApplePaySheetError', - 'Invalid union type "${json['errorType']}"!'); - } +} + +ApplePaySheetError _$ApplePaySheetErrorFromJson( + Map json +) { + switch (json['errorType']) { + case 'InvalidShippingAddress': + return _ApplePaySheetErrorInvalidShipping.fromJson( + json + ); + case 'UnserviceableShippingAddress': + return _ApplePaySheetErrorUnserviceableShipping.fromJson( + json + ); + case 'InvalidCouponCode': + return _ApplePaySheetErrorInvalidCouponCode.fromJson( + json + ); + case 'ExpiredCouponCode': + return _ApplePaySheetErrorExpiredCouponCode.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'errorType', + 'ApplePaySheetError', + 'Invalid union type "${json['errorType']}"!' +); + } + } /// @nodoc mixin _$ApplePaySheetError { + // message that needs to be displayed on the sheet - String? get message => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function(InvalidShippingField field, String? message) - invalidShippingField, - required TResult Function(String? message) unserviceableShippingAddress, - required TResult Function(String? message) invalidCouponCode, - required TResult Function(String? message) expiredCouponCode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult? Function(String? message)? unserviceableShippingAddress, - TResult? Function(String? message)? invalidCouponCode, - TResult? Function(String? message)? expiredCouponCode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult Function(String? message)? unserviceableShippingAddress, - TResult Function(String? message)? invalidCouponCode, - TResult Function(String? message)? expiredCouponCode, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_ApplePaySheetErrorInvalidShipping value) - invalidShippingField, - required TResult Function(_ApplePaySheetErrorUnserviceableShipping value) - unserviceableShippingAddress, - required TResult Function(_ApplePaySheetErrorInvalidCouponCode value) - invalidCouponCode, - required TResult Function(_ApplePaySheetErrorExpiredCouponCode value) - expiredCouponCode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult? Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult? Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult? Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + String? get message; +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePaySheetErrorCopyWith get copyWith => _$ApplePaySheetErrorCopyWithImpl(this as ApplePaySheetError, _$identity); /// Serializes this ApplePaySheetError to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePaySheetErrorCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePaySheetError&&(identical(other.message, message) || other.message == message)); } -/// @nodoc -abstract class $ApplePaySheetErrorCopyWith<$Res> { - factory $ApplePaySheetErrorCopyWith( - ApplePaySheetError value, $Res Function(ApplePaySheetError) then) = - _$ApplePaySheetErrorCopyWithImpl<$Res, ApplePaySheetError>; - @useResult - $Res call({String? message}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message); + +@override +String toString() { + return 'ApplePaySheetError(message: $message)'; } -/// @nodoc -class _$ApplePaySheetErrorCopyWithImpl<$Res, $Val extends ApplePaySheetError> - implements $ApplePaySheetErrorCopyWith<$Res> { - _$ApplePaySheetErrorCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? message = freezed, - }) { - return _then(_value.copyWith( - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ApplePaySheetErrorInvalidShippingImplCopyWith<$Res> +abstract mixin class $ApplePaySheetErrorCopyWith<$Res> { + factory $ApplePaySheetErrorCopyWith(ApplePaySheetError value, $Res Function(ApplePaySheetError) _then) = _$ApplePaySheetErrorCopyWithImpl; +@useResult +$Res call({ + String? message +}); + + + + +} +/// @nodoc +class _$ApplePaySheetErrorCopyWithImpl<$Res> implements $ApplePaySheetErrorCopyWith<$Res> { - factory _$$ApplePaySheetErrorInvalidShippingImplCopyWith( - _$ApplePaySheetErrorInvalidShippingImpl value, - $Res Function(_$ApplePaySheetErrorInvalidShippingImpl) then) = - __$$ApplePaySheetErrorInvalidShippingImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({InvalidShippingField field, String? message}); + _$ApplePaySheetErrorCopyWithImpl(this._self, this._then); + + final ApplePaySheetError _self; + final $Res Function(ApplePaySheetError) _then; + +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? message = freezed,}) { + return _then(_self.copyWith( +message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePaySheetError]. +extension ApplePaySheetErrorPatterns on ApplePaySheetError { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _ApplePaySheetErrorInvalidShipping value)? invalidShippingField,TResult Function( _ApplePaySheetErrorUnserviceableShipping value)? unserviceableShippingAddress,TResult Function( _ApplePaySheetErrorInvalidCouponCode value)? invalidCouponCode,TResult Function( _ApplePaySheetErrorExpiredCouponCode value)? expiredCouponCode,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePaySheetErrorInvalidShipping() when invalidShippingField != null: +return invalidShippingField(_that);case _ApplePaySheetErrorUnserviceableShipping() when unserviceableShippingAddress != null: +return unserviceableShippingAddress(_that);case _ApplePaySheetErrorInvalidCouponCode() when invalidCouponCode != null: +return invalidCouponCode(_that);case _ApplePaySheetErrorExpiredCouponCode() when expiredCouponCode != null: +return expiredCouponCode(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _ApplePaySheetErrorInvalidShipping value) invalidShippingField,required TResult Function( _ApplePaySheetErrorUnserviceableShipping value) unserviceableShippingAddress,required TResult Function( _ApplePaySheetErrorInvalidCouponCode value) invalidCouponCode,required TResult Function( _ApplePaySheetErrorExpiredCouponCode value) expiredCouponCode,}){ +final _that = this; +switch (_that) { +case _ApplePaySheetErrorInvalidShipping(): +return invalidShippingField(_that);case _ApplePaySheetErrorUnserviceableShipping(): +return unserviceableShippingAddress(_that);case _ApplePaySheetErrorInvalidCouponCode(): +return invalidCouponCode(_that);case _ApplePaySheetErrorExpiredCouponCode(): +return expiredCouponCode(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _ApplePaySheetErrorInvalidShipping value)? invalidShippingField,TResult? Function( _ApplePaySheetErrorUnserviceableShipping value)? unserviceableShippingAddress,TResult? Function( _ApplePaySheetErrorInvalidCouponCode value)? invalidCouponCode,TResult? Function( _ApplePaySheetErrorExpiredCouponCode value)? expiredCouponCode,}){ +final _that = this; +switch (_that) { +case _ApplePaySheetErrorInvalidShipping() when invalidShippingField != null: +return invalidShippingField(_that);case _ApplePaySheetErrorUnserviceableShipping() when unserviceableShippingAddress != null: +return unserviceableShippingAddress(_that);case _ApplePaySheetErrorInvalidCouponCode() when invalidCouponCode != null: +return invalidCouponCode(_that);case _ApplePaySheetErrorExpiredCouponCode() when expiredCouponCode != null: +return expiredCouponCode(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( InvalidShippingField field, String? message)? invalidShippingField,TResult Function( String? message)? unserviceableShippingAddress,TResult Function( String? message)? invalidCouponCode,TResult Function( String? message)? expiredCouponCode,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePaySheetErrorInvalidShipping() when invalidShippingField != null: +return invalidShippingField(_that.field,_that.message);case _ApplePaySheetErrorUnserviceableShipping() when unserviceableShippingAddress != null: +return unserviceableShippingAddress(_that.message);case _ApplePaySheetErrorInvalidCouponCode() when invalidCouponCode != null: +return invalidCouponCode(_that.message);case _ApplePaySheetErrorExpiredCouponCode() when expiredCouponCode != null: +return expiredCouponCode(_that.message);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( InvalidShippingField field, String? message) invalidShippingField,required TResult Function( String? message) unserviceableShippingAddress,required TResult Function( String? message) invalidCouponCode,required TResult Function( String? message) expiredCouponCode,}) {final _that = this; +switch (_that) { +case _ApplePaySheetErrorInvalidShipping(): +return invalidShippingField(_that.field,_that.message);case _ApplePaySheetErrorUnserviceableShipping(): +return unserviceableShippingAddress(_that.message);case _ApplePaySheetErrorInvalidCouponCode(): +return invalidCouponCode(_that.message);case _ApplePaySheetErrorExpiredCouponCode(): +return expiredCouponCode(_that.message);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( InvalidShippingField field, String? message)? invalidShippingField,TResult? Function( String? message)? unserviceableShippingAddress,TResult? Function( String? message)? invalidCouponCode,TResult? Function( String? message)? expiredCouponCode,}) {final _that = this; +switch (_that) { +case _ApplePaySheetErrorInvalidShipping() when invalidShippingField != null: +return invalidShippingField(_that.field,_that.message);case _ApplePaySheetErrorUnserviceableShipping() when unserviceableShippingAddress != null: +return unserviceableShippingAddress(_that.message);case _ApplePaySheetErrorInvalidCouponCode() when invalidCouponCode != null: +return invalidCouponCode(_that.message);case _ApplePaySheetErrorExpiredCouponCode() when expiredCouponCode != null: +return expiredCouponCode(_that.message);case _: + return null; + +} } -/// @nodoc -class __$$ApplePaySheetErrorInvalidShippingImplCopyWithImpl<$Res> - extends _$ApplePaySheetErrorCopyWithImpl<$Res, - _$ApplePaySheetErrorInvalidShippingImpl> - implements _$$ApplePaySheetErrorInvalidShippingImplCopyWith<$Res> { - __$$ApplePaySheetErrorInvalidShippingImplCopyWithImpl( - _$ApplePaySheetErrorInvalidShippingImpl _value, - $Res Function(_$ApplePaySheetErrorInvalidShippingImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? field = null, - Object? message = freezed, - }) { - return _then(_$ApplePaySheetErrorInvalidShippingImpl( - field: null == field - ? _value.field - : field // ignore: cast_nullable_to_non_nullable - as InvalidShippingField, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePaySheetErrorInvalidShippingImpl - implements _ApplePaySheetErrorInvalidShipping { - const _$ApplePaySheetErrorInvalidShippingImpl( - {required this.field, this.message, final String? $type}) - : $type = $type ?? 'InvalidShippingAddress'; - - factory _$ApplePaySheetErrorInvalidShippingImpl.fromJson( - Map json) => - _$$ApplePaySheetErrorInvalidShippingImplFromJson(json); +class _ApplePaySheetErrorInvalidShipping implements ApplePaySheetError { + const _ApplePaySheetErrorInvalidShipping({required this.field, this.message, final String? $type}): $type = $type ?? 'InvalidShippingAddress'; + factory _ApplePaySheetErrorInvalidShipping.fromJson(Map json) => _$ApplePaySheetErrorInvalidShippingFromJson(json); // Field that will be marked as invalid - @override - final InvalidShippingField field; + final InvalidShippingField field; // message that needs to be displayed on the sheet - @override - final String? message; - - @JsonKey(name: 'errorType') - final String $type; +@override final String? message; - @override - String toString() { - return 'ApplePaySheetError.invalidShippingField(field: $field, message: $message)'; - } +@JsonKey(name: 'errorType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePaySheetErrorInvalidShippingImpl && - (identical(other.field, field) || other.field == field) && - (identical(other.message, message) || other.message == message)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, field, message); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePaySheetErrorInvalidShippingImplCopyWith< - _$ApplePaySheetErrorInvalidShippingImpl> - get copyWith => __$$ApplePaySheetErrorInvalidShippingImplCopyWithImpl< - _$ApplePaySheetErrorInvalidShippingImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(InvalidShippingField field, String? message) - invalidShippingField, - required TResult Function(String? message) unserviceableShippingAddress, - required TResult Function(String? message) invalidCouponCode, - required TResult Function(String? message) expiredCouponCode, - }) { - return invalidShippingField(field, message); - } +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePaySheetErrorInvalidShippingCopyWith<_ApplePaySheetErrorInvalidShipping> get copyWith => __$ApplePaySheetErrorInvalidShippingCopyWithImpl<_ApplePaySheetErrorInvalidShipping>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult? Function(String? message)? unserviceableShippingAddress, - TResult? Function(String? message)? invalidCouponCode, - TResult? Function(String? message)? expiredCouponCode, - }) { - return invalidShippingField?.call(field, message); - } +@override +Map toJson() { + return _$ApplePaySheetErrorInvalidShippingToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult Function(String? message)? unserviceableShippingAddress, - TResult Function(String? message)? invalidCouponCode, - TResult Function(String? message)? expiredCouponCode, - required TResult orElse(), - }) { - if (invalidShippingField != null) { - return invalidShippingField(field, message); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePaySheetErrorInvalidShipping&&(identical(other.field, field) || other.field == field)&&(identical(other.message, message) || other.message == message)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_ApplePaySheetErrorInvalidShipping value) - invalidShippingField, - required TResult Function(_ApplePaySheetErrorUnserviceableShipping value) - unserviceableShippingAddress, - required TResult Function(_ApplePaySheetErrorInvalidCouponCode value) - invalidCouponCode, - required TResult Function(_ApplePaySheetErrorExpiredCouponCode value) - expiredCouponCode, - }) { - return invalidShippingField(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,field,message); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult? Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult? Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult? Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - }) { - return invalidShippingField?.call(this); - } +@override +String toString() { + return 'ApplePaySheetError.invalidShippingField(field: $field, message: $message)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - required TResult orElse(), - }) { - if (invalidShippingField != null) { - return invalidShippingField(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$ApplePaySheetErrorInvalidShippingImplToJson( - this, - ); - } } -abstract class _ApplePaySheetErrorInvalidShipping - implements ApplePaySheetError { - const factory _ApplePaySheetErrorInvalidShipping( - {required final InvalidShippingField field, - final String? message}) = _$ApplePaySheetErrorInvalidShippingImpl; +/// @nodoc +abstract mixin class _$ApplePaySheetErrorInvalidShippingCopyWith<$Res> implements $ApplePaySheetErrorCopyWith<$Res> { + factory _$ApplePaySheetErrorInvalidShippingCopyWith(_ApplePaySheetErrorInvalidShipping value, $Res Function(_ApplePaySheetErrorInvalidShipping) _then) = __$ApplePaySheetErrorInvalidShippingCopyWithImpl; +@override @useResult +$Res call({ + InvalidShippingField field, String? message +}); + - factory _ApplePaySheetErrorInvalidShipping.fromJson( - Map json) = - _$ApplePaySheetErrorInvalidShippingImpl.fromJson; -// Field that will be marked as invalid - InvalidShippingField - get field; // message that needs to be displayed on the sheet - @override - String? get message; - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePaySheetErrorInvalidShippingImplCopyWith< - _$ApplePaySheetErrorInvalidShippingImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$ApplePaySheetErrorUnserviceableShippingImplCopyWith<$Res> - implements $ApplePaySheetErrorCopyWith<$Res> { - factory _$$ApplePaySheetErrorUnserviceableShippingImplCopyWith( - _$ApplePaySheetErrorUnserviceableShippingImpl value, - $Res Function(_$ApplePaySheetErrorUnserviceableShippingImpl) then) = - __$$ApplePaySheetErrorUnserviceableShippingImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? message}); +class __$ApplePaySheetErrorInvalidShippingCopyWithImpl<$Res> + implements _$ApplePaySheetErrorInvalidShippingCopyWith<$Res> { + __$ApplePaySheetErrorInvalidShippingCopyWithImpl(this._self, this._then); + + final _ApplePaySheetErrorInvalidShipping _self; + final $Res Function(_ApplePaySheetErrorInvalidShipping) _then; + +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? field = null,Object? message = freezed,}) { + return _then(_ApplePaySheetErrorInvalidShipping( +field: null == field ? _self.field : field // ignore: cast_nullable_to_non_nullable +as InvalidShippingField,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -class __$$ApplePaySheetErrorUnserviceableShippingImplCopyWithImpl<$Res> - extends _$ApplePaySheetErrorCopyWithImpl<$Res, - _$ApplePaySheetErrorUnserviceableShippingImpl> - implements _$$ApplePaySheetErrorUnserviceableShippingImplCopyWith<$Res> { - __$$ApplePaySheetErrorUnserviceableShippingImplCopyWithImpl( - _$ApplePaySheetErrorUnserviceableShippingImpl _value, - $Res Function(_$ApplePaySheetErrorUnserviceableShippingImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? message = freezed, - }) { - return _then(_$ApplePaySheetErrorUnserviceableShippingImpl( - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePaySheetErrorUnserviceableShippingImpl - implements _ApplePaySheetErrorUnserviceableShipping { - const _$ApplePaySheetErrorUnserviceableShippingImpl( - {this.message, final String? $type}) - : $type = $type ?? 'UnserviceableShippingAddress'; - - factory _$ApplePaySheetErrorUnserviceableShippingImpl.fromJson( - Map json) => - _$$ApplePaySheetErrorUnserviceableShippingImplFromJson(json); +class _ApplePaySheetErrorUnserviceableShipping implements ApplePaySheetError { + const _ApplePaySheetErrorUnserviceableShipping({this.message, final String? $type}): $type = $type ?? 'UnserviceableShippingAddress'; + factory _ApplePaySheetErrorUnserviceableShipping.fromJson(Map json) => _$ApplePaySheetErrorUnserviceableShippingFromJson(json); // message that needs to be displayed on the sheet - @override - final String? message; +@override final String? message; - @JsonKey(name: 'errorType') - final String $type; - - @override - String toString() { - return 'ApplePaySheetError.unserviceableShippingAddress(message: $message)'; - } +@JsonKey(name: 'errorType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePaySheetErrorUnserviceableShippingImpl && - (identical(other.message, message) || other.message == message)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, message); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePaySheetErrorUnserviceableShippingImplCopyWith< - _$ApplePaySheetErrorUnserviceableShippingImpl> - get copyWith => - __$$ApplePaySheetErrorUnserviceableShippingImplCopyWithImpl< - _$ApplePaySheetErrorUnserviceableShippingImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(InvalidShippingField field, String? message) - invalidShippingField, - required TResult Function(String? message) unserviceableShippingAddress, - required TResult Function(String? message) invalidCouponCode, - required TResult Function(String? message) expiredCouponCode, - }) { - return unserviceableShippingAddress(message); - } +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePaySheetErrorUnserviceableShippingCopyWith<_ApplePaySheetErrorUnserviceableShipping> get copyWith => __$ApplePaySheetErrorUnserviceableShippingCopyWithImpl<_ApplePaySheetErrorUnserviceableShipping>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult? Function(String? message)? unserviceableShippingAddress, - TResult? Function(String? message)? invalidCouponCode, - TResult? Function(String? message)? expiredCouponCode, - }) { - return unserviceableShippingAddress?.call(message); - } +@override +Map toJson() { + return _$ApplePaySheetErrorUnserviceableShippingToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult Function(String? message)? unserviceableShippingAddress, - TResult Function(String? message)? invalidCouponCode, - TResult Function(String? message)? expiredCouponCode, - required TResult orElse(), - }) { - if (unserviceableShippingAddress != null) { - return unserviceableShippingAddress(message); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePaySheetErrorUnserviceableShipping&&(identical(other.message, message) || other.message == message)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_ApplePaySheetErrorInvalidShipping value) - invalidShippingField, - required TResult Function(_ApplePaySheetErrorUnserviceableShipping value) - unserviceableShippingAddress, - required TResult Function(_ApplePaySheetErrorInvalidCouponCode value) - invalidCouponCode, - required TResult Function(_ApplePaySheetErrorExpiredCouponCode value) - expiredCouponCode, - }) { - return unserviceableShippingAddress(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult? Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult? Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult? Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - }) { - return unserviceableShippingAddress?.call(this); - } +@override +String toString() { + return 'ApplePaySheetError.unserviceableShippingAddress(message: $message)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - required TResult orElse(), - }) { - if (unserviceableShippingAddress != null) { - return unserviceableShippingAddress(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$ApplePaySheetErrorUnserviceableShippingImplToJson( - this, - ); - } } -abstract class _ApplePaySheetErrorUnserviceableShipping - implements ApplePaySheetError { - const factory _ApplePaySheetErrorUnserviceableShipping( - {final String? message}) = _$ApplePaySheetErrorUnserviceableShippingImpl; +/// @nodoc +abstract mixin class _$ApplePaySheetErrorUnserviceableShippingCopyWith<$Res> implements $ApplePaySheetErrorCopyWith<$Res> { + factory _$ApplePaySheetErrorUnserviceableShippingCopyWith(_ApplePaySheetErrorUnserviceableShipping value, $Res Function(_ApplePaySheetErrorUnserviceableShipping) _then) = __$ApplePaySheetErrorUnserviceableShippingCopyWithImpl; +@override @useResult +$Res call({ + String? message +}); - factory _ApplePaySheetErrorUnserviceableShipping.fromJson( - Map json) = - _$ApplePaySheetErrorUnserviceableShippingImpl.fromJson; -// message that needs to be displayed on the sheet - @override - String? get message; - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePaySheetErrorUnserviceableShippingImplCopyWith< - _$ApplePaySheetErrorUnserviceableShippingImpl> - get copyWith => throw _privateConstructorUsedError; -} +} /// @nodoc -abstract class _$$ApplePaySheetErrorInvalidCouponCodeImplCopyWith<$Res> - implements $ApplePaySheetErrorCopyWith<$Res> { - factory _$$ApplePaySheetErrorInvalidCouponCodeImplCopyWith( - _$ApplePaySheetErrorInvalidCouponCodeImpl value, - $Res Function(_$ApplePaySheetErrorInvalidCouponCodeImpl) then) = - __$$ApplePaySheetErrorInvalidCouponCodeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? message}); +class __$ApplePaySheetErrorUnserviceableShippingCopyWithImpl<$Res> + implements _$ApplePaySheetErrorUnserviceableShippingCopyWith<$Res> { + __$ApplePaySheetErrorUnserviceableShippingCopyWithImpl(this._self, this._then); + + final _ApplePaySheetErrorUnserviceableShipping _self; + final $Res Function(_ApplePaySheetErrorUnserviceableShipping) _then; + +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { + return _then(_ApplePaySheetErrorUnserviceableShipping( +message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -class __$$ApplePaySheetErrorInvalidCouponCodeImplCopyWithImpl<$Res> - extends _$ApplePaySheetErrorCopyWithImpl<$Res, - _$ApplePaySheetErrorInvalidCouponCodeImpl> - implements _$$ApplePaySheetErrorInvalidCouponCodeImplCopyWith<$Res> { - __$$ApplePaySheetErrorInvalidCouponCodeImplCopyWithImpl( - _$ApplePaySheetErrorInvalidCouponCodeImpl _value, - $Res Function(_$ApplePaySheetErrorInvalidCouponCodeImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? message = freezed, - }) { - return _then(_$ApplePaySheetErrorInvalidCouponCodeImpl( - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc @JsonSerializable() -class _$ApplePaySheetErrorInvalidCouponCodeImpl - implements _ApplePaySheetErrorInvalidCouponCode { - const _$ApplePaySheetErrorInvalidCouponCodeImpl( - {this.message, final String? $type}) - : $type = $type ?? 'InvalidCouponCode'; - factory _$ApplePaySheetErrorInvalidCouponCodeImpl.fromJson( - Map json) => - _$$ApplePaySheetErrorInvalidCouponCodeImplFromJson(json); +class _ApplePaySheetErrorInvalidCouponCode implements ApplePaySheetError { + const _ApplePaySheetErrorInvalidCouponCode({this.message, final String? $type}): $type = $type ?? 'InvalidCouponCode'; + factory _ApplePaySheetErrorInvalidCouponCode.fromJson(Map json) => _$ApplePaySheetErrorInvalidCouponCodeFromJson(json); // message that needs to be displayed on the sheet - @override - final String? message; +@override final String? message; - @JsonKey(name: 'errorType') - final String $type; - - @override - String toString() { - return 'ApplePaySheetError.invalidCouponCode(message: $message)'; - } +@JsonKey(name: 'errorType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePaySheetErrorInvalidCouponCodeImpl && - (identical(other.message, message) || other.message == message)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, message); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePaySheetErrorInvalidCouponCodeImplCopyWith< - _$ApplePaySheetErrorInvalidCouponCodeImpl> - get copyWith => __$$ApplePaySheetErrorInvalidCouponCodeImplCopyWithImpl< - _$ApplePaySheetErrorInvalidCouponCodeImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(InvalidShippingField field, String? message) - invalidShippingField, - required TResult Function(String? message) unserviceableShippingAddress, - required TResult Function(String? message) invalidCouponCode, - required TResult Function(String? message) expiredCouponCode, - }) { - return invalidCouponCode(message); - } +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePaySheetErrorInvalidCouponCodeCopyWith<_ApplePaySheetErrorInvalidCouponCode> get copyWith => __$ApplePaySheetErrorInvalidCouponCodeCopyWithImpl<_ApplePaySheetErrorInvalidCouponCode>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult? Function(String? message)? unserviceableShippingAddress, - TResult? Function(String? message)? invalidCouponCode, - TResult? Function(String? message)? expiredCouponCode, - }) { - return invalidCouponCode?.call(message); - } +@override +Map toJson() { + return _$ApplePaySheetErrorInvalidCouponCodeToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult Function(String? message)? unserviceableShippingAddress, - TResult Function(String? message)? invalidCouponCode, - TResult Function(String? message)? expiredCouponCode, - required TResult orElse(), - }) { - if (invalidCouponCode != null) { - return invalidCouponCode(message); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePaySheetErrorInvalidCouponCode&&(identical(other.message, message) || other.message == message)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_ApplePaySheetErrorInvalidShipping value) - invalidShippingField, - required TResult Function(_ApplePaySheetErrorUnserviceableShipping value) - unserviceableShippingAddress, - required TResult Function(_ApplePaySheetErrorInvalidCouponCode value) - invalidCouponCode, - required TResult Function(_ApplePaySheetErrorExpiredCouponCode value) - expiredCouponCode, - }) { - return invalidCouponCode(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult? Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult? Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult? Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - }) { - return invalidCouponCode?.call(this); - } +@override +String toString() { + return 'ApplePaySheetError.invalidCouponCode(message: $message)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - required TResult orElse(), - }) { - if (invalidCouponCode != null) { - return invalidCouponCode(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$ApplePaySheetErrorInvalidCouponCodeImplToJson( - this, - ); - } } -abstract class _ApplePaySheetErrorInvalidCouponCode - implements ApplePaySheetError { - const factory _ApplePaySheetErrorInvalidCouponCode({final String? message}) = - _$ApplePaySheetErrorInvalidCouponCodeImpl; +/// @nodoc +abstract mixin class _$ApplePaySheetErrorInvalidCouponCodeCopyWith<$Res> implements $ApplePaySheetErrorCopyWith<$Res> { + factory _$ApplePaySheetErrorInvalidCouponCodeCopyWith(_ApplePaySheetErrorInvalidCouponCode value, $Res Function(_ApplePaySheetErrorInvalidCouponCode) _then) = __$ApplePaySheetErrorInvalidCouponCodeCopyWithImpl; +@override @useResult +$Res call({ + String? message +}); - factory _ApplePaySheetErrorInvalidCouponCode.fromJson( - Map json) = - _$ApplePaySheetErrorInvalidCouponCodeImpl.fromJson; -// message that needs to be displayed on the sheet - @override - String? get message; - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePaySheetErrorInvalidCouponCodeImplCopyWith< - _$ApplePaySheetErrorInvalidCouponCodeImpl> - get copyWith => throw _privateConstructorUsedError; -} +} /// @nodoc -abstract class _$$ApplePaySheetErrorExpiredCouponCodeImplCopyWith<$Res> - implements $ApplePaySheetErrorCopyWith<$Res> { - factory _$$ApplePaySheetErrorExpiredCouponCodeImplCopyWith( - _$ApplePaySheetErrorExpiredCouponCodeImpl value, - $Res Function(_$ApplePaySheetErrorExpiredCouponCodeImpl) then) = - __$$ApplePaySheetErrorExpiredCouponCodeImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String? message}); +class __$ApplePaySheetErrorInvalidCouponCodeCopyWithImpl<$Res> + implements _$ApplePaySheetErrorInvalidCouponCodeCopyWith<$Res> { + __$ApplePaySheetErrorInvalidCouponCodeCopyWithImpl(this._self, this._then); + + final _ApplePaySheetErrorInvalidCouponCode _self; + final $Res Function(_ApplePaySheetErrorInvalidCouponCode) _then; + +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { + return _then(_ApplePaySheetErrorInvalidCouponCode( +message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -class __$$ApplePaySheetErrorExpiredCouponCodeImplCopyWithImpl<$Res> - extends _$ApplePaySheetErrorCopyWithImpl<$Res, - _$ApplePaySheetErrorExpiredCouponCodeImpl> - implements _$$ApplePaySheetErrorExpiredCouponCodeImplCopyWith<$Res> { - __$$ApplePaySheetErrorExpiredCouponCodeImplCopyWithImpl( - _$ApplePaySheetErrorExpiredCouponCodeImpl _value, - $Res Function(_$ApplePaySheetErrorExpiredCouponCodeImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? message = freezed, - }) { - return _then(_$ApplePaySheetErrorExpiredCouponCodeImpl( - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); - } + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePaySheetErrorExpiredCouponCodeImpl - implements _ApplePaySheetErrorExpiredCouponCode { - const _$ApplePaySheetErrorExpiredCouponCodeImpl( - {this.message, final String? $type}) - : $type = $type ?? 'ExpiredCouponCode'; - - factory _$ApplePaySheetErrorExpiredCouponCodeImpl.fromJson( - Map json) => - _$$ApplePaySheetErrorExpiredCouponCodeImplFromJson(json); +class _ApplePaySheetErrorExpiredCouponCode implements ApplePaySheetError { + const _ApplePaySheetErrorExpiredCouponCode({this.message, final String? $type}): $type = $type ?? 'ExpiredCouponCode'; + factory _ApplePaySheetErrorExpiredCouponCode.fromJson(Map json) => _$ApplePaySheetErrorExpiredCouponCodeFromJson(json); // message that needs to be displayed on the sheet - @override - final String? message; - - @JsonKey(name: 'errorType') - final String $type; +@override final String? message; - @override - String toString() { - return 'ApplePaySheetError.expiredCouponCode(message: $message)'; - } +@JsonKey(name: 'errorType') +final String $type; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePaySheetErrorExpiredCouponCodeImpl && - (identical(other.message, message) || other.message == message)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, message); - - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePaySheetErrorExpiredCouponCodeImplCopyWith< - _$ApplePaySheetErrorExpiredCouponCodeImpl> - get copyWith => __$$ApplePaySheetErrorExpiredCouponCodeImplCopyWithImpl< - _$ApplePaySheetErrorExpiredCouponCodeImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(InvalidShippingField field, String? message) - invalidShippingField, - required TResult Function(String? message) unserviceableShippingAddress, - required TResult Function(String? message) invalidCouponCode, - required TResult Function(String? message) expiredCouponCode, - }) { - return expiredCouponCode(message); - } +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePaySheetErrorExpiredCouponCodeCopyWith<_ApplePaySheetErrorExpiredCouponCode> get copyWith => __$ApplePaySheetErrorExpiredCouponCodeCopyWithImpl<_ApplePaySheetErrorExpiredCouponCode>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult? Function(String? message)? unserviceableShippingAddress, - TResult? Function(String? message)? invalidCouponCode, - TResult? Function(String? message)? expiredCouponCode, - }) { - return expiredCouponCode?.call(message); - } +@override +Map toJson() { + return _$ApplePaySheetErrorExpiredCouponCodeToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(InvalidShippingField field, String? message)? - invalidShippingField, - TResult Function(String? message)? unserviceableShippingAddress, - TResult Function(String? message)? invalidCouponCode, - TResult Function(String? message)? expiredCouponCode, - required TResult orElse(), - }) { - if (expiredCouponCode != null) { - return expiredCouponCode(message); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePaySheetErrorExpiredCouponCode&&(identical(other.message, message) || other.message == message)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_ApplePaySheetErrorInvalidShipping value) - invalidShippingField, - required TResult Function(_ApplePaySheetErrorUnserviceableShipping value) - unserviceableShippingAddress, - required TResult Function(_ApplePaySheetErrorInvalidCouponCode value) - invalidCouponCode, - required TResult Function(_ApplePaySheetErrorExpiredCouponCode value) - expiredCouponCode, - }) { - return expiredCouponCode(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult? Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult? Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult? Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - }) { - return expiredCouponCode?.call(this); - } +@override +String toString() { + return 'ApplePaySheetError.expiredCouponCode(message: $message)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_ApplePaySheetErrorInvalidShipping value)? - invalidShippingField, - TResult Function(_ApplePaySheetErrorUnserviceableShipping value)? - unserviceableShippingAddress, - TResult Function(_ApplePaySheetErrorInvalidCouponCode value)? - invalidCouponCode, - TResult Function(_ApplePaySheetErrorExpiredCouponCode value)? - expiredCouponCode, - required TResult orElse(), - }) { - if (expiredCouponCode != null) { - return expiredCouponCode(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$ApplePaySheetErrorExpiredCouponCodeImplToJson( - this, - ); - } } -abstract class _ApplePaySheetErrorExpiredCouponCode - implements ApplePaySheetError { - const factory _ApplePaySheetErrorExpiredCouponCode({final String? message}) = - _$ApplePaySheetErrorExpiredCouponCodeImpl; - - factory _ApplePaySheetErrorExpiredCouponCode.fromJson( - Map json) = - _$ApplePaySheetErrorExpiredCouponCodeImpl.fromJson; +/// @nodoc +abstract mixin class _$ApplePaySheetErrorExpiredCouponCodeCopyWith<$Res> implements $ApplePaySheetErrorCopyWith<$Res> { + factory _$ApplePaySheetErrorExpiredCouponCodeCopyWith(_ApplePaySheetErrorExpiredCouponCode value, $Res Function(_ApplePaySheetErrorExpiredCouponCode) _then) = __$ApplePaySheetErrorExpiredCouponCodeCopyWithImpl; +@override @useResult +$Res call({ + String? message +}); -// message that needs to be displayed on the sheet - @override - String? get message; - /// Create a copy of ApplePaySheetError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePaySheetErrorExpiredCouponCodeImplCopyWith< - _$ApplePaySheetErrorExpiredCouponCodeImpl> - get copyWith => throw _privateConstructorUsedError; -} -/// @nodoc -mixin _$PlatformPayPaymentMethodParams { - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams) - googlePay, - required TResult Function(ApplePayParams applePayParams) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult? Function(ApplePayParams applePayParams)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult Function(ApplePayParams applePayParams)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayPaymentMethodParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayPaymentMethodParamsApplePay value) - applePay, - required TResult Function(PlatformPayPaymentMethodParamsWeb value) web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult? Function(PlatformPayPaymentMethodParamsWeb value)? web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult Function(PlatformPayPaymentMethodParamsWeb value)? web, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; -} -/// @nodoc -abstract class $PlatformPayPaymentMethodParamsCopyWith<$Res> { - factory $PlatformPayPaymentMethodParamsCopyWith( - PlatformPayPaymentMethodParams value, - $Res Function(PlatformPayPaymentMethodParams) then) = - _$PlatformPayPaymentMethodParamsCopyWithImpl<$Res, - PlatformPayPaymentMethodParams>; } - /// @nodoc -class _$PlatformPayPaymentMethodParamsCopyWithImpl<$Res, - $Val extends PlatformPayPaymentMethodParams> - implements $PlatformPayPaymentMethodParamsCopyWith<$Res> { - _$PlatformPayPaymentMethodParamsCopyWithImpl(this._value, this._then); +class __$ApplePaySheetErrorExpiredCouponCodeCopyWithImpl<$Res> + implements _$ApplePaySheetErrorExpiredCouponCodeCopyWith<$Res> { + __$ApplePaySheetErrorExpiredCouponCodeCopyWithImpl(this._self, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final _ApplePaySheetErrorExpiredCouponCode _self; + final $Res Function(_ApplePaySheetErrorExpiredCouponCode) _then; - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. +/// Create a copy of ApplePaySheetError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { + return _then(_ApplePaySheetErrorExpiredCouponCode( +message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$PlatformPayPaymentMethodParamsGooglePayImplCopyWith<$Res> { - factory _$$PlatformPayPaymentMethodParamsGooglePayImplCopyWith( - _$PlatformPayPaymentMethodParamsGooglePayImpl value, - $Res Function(_$PlatformPayPaymentMethodParamsGooglePayImpl) then) = - __$$PlatformPayPaymentMethodParamsGooglePayImplCopyWithImpl<$Res>; - @useResult - $Res call( - {GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams}); - $GooglePayParamsCopyWith<$Res> get googlePayParams; - $GooglePayPaymentMethodParamsCopyWith<$Res> get googlePayPaymentMethodParams; } /// @nodoc -class __$$PlatformPayPaymentMethodParamsGooglePayImplCopyWithImpl<$Res> - extends _$PlatformPayPaymentMethodParamsCopyWithImpl<$Res, - _$PlatformPayPaymentMethodParamsGooglePayImpl> - implements _$$PlatformPayPaymentMethodParamsGooglePayImplCopyWith<$Res> { - __$$PlatformPayPaymentMethodParamsGooglePayImplCopyWithImpl( - _$PlatformPayPaymentMethodParamsGooglePayImpl _value, - $Res Function(_$PlatformPayPaymentMethodParamsGooglePayImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? googlePayParams = null, - Object? googlePayPaymentMethodParams = null, - }) { - return _then(_$PlatformPayPaymentMethodParamsGooglePayImpl( - googlePayParams: null == googlePayParams - ? _value.googlePayParams - : googlePayParams // ignore: cast_nullable_to_non_nullable - as GooglePayParams, - googlePayPaymentMethodParams: null == googlePayPaymentMethodParams - ? _value.googlePayPaymentMethodParams - : googlePayPaymentMethodParams // ignore: cast_nullable_to_non_nullable - as GooglePayPaymentMethodParams, - )); - } +mixin _$PlatformPayPaymentMethodParams { - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayParamsCopyWith<$Res> get googlePayParams { - return $GooglePayParamsCopyWith<$Res>(_value.googlePayParams, (value) { - return _then(_value.copyWith(googlePayParams: value)); - }); - } - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayPaymentMethodParamsCopyWith<$Res> get googlePayPaymentMethodParams { - return $GooglePayPaymentMethodParamsCopyWith<$Res>( - _value.googlePayPaymentMethodParams, (value) { - return _then(_value.copyWith(googlePayPaymentMethodParams: value)); - }); - } -} -/// @nodoc -@JsonSerializable(explicitToJson: true) -class _$PlatformPayPaymentMethodParamsGooglePayImpl - implements PlatformPayPaymentMethodParamsGooglePay { - const _$PlatformPayPaymentMethodParamsGooglePayImpl( - {required this.googlePayParams, - required this.googlePayPaymentMethodParams}); - - @override - final GooglePayParams googlePayParams; - @override - final GooglePayPaymentMethodParams googlePayPaymentMethodParams; - - @override - String toString() { - return 'PlatformPayPaymentMethodParams.googlePay(googlePayParams: $googlePayParams, googlePayPaymentMethodParams: $googlePayPaymentMethodParams)'; - } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayPaymentMethodParamsGooglePayImpl && - (identical(other.googlePayParams, googlePayParams) || - other.googlePayParams == googlePayParams) && - (identical(other.googlePayPaymentMethodParams, - googlePayPaymentMethodParams) || - other.googlePayPaymentMethodParams == - googlePayPaymentMethodParams)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayPaymentMethodParams); +} - @override - int get hashCode => - Object.hash(runtimeType, googlePayParams, googlePayPaymentMethodParams); - - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayPaymentMethodParamsGooglePayImplCopyWith< - _$PlatformPayPaymentMethodParamsGooglePayImpl> - get copyWith => - __$$PlatformPayPaymentMethodParamsGooglePayImplCopyWithImpl< - _$PlatformPayPaymentMethodParamsGooglePayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams) - googlePay, - required TResult Function(ApplePayParams applePayParams) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) { - return googlePay(googlePayParams, googlePayPaymentMethodParams); - } - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult? Function(ApplePayParams applePayParams)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) { - return googlePay?.call(googlePayParams, googlePayPaymentMethodParams); - } +@override +int get hashCode => runtimeType.hashCode; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult Function(ApplePayParams applePayParams)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) { - if (googlePay != null) { - return googlePay(googlePayParams, googlePayPaymentMethodParams); - } - return orElse(); - } +@override +String toString() { + return 'PlatformPayPaymentMethodParams()'; +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayPaymentMethodParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayPaymentMethodParamsApplePay value) - applePay, - required TResult Function(PlatformPayPaymentMethodParamsWeb value) web, - }) { - return googlePay(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult? Function(PlatformPayPaymentMethodParamsWeb value)? web, - }) { - return googlePay?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult Function(PlatformPayPaymentMethodParamsWeb value)? web, - required TResult orElse(), - }) { - if (googlePay != null) { - return googlePay(this); - } - return orElse(); - } +/// @nodoc +class $PlatformPayPaymentMethodParamsCopyWith<$Res> { +$PlatformPayPaymentMethodParamsCopyWith(PlatformPayPaymentMethodParams _, $Res Function(PlatformPayPaymentMethodParams) __); } -abstract class PlatformPayPaymentMethodParamsGooglePay - implements PlatformPayPaymentMethodParams { - const factory PlatformPayPaymentMethodParamsGooglePay( - {required final GooglePayParams googlePayParams, - required final GooglePayPaymentMethodParams - googlePayPaymentMethodParams}) = - _$PlatformPayPaymentMethodParamsGooglePayImpl; - GooglePayParams get googlePayParams; - GooglePayPaymentMethodParams get googlePayPaymentMethodParams; +/// Adds pattern-matching-related methods to [PlatformPayPaymentMethodParams]. +extension PlatformPayPaymentMethodParamsPatterns on PlatformPayPaymentMethodParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayPaymentMethodParamsGooglePayImplCopyWith< - _$PlatformPayPaymentMethodParamsGooglePayImpl> - get copyWith => throw _privateConstructorUsedError; +@optionalTypeArgs TResult maybeMap({TResult Function( PlatformPayPaymentMethodParamsGooglePay value)? googlePay,TResult Function( PlatformPayPaymentMethodParamsApplePay value)? applePay,TResult Function( PlatformPayPaymentMethodParamsWeb value)? web,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case PlatformPayPaymentMethodParamsGooglePay() when googlePay != null: +return googlePay(_that);case PlatformPayPaymentMethodParamsApplePay() when applePay != null: +return applePay(_that);case PlatformPayPaymentMethodParamsWeb() when web != null: +return web(_that);case _: + return orElse(); + +} } +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` -/// @nodoc -abstract class _$$PlatformPayPaymentMethodParamsApplePayImplCopyWith<$Res> { - factory _$$PlatformPayPaymentMethodParamsApplePayImplCopyWith( - _$PlatformPayPaymentMethodParamsApplePayImpl value, - $Res Function(_$PlatformPayPaymentMethodParamsApplePayImpl) then) = - __$$PlatformPayPaymentMethodParamsApplePayImplCopyWithImpl<$Res>; - @useResult - $Res call({ApplePayParams applePayParams}); +@optionalTypeArgs TResult map({required TResult Function( PlatformPayPaymentMethodParamsGooglePay value) googlePay,required TResult Function( PlatformPayPaymentMethodParamsApplePay value) applePay,required TResult Function( PlatformPayPaymentMethodParamsWeb value) web,}){ +final _that = this; +switch (_that) { +case PlatformPayPaymentMethodParamsGooglePay(): +return googlePay(_that);case PlatformPayPaymentMethodParamsApplePay(): +return applePay(_that);case PlatformPayPaymentMethodParamsWeb(): +return web(_that);case _: + throw StateError('Unexpected subclass'); - $ApplePayParamsCopyWith<$Res> get applePayParams; } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` -/// @nodoc -class __$$PlatformPayPaymentMethodParamsApplePayImplCopyWithImpl<$Res> - extends _$PlatformPayPaymentMethodParamsCopyWithImpl<$Res, - _$PlatformPayPaymentMethodParamsApplePayImpl> - implements _$$PlatformPayPaymentMethodParamsApplePayImplCopyWith<$Res> { - __$$PlatformPayPaymentMethodParamsApplePayImplCopyWithImpl( - _$PlatformPayPaymentMethodParamsApplePayImpl _value, - $Res Function(_$PlatformPayPaymentMethodParamsApplePayImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePayParams = null, - }) { - return _then(_$PlatformPayPaymentMethodParamsApplePayImpl( - applePayParams: null == applePayParams - ? _value.applePayParams - : applePayParams // ignore: cast_nullable_to_non_nullable - as ApplePayParams, - )); - } +@optionalTypeArgs TResult? mapOrNull({TResult? Function( PlatformPayPaymentMethodParamsGooglePay value)? googlePay,TResult? Function( PlatformPayPaymentMethodParamsApplePay value)? applePay,TResult? Function( PlatformPayPaymentMethodParamsWeb value)? web,}){ +final _that = this; +switch (_that) { +case PlatformPayPaymentMethodParamsGooglePay() when googlePay != null: +return googlePay(_that);case PlatformPayPaymentMethodParamsApplePay() when applePay != null: +return applePay(_that);case PlatformPayPaymentMethodParamsWeb() when web != null: +return web(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( GooglePayParams googlePayParams, GooglePayPaymentMethodParams googlePayPaymentMethodParams)? googlePay,TResult Function( ApplePayParams applePayParams)? applePay,TResult Function( PlatformPayWebPaymentRequestCreateOptions options)? web,required TResult orElse(),}) {final _that = this; +switch (_that) { +case PlatformPayPaymentMethodParamsGooglePay() when googlePay != null: +return googlePay(_that.googlePayParams,_that.googlePayPaymentMethodParams);case PlatformPayPaymentMethodParamsApplePay() when applePay != null: +return applePay(_that.applePayParams);case PlatformPayPaymentMethodParamsWeb() when web != null: +return web(_that.options);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( GooglePayParams googlePayParams, GooglePayPaymentMethodParams googlePayPaymentMethodParams) googlePay,required TResult Function( ApplePayParams applePayParams) applePay,required TResult Function( PlatformPayWebPaymentRequestCreateOptions options) web,}) {final _that = this; +switch (_that) { +case PlatformPayPaymentMethodParamsGooglePay(): +return googlePay(_that.googlePayParams,_that.googlePayPaymentMethodParams);case PlatformPayPaymentMethodParamsApplePay(): +return applePay(_that.applePayParams);case PlatformPayPaymentMethodParamsWeb(): +return web(_that.options);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( GooglePayParams googlePayParams, GooglePayPaymentMethodParams googlePayPaymentMethodParams)? googlePay,TResult? Function( ApplePayParams applePayParams)? applePay,TResult? Function( PlatformPayWebPaymentRequestCreateOptions options)? web,}) {final _that = this; +switch (_that) { +case PlatformPayPaymentMethodParamsGooglePay() when googlePay != null: +return googlePay(_that.googlePayParams,_that.googlePayPaymentMethodParams);case PlatformPayPaymentMethodParamsApplePay() when applePay != null: +return applePay(_that.applePayParams);case PlatformPayPaymentMethodParamsWeb() when web != null: +return web(_that.options);case _: + return null; + +} +} - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ApplePayParamsCopyWith<$Res> get applePayParams { - return $ApplePayParamsCopyWith<$Res>(_value.applePayParams, (value) { - return _then(_value.copyWith(applePayParams: value)); - }); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PlatformPayPaymentMethodParamsApplePayImpl - implements PlatformPayPaymentMethodParamsApplePay { - const _$PlatformPayPaymentMethodParamsApplePayImpl( - {required this.applePayParams}); - - @override - final ApplePayParams applePayParams; +class PlatformPayPaymentMethodParamsGooglePay implements PlatformPayPaymentMethodParams { + const PlatformPayPaymentMethodParamsGooglePay({required this.googlePayParams, required this.googlePayPaymentMethodParams}); + - @override - String toString() { - return 'PlatformPayPaymentMethodParams.applePay(applePayParams: $applePayParams)'; - } + final GooglePayParams googlePayParams; + final GooglePayPaymentMethodParams googlePayPaymentMethodParams; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayPaymentMethodParamsApplePayImpl && - (identical(other.applePayParams, applePayParams) || - other.applePayParams == applePayParams)); - } +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayPaymentMethodParamsGooglePayCopyWith get copyWith => _$PlatformPayPaymentMethodParamsGooglePayCopyWithImpl(this, _$identity); - @override - int get hashCode => Object.hash(runtimeType, applePayParams); - - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayPaymentMethodParamsApplePayImplCopyWith< - _$PlatformPayPaymentMethodParamsApplePayImpl> - get copyWith => - __$$PlatformPayPaymentMethodParamsApplePayImplCopyWithImpl< - _$PlatformPayPaymentMethodParamsApplePayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams) - googlePay, - required TResult Function(ApplePayParams applePayParams) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) { - return applePay(applePayParams); - } - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult? Function(ApplePayParams applePayParams)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) { - return applePay?.call(applePayParams); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult Function(ApplePayParams applePayParams)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(applePayParams); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayPaymentMethodParamsGooglePay&&(identical(other.googlePayParams, googlePayParams) || other.googlePayParams == googlePayParams)&&(identical(other.googlePayPaymentMethodParams, googlePayPaymentMethodParams) || other.googlePayPaymentMethodParams == googlePayPaymentMethodParams)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayPaymentMethodParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayPaymentMethodParamsApplePay value) - applePay, - required TResult Function(PlatformPayPaymentMethodParamsWeb value) web, - }) { - return applePay(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult? Function(PlatformPayPaymentMethodParamsWeb value)? web, - }) { - return applePay?.call(this); - } +@override +int get hashCode => Object.hash(runtimeType,googlePayParams,googlePayPaymentMethodParams); - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult Function(PlatformPayPaymentMethodParamsWeb value)? web, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(this); - } - return orElse(); - } +@override +String toString() { + return 'PlatformPayPaymentMethodParams.googlePay(googlePayParams: $googlePayParams, googlePayPaymentMethodParams: $googlePayPaymentMethodParams)'; } -abstract class PlatformPayPaymentMethodParamsApplePay - implements PlatformPayPaymentMethodParams { - const factory PlatformPayPaymentMethodParamsApplePay( - {required final ApplePayParams applePayParams}) = - _$PlatformPayPaymentMethodParamsApplePayImpl; - - ApplePayParams get applePayParams; - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayPaymentMethodParamsApplePayImplCopyWith< - _$PlatformPayPaymentMethodParamsApplePayImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PlatformPayPaymentMethodParamsWebImplCopyWith<$Res> { - factory _$$PlatformPayPaymentMethodParamsWebImplCopyWith( - _$PlatformPayPaymentMethodParamsWebImpl value, - $Res Function(_$PlatformPayPaymentMethodParamsWebImpl) then) = - __$$PlatformPayPaymentMethodParamsWebImplCopyWithImpl<$Res>; - @useResult - $Res call({PlatformPayWebPaymentRequestCreateOptions options}); +abstract mixin class $PlatformPayPaymentMethodParamsGooglePayCopyWith<$Res> implements $PlatformPayPaymentMethodParamsCopyWith<$Res> { + factory $PlatformPayPaymentMethodParamsGooglePayCopyWith(PlatformPayPaymentMethodParamsGooglePay value, $Res Function(PlatformPayPaymentMethodParamsGooglePay) _then) = _$PlatformPayPaymentMethodParamsGooglePayCopyWithImpl; +@useResult +$Res call({ + GooglePayParams googlePayParams, GooglePayPaymentMethodParams googlePayPaymentMethodParams +}); - $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options; -} -/// @nodoc -class __$$PlatformPayPaymentMethodParamsWebImplCopyWithImpl<$Res> - extends _$PlatformPayPaymentMethodParamsCopyWithImpl<$Res, - _$PlatformPayPaymentMethodParamsWebImpl> - implements _$$PlatformPayPaymentMethodParamsWebImplCopyWith<$Res> { - __$$PlatformPayPaymentMethodParamsWebImplCopyWithImpl( - _$PlatformPayPaymentMethodParamsWebImpl _value, - $Res Function(_$PlatformPayPaymentMethodParamsWebImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? options = null, - }) { - return _then(_$PlatformPayPaymentMethodParamsWebImpl( - options: null == options - ? _value.options - : options // ignore: cast_nullable_to_non_nullable - as PlatformPayWebPaymentRequestCreateOptions, - )); - } +$GooglePayParamsCopyWith<$Res> get googlePayParams;$GooglePayPaymentMethodParamsCopyWith<$Res> get googlePayPaymentMethodParams; - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options { - return $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res>( - _value.options, (value) { - return _then(_value.copyWith(options: value)); - }); - } } - /// @nodoc +class _$PlatformPayPaymentMethodParamsGooglePayCopyWithImpl<$Res> + implements $PlatformPayPaymentMethodParamsGooglePayCopyWith<$Res> { + _$PlatformPayPaymentMethodParamsGooglePayCopyWithImpl(this._self, this._then); -@JsonSerializable(explicitToJson: true) -class _$PlatformPayPaymentMethodParamsWebImpl - implements PlatformPayPaymentMethodParamsWeb { - const _$PlatformPayPaymentMethodParamsWebImpl({required this.options}); + final PlatformPayPaymentMethodParamsGooglePay _self; + final $Res Function(PlatformPayPaymentMethodParamsGooglePay) _then; - @override - final PlatformPayWebPaymentRequestCreateOptions options; +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? googlePayParams = null,Object? googlePayPaymentMethodParams = null,}) { + return _then(PlatformPayPaymentMethodParamsGooglePay( +googlePayParams: null == googlePayParams ? _self.googlePayParams : googlePayParams // ignore: cast_nullable_to_non_nullable +as GooglePayParams,googlePayPaymentMethodParams: null == googlePayPaymentMethodParams ? _self.googlePayPaymentMethodParams : googlePayPaymentMethodParams // ignore: cast_nullable_to_non_nullable +as GooglePayPaymentMethodParams, + )); +} - @override - String toString() { - return 'PlatformPayPaymentMethodParams.web(options: $options)'; - } +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayParamsCopyWith<$Res> get googlePayParams { + + return $GooglePayParamsCopyWith<$Res>(_self.googlePayParams, (value) { + return _then(_self.copyWith(googlePayParams: value)); + }); +}/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayPaymentMethodParamsCopyWith<$Res> get googlePayPaymentMethodParams { + + return $GooglePayPaymentMethodParamsCopyWith<$Res>(_self.googlePayPaymentMethodParams, (value) { + return _then(_self.copyWith(googlePayPaymentMethodParams: value)); + }); +} +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayPaymentMethodParamsWebImpl && - (identical(other.options, options) || other.options == options)); - } +/// @nodoc - @override - int get hashCode => Object.hash(runtimeType, options); - - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayPaymentMethodParamsWebImplCopyWith< - _$PlatformPayPaymentMethodParamsWebImpl> - get copyWith => __$$PlatformPayPaymentMethodParamsWebImplCopyWithImpl< - _$PlatformPayPaymentMethodParamsWebImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams) - googlePay, - required TResult Function(ApplePayParams applePayParams) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) { - return web(options); - } +@JsonSerializable(explicitToJson: true) +class PlatformPayPaymentMethodParamsApplePay implements PlatformPayPaymentMethodParams { + const PlatformPayPaymentMethodParamsApplePay({required this.applePayParams}); + - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult? Function(ApplePayParams applePayParams)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) { - return web?.call(options); - } + final ApplePayParams applePayParams; - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePayParams, - GooglePayPaymentMethodParams googlePayPaymentMethodParams)? - googlePay, - TResult Function(ApplePayParams applePayParams)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) { - if (web != null) { - return web(options); - } - return orElse(); - } +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayPaymentMethodParamsApplePayCopyWith get copyWith => _$PlatformPayPaymentMethodParamsApplePayCopyWithImpl(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayPaymentMethodParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayPaymentMethodParamsApplePay value) - applePay, - required TResult Function(PlatformPayPaymentMethodParamsWeb value) web, - }) { - return web(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult? Function(PlatformPayPaymentMethodParamsWeb value)? web, - }) { - return web?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayPaymentMethodParamsGooglePay value)? googlePay, - TResult Function(PlatformPayPaymentMethodParamsApplePay value)? applePay, - TResult Function(PlatformPayPaymentMethodParamsWeb value)? web, - required TResult orElse(), - }) { - if (web != null) { - return web(this); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayPaymentMethodParamsApplePay&&(identical(other.applePayParams, applePayParams) || other.applePayParams == applePayParams)); } -abstract class PlatformPayPaymentMethodParamsWeb - implements PlatformPayPaymentMethodParams { - const factory PlatformPayPaymentMethodParamsWeb( - {required final PlatformPayWebPaymentRequestCreateOptions options}) = - _$PlatformPayPaymentMethodParamsWebImpl; - PlatformPayWebPaymentRequestCreateOptions get options; +@override +int get hashCode => Object.hash(runtimeType,applePayParams); - /// Create a copy of PlatformPayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayPaymentMethodParamsWebImplCopyWith< - _$PlatformPayPaymentMethodParamsWebImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PlatformPayPaymentMethodParams.applePay(applePayParams: $applePayParams)'; } -PlatformPayConfirmParams _$PlatformPayConfirmParamsFromJson( - Map json) { - switch (json['runtimeType']) { - case 'googlePay': - return PlatformPayConfirmParamsGooglePay.fromJson(json); - case 'applePay': - return PlatformPayConfirmParamsApplePay.fromJson(json); - case 'web': - return PlatformPayConfirmParamsWeb.fromJson(json); - - default: - throw CheckedFromJsonException( - json, - 'runtimeType', - 'PlatformPayConfirmParams', - 'Invalid union type "${json['runtimeType']}"!'); - } + } /// @nodoc -mixin _$PlatformPayConfirmParams { - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePay) googlePay, - required TResult Function(ApplePayParams applePay) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePay)? googlePay, - TResult? Function(ApplePayParams applePay)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePay)? googlePay, - TResult Function(ApplePayParams applePay)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayConfirmParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayConfirmParamsApplePay value) applePay, - required TResult Function(PlatformPayConfirmParamsWeb value) web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult? Function(PlatformPayConfirmParamsWeb value)? web, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult Function(PlatformPayConfirmParamsWeb value)? web, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; +abstract mixin class $PlatformPayPaymentMethodParamsApplePayCopyWith<$Res> implements $PlatformPayPaymentMethodParamsCopyWith<$Res> { + factory $PlatformPayPaymentMethodParamsApplePayCopyWith(PlatformPayPaymentMethodParamsApplePay value, $Res Function(PlatformPayPaymentMethodParamsApplePay) _then) = _$PlatformPayPaymentMethodParamsApplePayCopyWithImpl; +@useResult +$Res call({ + ApplePayParams applePayParams +}); - /// Serializes this PlatformPayConfirmParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; -} +$ApplePayParamsCopyWith<$Res> get applePayParams; + +} /// @nodoc -abstract class $PlatformPayConfirmParamsCopyWith<$Res> { - factory $PlatformPayConfirmParamsCopyWith(PlatformPayConfirmParams value, - $Res Function(PlatformPayConfirmParams) then) = - _$PlatformPayConfirmParamsCopyWithImpl<$Res, PlatformPayConfirmParams>; +class _$PlatformPayPaymentMethodParamsApplePayCopyWithImpl<$Res> + implements $PlatformPayPaymentMethodParamsApplePayCopyWith<$Res> { + _$PlatformPayPaymentMethodParamsApplePayCopyWithImpl(this._self, this._then); + + final PlatformPayPaymentMethodParamsApplePay _self; + final $Res Function(PlatformPayPaymentMethodParamsApplePay) _then; + +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? applePayParams = null,}) { + return _then(PlatformPayPaymentMethodParamsApplePay( +applePayParams: null == applePayParams ? _self.applePayParams : applePayParams // ignore: cast_nullable_to_non_nullable +as ApplePayParams, + )); +} + +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ApplePayParamsCopyWith<$Res> get applePayParams { + + return $ApplePayParamsCopyWith<$Res>(_self.applePayParams, (value) { + return _then(_self.copyWith(applePayParams: value)); + }); +} } /// @nodoc -class _$PlatformPayConfirmParamsCopyWithImpl<$Res, - $Val extends PlatformPayConfirmParams> - implements $PlatformPayConfirmParamsCopyWith<$Res> { - _$PlatformPayConfirmParamsCopyWithImpl(this._value, this._then); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +@JsonSerializable(explicitToJson: true) +class PlatformPayPaymentMethodParamsWeb implements PlatformPayPaymentMethodParams { + const PlatformPayPaymentMethodParamsWeb({required this.options}); + + + final PlatformPayWebPaymentRequestCreateOptions options; + +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayPaymentMethodParamsWebCopyWith get copyWith => _$PlatformPayPaymentMethodParamsWebCopyWithImpl(this, _$identity); + - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayPaymentMethodParamsWeb&&(identical(other.options, options) || other.options == options)); } -/// @nodoc -abstract class _$$PlatformPayConfirmParamsGooglePayImplCopyWith<$Res> { - factory _$$PlatformPayConfirmParamsGooglePayImplCopyWith( - _$PlatformPayConfirmParamsGooglePayImpl value, - $Res Function(_$PlatformPayConfirmParamsGooglePayImpl) then) = - __$$PlatformPayConfirmParamsGooglePayImplCopyWithImpl<$Res>; - @useResult - $Res call({GooglePayParams googlePay}); - $GooglePayParamsCopyWith<$Res> get googlePay; +@override +int get hashCode => Object.hash(runtimeType,options); + +@override +String toString() { + return 'PlatformPayPaymentMethodParams.web(options: $options)'; } -/// @nodoc -class __$$PlatformPayConfirmParamsGooglePayImplCopyWithImpl<$Res> - extends _$PlatformPayConfirmParamsCopyWithImpl<$Res, - _$PlatformPayConfirmParamsGooglePayImpl> - implements _$$PlatformPayConfirmParamsGooglePayImplCopyWith<$Res> { - __$$PlatformPayConfirmParamsGooglePayImplCopyWithImpl( - _$PlatformPayConfirmParamsGooglePayImpl _value, - $Res Function(_$PlatformPayConfirmParamsGooglePayImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? googlePay = null, - }) { - return _then(_$PlatformPayConfirmParamsGooglePayImpl( - googlePay: null == googlePay - ? _value.googlePay - : googlePay // ignore: cast_nullable_to_non_nullable - as GooglePayParams, - )); - } - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayParamsCopyWith<$Res> get googlePay { - return $GooglePayParamsCopyWith<$Res>(_value.googlePay, (value) { - return _then(_value.copyWith(googlePay: value)); - }); - } } /// @nodoc +abstract mixin class $PlatformPayPaymentMethodParamsWebCopyWith<$Res> implements $PlatformPayPaymentMethodParamsCopyWith<$Res> { + factory $PlatformPayPaymentMethodParamsWebCopyWith(PlatformPayPaymentMethodParamsWeb value, $Res Function(PlatformPayPaymentMethodParamsWeb) _then) = _$PlatformPayPaymentMethodParamsWebCopyWithImpl; +@useResult +$Res call({ + PlatformPayWebPaymentRequestCreateOptions options +}); -@JsonSerializable(explicitToJson: true) -class _$PlatformPayConfirmParamsGooglePayImpl - implements PlatformPayConfirmParamsGooglePay { - const _$PlatformPayConfirmParamsGooglePayImpl( - {required this.googlePay, final String? $type}) - : $type = $type ?? 'googlePay'; - factory _$PlatformPayConfirmParamsGooglePayImpl.fromJson( - Map json) => - _$$PlatformPayConfirmParamsGooglePayImplFromJson(json); +$PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options; - @override - final GooglePayParams googlePay; +} +/// @nodoc +class _$PlatformPayPaymentMethodParamsWebCopyWithImpl<$Res> + implements $PlatformPayPaymentMethodParamsWebCopyWith<$Res> { + _$PlatformPayPaymentMethodParamsWebCopyWithImpl(this._self, this._then); - @JsonKey(name: 'runtimeType') - final String $type; + final PlatformPayPaymentMethodParamsWeb _self; + final $Res Function(PlatformPayPaymentMethodParamsWeb) _then; - @override - String toString() { - return 'PlatformPayConfirmParams.googlePay(googlePay: $googlePay)'; - } +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? options = null,}) { + return _then(PlatformPayPaymentMethodParamsWeb( +options: null == options ? _self.options : options // ignore: cast_nullable_to_non_nullable +as PlatformPayWebPaymentRequestCreateOptions, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayConfirmParamsGooglePayImpl && - (identical(other.googlePay, googlePay) || - other.googlePay == googlePay)); - } +/// Create a copy of PlatformPayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options { + + return $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res>(_self.options, (value) { + return _then(_self.copyWith(options: value)); + }); +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, googlePay); - - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayConfirmParamsGooglePayImplCopyWith< - _$PlatformPayConfirmParamsGooglePayImpl> - get copyWith => __$$PlatformPayConfirmParamsGooglePayImplCopyWithImpl< - _$PlatformPayConfirmParamsGooglePayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePay) googlePay, - required TResult Function(ApplePayParams applePay) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) { - return googlePay(this.googlePay); - } +PlatformPayConfirmParams _$PlatformPayConfirmParamsFromJson( + Map json +) { + switch (json['runtimeType']) { + case 'googlePay': + return PlatformPayConfirmParamsGooglePay.fromJson( + json + ); + case 'applePay': + return PlatformPayConfirmParamsApplePay.fromJson( + json + ); + case 'web': + return PlatformPayConfirmParamsWeb.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'runtimeType', + 'PlatformPayConfirmParams', + 'Invalid union type "${json['runtimeType']}"!' +); + } + +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePay)? googlePay, - TResult? Function(ApplePayParams applePay)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) { - return googlePay?.call(this.googlePay); - } +/// @nodoc +mixin _$PlatformPayConfirmParams { - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePay)? googlePay, - TResult Function(ApplePayParams applePay)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) { - if (googlePay != null) { - return googlePay(this.googlePay); - } - return orElse(); - } - @override - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayConfirmParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayConfirmParamsApplePay value) applePay, - required TResult Function(PlatformPayConfirmParamsWeb value) web, - }) { - return googlePay(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult? Function(PlatformPayConfirmParamsWeb value)? web, - }) { - return googlePay?.call(this); - } + /// Serializes this PlatformPayConfirmParams to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayConfirmParams); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'PlatformPayConfirmParams()'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult Function(PlatformPayConfirmParamsWeb value)? web, - required TResult orElse(), - }) { - if (googlePay != null) { - return googlePay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PlatformPayConfirmParamsGooglePayImplToJson( - this, - ); - } } -abstract class PlatformPayConfirmParamsGooglePay - implements PlatformPayConfirmParams { - const factory PlatformPayConfirmParamsGooglePay( - {required final GooglePayParams googlePay}) = - _$PlatformPayConfirmParamsGooglePayImpl; +/// @nodoc +class $PlatformPayConfirmParamsCopyWith<$Res> { +$PlatformPayConfirmParamsCopyWith(PlatformPayConfirmParams _, $Res Function(PlatformPayConfirmParams) __); +} + + +/// Adds pattern-matching-related methods to [PlatformPayConfirmParams]. +extension PlatformPayConfirmParamsPatterns on PlatformPayConfirmParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( PlatformPayConfirmParamsGooglePay value)? googlePay,TResult Function( PlatformPayConfirmParamsApplePay value)? applePay,TResult Function( PlatformPayConfirmParamsWeb value)? web,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case PlatformPayConfirmParamsGooglePay() when googlePay != null: +return googlePay(_that);case PlatformPayConfirmParamsApplePay() when applePay != null: +return applePay(_that);case PlatformPayConfirmParamsWeb() when web != null: +return web(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( PlatformPayConfirmParamsGooglePay value) googlePay,required TResult Function( PlatformPayConfirmParamsApplePay value) applePay,required TResult Function( PlatformPayConfirmParamsWeb value) web,}){ +final _that = this; +switch (_that) { +case PlatformPayConfirmParamsGooglePay(): +return googlePay(_that);case PlatformPayConfirmParamsApplePay(): +return applePay(_that);case PlatformPayConfirmParamsWeb(): +return web(_that);case _: + throw StateError('Unexpected subclass'); - factory PlatformPayConfirmParamsGooglePay.fromJson( - Map json) = - _$PlatformPayConfirmParamsGooglePayImpl.fromJson; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - GooglePayParams get googlePay; +@optionalTypeArgs TResult? mapOrNull({TResult? Function( PlatformPayConfirmParamsGooglePay value)? googlePay,TResult? Function( PlatformPayConfirmParamsApplePay value)? applePay,TResult? Function( PlatformPayConfirmParamsWeb value)? web,}){ +final _that = this; +switch (_that) { +case PlatformPayConfirmParamsGooglePay() when googlePay != null: +return googlePay(_that);case PlatformPayConfirmParamsApplePay() when applePay != null: +return applePay(_that);case PlatformPayConfirmParamsWeb() when web != null: +return web(_that);case _: + return null; - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayConfirmParamsGooglePayImplCopyWith< - _$PlatformPayConfirmParamsGooglePayImpl> - get copyWith => throw _privateConstructorUsedError; } +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( GooglePayParams googlePay)? googlePay,TResult Function( ApplePayParams applePay)? applePay,TResult Function( PlatformPayWebPaymentRequestCreateOptions options)? web,required TResult orElse(),}) {final _that = this; +switch (_that) { +case PlatformPayConfirmParamsGooglePay() when googlePay != null: +return googlePay(_that.googlePay);case PlatformPayConfirmParamsApplePay() when applePay != null: +return applePay(_that.applePay);case PlatformPayConfirmParamsWeb() when web != null: +return web(_that.options);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( GooglePayParams googlePay) googlePay,required TResult Function( ApplePayParams applePay) applePay,required TResult Function( PlatformPayWebPaymentRequestCreateOptions options) web,}) {final _that = this; +switch (_that) { +case PlatformPayConfirmParamsGooglePay(): +return googlePay(_that.googlePay);case PlatformPayConfirmParamsApplePay(): +return applePay(_that.applePay);case PlatformPayConfirmParamsWeb(): +return web(_that.options);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( GooglePayParams googlePay)? googlePay,TResult? Function( ApplePayParams applePay)? applePay,TResult? Function( PlatformPayWebPaymentRequestCreateOptions options)? web,}) {final _that = this; +switch (_that) { +case PlatformPayConfirmParamsGooglePay() when googlePay != null: +return googlePay(_that.googlePay);case PlatformPayConfirmParamsApplePay() when applePay != null: +return applePay(_that.applePay);case PlatformPayConfirmParamsWeb() when web != null: +return web(_that.options);case _: + return null; -/// @nodoc -abstract class _$$PlatformPayConfirmParamsApplePayImplCopyWith<$Res> { - factory _$$PlatformPayConfirmParamsApplePayImplCopyWith( - _$PlatformPayConfirmParamsApplePayImpl value, - $Res Function(_$PlatformPayConfirmParamsApplePayImpl) then) = - __$$PlatformPayConfirmParamsApplePayImplCopyWithImpl<$Res>; - @useResult - $Res call({ApplePayParams applePay}); +} +} - $ApplePayParamsCopyWith<$Res> get applePay; } /// @nodoc -class __$$PlatformPayConfirmParamsApplePayImplCopyWithImpl<$Res> - extends _$PlatformPayConfirmParamsCopyWithImpl<$Res, - _$PlatformPayConfirmParamsApplePayImpl> - implements _$$PlatformPayConfirmParamsApplePayImplCopyWith<$Res> { - __$$PlatformPayConfirmParamsApplePayImplCopyWithImpl( - _$PlatformPayConfirmParamsApplePayImpl _value, - $Res Function(_$PlatformPayConfirmParamsApplePayImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? applePay = null, - }) { - return _then(_$PlatformPayConfirmParamsApplePayImpl( - applePay: null == applePay - ? _value.applePay - : applePay // ignore: cast_nullable_to_non_nullable - as ApplePayParams, - )); - } - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ApplePayParamsCopyWith<$Res> get applePay { - return $ApplePayParamsCopyWith<$Res>(_value.applePay, (value) { - return _then(_value.copyWith(applePay: value)); - }); - } +@JsonSerializable(explicitToJson: true) +class PlatformPayConfirmParamsGooglePay implements PlatformPayConfirmParams { + const PlatformPayConfirmParamsGooglePay({required this.googlePay, final String? $type}): $type = $type ?? 'googlePay'; + factory PlatformPayConfirmParamsGooglePay.fromJson(Map json) => _$PlatformPayConfirmParamsGooglePayFromJson(json); + + final GooglePayParams googlePay; + +@JsonKey(name: 'runtimeType') +final String $type; + + +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayConfirmParamsGooglePayCopyWith get copyWith => _$PlatformPayConfirmParamsGooglePayCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$PlatformPayConfirmParamsGooglePayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayConfirmParamsGooglePay&&(identical(other.googlePay, googlePay) || other.googlePay == googlePay)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,googlePay); + +@override +String toString() { + return 'PlatformPayConfirmParams.googlePay(googlePay: $googlePay)'; +} + + } /// @nodoc +abstract mixin class $PlatformPayConfirmParamsGooglePayCopyWith<$Res> implements $PlatformPayConfirmParamsCopyWith<$Res> { + factory $PlatformPayConfirmParamsGooglePayCopyWith(PlatformPayConfirmParamsGooglePay value, $Res Function(PlatformPayConfirmParamsGooglePay) _then) = _$PlatformPayConfirmParamsGooglePayCopyWithImpl; +@useResult +$Res call({ + GooglePayParams googlePay +}); -@JsonSerializable(explicitToJson: true) -class _$PlatformPayConfirmParamsApplePayImpl - implements PlatformPayConfirmParamsApplePay { - const _$PlatformPayConfirmParamsApplePayImpl( - {required this.applePay, final String? $type}) - : $type = $type ?? 'applePay'; - factory _$PlatformPayConfirmParamsApplePayImpl.fromJson( - Map json) => - _$$PlatformPayConfirmParamsApplePayImplFromJson(json); +$GooglePayParamsCopyWith<$Res> get googlePay; - @override - final ApplePayParams applePay; +} +/// @nodoc +class _$PlatformPayConfirmParamsGooglePayCopyWithImpl<$Res> + implements $PlatformPayConfirmParamsGooglePayCopyWith<$Res> { + _$PlatformPayConfirmParamsGooglePayCopyWithImpl(this._self, this._then); - @JsonKey(name: 'runtimeType') - final String $type; + final PlatformPayConfirmParamsGooglePay _self; + final $Res Function(PlatformPayConfirmParamsGooglePay) _then; - @override - String toString() { - return 'PlatformPayConfirmParams.applePay(applePay: $applePay)'; - } +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? googlePay = null,}) { + return _then(PlatformPayConfirmParamsGooglePay( +googlePay: null == googlePay ? _self.googlePay : googlePay // ignore: cast_nullable_to_non_nullable +as GooglePayParams, + )); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayConfirmParamsApplePayImpl && - (identical(other.applePay, applePay) || - other.applePay == applePay)); - } +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayParamsCopyWith<$Res> get googlePay { + + return $GooglePayParamsCopyWith<$Res>(_self.googlePay, (value) { + return _then(_self.copyWith(googlePay: value)); + }); +} +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, applePay); - - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayConfirmParamsApplePayImplCopyWith< - _$PlatformPayConfirmParamsApplePayImpl> - get copyWith => __$$PlatformPayConfirmParamsApplePayImplCopyWithImpl< - _$PlatformPayConfirmParamsApplePayImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePay) googlePay, - required TResult Function(ApplePayParams applePay) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) { - return applePay(this.applePay); - } +/// @nodoc - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePay)? googlePay, - TResult? Function(ApplePayParams applePay)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) { - return applePay?.call(this.applePay); - } +@JsonSerializable(explicitToJson: true) +class PlatformPayConfirmParamsApplePay implements PlatformPayConfirmParams { + const PlatformPayConfirmParamsApplePay({required this.applePay, final String? $type}): $type = $type ?? 'applePay'; + factory PlatformPayConfirmParamsApplePay.fromJson(Map json) => _$PlatformPayConfirmParamsApplePayFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePay)? googlePay, - TResult Function(ApplePayParams applePay)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(this.applePay); - } - return orElse(); - } + final ApplePayParams applePay; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayConfirmParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayConfirmParamsApplePay value) applePay, - required TResult Function(PlatformPayConfirmParamsWeb value) web, - }) { - return applePay(this); - } +@JsonKey(name: 'runtimeType') +final String $type; - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult? Function(PlatformPayConfirmParamsWeb value)? web, - }) { - return applePay?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult Function(PlatformPayConfirmParamsWeb value)? web, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(this); - } - return orElse(); - } +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayConfirmParamsApplePayCopyWith get copyWith => _$PlatformPayConfirmParamsApplePayCopyWithImpl(this, _$identity); - @override - Map toJson() { - return _$$PlatformPayConfirmParamsApplePayImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PlatformPayConfirmParamsApplePayToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayConfirmParamsApplePay&&(identical(other.applePay, applePay) || other.applePay == applePay)); } -abstract class PlatformPayConfirmParamsApplePay - implements PlatformPayConfirmParams { - const factory PlatformPayConfirmParamsApplePay( - {required final ApplePayParams applePay}) = - _$PlatformPayConfirmParamsApplePayImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,applePay); - factory PlatformPayConfirmParamsApplePay.fromJson(Map json) = - _$PlatformPayConfirmParamsApplePayImpl.fromJson; +@override +String toString() { + return 'PlatformPayConfirmParams.applePay(applePay: $applePay)'; +} - ApplePayParams get applePay; - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayConfirmParamsApplePayImplCopyWith< - _$PlatformPayConfirmParamsApplePayImpl> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PlatformPayConfirmParamsWebImplCopyWith<$Res> { - factory _$$PlatformPayConfirmParamsWebImplCopyWith( - _$PlatformPayConfirmParamsWebImpl value, - $Res Function(_$PlatformPayConfirmParamsWebImpl) then) = - __$$PlatformPayConfirmParamsWebImplCopyWithImpl<$Res>; - @useResult - $Res call({PlatformPayWebPaymentRequestCreateOptions options}); +abstract mixin class $PlatformPayConfirmParamsApplePayCopyWith<$Res> implements $PlatformPayConfirmParamsCopyWith<$Res> { + factory $PlatformPayConfirmParamsApplePayCopyWith(PlatformPayConfirmParamsApplePay value, $Res Function(PlatformPayConfirmParamsApplePay) _then) = _$PlatformPayConfirmParamsApplePayCopyWithImpl; +@useResult +$Res call({ + ApplePayParams applePay +}); - $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options; -} +$ApplePayParamsCopyWith<$Res> get applePay; + +} /// @nodoc -class __$$PlatformPayConfirmParamsWebImplCopyWithImpl<$Res> - extends _$PlatformPayConfirmParamsCopyWithImpl<$Res, - _$PlatformPayConfirmParamsWebImpl> - implements _$$PlatformPayConfirmParamsWebImplCopyWith<$Res> { - __$$PlatformPayConfirmParamsWebImplCopyWithImpl( - _$PlatformPayConfirmParamsWebImpl _value, - $Res Function(_$PlatformPayConfirmParamsWebImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? options = null, - }) { - return _then(_$PlatformPayConfirmParamsWebImpl( - options: null == options - ? _value.options - : options // ignore: cast_nullable_to_non_nullable - as PlatformPayWebPaymentRequestCreateOptions, - )); - } +class _$PlatformPayConfirmParamsApplePayCopyWithImpl<$Res> + implements $PlatformPayConfirmParamsApplePayCopyWith<$Res> { + _$PlatformPayConfirmParamsApplePayCopyWithImpl(this._self, this._then); - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options { - return $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res>( - _value.options, (value) { - return _then(_value.copyWith(options: value)); - }); - } + final PlatformPayConfirmParamsApplePay _self; + final $Res Function(PlatformPayConfirmParamsApplePay) _then; + +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? applePay = null,}) { + return _then(PlatformPayConfirmParamsApplePay( +applePay: null == applePay ? _self.applePay : applePay // ignore: cast_nullable_to_non_nullable +as ApplePayParams, + )); +} + +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ApplePayParamsCopyWith<$Res> get applePay { + + return $ApplePayParamsCopyWith<$Res>(_self.applePay, (value) { + return _then(_self.copyWith(applePay: value)); + }); +} } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PlatformPayConfirmParamsWebImpl implements PlatformPayConfirmParamsWeb { - const _$PlatformPayConfirmParamsWebImpl( - {required this.options, final String? $type}) - : $type = $type ?? 'web'; +class PlatformPayConfirmParamsWeb implements PlatformPayConfirmParams { + const PlatformPayConfirmParamsWeb({required this.options, final String? $type}): $type = $type ?? 'web'; + factory PlatformPayConfirmParamsWeb.fromJson(Map json) => _$PlatformPayConfirmParamsWebFromJson(json); - factory _$PlatformPayConfirmParamsWebImpl.fromJson( - Map json) => - _$$PlatformPayConfirmParamsWebImplFromJson(json); + final PlatformPayWebPaymentRequestCreateOptions options; - @override - final PlatformPayWebPaymentRequestCreateOptions options; +@JsonKey(name: 'runtimeType') +final String $type; - @JsonKey(name: 'runtimeType') - final String $type; - @override - String toString() { - return 'PlatformPayConfirmParams.web(options: $options)'; - } +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayConfirmParamsWebCopyWith get copyWith => _$PlatformPayConfirmParamsWebCopyWithImpl(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayConfirmParamsWebImpl && - (identical(other.options, options) || other.options == options)); - } +@override +Map toJson() { + return _$PlatformPayConfirmParamsWebToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, options); - - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayConfirmParamsWebImplCopyWith<_$PlatformPayConfirmParamsWebImpl> - get copyWith => __$$PlatformPayConfirmParamsWebImplCopyWithImpl< - _$PlatformPayConfirmParamsWebImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function(GooglePayParams googlePay) googlePay, - required TResult Function(ApplePayParams applePay) applePay, - required TResult Function(PlatformPayWebPaymentRequestCreateOptions options) - web, - }) { - return web(options); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayConfirmParamsWeb&&(identical(other.options, options) || other.options == options)); +} - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(GooglePayParams googlePay)? googlePay, - TResult? Function(ApplePayParams applePay)? applePay, - TResult? Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - }) { - return web?.call(options); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,options); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(GooglePayParams googlePay)? googlePay, - TResult Function(ApplePayParams applePay)? applePay, - TResult Function(PlatformPayWebPaymentRequestCreateOptions options)? web, - required TResult orElse(), - }) { - if (web != null) { - return web(options); - } - return orElse(); - } +@override +String toString() { + return 'PlatformPayConfirmParams.web(options: $options)'; +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(PlatformPayConfirmParamsGooglePay value) - googlePay, - required TResult Function(PlatformPayConfirmParamsApplePay value) applePay, - required TResult Function(PlatformPayConfirmParamsWeb value) web, - }) { - return web(this); - } - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult? Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult? Function(PlatformPayConfirmParamsWeb value)? web, - }) { - return web?.call(this); - } +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(PlatformPayConfirmParamsGooglePay value)? googlePay, - TResult Function(PlatformPayConfirmParamsApplePay value)? applePay, - TResult Function(PlatformPayConfirmParamsWeb value)? web, - required TResult orElse(), - }) { - if (web != null) { - return web(this); - } - return orElse(); - } +/// @nodoc +abstract mixin class $PlatformPayConfirmParamsWebCopyWith<$Res> implements $PlatformPayConfirmParamsCopyWith<$Res> { + factory $PlatformPayConfirmParamsWebCopyWith(PlatformPayConfirmParamsWeb value, $Res Function(PlatformPayConfirmParamsWeb) _then) = _$PlatformPayConfirmParamsWebCopyWithImpl; +@useResult +$Res call({ + PlatformPayWebPaymentRequestCreateOptions options +}); - @override - Map toJson() { - return _$$PlatformPayConfirmParamsWebImplToJson( - this, - ); - } -} -abstract class PlatformPayConfirmParamsWeb implements PlatformPayConfirmParams { - const factory PlatformPayConfirmParamsWeb( - {required final PlatformPayWebPaymentRequestCreateOptions options}) = - _$PlatformPayConfirmParamsWebImpl; +$PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options; - factory PlatformPayConfirmParamsWeb.fromJson(Map json) = - _$PlatformPayConfirmParamsWebImpl.fromJson; +} +/// @nodoc +class _$PlatformPayConfirmParamsWebCopyWithImpl<$Res> + implements $PlatformPayConfirmParamsWebCopyWith<$Res> { + _$PlatformPayConfirmParamsWebCopyWithImpl(this._self, this._then); - PlatformPayWebPaymentRequestCreateOptions get options; + final PlatformPayConfirmParamsWeb _self; + final $Res Function(PlatformPayConfirmParamsWeb) _then; - /// Create a copy of PlatformPayConfirmParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayConfirmParamsWebImplCopyWith<_$PlatformPayConfirmParamsWebImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? options = null,}) { + return _then(PlatformPayConfirmParamsWeb( +options: null == options ? _self.options : options // ignore: cast_nullable_to_non_nullable +as PlatformPayWebPaymentRequestCreateOptions, + )); } -PlatformPayShippingContact _$PlatformPayShippingContactFromJson( - Map json) { - return _PlatformPayShippingContact.fromJson(json); +/// Create a copy of PlatformPayConfirmParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> get options { + + return $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res>(_self.options, (value) { + return _then(_self.copyWith(options: value)); + }); +} } + /// @nodoc mixin _$PlatformPayShippingContact { - /// Email address of the shipping contact - String? get emailAddress => throw _privateConstructorUsedError; - /// Name of shipping contact - ApplePayContactName get name => throw _privateConstructorUsedError; +/// Email address of the shipping contact + String? get emailAddress;/// Name of shipping contact + ApplePayContactName get name;/// Postal address of shipping contact + ApplePayPostalAddress get postalAddress;///Phone Number of the shipping contact + String? get phoneNumber; +/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayShippingContactCopyWith get copyWith => _$PlatformPayShippingContactCopyWithImpl(this as PlatformPayShippingContact, _$identity); - /// Postal address of shipping contact - ApplePayPostalAddress get postalAddress => throw _privateConstructorUsedError; + /// Serializes this PlatformPayShippingContact to a JSON map. + Map toJson(); - ///Phone Number of the shipping contact - String? get phoneNumber => throw _privateConstructorUsedError; - /// Serializes this PlatformPayShippingContact to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayShippingContact&&(identical(other.emailAddress, emailAddress) || other.emailAddress == emailAddress)&&(identical(other.name, name) || other.name == name)&&(identical(other.postalAddress, postalAddress) || other.postalAddress == postalAddress)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,emailAddress,name,postalAddress,phoneNumber); - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPayShippingContactCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PlatformPayShippingContact(emailAddress: $emailAddress, name: $name, postalAddress: $postalAddress, phoneNumber: $phoneNumber)'; } -/// @nodoc -abstract class $PlatformPayShippingContactCopyWith<$Res> { - factory $PlatformPayShippingContactCopyWith(PlatformPayShippingContact value, - $Res Function(PlatformPayShippingContact) then) = - _$PlatformPayShippingContactCopyWithImpl<$Res, - PlatformPayShippingContact>; - @useResult - $Res call( - {String? emailAddress, - ApplePayContactName name, - ApplePayPostalAddress postalAddress, - String? phoneNumber}); - - $ApplePayContactNameCopyWith<$Res> get name; - $ApplePayPostalAddressCopyWith<$Res> get postalAddress; + } /// @nodoc -class _$PlatformPayShippingContactCopyWithImpl<$Res, - $Val extends PlatformPayShippingContact> - implements $PlatformPayShippingContactCopyWith<$Res> { - _$PlatformPayShippingContactCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? emailAddress = freezed, - Object? name = null, - Object? postalAddress = null, - Object? phoneNumber = freezed, - }) { - return _then(_value.copyWith( - emailAddress: freezed == emailAddress - ? _value.emailAddress - : emailAddress // ignore: cast_nullable_to_non_nullable - as String?, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as ApplePayContactName, - postalAddress: null == postalAddress - ? _value.postalAddress - : postalAddress // ignore: cast_nullable_to_non_nullable - as ApplePayPostalAddress, - phoneNumber: freezed == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } +abstract mixin class $PlatformPayShippingContactCopyWith<$Res> { + factory $PlatformPayShippingContactCopyWith(PlatformPayShippingContact value, $Res Function(PlatformPayShippingContact) _then) = _$PlatformPayShippingContactCopyWithImpl; +@useResult +$Res call({ + String? emailAddress, ApplePayContactName name, ApplePayPostalAddress postalAddress, String? phoneNumber +}); - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ApplePayContactNameCopyWith<$Res> get name { - return $ApplePayContactNameCopyWith<$Res>(_value.name, (value) { - return _then(_value.copyWith(name: value) as $Val); - }); - } - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ApplePayPostalAddressCopyWith<$Res> get postalAddress { - return $ApplePayPostalAddressCopyWith<$Res>(_value.postalAddress, (value) { - return _then(_value.copyWith(postalAddress: value) as $Val); - }); - } -} +$ApplePayContactNameCopyWith<$Res> get name;$ApplePayPostalAddressCopyWith<$Res> get postalAddress; +} /// @nodoc -abstract class _$$PlatformPayShippingContactImplCopyWith<$Res> +class _$PlatformPayShippingContactCopyWithImpl<$Res> implements $PlatformPayShippingContactCopyWith<$Res> { - factory _$$PlatformPayShippingContactImplCopyWith( - _$PlatformPayShippingContactImpl value, - $Res Function(_$PlatformPayShippingContactImpl) then) = - __$$PlatformPayShippingContactImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? emailAddress, - ApplePayContactName name, - ApplePayPostalAddress postalAddress, - String? phoneNumber}); - - @override - $ApplePayContactNameCopyWith<$Res> get name; - @override - $ApplePayPostalAddressCopyWith<$Res> get postalAddress; + _$PlatformPayShippingContactCopyWithImpl(this._self, this._then); + + final PlatformPayShippingContact _self; + final $Res Function(PlatformPayShippingContact) _then; + +/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? emailAddress = freezed,Object? name = null,Object? postalAddress = null,Object? phoneNumber = freezed,}) { + return _then(_self.copyWith( +emailAddress: freezed == emailAddress ? _self.emailAddress : emailAddress // ignore: cast_nullable_to_non_nullable +as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as ApplePayContactName,postalAddress: null == postalAddress ? _self.postalAddress : postalAddress // ignore: cast_nullable_to_non_nullable +as ApplePayPostalAddress,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ApplePayContactNameCopyWith<$Res> get name { + + return $ApplePayContactNameCopyWith<$Res>(_self.name, (value) { + return _then(_self.copyWith(name: value)); + }); +}/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ApplePayPostalAddressCopyWith<$Res> get postalAddress { + + return $ApplePayPostalAddressCopyWith<$Res>(_self.postalAddress, (value) { + return _then(_self.copyWith(postalAddress: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PlatformPayShippingContact]. +extension PlatformPayShippingContactPatterns on PlatformPayShippingContact { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PlatformPayShippingContact value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PlatformPayShippingContact() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PlatformPayShippingContact value) $default,){ +final _that = this; +switch (_that) { +case _PlatformPayShippingContact(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PlatformPayShippingContact value)? $default,){ +final _that = this; +switch (_that) { +case _PlatformPayShippingContact() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? emailAddress, ApplePayContactName name, ApplePayPostalAddress postalAddress, String? phoneNumber)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PlatformPayShippingContact() when $default != null: +return $default(_that.emailAddress,_that.name,_that.postalAddress,_that.phoneNumber);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? emailAddress, ApplePayContactName name, ApplePayPostalAddress postalAddress, String? phoneNumber) $default,) {final _that = this; +switch (_that) { +case _PlatformPayShippingContact(): +return $default(_that.emailAddress,_that.name,_that.postalAddress,_that.phoneNumber);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? emailAddress, ApplePayContactName name, ApplePayPostalAddress postalAddress, String? phoneNumber)? $default,) {final _that = this; +switch (_that) { +case _PlatformPayShippingContact() when $default != null: +return $default(_that.emailAddress,_that.name,_that.postalAddress,_that.phoneNumber);case _: + return null; + +} } -/// @nodoc -class __$$PlatformPayShippingContactImplCopyWithImpl<$Res> - extends _$PlatformPayShippingContactCopyWithImpl<$Res, - _$PlatformPayShippingContactImpl> - implements _$$PlatformPayShippingContactImplCopyWith<$Res> { - __$$PlatformPayShippingContactImplCopyWithImpl( - _$PlatformPayShippingContactImpl _value, - $Res Function(_$PlatformPayShippingContactImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? emailAddress = freezed, - Object? name = null, - Object? postalAddress = null, - Object? phoneNumber = freezed, - }) { - return _then(_$PlatformPayShippingContactImpl( - emailAddress: freezed == emailAddress - ? _value.emailAddress - : emailAddress // ignore: cast_nullable_to_non_nullable - as String?, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as ApplePayContactName, - postalAddress: null == postalAddress - ? _value.postalAddress - : postalAddress // ignore: cast_nullable_to_non_nullable - as ApplePayPostalAddress, - phoneNumber: freezed == phoneNumber - ? _value.phoneNumber - : phoneNumber // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PlatformPayShippingContactImpl implements _PlatformPayShippingContact { - const _$PlatformPayShippingContactImpl( - {this.emailAddress, - required this.name, - required this.postalAddress, - this.phoneNumber}); - - factory _$PlatformPayShippingContactImpl.fromJson( - Map json) => - _$$PlatformPayShippingContactImplFromJson(json); - - /// Email address of the shipping contact - @override - final String? emailAddress; - - /// Name of shipping contact - @override - final ApplePayContactName name; - - /// Postal address of shipping contact - @override - final ApplePayPostalAddress postalAddress; - - ///Phone Number of the shipping contact - @override - final String? phoneNumber; - - @override - String toString() { - return 'PlatformPayShippingContact(emailAddress: $emailAddress, name: $name, postalAddress: $postalAddress, phoneNumber: $phoneNumber)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayShippingContactImpl && - (identical(other.emailAddress, emailAddress) || - other.emailAddress == emailAddress) && - (identical(other.name, name) || other.name == name) && - (identical(other.postalAddress, postalAddress) || - other.postalAddress == postalAddress) && - (identical(other.phoneNumber, phoneNumber) || - other.phoneNumber == phoneNumber)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, emailAddress, name, postalAddress, phoneNumber); - - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayShippingContactImplCopyWith<_$PlatformPayShippingContactImpl> - get copyWith => __$$PlatformPayShippingContactImplCopyWithImpl< - _$PlatformPayShippingContactImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PlatformPayShippingContactImplToJson( - this, - ); - } -} - -abstract class _PlatformPayShippingContact - implements PlatformPayShippingContact { - const factory _PlatformPayShippingContact( - {final String? emailAddress, - required final ApplePayContactName name, - required final ApplePayPostalAddress postalAddress, - final String? phoneNumber}) = _$PlatformPayShippingContactImpl; +class _PlatformPayShippingContact implements PlatformPayShippingContact { + const _PlatformPayShippingContact({this.emailAddress, required this.name, required this.postalAddress, this.phoneNumber}); + factory _PlatformPayShippingContact.fromJson(Map json) => _$PlatformPayShippingContactFromJson(json); - factory _PlatformPayShippingContact.fromJson(Map json) = - _$PlatformPayShippingContactImpl.fromJson; +/// Email address of the shipping contact +@override final String? emailAddress; +/// Name of shipping contact +@override final ApplePayContactName name; +/// Postal address of shipping contact +@override final ApplePayPostalAddress postalAddress; +///Phone Number of the shipping contact +@override final String? phoneNumber; - /// Email address of the shipping contact - @override - String? get emailAddress; +/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PlatformPayShippingContactCopyWith<_PlatformPayShippingContact> get copyWith => __$PlatformPayShippingContactCopyWithImpl<_PlatformPayShippingContact>(this, _$identity); - /// Name of shipping contact - @override - ApplePayContactName get name; +@override +Map toJson() { + return _$PlatformPayShippingContactToJson(this, ); +} - /// Postal address of shipping contact - @override - ApplePayPostalAddress get postalAddress; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PlatformPayShippingContact&&(identical(other.emailAddress, emailAddress) || other.emailAddress == emailAddress)&&(identical(other.name, name) || other.name == name)&&(identical(other.postalAddress, postalAddress) || other.postalAddress == postalAddress)&&(identical(other.phoneNumber, phoneNumber) || other.phoneNumber == phoneNumber)); +} - ///Phone Number of the shipping contact - @override - String? get phoneNumber; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,emailAddress,name,postalAddress,phoneNumber); - /// Create a copy of PlatformPayShippingContact - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayShippingContactImplCopyWith<_$PlatformPayShippingContactImpl> - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PlatformPayShippingContact(emailAddress: $emailAddress, name: $name, postalAddress: $postalAddress, phoneNumber: $phoneNumber)'; } -ApplePayParams _$ApplePayParamsFromJson(Map json) { - return _ApplePayParams.fromJson(json); + } /// @nodoc -mixin _$ApplePayParams { - /// ISO 3166-1 alpha-2 country code where the transaction is processed. - String get merchantCountryCode => throw _privateConstructorUsedError; +abstract mixin class _$PlatformPayShippingContactCopyWith<$Res> implements $PlatformPayShippingContactCopyWith<$Res> { + factory _$PlatformPayShippingContactCopyWith(_PlatformPayShippingContact value, $Res Function(_PlatformPayShippingContact) _then) = __$PlatformPayShippingContactCopyWithImpl; +@override @useResult +$Res call({ + String? emailAddress, ApplePayContactName name, ApplePayPostalAddress postalAddress, String? phoneNumber +}); - /// ISO 4217 alphabetic currency code. - String get currencyCode => throw _privateConstructorUsedError; - /// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. - List? get additionalEnabledNetworks => - throw _privateConstructorUsedError; +@override $ApplePayContactNameCopyWith<$Res> get name;@override $ApplePayPostalAddressCopyWith<$Res> get postalAddress; - /// The list of items that describe a purchase. For example: total, tax, discount, and grand total. - List get cartItems => - throw _privateConstructorUsedError; +} +/// @nodoc +class __$PlatformPayShippingContactCopyWithImpl<$Res> + implements _$PlatformPayShippingContactCopyWith<$Res> { + __$PlatformPayShippingContactCopyWithImpl(this._self, this._then); - /// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. - List? get requiredShippingAddressFields => - throw _privateConstructorUsedError; + final _PlatformPayShippingContact _self; + final $Res Function(_PlatformPayShippingContact) _then; - /// The list of fields that you need for a billing contact in order to process the transaction. - List? get requiredBillingContactFields => - throw _privateConstructorUsedError; +/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? emailAddress = freezed,Object? name = null,Object? postalAddress = null,Object? phoneNumber = freezed,}) { + return _then(_PlatformPayShippingContact( +emailAddress: freezed == emailAddress ? _self.emailAddress : emailAddress // ignore: cast_nullable_to_non_nullable +as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as ApplePayContactName,postalAddress: null == postalAddress ? _self.postalAddress : postalAddress // ignore: cast_nullable_to_non_nullable +as ApplePayPostalAddress,phoneNumber: freezed == phoneNumber ? _self.phoneNumber : phoneNumber // ignore: cast_nullable_to_non_nullable +as String?, + )); +} - /// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. - List? get shippingMethods => - throw _privateConstructorUsedError; +/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ApplePayContactNameCopyWith<$Res> get name { + + return $ApplePayContactNameCopyWith<$Res>(_self.name, (value) { + return _then(_self.copyWith(name: value)); + }); +}/// Create a copy of PlatformPayShippingContact +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ApplePayPostalAddressCopyWith<$Res> get postalAddress { + + return $ApplePayPostalAddressCopyWith<$Res>(_self.postalAddress, (value) { + return _then(_self.copyWith(postalAddress: value)); + }); +} +} - /// Set the payment capabilities you support. If set, 3DS is required. - List? get merchantCapabilities => - throw _privateConstructorUsedError; - /// An optional value that indicates how to ship purchased items. Defaults to 'Shipping'. - ApplePayShippingType? get shippingType => throw _privateConstructorUsedError; +/// @nodoc +mixin _$ApplePayParams { - /// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. - List? get supportedCountries => throw _privateConstructorUsedError; +/// ISO 3166-1 alpha-2 country code where the transaction is processed. + String get merchantCountryCode;/// ISO 4217 alphabetic currency code. + String get currencyCode;/// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. + List? get additionalEnabledNetworks;/// The list of items that describe a purchase. For example: total, tax, discount, and grand total. + List get cartItems;/// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. + List? get requiredShippingAddressFields;/// The list of fields that you need for a billing contact in order to process the transaction. + List? get requiredBillingContactFields;/// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. + List? get shippingMethods;/// Set the payment capabilities you support. If set, 3DS is required. + List? get merchantCapabilities;/// An optional value that indicates how to ship purchased items. Defaults to 'Shipping'. + ApplePayShippingType? get shippingType;/// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. + List? get supportedCountries;/// Enables support for coupon codes in the Apple Pay button. +/// When this is set to true it shows the coupon code field and if [couponCode] +/// has a value it will display the value as default +/// +/// Supported on iOS 15 and higher. + bool? get supportsCouponCode;/// Default coupon code display in the apple pay sheet + String? get couponCode;/// Use this to support different types of payment request. +/// +/// Only supported on iOS 16 and higher. + PaymentRequestType? get request; +/// Create a copy of ApplePayParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayParamsCopyWith get copyWith => _$ApplePayParamsCopyWithImpl(this as ApplePayParams, _$identity); - /// Enables support for coupon codes in the Apple Pay button. - /// When this is set to true it shows the coupon code field and if [couponCode] - /// has a value it will display the value as default - /// - /// Supported on iOS 15 and higher. - bool? get supportsCouponCode => throw _privateConstructorUsedError; + /// Serializes this ApplePayParams to a JSON map. + Map toJson(); - /// Default coupon code display in the apple pay sheet - String? get couponCode => throw _privateConstructorUsedError; - /// Use this to support different types of payment request. - /// - /// Only supported on iOS 16 and higher. - PaymentRequestType? get request => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayParams&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&const DeepCollectionEquality().equals(other.additionalEnabledNetworks, additionalEnabledNetworks)&&const DeepCollectionEquality().equals(other.cartItems, cartItems)&&const DeepCollectionEquality().equals(other.requiredShippingAddressFields, requiredShippingAddressFields)&&const DeepCollectionEquality().equals(other.requiredBillingContactFields, requiredBillingContactFields)&&const DeepCollectionEquality().equals(other.shippingMethods, shippingMethods)&&const DeepCollectionEquality().equals(other.merchantCapabilities, merchantCapabilities)&&(identical(other.shippingType, shippingType) || other.shippingType == shippingType)&&const DeepCollectionEquality().equals(other.supportedCountries, supportedCountries)&&(identical(other.supportsCouponCode, supportsCouponCode) || other.supportsCouponCode == supportsCouponCode)&&(identical(other.couponCode, couponCode) || other.couponCode == couponCode)&&(identical(other.request, request) || other.request == request)); +} - /// Serializes this ApplePayParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantCountryCode,currencyCode,const DeepCollectionEquality().hash(additionalEnabledNetworks),const DeepCollectionEquality().hash(cartItems),const DeepCollectionEquality().hash(requiredShippingAddressFields),const DeepCollectionEquality().hash(requiredBillingContactFields),const DeepCollectionEquality().hash(shippingMethods),const DeepCollectionEquality().hash(merchantCapabilities),shippingType,const DeepCollectionEquality().hash(supportedCountries),supportsCouponCode,couponCode,request); - /// Create a copy of ApplePayParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'ApplePayParams(merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, additionalEnabledNetworks: $additionalEnabledNetworks, cartItems: $cartItems, requiredShippingAddressFields: $requiredShippingAddressFields, requiredBillingContactFields: $requiredBillingContactFields, shippingMethods: $shippingMethods, merchantCapabilities: $merchantCapabilities, shippingType: $shippingType, supportedCountries: $supportedCountries, supportsCouponCode: $supportsCouponCode, couponCode: $couponCode, request: $request)'; } -/// @nodoc -abstract class $ApplePayParamsCopyWith<$Res> { - factory $ApplePayParamsCopyWith( - ApplePayParams value, $Res Function(ApplePayParams) then) = - _$ApplePayParamsCopyWithImpl<$Res, ApplePayParams>; - @useResult - $Res call( - {String merchantCountryCode, - String currencyCode, - List? additionalEnabledNetworks, - List cartItems, - List? requiredShippingAddressFields, - List? requiredBillingContactFields, - List? shippingMethods, - List? merchantCapabilities, - ApplePayShippingType? shippingType, - List? supportedCountries, - bool? supportsCouponCode, - String? couponCode, - PaymentRequestType? request}); - - $PaymentRequestTypeCopyWith<$Res>? get request; + } /// @nodoc -class _$ApplePayParamsCopyWithImpl<$Res, $Val extends ApplePayParams> - implements $ApplePayParamsCopyWith<$Res> { - _$ApplePayParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantCountryCode = null, - Object? currencyCode = null, - Object? additionalEnabledNetworks = freezed, - Object? cartItems = null, - Object? requiredShippingAddressFields = freezed, - Object? requiredBillingContactFields = freezed, - Object? shippingMethods = freezed, - Object? merchantCapabilities = freezed, - Object? shippingType = freezed, - Object? supportedCountries = freezed, - Object? supportsCouponCode = freezed, - Object? couponCode = freezed, - Object? request = freezed, - }) { - return _then(_value.copyWith( - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - additionalEnabledNetworks: freezed == additionalEnabledNetworks - ? _value.additionalEnabledNetworks - : additionalEnabledNetworks // ignore: cast_nullable_to_non_nullable - as List?, - cartItems: null == cartItems - ? _value.cartItems - : cartItems // ignore: cast_nullable_to_non_nullable - as List, - requiredShippingAddressFields: freezed == requiredShippingAddressFields - ? _value.requiredShippingAddressFields - : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable - as List?, - requiredBillingContactFields: freezed == requiredBillingContactFields - ? _value.requiredBillingContactFields - : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable - as List?, - shippingMethods: freezed == shippingMethods - ? _value.shippingMethods - : shippingMethods // ignore: cast_nullable_to_non_nullable - as List?, - merchantCapabilities: freezed == merchantCapabilities - ? _value.merchantCapabilities - : merchantCapabilities // ignore: cast_nullable_to_non_nullable - as List?, - shippingType: freezed == shippingType - ? _value.shippingType - : shippingType // ignore: cast_nullable_to_non_nullable - as ApplePayShippingType?, - supportedCountries: freezed == supportedCountries - ? _value.supportedCountries - : supportedCountries // ignore: cast_nullable_to_non_nullable - as List?, - supportsCouponCode: freezed == supportsCouponCode - ? _value.supportsCouponCode - : supportsCouponCode // ignore: cast_nullable_to_non_nullable - as bool?, - couponCode: freezed == couponCode - ? _value.couponCode - : couponCode // ignore: cast_nullable_to_non_nullable - as String?, - request: freezed == request - ? _value.request - : request // ignore: cast_nullable_to_non_nullable - as PaymentRequestType?, - ) as $Val); - } +abstract mixin class $ApplePayParamsCopyWith<$Res> { + factory $ApplePayParamsCopyWith(ApplePayParams value, $Res Function(ApplePayParams) _then) = _$ApplePayParamsCopyWithImpl; +@useResult +$Res call({ + String merchantCountryCode, String currencyCode, List? additionalEnabledNetworks, List cartItems, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, List? merchantCapabilities, ApplePayShippingType? shippingType, List? supportedCountries, bool? supportsCouponCode, String? couponCode, PaymentRequestType? request +}); - /// Create a copy of ApplePayParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PaymentRequestTypeCopyWith<$Res>? get request { - if (_value.request == null) { - return null; - } - - return $PaymentRequestTypeCopyWith<$Res>(_value.request!, (value) { - return _then(_value.copyWith(request: value) as $Val); - }); - } -} +$PaymentRequestTypeCopyWith<$Res>? get request; + +} /// @nodoc -abstract class _$$ApplePayParamsImplCopyWith<$Res> +class _$ApplePayParamsCopyWithImpl<$Res> implements $ApplePayParamsCopyWith<$Res> { - factory _$$ApplePayParamsImplCopyWith(_$ApplePayParamsImpl value, - $Res Function(_$ApplePayParamsImpl) then) = - __$$ApplePayParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String merchantCountryCode, - String currencyCode, - List? additionalEnabledNetworks, - List cartItems, - List? requiredShippingAddressFields, - List? requiredBillingContactFields, - List? shippingMethods, - List? merchantCapabilities, - ApplePayShippingType? shippingType, - List? supportedCountries, - bool? supportsCouponCode, - String? couponCode, - PaymentRequestType? request}); - - @override - $PaymentRequestTypeCopyWith<$Res>? get request; + _$ApplePayParamsCopyWithImpl(this._self, this._then); + + final ApplePayParams _self; + final $Res Function(ApplePayParams) _then; + +/// Create a copy of ApplePayParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? merchantCountryCode = null,Object? currencyCode = null,Object? additionalEnabledNetworks = freezed,Object? cartItems = null,Object? requiredShippingAddressFields = freezed,Object? requiredBillingContactFields = freezed,Object? shippingMethods = freezed,Object? merchantCapabilities = freezed,Object? shippingType = freezed,Object? supportedCountries = freezed,Object? supportsCouponCode = freezed,Object? couponCode = freezed,Object? request = freezed,}) { + return _then(_self.copyWith( +merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,additionalEnabledNetworks: freezed == additionalEnabledNetworks ? _self.additionalEnabledNetworks : additionalEnabledNetworks // ignore: cast_nullable_to_non_nullable +as List?,cartItems: null == cartItems ? _self.cartItems : cartItems // ignore: cast_nullable_to_non_nullable +as List,requiredShippingAddressFields: freezed == requiredShippingAddressFields ? _self.requiredShippingAddressFields : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable +as List?,requiredBillingContactFields: freezed == requiredBillingContactFields ? _self.requiredBillingContactFields : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable +as List?,shippingMethods: freezed == shippingMethods ? _self.shippingMethods : shippingMethods // ignore: cast_nullable_to_non_nullable +as List?,merchantCapabilities: freezed == merchantCapabilities ? _self.merchantCapabilities : merchantCapabilities // ignore: cast_nullable_to_non_nullable +as List?,shippingType: freezed == shippingType ? _self.shippingType : shippingType // ignore: cast_nullable_to_non_nullable +as ApplePayShippingType?,supportedCountries: freezed == supportedCountries ? _self.supportedCountries : supportedCountries // ignore: cast_nullable_to_non_nullable +as List?,supportsCouponCode: freezed == supportsCouponCode ? _self.supportsCouponCode : supportsCouponCode // ignore: cast_nullable_to_non_nullable +as bool?,couponCode: freezed == couponCode ? _self.couponCode : couponCode // ignore: cast_nullable_to_non_nullable +as String?,request: freezed == request ? _self.request : request // ignore: cast_nullable_to_non_nullable +as PaymentRequestType?, + )); +} +/// Create a copy of ApplePayParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentRequestTypeCopyWith<$Res>? get request { + if (_self.request == null) { + return null; + } + + return $PaymentRequestTypeCopyWith<$Res>(_self.request!, (value) { + return _then(_self.copyWith(request: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ApplePayParams]. +extension ApplePayParamsPatterns on ApplePayParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayParams value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayParams value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String merchantCountryCode, String currencyCode, List? additionalEnabledNetworks, List cartItems, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, List? merchantCapabilities, ApplePayShippingType? shippingType, List? supportedCountries, bool? supportsCouponCode, String? couponCode, PaymentRequestType? request)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayParams() when $default != null: +return $default(_that.merchantCountryCode,_that.currencyCode,_that.additionalEnabledNetworks,_that.cartItems,_that.requiredShippingAddressFields,_that.requiredBillingContactFields,_that.shippingMethods,_that.merchantCapabilities,_that.shippingType,_that.supportedCountries,_that.supportsCouponCode,_that.couponCode,_that.request);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String merchantCountryCode, String currencyCode, List? additionalEnabledNetworks, List cartItems, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, List? merchantCapabilities, ApplePayShippingType? shippingType, List? supportedCountries, bool? supportsCouponCode, String? couponCode, PaymentRequestType? request) $default,) {final _that = this; +switch (_that) { +case _ApplePayParams(): +return $default(_that.merchantCountryCode,_that.currencyCode,_that.additionalEnabledNetworks,_that.cartItems,_that.requiredShippingAddressFields,_that.requiredBillingContactFields,_that.shippingMethods,_that.merchantCapabilities,_that.shippingType,_that.supportedCountries,_that.supportsCouponCode,_that.couponCode,_that.request);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String merchantCountryCode, String currencyCode, List? additionalEnabledNetworks, List cartItems, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, List? merchantCapabilities, ApplePayShippingType? shippingType, List? supportedCountries, bool? supportsCouponCode, String? couponCode, PaymentRequestType? request)? $default,) {final _that = this; +switch (_that) { +case _ApplePayParams() when $default != null: +return $default(_that.merchantCountryCode,_that.currencyCode,_that.additionalEnabledNetworks,_that.cartItems,_that.requiredShippingAddressFields,_that.requiredBillingContactFields,_that.shippingMethods,_that.merchantCapabilities,_that.shippingType,_that.supportedCountries,_that.supportsCouponCode,_that.couponCode,_that.request);case _: + return null; + +} } -/// @nodoc -class __$$ApplePayParamsImplCopyWithImpl<$Res> - extends _$ApplePayParamsCopyWithImpl<$Res, _$ApplePayParamsImpl> - implements _$$ApplePayParamsImplCopyWith<$Res> { - __$$ApplePayParamsImplCopyWithImpl( - _$ApplePayParamsImpl _value, $Res Function(_$ApplePayParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantCountryCode = null, - Object? currencyCode = null, - Object? additionalEnabledNetworks = freezed, - Object? cartItems = null, - Object? requiredShippingAddressFields = freezed, - Object? requiredBillingContactFields = freezed, - Object? shippingMethods = freezed, - Object? merchantCapabilities = freezed, - Object? shippingType = freezed, - Object? supportedCountries = freezed, - Object? supportsCouponCode = freezed, - Object? couponCode = freezed, - Object? request = freezed, - }) { - return _then(_$ApplePayParamsImpl( - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - additionalEnabledNetworks: freezed == additionalEnabledNetworks - ? _value._additionalEnabledNetworks - : additionalEnabledNetworks // ignore: cast_nullable_to_non_nullable - as List?, - cartItems: null == cartItems - ? _value._cartItems - : cartItems // ignore: cast_nullable_to_non_nullable - as List, - requiredShippingAddressFields: freezed == requiredShippingAddressFields - ? _value._requiredShippingAddressFields - : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable - as List?, - requiredBillingContactFields: freezed == requiredBillingContactFields - ? _value._requiredBillingContactFields - : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable - as List?, - shippingMethods: freezed == shippingMethods - ? _value._shippingMethods - : shippingMethods // ignore: cast_nullable_to_non_nullable - as List?, - merchantCapabilities: freezed == merchantCapabilities - ? _value._merchantCapabilities - : merchantCapabilities // ignore: cast_nullable_to_non_nullable - as List?, - shippingType: freezed == shippingType - ? _value.shippingType - : shippingType // ignore: cast_nullable_to_non_nullable - as ApplePayShippingType?, - supportedCountries: freezed == supportedCountries - ? _value._supportedCountries - : supportedCountries // ignore: cast_nullable_to_non_nullable - as List?, - supportsCouponCode: freezed == supportsCouponCode - ? _value.supportsCouponCode - : supportsCouponCode // ignore: cast_nullable_to_non_nullable - as bool?, - couponCode: freezed == couponCode - ? _value.couponCode - : couponCode // ignore: cast_nullable_to_non_nullable - as String?, - request: freezed == request - ? _value.request - : request // ignore: cast_nullable_to_non_nullable - as PaymentRequestType?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayParamsImpl implements _ApplePayParams { - const _$ApplePayParamsImpl( - {required this.merchantCountryCode, - required this.currencyCode, - final List? additionalEnabledNetworks, - required final List cartItems, - final List? requiredShippingAddressFields, - final List? requiredBillingContactFields, - final List? shippingMethods, - final List? merchantCapabilities, - this.shippingType, - final List? supportedCountries, - this.supportsCouponCode, - this.couponCode, - this.request}) - : _additionalEnabledNetworks = additionalEnabledNetworks, - _cartItems = cartItems, - _requiredShippingAddressFields = requiredShippingAddressFields, - _requiredBillingContactFields = requiredBillingContactFields, - _shippingMethods = shippingMethods, - _merchantCapabilities = merchantCapabilities, - _supportedCountries = supportedCountries; - - factory _$ApplePayParamsImpl.fromJson(Map json) => - _$$ApplePayParamsImplFromJson(json); - - /// ISO 3166-1 alpha-2 country code where the transaction is processed. - @override - final String merchantCountryCode; - - /// ISO 4217 alphabetic currency code. - @override - final String currencyCode; - - /// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. - final List? _additionalEnabledNetworks; - - /// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. - @override - List? get additionalEnabledNetworks { - final value = _additionalEnabledNetworks; - if (value == null) return null; - if (_additionalEnabledNetworks is EqualUnmodifiableListView) - return _additionalEnabledNetworks; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _ApplePayParams implements ApplePayParams { + const _ApplePayParams({required this.merchantCountryCode, required this.currencyCode, final List? additionalEnabledNetworks, required final List cartItems, final List? requiredShippingAddressFields, final List? requiredBillingContactFields, final List? shippingMethods, final List? merchantCapabilities, this.shippingType, final List? supportedCountries, this.supportsCouponCode, this.couponCode, this.request}): _additionalEnabledNetworks = additionalEnabledNetworks,_cartItems = cartItems,_requiredShippingAddressFields = requiredShippingAddressFields,_requiredBillingContactFields = requiredBillingContactFields,_shippingMethods = shippingMethods,_merchantCapabilities = merchantCapabilities,_supportedCountries = supportedCountries; + factory _ApplePayParams.fromJson(Map json) => _$ApplePayParamsFromJson(json); + +/// ISO 3166-1 alpha-2 country code where the transaction is processed. +@override final String merchantCountryCode; +/// ISO 4217 alphabetic currency code. +@override final String currencyCode; +/// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. + final List? _additionalEnabledNetworks; +/// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. +@override List? get additionalEnabledNetworks { + final value = _additionalEnabledNetworks; + if (value == null) return null; + if (_additionalEnabledNetworks is EqualUnmodifiableListView) return _additionalEnabledNetworks; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// The list of items that describe a purchase. For example: total, tax, discount, and grand total. + final List _cartItems; +/// The list of items that describe a purchase. For example: total, tax, discount, and grand total. +@override List get cartItems { + if (_cartItems is EqualUnmodifiableListView) return _cartItems; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_cartItems); +} + +/// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. + final List? _requiredShippingAddressFields; +/// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. +@override List? get requiredShippingAddressFields { + final value = _requiredShippingAddressFields; + if (value == null) return null; + if (_requiredShippingAddressFields is EqualUnmodifiableListView) return _requiredShippingAddressFields; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// The list of fields that you need for a billing contact in order to process the transaction. + final List? _requiredBillingContactFields; +/// The list of fields that you need for a billing contact in order to process the transaction. +@override List? get requiredBillingContactFields { + final value = _requiredBillingContactFields; + if (value == null) return null; + if (_requiredBillingContactFields is EqualUnmodifiableListView) return _requiredBillingContactFields; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. + final List? _shippingMethods; +/// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. +@override List? get shippingMethods { + final value = _shippingMethods; + if (value == null) return null; + if (_shippingMethods is EqualUnmodifiableListView) return _shippingMethods; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// Set the payment capabilities you support. If set, 3DS is required. + final List? _merchantCapabilities; +/// Set the payment capabilities you support. If set, 3DS is required. +@override List? get merchantCapabilities { + final value = _merchantCapabilities; + if (value == null) return null; + if (_merchantCapabilities is EqualUnmodifiableListView) return _merchantCapabilities; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// An optional value that indicates how to ship purchased items. Defaults to 'Shipping'. +@override final ApplePayShippingType? shippingType; +/// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. + final List? _supportedCountries; +/// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. +@override List? get supportedCountries { + final value = _supportedCountries; + if (value == null) return null; + if (_supportedCountries is EqualUnmodifiableListView) return _supportedCountries; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +/// Enables support for coupon codes in the Apple Pay button. +/// When this is set to true it shows the coupon code field and if [couponCode] +/// has a value it will display the value as default +/// +/// Supported on iOS 15 and higher. +@override final bool? supportsCouponCode; +/// Default coupon code display in the apple pay sheet +@override final String? couponCode; +/// Use this to support different types of payment request. +/// +/// Only supported on iOS 16 and higher. +@override final PaymentRequestType? request; + +/// Create a copy of ApplePayParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayParamsCopyWith<_ApplePayParams> get copyWith => __$ApplePayParamsCopyWithImpl<_ApplePayParams>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayParams&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&const DeepCollectionEquality().equals(other._additionalEnabledNetworks, _additionalEnabledNetworks)&&const DeepCollectionEquality().equals(other._cartItems, _cartItems)&&const DeepCollectionEquality().equals(other._requiredShippingAddressFields, _requiredShippingAddressFields)&&const DeepCollectionEquality().equals(other._requiredBillingContactFields, _requiredBillingContactFields)&&const DeepCollectionEquality().equals(other._shippingMethods, _shippingMethods)&&const DeepCollectionEquality().equals(other._merchantCapabilities, _merchantCapabilities)&&(identical(other.shippingType, shippingType) || other.shippingType == shippingType)&&const DeepCollectionEquality().equals(other._supportedCountries, _supportedCountries)&&(identical(other.supportsCouponCode, supportsCouponCode) || other.supportsCouponCode == supportsCouponCode)&&(identical(other.couponCode, couponCode) || other.couponCode == couponCode)&&(identical(other.request, request) || other.request == request)); +} - /// The list of items that describe a purchase. For example: total, tax, discount, and grand total. - final List _cartItems; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantCountryCode,currencyCode,const DeepCollectionEquality().hash(_additionalEnabledNetworks),const DeepCollectionEquality().hash(_cartItems),const DeepCollectionEquality().hash(_requiredShippingAddressFields),const DeepCollectionEquality().hash(_requiredBillingContactFields),const DeepCollectionEquality().hash(_shippingMethods),const DeepCollectionEquality().hash(_merchantCapabilities),shippingType,const DeepCollectionEquality().hash(_supportedCountries),supportsCouponCode,couponCode,request); - /// The list of items that describe a purchase. For example: total, tax, discount, and grand total. - @override - List get cartItems { - if (_cartItems is EqualUnmodifiableListView) return _cartItems; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_cartItems); - } +@override +String toString() { + return 'ApplePayParams(merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, additionalEnabledNetworks: $additionalEnabledNetworks, cartItems: $cartItems, requiredShippingAddressFields: $requiredShippingAddressFields, requiredBillingContactFields: $requiredBillingContactFields, shippingMethods: $shippingMethods, merchantCapabilities: $merchantCapabilities, shippingType: $shippingType, supportedCountries: $supportedCountries, supportsCouponCode: $supportsCouponCode, couponCode: $couponCode, request: $request)'; +} - /// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. - final List? _requiredShippingAddressFields; - - /// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. - @override - List? get requiredShippingAddressFields { - final value = _requiredShippingAddressFields; - if (value == null) return null; - if (_requiredShippingAddressFields is EqualUnmodifiableListView) - return _requiredShippingAddressFields; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - /// The list of fields that you need for a billing contact in order to process the transaction. - final List? _requiredBillingContactFields; - - /// The list of fields that you need for a billing contact in order to process the transaction. - @override - List? get requiredBillingContactFields { - final value = _requiredBillingContactFields; - if (value == null) return null; - if (_requiredBillingContactFields is EqualUnmodifiableListView) - return _requiredBillingContactFields; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +} - /// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. - final List? _shippingMethods; - - /// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. - @override - List? get shippingMethods { - final value = _shippingMethods; - if (value == null) return null; - if (_shippingMethods is EqualUnmodifiableListView) return _shippingMethods; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +/// @nodoc +abstract mixin class _$ApplePayParamsCopyWith<$Res> implements $ApplePayParamsCopyWith<$Res> { + factory _$ApplePayParamsCopyWith(_ApplePayParams value, $Res Function(_ApplePayParams) _then) = __$ApplePayParamsCopyWithImpl; +@override @useResult +$Res call({ + String merchantCountryCode, String currencyCode, List? additionalEnabledNetworks, List cartItems, List? requiredShippingAddressFields, List? requiredBillingContactFields, List? shippingMethods, List? merchantCapabilities, ApplePayShippingType? shippingType, List? supportedCountries, bool? supportsCouponCode, String? couponCode, PaymentRequestType? request +}); - /// Set the payment capabilities you support. If set, 3DS is required. - final List? _merchantCapabilities; - - /// Set the payment capabilities you support. If set, 3DS is required. - @override - List? get merchantCapabilities { - final value = _merchantCapabilities; - if (value == null) return null; - if (_merchantCapabilities is EqualUnmodifiableListView) - return _merchantCapabilities; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } - /// An optional value that indicates how to ship purchased items. Defaults to 'Shipping'. - @override - final ApplePayShippingType? shippingType; - - /// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. - final List? _supportedCountries; - - /// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. - @override - List? get supportedCountries { - final value = _supportedCountries; - if (value == null) return null; - if (_supportedCountries is EqualUnmodifiableListView) - return _supportedCountries; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +@override $PaymentRequestTypeCopyWith<$Res>? get request; - /// Enables support for coupon codes in the Apple Pay button. - /// When this is set to true it shows the coupon code field and if [couponCode] - /// has a value it will display the value as default - /// - /// Supported on iOS 15 and higher. - @override - final bool? supportsCouponCode; - - /// Default coupon code display in the apple pay sheet - @override - final String? couponCode; - - /// Use this to support different types of payment request. - /// - /// Only supported on iOS 16 and higher. - @override - final PaymentRequestType? request; - - @override - String toString() { - return 'ApplePayParams(merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, additionalEnabledNetworks: $additionalEnabledNetworks, cartItems: $cartItems, requiredShippingAddressFields: $requiredShippingAddressFields, requiredBillingContactFields: $requiredBillingContactFields, shippingMethods: $shippingMethods, merchantCapabilities: $merchantCapabilities, shippingType: $shippingType, supportedCountries: $supportedCountries, supportsCouponCode: $supportsCouponCode, couponCode: $couponCode, request: $request)'; - } +} +/// @nodoc +class __$ApplePayParamsCopyWithImpl<$Res> + implements _$ApplePayParamsCopyWith<$Res> { + __$ApplePayParamsCopyWithImpl(this._self, this._then); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayParamsImpl && - (identical(other.merchantCountryCode, merchantCountryCode) || - other.merchantCountryCode == merchantCountryCode) && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode) && - const DeepCollectionEquality().equals( - other._additionalEnabledNetworks, _additionalEnabledNetworks) && - const DeepCollectionEquality() - .equals(other._cartItems, _cartItems) && - const DeepCollectionEquality().equals( - other._requiredShippingAddressFields, - _requiredShippingAddressFields) && - const DeepCollectionEquality().equals( - other._requiredBillingContactFields, - _requiredBillingContactFields) && - const DeepCollectionEquality() - .equals(other._shippingMethods, _shippingMethods) && - const DeepCollectionEquality() - .equals(other._merchantCapabilities, _merchantCapabilities) && - (identical(other.shippingType, shippingType) || - other.shippingType == shippingType) && - const DeepCollectionEquality() - .equals(other._supportedCountries, _supportedCountries) && - (identical(other.supportsCouponCode, supportsCouponCode) || - other.supportsCouponCode == supportsCouponCode) && - (identical(other.couponCode, couponCode) || - other.couponCode == couponCode) && - (identical(other.request, request) || other.request == request)); - } + final _ApplePayParams _self; + final $Res Function(_ApplePayParams) _then; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - merchantCountryCode, - currencyCode, - const DeepCollectionEquality().hash(_additionalEnabledNetworks), - const DeepCollectionEquality().hash(_cartItems), - const DeepCollectionEquality().hash(_requiredShippingAddressFields), - const DeepCollectionEquality().hash(_requiredBillingContactFields), - const DeepCollectionEquality().hash(_shippingMethods), - const DeepCollectionEquality().hash(_merchantCapabilities), - shippingType, - const DeepCollectionEquality().hash(_supportedCountries), - supportsCouponCode, - couponCode, - request); - - /// Create a copy of ApplePayParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayParamsImplCopyWith<_$ApplePayParamsImpl> get copyWith => - __$$ApplePayParamsImplCopyWithImpl<_$ApplePayParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$ApplePayParamsImplToJson( - this, - ); - } +/// Create a copy of ApplePayParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? merchantCountryCode = null,Object? currencyCode = null,Object? additionalEnabledNetworks = freezed,Object? cartItems = null,Object? requiredShippingAddressFields = freezed,Object? requiredBillingContactFields = freezed,Object? shippingMethods = freezed,Object? merchantCapabilities = freezed,Object? shippingType = freezed,Object? supportedCountries = freezed,Object? supportsCouponCode = freezed,Object? couponCode = freezed,Object? request = freezed,}) { + return _then(_ApplePayParams( +merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,additionalEnabledNetworks: freezed == additionalEnabledNetworks ? _self._additionalEnabledNetworks : additionalEnabledNetworks // ignore: cast_nullable_to_non_nullable +as List?,cartItems: null == cartItems ? _self._cartItems : cartItems // ignore: cast_nullable_to_non_nullable +as List,requiredShippingAddressFields: freezed == requiredShippingAddressFields ? _self._requiredShippingAddressFields : requiredShippingAddressFields // ignore: cast_nullable_to_non_nullable +as List?,requiredBillingContactFields: freezed == requiredBillingContactFields ? _self._requiredBillingContactFields : requiredBillingContactFields // ignore: cast_nullable_to_non_nullable +as List?,shippingMethods: freezed == shippingMethods ? _self._shippingMethods : shippingMethods // ignore: cast_nullable_to_non_nullable +as List?,merchantCapabilities: freezed == merchantCapabilities ? _self._merchantCapabilities : merchantCapabilities // ignore: cast_nullable_to_non_nullable +as List?,shippingType: freezed == shippingType ? _self.shippingType : shippingType // ignore: cast_nullable_to_non_nullable +as ApplePayShippingType?,supportedCountries: freezed == supportedCountries ? _self._supportedCountries : supportedCountries // ignore: cast_nullable_to_non_nullable +as List?,supportsCouponCode: freezed == supportsCouponCode ? _self.supportsCouponCode : supportsCouponCode // ignore: cast_nullable_to_non_nullable +as bool?,couponCode: freezed == couponCode ? _self.couponCode : couponCode // ignore: cast_nullable_to_non_nullable +as String?,request: freezed == request ? _self.request : request // ignore: cast_nullable_to_non_nullable +as PaymentRequestType?, + )); } -abstract class _ApplePayParams implements ApplePayParams { - const factory _ApplePayParams( - {required final String merchantCountryCode, - required final String currencyCode, - final List? additionalEnabledNetworks, - required final List cartItems, - final List? requiredShippingAddressFields, - final List? requiredBillingContactFields, - final List? shippingMethods, - final List? merchantCapabilities, - final ApplePayShippingType? shippingType, - final List? supportedCountries, - final bool? supportsCouponCode, - final String? couponCode, - final PaymentRequestType? request}) = _$ApplePayParamsImpl; - - factory _ApplePayParams.fromJson(Map json) = - _$ApplePayParamsImpl.fromJson; - - /// ISO 3166-1 alpha-2 country code where the transaction is processed. - @override - String get merchantCountryCode; - - /// ISO 4217 alphabetic currency code. - @override - String get currencyCode; - - /// The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: ["JCB", "barcode", "chinaUnionPay"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. - @override - List? get additionalEnabledNetworks; - - /// The list of items that describe a purchase. For example: total, tax, discount, and grand total. - @override - List get cartItems; - - /// The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there. - @override - List? get requiredShippingAddressFields; - - /// The list of fields that you need for a billing contact in order to process the transaction. - @override - List? get requiredBillingContactFields; - - /// An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. - @override - List? get shippingMethods; - - /// Set the payment capabilities you support. If set, 3DS is required. - @override - List? get merchantCapabilities; - - /// An optional value that indicates how to ship purchased items. Defaults to 'Shipping'. - @override - ApplePayShippingType? get shippingType; - - /// A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. - @override - List? get supportedCountries; - - /// Enables support for coupon codes in the Apple Pay button. - /// When this is set to true it shows the coupon code field and if [couponCode] - /// has a value it will display the value as default - /// - /// Supported on iOS 15 and higher. - @override - bool? get supportsCouponCode; - - /// Default coupon code display in the apple pay sheet - @override - String? get couponCode; - - /// Use this to support different types of payment request. - /// - /// Only supported on iOS 16 and higher. - @override - PaymentRequestType? get request; - - /// Create a copy of ApplePayParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayParamsImplCopyWith<_$ApplePayParamsImpl> get copyWith => - throw _privateConstructorUsedError; -} - -GooglePayParams _$GooglePayParamsFromJson(Map json) { - return _GooglePayParams.fromJson(json); +/// Create a copy of ApplePayParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PaymentRequestTypeCopyWith<$Res>? get request { + if (_self.request == null) { + return null; + } + + return $PaymentRequestTypeCopyWith<$Res>(_self.request!, (value) { + return _then(_self.copyWith(request: value)); + }); +} } + /// @nodoc mixin _$GooglePayParams { + /** * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK. - Does not require the application to be uploaded to the Google Play Store. @@ -3790,220 +2769,230 @@ mixin _$GooglePayParams { - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential. - The user will see a warning message that the app is not recognized/verified. */ - bool get testEnv => throw _privateConstructorUsedError; - - /// ISO 3166-1 alpha-2 country code where the transaction is processed. - String get merchantCountryCode => throw _privateConstructorUsedError; + bool get testEnv;/// ISO 3166-1 alpha-2 country code where the transaction is processed. + String get merchantCountryCode;/// ISO 4217 alphabetic currency code. + String get currencyCode;/// Merchant name, displayed in the Google Pay sheet. + String? get merchantName;/// Set to true to request an email address. +/// +/// Defaults to false. + bool? get isEmailRequired;/// Set to false if you don't support credit cards. +/// +/// Defaults to true. + bool? get allowCreditCards;/// Describes the configuration for billing address collection in the Google Pay sheet. + GooglePayBillingAddressConfig? get billingAddressConfig; +/// Create a copy of GooglePayParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GooglePayParamsCopyWith get copyWith => _$GooglePayParamsCopyWithImpl(this as GooglePayParams, _$identity); - /// ISO 4217 alphabetic currency code. - String get currencyCode => throw _privateConstructorUsedError; + /// Serializes this GooglePayParams to a JSON map. + Map toJson(); - /// Merchant name, displayed in the Google Pay sheet. - String? get merchantName => throw _privateConstructorUsedError; - /// Set to true to request an email address. - /// - /// Defaults to false. - bool? get isEmailRequired => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GooglePayParams&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.merchantName, merchantName) || other.merchantName == merchantName)&&(identical(other.isEmailRequired, isEmailRequired) || other.isEmailRequired == isEmailRequired)&&(identical(other.allowCreditCards, allowCreditCards) || other.allowCreditCards == allowCreditCards)&&(identical(other.billingAddressConfig, billingAddressConfig) || other.billingAddressConfig == billingAddressConfig)); +} - /// Set to false if you don't support credit cards. - /// - /// Defaults to true. - bool? get allowCreditCards => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testEnv,merchantCountryCode,currencyCode,merchantName,isEmailRequired,allowCreditCards,billingAddressConfig); - /// Describes the configuration for billing address collection in the Google Pay sheet. - GooglePayBillingAddressConfig? get billingAddressConfig => - throw _privateConstructorUsedError; +@override +String toString() { + return 'GooglePayParams(testEnv: $testEnv, merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, merchantName: $merchantName, isEmailRequired: $isEmailRequired, allowCreditCards: $allowCreditCards, billingAddressConfig: $billingAddressConfig)'; +} - /// Serializes this GooglePayParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of GooglePayParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $GooglePayParamsCopyWith get copyWith => - throw _privateConstructorUsedError; } /// @nodoc -abstract class $GooglePayParamsCopyWith<$Res> { - factory $GooglePayParamsCopyWith( - GooglePayParams value, $Res Function(GooglePayParams) then) = - _$GooglePayParamsCopyWithImpl<$Res, GooglePayParams>; - @useResult - $Res call( - {bool testEnv, - String merchantCountryCode, - String currencyCode, - String? merchantName, - bool? isEmailRequired, - bool? allowCreditCards, - GooglePayBillingAddressConfig? billingAddressConfig}); - - $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig; -} +abstract mixin class $GooglePayParamsCopyWith<$Res> { + factory $GooglePayParamsCopyWith(GooglePayParams value, $Res Function(GooglePayParams) _then) = _$GooglePayParamsCopyWithImpl; +@useResult +$Res call({ + bool testEnv, String merchantCountryCode, String currencyCode, String? merchantName, bool? isEmailRequired, bool? allowCreditCards, GooglePayBillingAddressConfig? billingAddressConfig +}); -/// @nodoc -class _$GooglePayParamsCopyWithImpl<$Res, $Val extends GooglePayParams> - implements $GooglePayParamsCopyWith<$Res> { - _$GooglePayParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of GooglePayParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testEnv = null, - Object? merchantCountryCode = null, - Object? currencyCode = null, - Object? merchantName = freezed, - Object? isEmailRequired = freezed, - Object? allowCreditCards = freezed, - Object? billingAddressConfig = freezed, - }) { - return _then(_value.copyWith( - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - merchantName: freezed == merchantName - ? _value.merchantName - : merchantName // ignore: cast_nullable_to_non_nullable - as String?, - isEmailRequired: freezed == isEmailRequired - ? _value.isEmailRequired - : isEmailRequired // ignore: cast_nullable_to_non_nullable - as bool?, - allowCreditCards: freezed == allowCreditCards - ? _value.allowCreditCards - : allowCreditCards // ignore: cast_nullable_to_non_nullable - as bool?, - billingAddressConfig: freezed == billingAddressConfig - ? _value.billingAddressConfig - : billingAddressConfig // ignore: cast_nullable_to_non_nullable - as GooglePayBillingAddressConfig?, - ) as $Val); - } - /// Create a copy of GooglePayParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig { - if (_value.billingAddressConfig == null) { - return null; - } - - return $GooglePayBillingAddressConfigCopyWith<$Res>( - _value.billingAddressConfig!, (value) { - return _then(_value.copyWith(billingAddressConfig: value) as $Val); - }); - } -} +$GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig; +} /// @nodoc -abstract class _$$GooglePayParamsImplCopyWith<$Res> +class _$GooglePayParamsCopyWithImpl<$Res> implements $GooglePayParamsCopyWith<$Res> { - factory _$$GooglePayParamsImplCopyWith(_$GooglePayParamsImpl value, - $Res Function(_$GooglePayParamsImpl) then) = - __$$GooglePayParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool testEnv, - String merchantCountryCode, - String currencyCode, - String? merchantName, - bool? isEmailRequired, - bool? allowCreditCards, - GooglePayBillingAddressConfig? billingAddressConfig}); - - @override - $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig; + _$GooglePayParamsCopyWithImpl(this._self, this._then); + + final GooglePayParams _self; + final $Res Function(GooglePayParams) _then; + +/// Create a copy of GooglePayParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? testEnv = null,Object? merchantCountryCode = null,Object? currencyCode = null,Object? merchantName = freezed,Object? isEmailRequired = freezed,Object? allowCreditCards = freezed,Object? billingAddressConfig = freezed,}) { + return _then(_self.copyWith( +testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,merchantName: freezed == merchantName ? _self.merchantName : merchantName // ignore: cast_nullable_to_non_nullable +as String?,isEmailRequired: freezed == isEmailRequired ? _self.isEmailRequired : isEmailRequired // ignore: cast_nullable_to_non_nullable +as bool?,allowCreditCards: freezed == allowCreditCards ? _self.allowCreditCards : allowCreditCards // ignore: cast_nullable_to_non_nullable +as bool?,billingAddressConfig: freezed == billingAddressConfig ? _self.billingAddressConfig : billingAddressConfig // ignore: cast_nullable_to_non_nullable +as GooglePayBillingAddressConfig?, + )); +} +/// Create a copy of GooglePayParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig { + if (_self.billingAddressConfig == null) { + return null; + } + + return $GooglePayBillingAddressConfigCopyWith<$Res>(_self.billingAddressConfig!, (value) { + return _then(_self.copyWith(billingAddressConfig: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [GooglePayParams]. +extension GooglePayParamsPatterns on GooglePayParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GooglePayParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GooglePayParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GooglePayParams value) $default,){ +final _that = this; +switch (_that) { +case _GooglePayParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GooglePayParams value)? $default,){ +final _that = this; +switch (_that) { +case _GooglePayParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool testEnv, String merchantCountryCode, String currencyCode, String? merchantName, bool? isEmailRequired, bool? allowCreditCards, GooglePayBillingAddressConfig? billingAddressConfig)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GooglePayParams() when $default != null: +return $default(_that.testEnv,_that.merchantCountryCode,_that.currencyCode,_that.merchantName,_that.isEmailRequired,_that.allowCreditCards,_that.billingAddressConfig);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool testEnv, String merchantCountryCode, String currencyCode, String? merchantName, bool? isEmailRequired, bool? allowCreditCards, GooglePayBillingAddressConfig? billingAddressConfig) $default,) {final _that = this; +switch (_that) { +case _GooglePayParams(): +return $default(_that.testEnv,_that.merchantCountryCode,_that.currencyCode,_that.merchantName,_that.isEmailRequired,_that.allowCreditCards,_that.billingAddressConfig);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool testEnv, String merchantCountryCode, String currencyCode, String? merchantName, bool? isEmailRequired, bool? allowCreditCards, GooglePayBillingAddressConfig? billingAddressConfig)? $default,) {final _that = this; +switch (_that) { +case _GooglePayParams() when $default != null: +return $default(_that.testEnv,_that.merchantCountryCode,_that.currencyCode,_that.merchantName,_that.isEmailRequired,_that.allowCreditCards,_that.billingAddressConfig);case _: + return null; + +} } -/// @nodoc -class __$$GooglePayParamsImplCopyWithImpl<$Res> - extends _$GooglePayParamsCopyWithImpl<$Res, _$GooglePayParamsImpl> - implements _$$GooglePayParamsImplCopyWith<$Res> { - __$$GooglePayParamsImplCopyWithImpl( - _$GooglePayParamsImpl _value, $Res Function(_$GooglePayParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of GooglePayParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? testEnv = null, - Object? merchantCountryCode = null, - Object? currencyCode = null, - Object? merchantName = freezed, - Object? isEmailRequired = freezed, - Object? allowCreditCards = freezed, - Object? billingAddressConfig = freezed, - }) { - return _then(_$GooglePayParamsImpl( - testEnv: null == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool, - merchantCountryCode: null == merchantCountryCode - ? _value.merchantCountryCode - : merchantCountryCode // ignore: cast_nullable_to_non_nullable - as String, - currencyCode: null == currencyCode - ? _value.currencyCode - : currencyCode // ignore: cast_nullable_to_non_nullable - as String, - merchantName: freezed == merchantName - ? _value.merchantName - : merchantName // ignore: cast_nullable_to_non_nullable - as String?, - isEmailRequired: freezed == isEmailRequired - ? _value.isEmailRequired - : isEmailRequired // ignore: cast_nullable_to_non_nullable - as bool?, - allowCreditCards: freezed == allowCreditCards - ? _value.allowCreditCards - : allowCreditCards // ignore: cast_nullable_to_non_nullable - as bool?, - billingAddressConfig: freezed == billingAddressConfig - ? _value.billingAddressConfig - : billingAddressConfig // ignore: cast_nullable_to_non_nullable - as GooglePayBillingAddressConfig?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$GooglePayParamsImpl implements _GooglePayParams { - const _$GooglePayParamsImpl( - {this.testEnv = false, - required this.merchantCountryCode, - required this.currencyCode, - this.merchantName, - this.isEmailRequired, - this.allowCreditCards, - this.billingAddressConfig}); - - factory _$GooglePayParamsImpl.fromJson(Map json) => - _$$GooglePayParamsImplFromJson(json); +class _GooglePayParams implements GooglePayParams { + const _GooglePayParams({this.testEnv = false, required this.merchantCountryCode, required this.currencyCode, this.merchantName, this.isEmailRequired, this.allowCreditCards, this.billingAddressConfig}); + factory _GooglePayParams.fromJson(Map json) => _$GooglePayParamsFromJson(json); /** * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK. @@ -4012,3570 +3001,3009 @@ class _$GooglePayParamsImpl implements _GooglePayParams { - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential. - The user will see a warning message that the app is not recognized/verified. */ - @override - @JsonKey() - final bool testEnv; - - /// ISO 3166-1 alpha-2 country code where the transaction is processed. - @override - final String merchantCountryCode; - - /// ISO 4217 alphabetic currency code. - @override - final String currencyCode; - - /// Merchant name, displayed in the Google Pay sheet. - @override - final String? merchantName; - - /// Set to true to request an email address. - /// - /// Defaults to false. - @override - final bool? isEmailRequired; - - /// Set to false if you don't support credit cards. - /// - /// Defaults to true. - @override - final bool? allowCreditCards; - - /// Describes the configuration for billing address collection in the Google Pay sheet. - @override - final GooglePayBillingAddressConfig? billingAddressConfig; - - @override - String toString() { - return 'GooglePayParams(testEnv: $testEnv, merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, merchantName: $merchantName, isEmailRequired: $isEmailRequired, allowCreditCards: $allowCreditCards, billingAddressConfig: $billingAddressConfig)'; - } +@override@JsonKey() final bool testEnv; +/// ISO 3166-1 alpha-2 country code where the transaction is processed. +@override final String merchantCountryCode; +/// ISO 4217 alphabetic currency code. +@override final String currencyCode; +/// Merchant name, displayed in the Google Pay sheet. +@override final String? merchantName; +/// Set to true to request an email address. +/// +/// Defaults to false. +@override final bool? isEmailRequired; +/// Set to false if you don't support credit cards. +/// +/// Defaults to true. +@override final bool? allowCreditCards; +/// Describes the configuration for billing address collection in the Google Pay sheet. +@override final GooglePayBillingAddressConfig? billingAddressConfig; - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GooglePayParamsImpl && - (identical(other.testEnv, testEnv) || other.testEnv == testEnv) && - (identical(other.merchantCountryCode, merchantCountryCode) || - other.merchantCountryCode == merchantCountryCode) && - (identical(other.currencyCode, currencyCode) || - other.currencyCode == currencyCode) && - (identical(other.merchantName, merchantName) || - other.merchantName == merchantName) && - (identical(other.isEmailRequired, isEmailRequired) || - other.isEmailRequired == isEmailRequired) && - (identical(other.allowCreditCards, allowCreditCards) || - other.allowCreditCards == allowCreditCards) && - (identical(other.billingAddressConfig, billingAddressConfig) || - other.billingAddressConfig == billingAddressConfig)); - } +/// Create a copy of GooglePayParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GooglePayParamsCopyWith<_GooglePayParams> get copyWith => __$GooglePayParamsCopyWithImpl<_GooglePayParams>(this, _$identity); - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - testEnv, - merchantCountryCode, - currencyCode, - merchantName, - isEmailRequired, - allowCreditCards, - billingAddressConfig); - - /// Create a copy of GooglePayParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$GooglePayParamsImplCopyWith<_$GooglePayParamsImpl> get copyWith => - __$$GooglePayParamsImplCopyWithImpl<_$GooglePayParamsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$GooglePayParamsImplToJson( - this, - ); - } +@override +Map toJson() { + return _$GooglePayParamsToJson(this, ); } -abstract class _GooglePayParams implements GooglePayParams { - const factory _GooglePayParams( - {final bool testEnv, - required final String merchantCountryCode, - required final String currencyCode, - final String? merchantName, - final bool? isEmailRequired, - final bool? allowCreditCards, - final GooglePayBillingAddressConfig? billingAddressConfig}) = - _$GooglePayParamsImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GooglePayParams&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.merchantCountryCode, merchantCountryCode) || other.merchantCountryCode == merchantCountryCode)&&(identical(other.currencyCode, currencyCode) || other.currencyCode == currencyCode)&&(identical(other.merchantName, merchantName) || other.merchantName == merchantName)&&(identical(other.isEmailRequired, isEmailRequired) || other.isEmailRequired == isEmailRequired)&&(identical(other.allowCreditCards, allowCreditCards) || other.allowCreditCards == allowCreditCards)&&(identical(other.billingAddressConfig, billingAddressConfig) || other.billingAddressConfig == billingAddressConfig)); +} - factory _GooglePayParams.fromJson(Map json) = - _$GooglePayParamsImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,testEnv,merchantCountryCode,currencyCode,merchantName,isEmailRequired,allowCreditCards,billingAddressConfig); -/** - * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK. - - Does not require the application to be uploaded to the Google Play Store. - - Does not require a Google Pay Developer Profile. - - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential. - - The user will see a warning message that the app is not recognized/verified. - */ - @override - bool get testEnv; +@override +String toString() { + return 'GooglePayParams(testEnv: $testEnv, merchantCountryCode: $merchantCountryCode, currencyCode: $currencyCode, merchantName: $merchantName, isEmailRequired: $isEmailRequired, allowCreditCards: $allowCreditCards, billingAddressConfig: $billingAddressConfig)'; +} - /// ISO 3166-1 alpha-2 country code where the transaction is processed. - @override - String get merchantCountryCode; - /// ISO 4217 alphabetic currency code. - @override - String get currencyCode; +} + +/// @nodoc +abstract mixin class _$GooglePayParamsCopyWith<$Res> implements $GooglePayParamsCopyWith<$Res> { + factory _$GooglePayParamsCopyWith(_GooglePayParams value, $Res Function(_GooglePayParams) _then) = __$GooglePayParamsCopyWithImpl; +@override @useResult +$Res call({ + bool testEnv, String merchantCountryCode, String currencyCode, String? merchantName, bool? isEmailRequired, bool? allowCreditCards, GooglePayBillingAddressConfig? billingAddressConfig +}); - /// Merchant name, displayed in the Google Pay sheet. - @override - String? get merchantName; - /// Set to true to request an email address. - /// - /// Defaults to false. - @override - bool? get isEmailRequired; +@override $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig; - /// Set to false if you don't support credit cards. - /// - /// Defaults to true. - @override - bool? get allowCreditCards; +} +/// @nodoc +class __$GooglePayParamsCopyWithImpl<$Res> + implements _$GooglePayParamsCopyWith<$Res> { + __$GooglePayParamsCopyWithImpl(this._self, this._then); - /// Describes the configuration for billing address collection in the Google Pay sheet. - @override - GooglePayBillingAddressConfig? get billingAddressConfig; + final _GooglePayParams _self; + final $Res Function(_GooglePayParams) _then; - /// Create a copy of GooglePayParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$GooglePayParamsImplCopyWith<_$GooglePayParamsImpl> get copyWith => - throw _privateConstructorUsedError; +/// Create a copy of GooglePayParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? testEnv = null,Object? merchantCountryCode = null,Object? currencyCode = null,Object? merchantName = freezed,Object? isEmailRequired = freezed,Object? allowCreditCards = freezed,Object? billingAddressConfig = freezed,}) { + return _then(_GooglePayParams( +testEnv: null == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool,merchantCountryCode: null == merchantCountryCode ? _self.merchantCountryCode : merchantCountryCode // ignore: cast_nullable_to_non_nullable +as String,currencyCode: null == currencyCode ? _self.currencyCode : currencyCode // ignore: cast_nullable_to_non_nullable +as String,merchantName: freezed == merchantName ? _self.merchantName : merchantName // ignore: cast_nullable_to_non_nullable +as String?,isEmailRequired: freezed == isEmailRequired ? _self.isEmailRequired : isEmailRequired // ignore: cast_nullable_to_non_nullable +as bool?,allowCreditCards: freezed == allowCreditCards ? _self.allowCreditCards : allowCreditCards // ignore: cast_nullable_to_non_nullable +as bool?,billingAddressConfig: freezed == billingAddressConfig ? _self.billingAddressConfig : billingAddressConfig // ignore: cast_nullable_to_non_nullable +as GooglePayBillingAddressConfig?, + )); } -GooglePayPaymentMethodParams _$GooglePayPaymentMethodParamsFromJson( - Map json) { - return _GooglePayPaymentMethodParams.fromJson(json); +/// Create a copy of GooglePayParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig { + if (_self.billingAddressConfig == null) { + return null; + } + + return $GooglePayBillingAddressConfigCopyWith<$Res>(_self.billingAddressConfig!, (value) { + return _then(_self.copyWith(billingAddressConfig: value)); + }); +} } + /// @nodoc mixin _$GooglePayPaymentMethodParams { - /// If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. - /// - /// Defaults to false. - bool? get existingPaymentMethodRequired => throw _privateConstructorUsedError; - /// Total monetary value of the transaction. - /// Provide this value in the currency’s smallest unit. - int get amount => throw _privateConstructorUsedError; +/// If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. +/// +/// Defaults to false. + bool? get existingPaymentMethodRequired;/// Total monetary value of the transaction. +/// Provide this value in the currency’s smallest unit. + int get amount;/// Describes the configuration for billing address collection in the Google Pay sheet. + GooglePayBillingAddressConfig? get billingAddressConfig;/// Describes the configuration for shipping address collection in the Google Pay sheet. + GooglePayShippingAddressConfig? get shippingAddressConfig; +/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GooglePayPaymentMethodParamsCopyWith get copyWith => _$GooglePayPaymentMethodParamsCopyWithImpl(this as GooglePayPaymentMethodParams, _$identity); - /// Describes the configuration for billing address collection in the Google Pay sheet. - GooglePayBillingAddressConfig? get billingAddressConfig => - throw _privateConstructorUsedError; + /// Serializes this GooglePayPaymentMethodParams to a JSON map. + Map toJson(); - /// Describes the configuration for shipping address collection in the Google Pay sheet. - GooglePayShippingAddressConfig? get shippingAddressConfig => - throw _privateConstructorUsedError; - /// Serializes this GooglePayPaymentMethodParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GooglePayPaymentMethodParams&&(identical(other.existingPaymentMethodRequired, existingPaymentMethodRequired) || other.existingPaymentMethodRequired == existingPaymentMethodRequired)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.billingAddressConfig, billingAddressConfig) || other.billingAddressConfig == billingAddressConfig)&&(identical(other.shippingAddressConfig, shippingAddressConfig) || other.shippingAddressConfig == shippingAddressConfig)); +} - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $GooglePayPaymentMethodParamsCopyWith - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,existingPaymentMethodRequired,amount,billingAddressConfig,shippingAddressConfig); + +@override +String toString() { + return 'GooglePayPaymentMethodParams(existingPaymentMethodRequired: $existingPaymentMethodRequired, amount: $amount, billingAddressConfig: $billingAddressConfig, shippingAddressConfig: $shippingAddressConfig)'; } -/// @nodoc -abstract class $GooglePayPaymentMethodParamsCopyWith<$Res> { - factory $GooglePayPaymentMethodParamsCopyWith( - GooglePayPaymentMethodParams value, - $Res Function(GooglePayPaymentMethodParams) then) = - _$GooglePayPaymentMethodParamsCopyWithImpl<$Res, - GooglePayPaymentMethodParams>; - @useResult - $Res call( - {bool? existingPaymentMethodRequired, - int amount, - GooglePayBillingAddressConfig? billingAddressConfig, - GooglePayShippingAddressConfig? shippingAddressConfig}); - - $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig; - $GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig; + } /// @nodoc -class _$GooglePayPaymentMethodParamsCopyWithImpl<$Res, - $Val extends GooglePayPaymentMethodParams> - implements $GooglePayPaymentMethodParamsCopyWith<$Res> { - _$GooglePayPaymentMethodParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? existingPaymentMethodRequired = freezed, - Object? amount = null, - Object? billingAddressConfig = freezed, - Object? shippingAddressConfig = freezed, - }) { - return _then(_value.copyWith( - existingPaymentMethodRequired: freezed == existingPaymentMethodRequired - ? _value.existingPaymentMethodRequired - : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable - as bool?, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - billingAddressConfig: freezed == billingAddressConfig - ? _value.billingAddressConfig - : billingAddressConfig // ignore: cast_nullable_to_non_nullable - as GooglePayBillingAddressConfig?, - shippingAddressConfig: freezed == shippingAddressConfig - ? _value.shippingAddressConfig - : shippingAddressConfig // ignore: cast_nullable_to_non_nullable - as GooglePayShippingAddressConfig?, - ) as $Val); - } +abstract mixin class $GooglePayPaymentMethodParamsCopyWith<$Res> { + factory $GooglePayPaymentMethodParamsCopyWith(GooglePayPaymentMethodParams value, $Res Function(GooglePayPaymentMethodParams) _then) = _$GooglePayPaymentMethodParamsCopyWithImpl; +@useResult +$Res call({ + bool? existingPaymentMethodRequired, int amount, GooglePayBillingAddressConfig? billingAddressConfig, GooglePayShippingAddressConfig? shippingAddressConfig +}); - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig { - if (_value.billingAddressConfig == null) { - return null; - } - - return $GooglePayBillingAddressConfigCopyWith<$Res>( - _value.billingAddressConfig!, (value) { - return _then(_value.copyWith(billingAddressConfig: value) as $Val); - }); - } - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig { - if (_value.shippingAddressConfig == null) { - return null; - } - - return $GooglePayShippingAddressConfigCopyWith<$Res>( - _value.shippingAddressConfig!, (value) { - return _then(_value.copyWith(shippingAddressConfig: value) as $Val); - }); - } -} +$GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig;$GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig; +} /// @nodoc -abstract class _$$GooglePayPaymentMethodParamsImplCopyWith<$Res> +class _$GooglePayPaymentMethodParamsCopyWithImpl<$Res> implements $GooglePayPaymentMethodParamsCopyWith<$Res> { - factory _$$GooglePayPaymentMethodParamsImplCopyWith( - _$GooglePayPaymentMethodParamsImpl value, - $Res Function(_$GooglePayPaymentMethodParamsImpl) then) = - __$$GooglePayPaymentMethodParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool? existingPaymentMethodRequired, - int amount, - GooglePayBillingAddressConfig? billingAddressConfig, - GooglePayShippingAddressConfig? shippingAddressConfig}); - - @override - $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig; - @override - $GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig; + _$GooglePayPaymentMethodParamsCopyWithImpl(this._self, this._then); + + final GooglePayPaymentMethodParams _self; + final $Res Function(GooglePayPaymentMethodParams) _then; + +/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? existingPaymentMethodRequired = freezed,Object? amount = null,Object? billingAddressConfig = freezed,Object? shippingAddressConfig = freezed,}) { + return _then(_self.copyWith( +existingPaymentMethodRequired: freezed == existingPaymentMethodRequired ? _self.existingPaymentMethodRequired : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable +as bool?,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int,billingAddressConfig: freezed == billingAddressConfig ? _self.billingAddressConfig : billingAddressConfig // ignore: cast_nullable_to_non_nullable +as GooglePayBillingAddressConfig?,shippingAddressConfig: freezed == shippingAddressConfig ? _self.shippingAddressConfig : shippingAddressConfig // ignore: cast_nullable_to_non_nullable +as GooglePayShippingAddressConfig?, + )); +} +/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig { + if (_self.billingAddressConfig == null) { + return null; + } + + return $GooglePayBillingAddressConfigCopyWith<$Res>(_self.billingAddressConfig!, (value) { + return _then(_self.copyWith(billingAddressConfig: value)); + }); +}/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig { + if (_self.shippingAddressConfig == null) { + return null; + } + + return $GooglePayShippingAddressConfigCopyWith<$Res>(_self.shippingAddressConfig!, (value) { + return _then(_self.copyWith(shippingAddressConfig: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [GooglePayPaymentMethodParams]. +extension GooglePayPaymentMethodParamsPatterns on GooglePayPaymentMethodParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GooglePayPaymentMethodParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GooglePayPaymentMethodParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GooglePayPaymentMethodParams value) $default,){ +final _that = this; +switch (_that) { +case _GooglePayPaymentMethodParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GooglePayPaymentMethodParams value)? $default,){ +final _that = this; +switch (_that) { +case _GooglePayPaymentMethodParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? existingPaymentMethodRequired, int amount, GooglePayBillingAddressConfig? billingAddressConfig, GooglePayShippingAddressConfig? shippingAddressConfig)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GooglePayPaymentMethodParams() when $default != null: +return $default(_that.existingPaymentMethodRequired,_that.amount,_that.billingAddressConfig,_that.shippingAddressConfig);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? existingPaymentMethodRequired, int amount, GooglePayBillingAddressConfig? billingAddressConfig, GooglePayShippingAddressConfig? shippingAddressConfig) $default,) {final _that = this; +switch (_that) { +case _GooglePayPaymentMethodParams(): +return $default(_that.existingPaymentMethodRequired,_that.amount,_that.billingAddressConfig,_that.shippingAddressConfig);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? existingPaymentMethodRequired, int amount, GooglePayBillingAddressConfig? billingAddressConfig, GooglePayShippingAddressConfig? shippingAddressConfig)? $default,) {final _that = this; +switch (_that) { +case _GooglePayPaymentMethodParams() when $default != null: +return $default(_that.existingPaymentMethodRequired,_that.amount,_that.billingAddressConfig,_that.shippingAddressConfig);case _: + return null; + +} } -/// @nodoc -class __$$GooglePayPaymentMethodParamsImplCopyWithImpl<$Res> - extends _$GooglePayPaymentMethodParamsCopyWithImpl<$Res, - _$GooglePayPaymentMethodParamsImpl> - implements _$$GooglePayPaymentMethodParamsImplCopyWith<$Res> { - __$$GooglePayPaymentMethodParamsImplCopyWithImpl( - _$GooglePayPaymentMethodParamsImpl _value, - $Res Function(_$GooglePayPaymentMethodParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? existingPaymentMethodRequired = freezed, - Object? amount = null, - Object? billingAddressConfig = freezed, - Object? shippingAddressConfig = freezed, - }) { - return _then(_$GooglePayPaymentMethodParamsImpl( - existingPaymentMethodRequired: freezed == existingPaymentMethodRequired - ? _value.existingPaymentMethodRequired - : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable - as bool?, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, - billingAddressConfig: freezed == billingAddressConfig - ? _value.billingAddressConfig - : billingAddressConfig // ignore: cast_nullable_to_non_nullable - as GooglePayBillingAddressConfig?, - shippingAddressConfig: freezed == shippingAddressConfig - ? _value.shippingAddressConfig - : shippingAddressConfig // ignore: cast_nullable_to_non_nullable - as GooglePayShippingAddressConfig?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$GooglePayPaymentMethodParamsImpl - implements _GooglePayPaymentMethodParams { - const _$GooglePayPaymentMethodParamsImpl( - {this.existingPaymentMethodRequired, - required this.amount, - this.billingAddressConfig, - this.shippingAddressConfig}); - - factory _$GooglePayPaymentMethodParamsImpl.fromJson( - Map json) => - _$$GooglePayPaymentMethodParamsImplFromJson(json); - - /// If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. - /// - /// Defaults to false. - @override - final bool? existingPaymentMethodRequired; - - /// Total monetary value of the transaction. - /// Provide this value in the currency’s smallest unit. - @override - final int amount; - - /// Describes the configuration for billing address collection in the Google Pay sheet. - @override - final GooglePayBillingAddressConfig? billingAddressConfig; - - /// Describes the configuration for shipping address collection in the Google Pay sheet. - @override - final GooglePayShippingAddressConfig? shippingAddressConfig; - - @override - String toString() { - return 'GooglePayPaymentMethodParams(existingPaymentMethodRequired: $existingPaymentMethodRequired, amount: $amount, billingAddressConfig: $billingAddressConfig, shippingAddressConfig: $shippingAddressConfig)'; - } +class _GooglePayPaymentMethodParams implements GooglePayPaymentMethodParams { + const _GooglePayPaymentMethodParams({this.existingPaymentMethodRequired, required this.amount, this.billingAddressConfig, this.shippingAddressConfig}); + factory _GooglePayPaymentMethodParams.fromJson(Map json) => _$GooglePayPaymentMethodParamsFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GooglePayPaymentMethodParamsImpl && - (identical(other.existingPaymentMethodRequired, - existingPaymentMethodRequired) || - other.existingPaymentMethodRequired == - existingPaymentMethodRequired) && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.billingAddressConfig, billingAddressConfig) || - other.billingAddressConfig == billingAddressConfig) && - (identical(other.shippingAddressConfig, shippingAddressConfig) || - other.shippingAddressConfig == shippingAddressConfig)); - } +/// If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. +/// +/// Defaults to false. +@override final bool? existingPaymentMethodRequired; +/// Total monetary value of the transaction. +/// Provide this value in the currency’s smallest unit. +@override final int amount; +/// Describes the configuration for billing address collection in the Google Pay sheet. +@override final GooglePayBillingAddressConfig? billingAddressConfig; +/// Describes the configuration for shipping address collection in the Google Pay sheet. +@override final GooglePayShippingAddressConfig? shippingAddressConfig; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, existingPaymentMethodRequired, - amount, billingAddressConfig, shippingAddressConfig); - - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$GooglePayPaymentMethodParamsImplCopyWith< - _$GooglePayPaymentMethodParamsImpl> - get copyWith => __$$GooglePayPaymentMethodParamsImplCopyWithImpl< - _$GooglePayPaymentMethodParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$GooglePayPaymentMethodParamsImplToJson( - this, - ); - } +/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GooglePayPaymentMethodParamsCopyWith<_GooglePayPaymentMethodParams> get copyWith => __$GooglePayPaymentMethodParamsCopyWithImpl<_GooglePayPaymentMethodParams>(this, _$identity); + +@override +Map toJson() { + return _$GooglePayPaymentMethodParamsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GooglePayPaymentMethodParams&&(identical(other.existingPaymentMethodRequired, existingPaymentMethodRequired) || other.existingPaymentMethodRequired == existingPaymentMethodRequired)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.billingAddressConfig, billingAddressConfig) || other.billingAddressConfig == billingAddressConfig)&&(identical(other.shippingAddressConfig, shippingAddressConfig) || other.shippingAddressConfig == shippingAddressConfig)); } -abstract class _GooglePayPaymentMethodParams - implements GooglePayPaymentMethodParams { - const factory _GooglePayPaymentMethodParams( - {final bool? existingPaymentMethodRequired, - required final int amount, - final GooglePayBillingAddressConfig? billingAddressConfig, - final GooglePayShippingAddressConfig? shippingAddressConfig}) = - _$GooglePayPaymentMethodParamsImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,existingPaymentMethodRequired,amount,billingAddressConfig,shippingAddressConfig); - factory _GooglePayPaymentMethodParams.fromJson(Map json) = - _$GooglePayPaymentMethodParamsImpl.fromJson; +@override +String toString() { + return 'GooglePayPaymentMethodParams(existingPaymentMethodRequired: $existingPaymentMethodRequired, amount: $amount, billingAddressConfig: $billingAddressConfig, shippingAddressConfig: $shippingAddressConfig)'; +} - /// If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. - /// - /// Defaults to false. - @override - bool? get existingPaymentMethodRequired; - /// Total monetary value of the transaction. - /// Provide this value in the currency’s smallest unit. - @override - int get amount; +} - /// Describes the configuration for billing address collection in the Google Pay sheet. - @override - GooglePayBillingAddressConfig? get billingAddressConfig; +/// @nodoc +abstract mixin class _$GooglePayPaymentMethodParamsCopyWith<$Res> implements $GooglePayPaymentMethodParamsCopyWith<$Res> { + factory _$GooglePayPaymentMethodParamsCopyWith(_GooglePayPaymentMethodParams value, $Res Function(_GooglePayPaymentMethodParams) _then) = __$GooglePayPaymentMethodParamsCopyWithImpl; +@override @useResult +$Res call({ + bool? existingPaymentMethodRequired, int amount, GooglePayBillingAddressConfig? billingAddressConfig, GooglePayShippingAddressConfig? shippingAddressConfig +}); - /// Describes the configuration for shipping address collection in the Google Pay sheet. - @override - GooglePayShippingAddressConfig? get shippingAddressConfig; - /// Create a copy of GooglePayPaymentMethodParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$GooglePayPaymentMethodParamsImplCopyWith< - _$GooglePayPaymentMethodParamsImpl> - get copyWith => throw _privateConstructorUsedError; +@override $GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig;@override $GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig; + } +/// @nodoc +class __$GooglePayPaymentMethodParamsCopyWithImpl<$Res> + implements _$GooglePayPaymentMethodParamsCopyWith<$Res> { + __$GooglePayPaymentMethodParamsCopyWithImpl(this._self, this._then); + + final _GooglePayPaymentMethodParams _self; + final $Res Function(_GooglePayPaymentMethodParams) _then; -GooglePayBillingAddressConfig _$GooglePayBillingAddressConfigFromJson( - Map json) { - return _GooglePayBillingAddressConfig.fromJson(json); +/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? existingPaymentMethodRequired = freezed,Object? amount = null,Object? billingAddressConfig = freezed,Object? shippingAddressConfig = freezed,}) { + return _then(_GooglePayPaymentMethodParams( +existingPaymentMethodRequired: freezed == existingPaymentMethodRequired ? _self.existingPaymentMethodRequired : existingPaymentMethodRequired // ignore: cast_nullable_to_non_nullable +as bool?,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int,billingAddressConfig: freezed == billingAddressConfig ? _self.billingAddressConfig : billingAddressConfig // ignore: cast_nullable_to_non_nullable +as GooglePayBillingAddressConfig?,shippingAddressConfig: freezed == shippingAddressConfig ? _self.shippingAddressConfig : shippingAddressConfig // ignore: cast_nullable_to_non_nullable +as GooglePayShippingAddressConfig?, + )); } +/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayBillingAddressConfigCopyWith<$Res>? get billingAddressConfig { + if (_self.billingAddressConfig == null) { + return null; + } + + return $GooglePayBillingAddressConfigCopyWith<$Res>(_self.billingAddressConfig!, (value) { + return _then(_self.copyWith(billingAddressConfig: value)); + }); +}/// Create a copy of GooglePayPaymentMethodParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayShippingAddressConfigCopyWith<$Res>? get shippingAddressConfig { + if (_self.shippingAddressConfig == null) { + return null; + } + + return $GooglePayShippingAddressConfigCopyWith<$Res>(_self.shippingAddressConfig!, (value) { + return _then(_self.copyWith(shippingAddressConfig: value)); + }); +} +} + + /// @nodoc mixin _$GooglePayBillingAddressConfig { - /// Set to true if billing address is required for payment. - /// - /// Defaults to false. - bool? get isRequired => throw _privateConstructorUsedError; - /// Set to true if phone number is required for payment. - /// - /// Defaults to false. - bool? get isPhoneNumberRequired => throw _privateConstructorUsedError; - - /// Defines what address fields to collect. - /// - /// Defaults to [BillingAddressFormat.MIN] - BillingAddressFormat? get format => throw _privateConstructorUsedError; +/// Set to true if billing address is required for payment. +/// +/// Defaults to false. + bool? get isRequired;/// Set to true if phone number is required for payment. +/// +/// Defaults to false. + bool? get isPhoneNumberRequired;/// Defines what address fields to collect. +/// +/// Defaults to [BillingAddressFormat.MIN] + BillingAddressFormat? get format; +/// Create a copy of GooglePayBillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GooglePayBillingAddressConfigCopyWith get copyWith => _$GooglePayBillingAddressConfigCopyWithImpl(this as GooglePayBillingAddressConfig, _$identity); /// Serializes this GooglePayBillingAddressConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of GooglePayBillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $GooglePayBillingAddressConfigCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GooglePayBillingAddressConfig&&(identical(other.isRequired, isRequired) || other.isRequired == isRequired)&&(identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || other.isPhoneNumberRequired == isPhoneNumberRequired)&&(identical(other.format, format) || other.format == format)); } -/// @nodoc -abstract class $GooglePayBillingAddressConfigCopyWith<$Res> { - factory $GooglePayBillingAddressConfigCopyWith( - GooglePayBillingAddressConfig value, - $Res Function(GooglePayBillingAddressConfig) then) = - _$GooglePayBillingAddressConfigCopyWithImpl<$Res, - GooglePayBillingAddressConfig>; - @useResult - $Res call( - {bool? isRequired, - bool? isPhoneNumberRequired, - BillingAddressFormat? format}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isRequired,isPhoneNumberRequired,format); + +@override +String toString() { + return 'GooglePayBillingAddressConfig(isRequired: $isRequired, isPhoneNumberRequired: $isPhoneNumberRequired, format: $format)'; } -/// @nodoc -class _$GooglePayBillingAddressConfigCopyWithImpl<$Res, - $Val extends GooglePayBillingAddressConfig> - implements $GooglePayBillingAddressConfigCopyWith<$Res> { - _$GooglePayBillingAddressConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of GooglePayBillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isRequired = freezed, - Object? isPhoneNumberRequired = freezed, - Object? format = freezed, - }) { - return _then(_value.copyWith( - isRequired: freezed == isRequired - ? _value.isRequired - : isRequired // ignore: cast_nullable_to_non_nullable - as bool?, - isPhoneNumberRequired: freezed == isPhoneNumberRequired - ? _value.isPhoneNumberRequired - : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable - as bool?, - format: freezed == format - ? _value.format - : format // ignore: cast_nullable_to_non_nullable - as BillingAddressFormat?, - ) as $Val); - } + } /// @nodoc -abstract class _$$GooglePayBillingAddressConfigImplCopyWith<$Res> +abstract mixin class $GooglePayBillingAddressConfigCopyWith<$Res> { + factory $GooglePayBillingAddressConfigCopyWith(GooglePayBillingAddressConfig value, $Res Function(GooglePayBillingAddressConfig) _then) = _$GooglePayBillingAddressConfigCopyWithImpl; +@useResult +$Res call({ + bool? isRequired, bool? isPhoneNumberRequired, BillingAddressFormat? format +}); + + + + +} +/// @nodoc +class _$GooglePayBillingAddressConfigCopyWithImpl<$Res> implements $GooglePayBillingAddressConfigCopyWith<$Res> { - factory _$$GooglePayBillingAddressConfigImplCopyWith( - _$GooglePayBillingAddressConfigImpl value, - $Res Function(_$GooglePayBillingAddressConfigImpl) then) = - __$$GooglePayBillingAddressConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool? isRequired, - bool? isPhoneNumberRequired, - BillingAddressFormat? format}); + _$GooglePayBillingAddressConfigCopyWithImpl(this._self, this._then); + + final GooglePayBillingAddressConfig _self; + final $Res Function(GooglePayBillingAddressConfig) _then; + +/// Create a copy of GooglePayBillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isRequired = freezed,Object? isPhoneNumberRequired = freezed,Object? format = freezed,}) { + return _then(_self.copyWith( +isRequired: freezed == isRequired ? _self.isRequired : isRequired // ignore: cast_nullable_to_non_nullable +as bool?,isPhoneNumberRequired: freezed == isPhoneNumberRequired ? _self.isPhoneNumberRequired : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable +as bool?,format: freezed == format ? _self.format : format // ignore: cast_nullable_to_non_nullable +as BillingAddressFormat?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GooglePayBillingAddressConfig]. +extension GooglePayBillingAddressConfigPatterns on GooglePayBillingAddressConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GooglePayBillingAddressConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GooglePayBillingAddressConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GooglePayBillingAddressConfig value) $default,){ +final _that = this; +switch (_that) { +case _GooglePayBillingAddressConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GooglePayBillingAddressConfig value)? $default,){ +final _that = this; +switch (_that) { +case _GooglePayBillingAddressConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? isRequired, bool? isPhoneNumberRequired, BillingAddressFormat? format)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GooglePayBillingAddressConfig() when $default != null: +return $default(_that.isRequired,_that.isPhoneNumberRequired,_that.format);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? isRequired, bool? isPhoneNumberRequired, BillingAddressFormat? format) $default,) {final _that = this; +switch (_that) { +case _GooglePayBillingAddressConfig(): +return $default(_that.isRequired,_that.isPhoneNumberRequired,_that.format);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? isRequired, bool? isPhoneNumberRequired, BillingAddressFormat? format)? $default,) {final _that = this; +switch (_that) { +case _GooglePayBillingAddressConfig() when $default != null: +return $default(_that.isRequired,_that.isPhoneNumberRequired,_that.format);case _: + return null; + +} } -/// @nodoc -class __$$GooglePayBillingAddressConfigImplCopyWithImpl<$Res> - extends _$GooglePayBillingAddressConfigCopyWithImpl<$Res, - _$GooglePayBillingAddressConfigImpl> - implements _$$GooglePayBillingAddressConfigImplCopyWith<$Res> { - __$$GooglePayBillingAddressConfigImplCopyWithImpl( - _$GooglePayBillingAddressConfigImpl _value, - $Res Function(_$GooglePayBillingAddressConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of GooglePayBillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isRequired = freezed, - Object? isPhoneNumberRequired = freezed, - Object? format = freezed, - }) { - return _then(_$GooglePayBillingAddressConfigImpl( - isRequired: freezed == isRequired - ? _value.isRequired - : isRequired // ignore: cast_nullable_to_non_nullable - as bool?, - isPhoneNumberRequired: freezed == isPhoneNumberRequired - ? _value.isPhoneNumberRequired - : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable - as bool?, - format: freezed == format - ? _value.format - : format // ignore: cast_nullable_to_non_nullable - as BillingAddressFormat?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$GooglePayBillingAddressConfigImpl - implements _GooglePayBillingAddressConfig { - const _$GooglePayBillingAddressConfigImpl( - {this.isRequired, this.isPhoneNumberRequired, this.format}); - - factory _$GooglePayBillingAddressConfigImpl.fromJson( - Map json) => - _$$GooglePayBillingAddressConfigImplFromJson(json); - - /// Set to true if billing address is required for payment. - /// - /// Defaults to false. - @override - final bool? isRequired; - - /// Set to true if phone number is required for payment. - /// - /// Defaults to false. - @override - final bool? isPhoneNumberRequired; - - /// Defines what address fields to collect. - /// - /// Defaults to [BillingAddressFormat.MIN] - @override - final BillingAddressFormat? format; - - @override - String toString() { - return 'GooglePayBillingAddressConfig(isRequired: $isRequired, isPhoneNumberRequired: $isPhoneNumberRequired, format: $format)'; - } +class _GooglePayBillingAddressConfig implements GooglePayBillingAddressConfig { + const _GooglePayBillingAddressConfig({this.isRequired, this.isPhoneNumberRequired, this.format}); + factory _GooglePayBillingAddressConfig.fromJson(Map json) => _$GooglePayBillingAddressConfigFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GooglePayBillingAddressConfigImpl && - (identical(other.isRequired, isRequired) || - other.isRequired == isRequired) && - (identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || - other.isPhoneNumberRequired == isPhoneNumberRequired) && - (identical(other.format, format) || other.format == format)); - } +/// Set to true if billing address is required for payment. +/// +/// Defaults to false. +@override final bool? isRequired; +/// Set to true if phone number is required for payment. +/// +/// Defaults to false. +@override final bool? isPhoneNumberRequired; +/// Defines what address fields to collect. +/// +/// Defaults to [BillingAddressFormat.MIN] +@override final BillingAddressFormat? format; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, isRequired, isPhoneNumberRequired, format); - - /// Create a copy of GooglePayBillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$GooglePayBillingAddressConfigImplCopyWith< - _$GooglePayBillingAddressConfigImpl> - get copyWith => __$$GooglePayBillingAddressConfigImplCopyWithImpl< - _$GooglePayBillingAddressConfigImpl>(this, _$identity); - - @override - Map toJson() { - return _$$GooglePayBillingAddressConfigImplToJson( - this, - ); - } +/// Create a copy of GooglePayBillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GooglePayBillingAddressConfigCopyWith<_GooglePayBillingAddressConfig> get copyWith => __$GooglePayBillingAddressConfigCopyWithImpl<_GooglePayBillingAddressConfig>(this, _$identity); + +@override +Map toJson() { + return _$GooglePayBillingAddressConfigToJson(this, ); } -abstract class _GooglePayBillingAddressConfig - implements GooglePayBillingAddressConfig { - const factory _GooglePayBillingAddressConfig( - {final bool? isRequired, - final bool? isPhoneNumberRequired, - final BillingAddressFormat? format}) = - _$GooglePayBillingAddressConfigImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GooglePayBillingAddressConfig&&(identical(other.isRequired, isRequired) || other.isRequired == isRequired)&&(identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || other.isPhoneNumberRequired == isPhoneNumberRequired)&&(identical(other.format, format) || other.format == format)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isRequired,isPhoneNumberRequired,format); + +@override +String toString() { + return 'GooglePayBillingAddressConfig(isRequired: $isRequired, isPhoneNumberRequired: $isPhoneNumberRequired, format: $format)'; +} + + +} - factory _GooglePayBillingAddressConfig.fromJson(Map json) = - _$GooglePayBillingAddressConfigImpl.fromJson; +/// @nodoc +abstract mixin class _$GooglePayBillingAddressConfigCopyWith<$Res> implements $GooglePayBillingAddressConfigCopyWith<$Res> { + factory _$GooglePayBillingAddressConfigCopyWith(_GooglePayBillingAddressConfig value, $Res Function(_GooglePayBillingAddressConfig) _then) = __$GooglePayBillingAddressConfigCopyWithImpl; +@override @useResult +$Res call({ + bool? isRequired, bool? isPhoneNumberRequired, BillingAddressFormat? format +}); - /// Set to true if billing address is required for payment. - /// - /// Defaults to false. - @override - bool? get isRequired; - /// Set to true if phone number is required for payment. - /// - /// Defaults to false. - @override - bool? get isPhoneNumberRequired; - /// Defines what address fields to collect. - /// - /// Defaults to [BillingAddressFormat.MIN] - @override - BillingAddressFormat? get format; - /// Create a copy of GooglePayBillingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$GooglePayBillingAddressConfigImplCopyWith< - _$GooglePayBillingAddressConfigImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$GooglePayBillingAddressConfigCopyWithImpl<$Res> + implements _$GooglePayBillingAddressConfigCopyWith<$Res> { + __$GooglePayBillingAddressConfigCopyWithImpl(this._self, this._then); -GooglePayShippingAddressConfig _$GooglePayShippingAddressConfigFromJson( - Map json) { - return _GooglePayShippingAddressConfig.fromJson(json); + final _GooglePayBillingAddressConfig _self; + final $Res Function(_GooglePayBillingAddressConfig) _then; + +/// Create a copy of GooglePayBillingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isRequired = freezed,Object? isPhoneNumberRequired = freezed,Object? format = freezed,}) { + return _then(_GooglePayBillingAddressConfig( +isRequired: freezed == isRequired ? _self.isRequired : isRequired // ignore: cast_nullable_to_non_nullable +as bool?,isPhoneNumberRequired: freezed == isPhoneNumberRequired ? _self.isPhoneNumberRequired : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable +as bool?,format: freezed == format ? _self.format : format // ignore: cast_nullable_to_non_nullable +as BillingAddressFormat?, + )); } + +} + + /// @nodoc mixin _$GooglePayShippingAddressConfig { - /// Set to true if shipping address is required for payment. - /// - /// Defaults to false - bool? get isRequired => throw _privateConstructorUsedError; - - /// Set to true if phone number is required for payment. - /// - /// Defaults to false. - bool? get isPhoneNumberRequired => throw _privateConstructorUsedError; - /// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. - /// - /// Defaults to all shipping address countries. - List? get allowedCountryCodes => throw _privateConstructorUsedError; +/// Set to true if shipping address is required for payment. +/// +/// Defaults to false + bool? get isRequired;/// Set to true if phone number is required for payment. +/// +/// Defaults to false. + bool? get isPhoneNumberRequired;/// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. +/// +/// Defaults to all shipping address countries. + List? get allowedCountryCodes; +/// Create a copy of GooglePayShippingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GooglePayShippingAddressConfigCopyWith get copyWith => _$GooglePayShippingAddressConfigCopyWithImpl(this as GooglePayShippingAddressConfig, _$identity); /// Serializes this GooglePayShippingAddressConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of GooglePayShippingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $GooglePayShippingAddressConfigCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GooglePayShippingAddressConfig&&(identical(other.isRequired, isRequired) || other.isRequired == isRequired)&&(identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || other.isPhoneNumberRequired == isPhoneNumberRequired)&&const DeepCollectionEquality().equals(other.allowedCountryCodes, allowedCountryCodes)); } -/// @nodoc -abstract class $GooglePayShippingAddressConfigCopyWith<$Res> { - factory $GooglePayShippingAddressConfigCopyWith( - GooglePayShippingAddressConfig value, - $Res Function(GooglePayShippingAddressConfig) then) = - _$GooglePayShippingAddressConfigCopyWithImpl<$Res, - GooglePayShippingAddressConfig>; - @useResult - $Res call( - {bool? isRequired, - bool? isPhoneNumberRequired, - List? allowedCountryCodes}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isRequired,isPhoneNumberRequired,const DeepCollectionEquality().hash(allowedCountryCodes)); + +@override +String toString() { + return 'GooglePayShippingAddressConfig(isRequired: $isRequired, isPhoneNumberRequired: $isPhoneNumberRequired, allowedCountryCodes: $allowedCountryCodes)'; } -/// @nodoc -class _$GooglePayShippingAddressConfigCopyWithImpl<$Res, - $Val extends GooglePayShippingAddressConfig> - implements $GooglePayShippingAddressConfigCopyWith<$Res> { - _$GooglePayShippingAddressConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of GooglePayShippingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isRequired = freezed, - Object? isPhoneNumberRequired = freezed, - Object? allowedCountryCodes = freezed, - }) { - return _then(_value.copyWith( - isRequired: freezed == isRequired - ? _value.isRequired - : isRequired // ignore: cast_nullable_to_non_nullable - as bool?, - isPhoneNumberRequired: freezed == isPhoneNumberRequired - ? _value.isPhoneNumberRequired - : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable - as bool?, - allowedCountryCodes: freezed == allowedCountryCodes - ? _value.allowedCountryCodes - : allowedCountryCodes // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); - } + } /// @nodoc -abstract class _$$GooglePayShippingAddressConfigImplCopyWith<$Res> +abstract mixin class $GooglePayShippingAddressConfigCopyWith<$Res> { + factory $GooglePayShippingAddressConfigCopyWith(GooglePayShippingAddressConfig value, $Res Function(GooglePayShippingAddressConfig) _then) = _$GooglePayShippingAddressConfigCopyWithImpl; +@useResult +$Res call({ + bool? isRequired, bool? isPhoneNumberRequired, List? allowedCountryCodes +}); + + + + +} +/// @nodoc +class _$GooglePayShippingAddressConfigCopyWithImpl<$Res> implements $GooglePayShippingAddressConfigCopyWith<$Res> { - factory _$$GooglePayShippingAddressConfigImplCopyWith( - _$GooglePayShippingAddressConfigImpl value, - $Res Function(_$GooglePayShippingAddressConfigImpl) then) = - __$$GooglePayShippingAddressConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool? isRequired, - bool? isPhoneNumberRequired, - List? allowedCountryCodes}); + _$GooglePayShippingAddressConfigCopyWithImpl(this._self, this._then); + + final GooglePayShippingAddressConfig _self; + final $Res Function(GooglePayShippingAddressConfig) _then; + +/// Create a copy of GooglePayShippingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isRequired = freezed,Object? isPhoneNumberRequired = freezed,Object? allowedCountryCodes = freezed,}) { + return _then(_self.copyWith( +isRequired: freezed == isRequired ? _self.isRequired : isRequired // ignore: cast_nullable_to_non_nullable +as bool?,isPhoneNumberRequired: freezed == isPhoneNumberRequired ? _self.isPhoneNumberRequired : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable +as bool?,allowedCountryCodes: freezed == allowedCountryCodes ? _self.allowedCountryCodes : allowedCountryCodes // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GooglePayShippingAddressConfig]. +extension GooglePayShippingAddressConfigPatterns on GooglePayShippingAddressConfig { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GooglePayShippingAddressConfig value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GooglePayShippingAddressConfig() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GooglePayShippingAddressConfig value) $default,){ +final _that = this; +switch (_that) { +case _GooglePayShippingAddressConfig(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GooglePayShippingAddressConfig value)? $default,){ +final _that = this; +switch (_that) { +case _GooglePayShippingAddressConfig() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool? isRequired, bool? isPhoneNumberRequired, List? allowedCountryCodes)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GooglePayShippingAddressConfig() when $default != null: +return $default(_that.isRequired,_that.isPhoneNumberRequired,_that.allowedCountryCodes);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool? isRequired, bool? isPhoneNumberRequired, List? allowedCountryCodes) $default,) {final _that = this; +switch (_that) { +case _GooglePayShippingAddressConfig(): +return $default(_that.isRequired,_that.isPhoneNumberRequired,_that.allowedCountryCodes);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool? isRequired, bool? isPhoneNumberRequired, List? allowedCountryCodes)? $default,) {final _that = this; +switch (_that) { +case _GooglePayShippingAddressConfig() when $default != null: +return $default(_that.isRequired,_that.isPhoneNumberRequired,_that.allowedCountryCodes);case _: + return null; + +} } -/// @nodoc -class __$$GooglePayShippingAddressConfigImplCopyWithImpl<$Res> - extends _$GooglePayShippingAddressConfigCopyWithImpl<$Res, - _$GooglePayShippingAddressConfigImpl> - implements _$$GooglePayShippingAddressConfigImplCopyWith<$Res> { - __$$GooglePayShippingAddressConfigImplCopyWithImpl( - _$GooglePayShippingAddressConfigImpl _value, - $Res Function(_$GooglePayShippingAddressConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of GooglePayShippingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isRequired = freezed, - Object? isPhoneNumberRequired = freezed, - Object? allowedCountryCodes = freezed, - }) { - return _then(_$GooglePayShippingAddressConfigImpl( - isRequired: freezed == isRequired - ? _value.isRequired - : isRequired // ignore: cast_nullable_to_non_nullable - as bool?, - isPhoneNumberRequired: freezed == isPhoneNumberRequired - ? _value.isPhoneNumberRequired - : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable - as bool?, - allowedCountryCodes: freezed == allowedCountryCodes - ? _value._allowedCountryCodes - : allowedCountryCodes // ignore: cast_nullable_to_non_nullable - as List?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$GooglePayShippingAddressConfigImpl - implements _GooglePayShippingAddressConfig { - const _$GooglePayShippingAddressConfigImpl( - {this.isRequired, - this.isPhoneNumberRequired, - final List? allowedCountryCodes}) - : _allowedCountryCodes = allowedCountryCodes; - - factory _$GooglePayShippingAddressConfigImpl.fromJson( - Map json) => - _$$GooglePayShippingAddressConfigImplFromJson(json); - - /// Set to true if shipping address is required for payment. - /// - /// Defaults to false - @override - final bool? isRequired; - - /// Set to true if phone number is required for payment. - /// - /// Defaults to false. - @override - final bool? isPhoneNumberRequired; - - /// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. - /// - /// Defaults to all shipping address countries. - final List? _allowedCountryCodes; - - /// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. - /// - /// Defaults to all shipping address countries. - @override - List? get allowedCountryCodes { - final value = _allowedCountryCodes; - if (value == null) return null; - if (_allowedCountryCodes is EqualUnmodifiableListView) - return _allowedCountryCodes; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); - } +class _GooglePayShippingAddressConfig implements GooglePayShippingAddressConfig { + const _GooglePayShippingAddressConfig({this.isRequired, this.isPhoneNumberRequired, final List? allowedCountryCodes}): _allowedCountryCodes = allowedCountryCodes; + factory _GooglePayShippingAddressConfig.fromJson(Map json) => _$GooglePayShippingAddressConfigFromJson(json); - @override - String toString() { - return 'GooglePayShippingAddressConfig(isRequired: $isRequired, isPhoneNumberRequired: $isPhoneNumberRequired, allowedCountryCodes: $allowedCountryCodes)'; - } +/// Set to true if shipping address is required for payment. +/// +/// Defaults to false +@override final bool? isRequired; +/// Set to true if phone number is required for payment. +/// +/// Defaults to false. +@override final bool? isPhoneNumberRequired; +/// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. +/// +/// Defaults to all shipping address countries. + final List? _allowedCountryCodes; +/// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. +/// +/// Defaults to all shipping address countries. +@override List? get allowedCountryCodes { + final value = _allowedCountryCodes; + if (value == null) return null; + if (_allowedCountryCodes is EqualUnmodifiableListView) return _allowedCountryCodes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GooglePayShippingAddressConfigImpl && - (identical(other.isRequired, isRequired) || - other.isRequired == isRequired) && - (identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || - other.isPhoneNumberRequired == isPhoneNumberRequired) && - const DeepCollectionEquality() - .equals(other._allowedCountryCodes, _allowedCountryCodes)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - isRequired, - isPhoneNumberRequired, - const DeepCollectionEquality().hash(_allowedCountryCodes)); - - /// Create a copy of GooglePayShippingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$GooglePayShippingAddressConfigImplCopyWith< - _$GooglePayShippingAddressConfigImpl> - get copyWith => __$$GooglePayShippingAddressConfigImplCopyWithImpl< - _$GooglePayShippingAddressConfigImpl>(this, _$identity); - - @override - Map toJson() { - return _$$GooglePayShippingAddressConfigImplToJson( - this, - ); - } +/// Create a copy of GooglePayShippingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GooglePayShippingAddressConfigCopyWith<_GooglePayShippingAddressConfig> get copyWith => __$GooglePayShippingAddressConfigCopyWithImpl<_GooglePayShippingAddressConfig>(this, _$identity); + +@override +Map toJson() { + return _$GooglePayShippingAddressConfigToJson(this, ); } -abstract class _GooglePayShippingAddressConfig - implements GooglePayShippingAddressConfig { - const factory _GooglePayShippingAddressConfig( - {final bool? isRequired, - final bool? isPhoneNumberRequired, - final List? allowedCountryCodes}) = - _$GooglePayShippingAddressConfigImpl; - - factory _GooglePayShippingAddressConfig.fromJson(Map json) = - _$GooglePayShippingAddressConfigImpl.fromJson; - - /// Set to true if shipping address is required for payment. - /// - /// Defaults to false - @override - bool? get isRequired; - - /// Set to true if phone number is required for payment. - /// - /// Defaults to false. - @override - bool? get isPhoneNumberRequired; - - /// List of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. - /// - /// Defaults to all shipping address countries. - @override - List? get allowedCountryCodes; - - /// Create a copy of GooglePayShippingAddressConfig - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$GooglePayShippingAddressConfigImplCopyWith< - _$GooglePayShippingAddressConfigImpl> - get copyWith => throw _privateConstructorUsedError; -} - -PaymentRequestType _$PaymentRequestTypeFromJson(Map json) { - switch (json['type']) { - case 'Recurring': - return _PaymentRequestTypeRecurring.fromJson(json); - case 'AutomaticReload': - return _PaymentRequestTypeReload.fromJson(json); - case 'MultiMerchant': - return _PaymentRequestTypeMultiMerchant.fromJson(json); - - default: - throw CheckedFromJsonException(json, 'type', 'PaymentRequestType', - 'Invalid union type "${json['type']}"!'); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GooglePayShippingAddressConfig&&(identical(other.isRequired, isRequired) || other.isRequired == isRequired)&&(identical(other.isPhoneNumberRequired, isPhoneNumberRequired) || other.isPhoneNumberRequired == isPhoneNumberRequired)&&const DeepCollectionEquality().equals(other._allowedCountryCodes, _allowedCountryCodes)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isRequired,isPhoneNumberRequired,const DeepCollectionEquality().hash(_allowedCountryCodes)); + +@override +String toString() { + return 'GooglePayShippingAddressConfig(isRequired: $isRequired, isPhoneNumberRequired: $isPhoneNumberRequired, allowedCountryCodes: $allowedCountryCodes)'; +} + + } /// @nodoc -mixin _$PaymentRequestType { - @optionalTypeArgs - TResult when({ - required TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL) - recurring, - required TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL) - automaticReload, - required TResult Function(List merchants) - multiMerchant, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult? Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult? Function(List merchants)? multiMerchant, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult Function(List merchants)? multiMerchant, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentRequestTypeRecurring value) recurring, - required TResult Function(_PaymentRequestTypeReload value) automaticReload, - required TResult Function(_PaymentRequestTypeMultiMerchant value) - multiMerchant, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentRequestTypeRecurring value)? recurring, - TResult? Function(_PaymentRequestTypeReload value)? automaticReload, - TResult? Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentRequestTypeRecurring value)? recurring, - TResult Function(_PaymentRequestTypeReload value)? automaticReload, - TResult Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; +abstract mixin class _$GooglePayShippingAddressConfigCopyWith<$Res> implements $GooglePayShippingAddressConfigCopyWith<$Res> { + factory _$GooglePayShippingAddressConfigCopyWith(_GooglePayShippingAddressConfig value, $Res Function(_GooglePayShippingAddressConfig) _then) = __$GooglePayShippingAddressConfigCopyWithImpl; +@override @useResult +$Res call({ + bool? isRequired, bool? isPhoneNumberRequired, List? allowedCountryCodes +}); + + + - /// Serializes this PaymentRequestType to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +/// @nodoc +class __$GooglePayShippingAddressConfigCopyWithImpl<$Res> + implements _$GooglePayShippingAddressConfigCopyWith<$Res> { + __$GooglePayShippingAddressConfigCopyWithImpl(this._self, this._then); + + final _GooglePayShippingAddressConfig _self; + final $Res Function(_GooglePayShippingAddressConfig) _then; + +/// Create a copy of GooglePayShippingAddressConfig +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isRequired = freezed,Object? isPhoneNumberRequired = freezed,Object? allowedCountryCodes = freezed,}) { + return _then(_GooglePayShippingAddressConfig( +isRequired: freezed == isRequired ? _self.isRequired : isRequired // ignore: cast_nullable_to_non_nullable +as bool?,isPhoneNumberRequired: freezed == isPhoneNumberRequired ? _self.isPhoneNumberRequired : isPhoneNumberRequired // ignore: cast_nullable_to_non_nullable +as bool?,allowedCountryCodes: freezed == allowedCountryCodes ? _self._allowedCountryCodes : allowedCountryCodes // ignore: cast_nullable_to_non_nullable +as List?, + )); +} + + +} + +PaymentRequestType _$PaymentRequestTypeFromJson( + Map json +) { + switch (json['type']) { + case 'Recurring': + return _PaymentRequestTypeRecurring.fromJson( + json + ); + case 'AutomaticReload': + return _PaymentRequestTypeReload.fromJson( + json + ); + case 'MultiMerchant': + return _PaymentRequestTypeMultiMerchant.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'type', + 'PaymentRequestType', + 'Invalid union type "${json['type']}"!' +); + } + } /// @nodoc -abstract class $PaymentRequestTypeCopyWith<$Res> { - factory $PaymentRequestTypeCopyWith( - PaymentRequestType value, $Res Function(PaymentRequestType) then) = - _$PaymentRequestTypeCopyWithImpl<$Res, PaymentRequestType>; +mixin _$PaymentRequestType { + + + + /// Serializes this PaymentRequestType to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PaymentRequestType); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'PaymentRequestType()'; +} + + } /// @nodoc -class _$PaymentRequestTypeCopyWithImpl<$Res, $Val extends PaymentRequestType> - implements $PaymentRequestTypeCopyWith<$Res> { - _$PaymentRequestTypeCopyWithImpl(this._value, this._then); +class $PaymentRequestTypeCopyWith<$Res> { +$PaymentRequestTypeCopyWith(PaymentRequestType _, $Res Function(PaymentRequestType) __); +} + + +/// Adds pattern-matching-related methods to [PaymentRequestType]. +extension PaymentRequestTypePatterns on PaymentRequestType { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _PaymentRequestTypeRecurring value)? recurring,TResult Function( _PaymentRequestTypeReload value)? automaticReload,TResult Function( _PaymentRequestTypeMultiMerchant value)? multiMerchant,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentRequestTypeRecurring() when recurring != null: +return recurring(_that);case _PaymentRequestTypeReload() when automaticReload != null: +return automaticReload(_that);case _PaymentRequestTypeMultiMerchant() when multiMerchant != null: +return multiMerchant(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _PaymentRequestTypeRecurring value) recurring,required TResult Function( _PaymentRequestTypeReload value) automaticReload,required TResult Function( _PaymentRequestTypeMultiMerchant value) multiMerchant,}){ +final _that = this; +switch (_that) { +case _PaymentRequestTypeRecurring(): +return recurring(_that);case _PaymentRequestTypeReload(): +return automaticReload(_that);case _PaymentRequestTypeMultiMerchant(): +return multiMerchant(_that);case _: + throw StateError('Unexpected subclass'); - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _PaymentRequestTypeRecurring value)? recurring,TResult? Function( _PaymentRequestTypeReload value)? automaticReload,TResult? Function( _PaymentRequestTypeMultiMerchant value)? multiMerchant,}){ +final _that = this; +switch (_that) { +case _PaymentRequestTypeRecurring() when recurring != null: +return recurring(_that);case _PaymentRequestTypeReload() when automaticReload != null: +return automaticReload(_that);case _PaymentRequestTypeMultiMerchant() when multiMerchant != null: +return multiMerchant(_that);case _: + return null; + +} } +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( String description, String managementUrl, RecurringCartSummaryItem billing, RecurringCartSummaryItem? trialBilling, String? billingAgreement, String? tokenNotificationURL)? recurring,TResult Function( String description, String managementUrl, String label, String reloadAmount, String thresholdAmount, String? billingAgreement, String? tokenNotificationURL)? automaticReload,TResult Function( List merchants)? multiMerchant,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentRequestTypeRecurring() when recurring != null: +return recurring(_that.description,_that.managementUrl,_that.billing,_that.trialBilling,_that.billingAgreement,_that.tokenNotificationURL);case _PaymentRequestTypeReload() when automaticReload != null: +return automaticReload(_that.description,_that.managementUrl,_that.label,_that.reloadAmount,_that.thresholdAmount,_that.billingAgreement,_that.tokenNotificationURL);case _PaymentRequestTypeMultiMerchant() when multiMerchant != null: +return multiMerchant(_that.merchants);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( String description, String managementUrl, RecurringCartSummaryItem billing, RecurringCartSummaryItem? trialBilling, String? billingAgreement, String? tokenNotificationURL) recurring,required TResult Function( String description, String managementUrl, String label, String reloadAmount, String thresholdAmount, String? billingAgreement, String? tokenNotificationURL) automaticReload,required TResult Function( List merchants) multiMerchant,}) {final _that = this; +switch (_that) { +case _PaymentRequestTypeRecurring(): +return recurring(_that.description,_that.managementUrl,_that.billing,_that.trialBilling,_that.billingAgreement,_that.tokenNotificationURL);case _PaymentRequestTypeReload(): +return automaticReload(_that.description,_that.managementUrl,_that.label,_that.reloadAmount,_that.thresholdAmount,_that.billingAgreement,_that.tokenNotificationURL);case _PaymentRequestTypeMultiMerchant(): +return multiMerchant(_that.merchants);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( String description, String managementUrl, RecurringCartSummaryItem billing, RecurringCartSummaryItem? trialBilling, String? billingAgreement, String? tokenNotificationURL)? recurring,TResult? Function( String description, String managementUrl, String label, String reloadAmount, String thresholdAmount, String? billingAgreement, String? tokenNotificationURL)? automaticReload,TResult? Function( List merchants)? multiMerchant,}) {final _that = this; +switch (_that) { +case _PaymentRequestTypeRecurring() when recurring != null: +return recurring(_that.description,_that.managementUrl,_that.billing,_that.trialBilling,_that.billingAgreement,_that.tokenNotificationURL);case _PaymentRequestTypeReload() when automaticReload != null: +return automaticReload(_that.description,_that.managementUrl,_that.label,_that.reloadAmount,_that.thresholdAmount,_that.billingAgreement,_that.tokenNotificationURL);case _PaymentRequestTypeMultiMerchant() when multiMerchant != null: +return multiMerchant(_that.merchants);case _: + return null; -/// @nodoc -abstract class _$$PaymentRequestTypeRecurringImplCopyWith<$Res> { - factory _$$PaymentRequestTypeRecurringImplCopyWith( - _$PaymentRequestTypeRecurringImpl value, - $Res Function(_$PaymentRequestTypeRecurringImpl) then) = - __$$PaymentRequestTypeRecurringImplCopyWithImpl<$Res>; - @useResult - $Res call( - {String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL}); +} } -/// @nodoc -class __$$PaymentRequestTypeRecurringImplCopyWithImpl<$Res> - extends _$PaymentRequestTypeCopyWithImpl<$Res, - _$PaymentRequestTypeRecurringImpl> - implements _$$PaymentRequestTypeRecurringImplCopyWith<$Res> { - __$$PaymentRequestTypeRecurringImplCopyWithImpl( - _$PaymentRequestTypeRecurringImpl _value, - $Res Function(_$PaymentRequestTypeRecurringImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? description = null, - Object? managementUrl = null, - Object? billing = freezed, - Object? trialBilling = freezed, - Object? billingAgreement = freezed, - Object? tokenNotificationURL = freezed, - }) { - return _then(_$PaymentRequestTypeRecurringImpl( - description: null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - billing: freezed == billing - ? _value.billing - : billing // ignore: cast_nullable_to_non_nullable - as RecurringCartSummaryItem, - trialBilling: freezed == trialBilling - ? _value.trialBilling - : trialBilling // ignore: cast_nullable_to_non_nullable - as RecurringCartSummaryItem?, - billingAgreement: freezed == billingAgreement - ? _value.billingAgreement - : billingAgreement // ignore: cast_nullable_to_non_nullable - as String?, - tokenNotificationURL: freezed == tokenNotificationURL - ? _value.tokenNotificationURL - : tokenNotificationURL // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentRequestTypeRecurringImpl - implements _PaymentRequestTypeRecurring { - const _$PaymentRequestTypeRecurringImpl( - {required this.description, - required this.managementUrl, - required this.billing, - this.trialBilling, - this.billingAgreement, - this.tokenNotificationURL, - final String? $type}) - : $type = $type ?? 'Recurring'; - - factory _$PaymentRequestTypeRecurringImpl.fromJson( - Map json) => - _$$PaymentRequestTypeRecurringImplFromJson(json); - - /// Description that you provide to the recurring payment. - /// - /// Apple will display this in the sheet - @override - final String description; - - /// A URL to web page where the user can update or delete the payment method for recurring - @override - final String managementUrl; - - /// The regular billing cycle for the payment, including start end dates, interval and count. - @override - final RecurringCartSummaryItem billing; - - /// Same as the billing property but related to trial period. - @override - final RecurringCartSummaryItem? trialBilling; - - /// A localized billing agreement that Apple displays to user before authorizing the payment - @override - final String? billingAgreement; - - /// A URL you provide to receive life cycle notifications from Apple pay servers about the merchant token for recurring payment. - /// - /// For more info see receiving and handling merchant token notifications - @override - final String? tokenNotificationURL; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'PaymentRequestType.recurring(description: $description, managementUrl: $managementUrl, billing: $billing, trialBilling: $trialBilling, billingAgreement: $billingAgreement, tokenNotificationURL: $tokenNotificationURL)'; - } +class _PaymentRequestTypeRecurring implements PaymentRequestType { + const _PaymentRequestTypeRecurring({required this.description, required this.managementUrl, required this.billing, this.trialBilling, this.billingAgreement, this.tokenNotificationURL, final String? $type}): $type = $type ?? 'Recurring'; + factory _PaymentRequestTypeRecurring.fromJson(Map json) => _$PaymentRequestTypeRecurringFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentRequestTypeRecurringImpl && - (identical(other.description, description) || - other.description == description) && - (identical(other.managementUrl, managementUrl) || - other.managementUrl == managementUrl) && - const DeepCollectionEquality().equals(other.billing, billing) && - const DeepCollectionEquality() - .equals(other.trialBilling, trialBilling) && - (identical(other.billingAgreement, billingAgreement) || - other.billingAgreement == billingAgreement) && - (identical(other.tokenNotificationURL, tokenNotificationURL) || - other.tokenNotificationURL == tokenNotificationURL)); - } +/// Description that you provide to the recurring payment. +/// +/// Apple will display this in the sheet + final String description; +/// A URL to web page where the user can update or delete the payment method for recurring + final String managementUrl; +/// The regular billing cycle for the payment, including start end dates, interval and count. + final RecurringCartSummaryItem billing; +/// Same as the billing property but related to trial period. + final RecurringCartSummaryItem? trialBilling; +/// A localized billing agreement that Apple displays to user before authorizing the payment + final String? billingAgreement; +/// A URL you provide to receive life cycle notifications from Apple pay servers about the merchant token for recurring payment. +/// +/// For more info see receiving and handling merchant token notifications + final String? tokenNotificationURL; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - description, - managementUrl, - const DeepCollectionEquality().hash(billing), - const DeepCollectionEquality().hash(trialBilling), - billingAgreement, - tokenNotificationURL); - - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentRequestTypeRecurringImplCopyWith<_$PaymentRequestTypeRecurringImpl> - get copyWith => __$$PaymentRequestTypeRecurringImplCopyWithImpl< - _$PaymentRequestTypeRecurringImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL) - recurring, - required TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL) - automaticReload, - required TResult Function(List merchants) - multiMerchant, - }) { - return recurring(description, managementUrl, billing, trialBilling, - billingAgreement, tokenNotificationURL); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult? Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult? Function(List merchants)? multiMerchant, - }) { - return recurring?.call(description, managementUrl, billing, trialBilling, - billingAgreement, tokenNotificationURL); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult Function(List merchants)? multiMerchant, - required TResult orElse(), - }) { - if (recurring != null) { - return recurring(description, managementUrl, billing, trialBilling, - billingAgreement, tokenNotificationURL); - } - return orElse(); - } +/// Create a copy of PaymentRequestType +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentRequestTypeRecurringCopyWith<_PaymentRequestTypeRecurring> get copyWith => __$PaymentRequestTypeRecurringCopyWithImpl<_PaymentRequestTypeRecurring>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentRequestTypeRecurring value) recurring, - required TResult Function(_PaymentRequestTypeReload value) automaticReload, - required TResult Function(_PaymentRequestTypeMultiMerchant value) - multiMerchant, - }) { - return recurring(this); - } +@override +Map toJson() { + return _$PaymentRequestTypeRecurringToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentRequestTypeRecurring value)? recurring, - TResult? Function(_PaymentRequestTypeReload value)? automaticReload, - TResult? Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - }) { - return recurring?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentRequestTypeRecurring&&(identical(other.description, description) || other.description == description)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&const DeepCollectionEquality().equals(other.billing, billing)&&const DeepCollectionEquality().equals(other.trialBilling, trialBilling)&&(identical(other.billingAgreement, billingAgreement) || other.billingAgreement == billingAgreement)&&(identical(other.tokenNotificationURL, tokenNotificationURL) || other.tokenNotificationURL == tokenNotificationURL)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentRequestTypeRecurring value)? recurring, - TResult Function(_PaymentRequestTypeReload value)? automaticReload, - TResult Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - required TResult orElse(), - }) { - if (recurring != null) { - return recurring(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,description,managementUrl,const DeepCollectionEquality().hash(billing),const DeepCollectionEquality().hash(trialBilling),billingAgreement,tokenNotificationURL); - @override - Map toJson() { - return _$$PaymentRequestTypeRecurringImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentRequestType.recurring(description: $description, managementUrl: $managementUrl, billing: $billing, trialBilling: $trialBilling, billingAgreement: $billingAgreement, tokenNotificationURL: $tokenNotificationURL)'; } -abstract class _PaymentRequestTypeRecurring implements PaymentRequestType { - const factory _PaymentRequestTypeRecurring( - {required final String description, - required final String managementUrl, - required final RecurringCartSummaryItem billing, - final RecurringCartSummaryItem? trialBilling, - final String? billingAgreement, - final String? tokenNotificationURL}) = _$PaymentRequestTypeRecurringImpl; - factory _PaymentRequestTypeRecurring.fromJson(Map json) = - _$PaymentRequestTypeRecurringImpl.fromJson; +} - /// Description that you provide to the recurring payment. - /// - /// Apple will display this in the sheet - String get description; +/// @nodoc +abstract mixin class _$PaymentRequestTypeRecurringCopyWith<$Res> implements $PaymentRequestTypeCopyWith<$Res> { + factory _$PaymentRequestTypeRecurringCopyWith(_PaymentRequestTypeRecurring value, $Res Function(_PaymentRequestTypeRecurring) _then) = __$PaymentRequestTypeRecurringCopyWithImpl; +@useResult +$Res call({ + String description, String managementUrl, RecurringCartSummaryItem billing, RecurringCartSummaryItem? trialBilling, String? billingAgreement, String? tokenNotificationURL +}); - /// A URL to web page where the user can update or delete the payment method for recurring - String get managementUrl; - /// The regular billing cycle for the payment, including start end dates, interval and count. - RecurringCartSummaryItem get billing; - /// Same as the billing property but related to trial period. - RecurringCartSummaryItem? get trialBilling; - /// A localized billing agreement that Apple displays to user before authorizing the payment - String? get billingAgreement; +} +/// @nodoc +class __$PaymentRequestTypeRecurringCopyWithImpl<$Res> + implements _$PaymentRequestTypeRecurringCopyWith<$Res> { + __$PaymentRequestTypeRecurringCopyWithImpl(this._self, this._then); - /// A URL you provide to receive life cycle notifications from Apple pay servers about the merchant token for recurring payment. - /// - /// For more info see receiving and handling merchant token notifications - String? get tokenNotificationURL; + final _PaymentRequestTypeRecurring _self; + final $Res Function(_PaymentRequestTypeRecurring) _then; - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentRequestTypeRecurringImplCopyWith<_$PaymentRequestTypeRecurringImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentRequestType +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? description = null,Object? managementUrl = null,Object? billing = freezed,Object? trialBilling = freezed,Object? billingAgreement = freezed,Object? tokenNotificationURL = freezed,}) { + return _then(_PaymentRequestTypeRecurring( +description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,billing: freezed == billing ? _self.billing : billing // ignore: cast_nullable_to_non_nullable +as RecurringCartSummaryItem,trialBilling: freezed == trialBilling ? _self.trialBilling : trialBilling // ignore: cast_nullable_to_non_nullable +as RecurringCartSummaryItem?,billingAgreement: freezed == billingAgreement ? _self.billingAgreement : billingAgreement // ignore: cast_nullable_to_non_nullable +as String?,tokenNotificationURL: freezed == tokenNotificationURL ? _self.tokenNotificationURL : tokenNotificationURL // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -abstract class _$$PaymentRequestTypeReloadImplCopyWith<$Res> { - factory _$$PaymentRequestTypeReloadImplCopyWith( - _$PaymentRequestTypeReloadImpl value, - $Res Function(_$PaymentRequestTypeReloadImpl) then) = - __$$PaymentRequestTypeReloadImplCopyWithImpl<$Res>; - @useResult - $Res call( - {String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL}); -} -/// @nodoc -class __$$PaymentRequestTypeReloadImplCopyWithImpl<$Res> - extends _$PaymentRequestTypeCopyWithImpl<$Res, - _$PaymentRequestTypeReloadImpl> - implements _$$PaymentRequestTypeReloadImplCopyWith<$Res> { - __$$PaymentRequestTypeReloadImplCopyWithImpl( - _$PaymentRequestTypeReloadImpl _value, - $Res Function(_$PaymentRequestTypeReloadImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? description = null, - Object? managementUrl = null, - Object? label = null, - Object? reloadAmount = null, - Object? thresholdAmount = null, - Object? billingAgreement = freezed, - Object? tokenNotificationURL = freezed, - }) { - return _then(_$PaymentRequestTypeReloadImpl( - description: null == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String, - managementUrl: null == managementUrl - ? _value.managementUrl - : managementUrl // ignore: cast_nullable_to_non_nullable - as String, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - reloadAmount: null == reloadAmount - ? _value.reloadAmount - : reloadAmount // ignore: cast_nullable_to_non_nullable - as String, - thresholdAmount: null == thresholdAmount - ? _value.thresholdAmount - : thresholdAmount // ignore: cast_nullable_to_non_nullable - as String, - billingAgreement: freezed == billingAgreement - ? _value.billingAgreement - : billingAgreement // ignore: cast_nullable_to_non_nullable - as String?, - tokenNotificationURL: freezed == tokenNotificationURL - ? _value.tokenNotificationURL - : tokenNotificationURL // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$PaymentRequestTypeReloadImpl implements _PaymentRequestTypeReload { - const _$PaymentRequestTypeReloadImpl( - {required this.description, - required this.managementUrl, - required this.label, - required this.reloadAmount, - required this.thresholdAmount, - this.billingAgreement, - this.tokenNotificationURL, - final String? $type}) - : $type = $type ?? 'AutomaticReload'; - - factory _$PaymentRequestTypeReloadImpl.fromJson(Map json) => - _$$PaymentRequestTypeReloadImplFromJson(json); - - /// Descirption that you provide to the recurring payment. - /// - /// Apple will display this in the sheet - @override - final String description; - - /// A URL to web page where the user can update or delete the payment method for recurring - @override - final String managementUrl; - - /// A short localized description of the item - @override - final String label; - - /// The amount that is automatically applied to the account when the balance drops below the threshold amount. - @override - final String reloadAmount; - - /// The balance and account reaches before you apply the automatic reload amount. - @override - final String thresholdAmount; - - /// A localized billing agreement that Apple displays to user before authorizing the payment - @override - final String? billingAgreement; - - /// A URL you provide to receive life cycle notifications from Apple pay servers about the merchant token for recurring payment. - /// - /// For more info see receiving and handling merchant token notifications - @override - final String? tokenNotificationURL; - - @JsonKey(name: 'type') - final String $type; - - @override - String toString() { - return 'PaymentRequestType.automaticReload(description: $description, managementUrl: $managementUrl, label: $label, reloadAmount: $reloadAmount, thresholdAmount: $thresholdAmount, billingAgreement: $billingAgreement, tokenNotificationURL: $tokenNotificationURL)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentRequestTypeReloadImpl && - (identical(other.description, description) || - other.description == description) && - (identical(other.managementUrl, managementUrl) || - other.managementUrl == managementUrl) && - (identical(other.label, label) || other.label == label) && - (identical(other.reloadAmount, reloadAmount) || - other.reloadAmount == reloadAmount) && - (identical(other.thresholdAmount, thresholdAmount) || - other.thresholdAmount == thresholdAmount) && - (identical(other.billingAgreement, billingAgreement) || - other.billingAgreement == billingAgreement) && - (identical(other.tokenNotificationURL, tokenNotificationURL) || - other.tokenNotificationURL == tokenNotificationURL)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - description, - managementUrl, - label, - reloadAmount, - thresholdAmount, - billingAgreement, - tokenNotificationURL); - - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentRequestTypeReloadImplCopyWith<_$PaymentRequestTypeReloadImpl> - get copyWith => __$$PaymentRequestTypeReloadImplCopyWithImpl< - _$PaymentRequestTypeReloadImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL) - recurring, - required TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL) - automaticReload, - required TResult Function(List merchants) - multiMerchant, - }) { - return automaticReload(description, managementUrl, label, reloadAmount, - thresholdAmount, billingAgreement, tokenNotificationURL); - } - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult? Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult? Function(List merchants)? multiMerchant, - }) { - return automaticReload?.call(description, managementUrl, label, - reloadAmount, thresholdAmount, billingAgreement, tokenNotificationURL); - } +class _PaymentRequestTypeReload implements PaymentRequestType { + const _PaymentRequestTypeReload({required this.description, required this.managementUrl, required this.label, required this.reloadAmount, required this.thresholdAmount, this.billingAgreement, this.tokenNotificationURL, final String? $type}): $type = $type ?? 'AutomaticReload'; + factory _PaymentRequestTypeReload.fromJson(Map json) => _$PaymentRequestTypeReloadFromJson(json); - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult Function(List merchants)? multiMerchant, - required TResult orElse(), - }) { - if (automaticReload != null) { - return automaticReload(description, managementUrl, label, reloadAmount, - thresholdAmount, billingAgreement, tokenNotificationURL); - } - return orElse(); - } +/// Descirption that you provide to the recurring payment. +/// +/// Apple will display this in the sheet + final String description; +/// A URL to web page where the user can update or delete the payment method for recurring + final String managementUrl; +/// A short localized description of the item + final String label; +/// The amount that is automatically applied to the account when the balance drops below the threshold amount. + final String reloadAmount; +/// The balance and account reaches before you apply the automatic reload amount. + final String thresholdAmount; +/// A localized billing agreement that Apple displays to user before authorizing the payment + final String? billingAgreement; +/// A URL you provide to receive life cycle notifications from Apple pay servers about the merchant token for recurring payment. +/// +/// For more info see receiving and handling merchant token notifications + final String? tokenNotificationURL; - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentRequestTypeRecurring value) recurring, - required TResult Function(_PaymentRequestTypeReload value) automaticReload, - required TResult Function(_PaymentRequestTypeMultiMerchant value) - multiMerchant, - }) { - return automaticReload(this); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentRequestTypeRecurring value)? recurring, - TResult? Function(_PaymentRequestTypeReload value)? automaticReload, - TResult? Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - }) { - return automaticReload?.call(this); - } - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentRequestTypeRecurring value)? recurring, - TResult Function(_PaymentRequestTypeReload value)? automaticReload, - TResult Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - required TResult orElse(), - }) { - if (automaticReload != null) { - return automaticReload(this); - } - return orElse(); - } +/// Create a copy of PaymentRequestType +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentRequestTypeReloadCopyWith<_PaymentRequestTypeReload> get copyWith => __$PaymentRequestTypeReloadCopyWithImpl<_PaymentRequestTypeReload>(this, _$identity); - @override - Map toJson() { - return _$$PaymentRequestTypeReloadImplToJson( - this, - ); - } +@override +Map toJson() { + return _$PaymentRequestTypeReloadToJson(this, ); } -abstract class _PaymentRequestTypeReload implements PaymentRequestType { - const factory _PaymentRequestTypeReload( - {required final String description, - required final String managementUrl, - required final String label, - required final String reloadAmount, - required final String thresholdAmount, - final String? billingAgreement, - final String? tokenNotificationURL}) = _$PaymentRequestTypeReloadImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentRequestTypeReload&&(identical(other.description, description) || other.description == description)&&(identical(other.managementUrl, managementUrl) || other.managementUrl == managementUrl)&&(identical(other.label, label) || other.label == label)&&(identical(other.reloadAmount, reloadAmount) || other.reloadAmount == reloadAmount)&&(identical(other.thresholdAmount, thresholdAmount) || other.thresholdAmount == thresholdAmount)&&(identical(other.billingAgreement, billingAgreement) || other.billingAgreement == billingAgreement)&&(identical(other.tokenNotificationURL, tokenNotificationURL) || other.tokenNotificationURL == tokenNotificationURL)); +} - factory _PaymentRequestTypeReload.fromJson(Map json) = - _$PaymentRequestTypeReloadImpl.fromJson; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,description,managementUrl,label,reloadAmount,thresholdAmount,billingAgreement,tokenNotificationURL); - /// Descirption that you provide to the recurring payment. - /// - /// Apple will display this in the sheet - String get description; +@override +String toString() { + return 'PaymentRequestType.automaticReload(description: $description, managementUrl: $managementUrl, label: $label, reloadAmount: $reloadAmount, thresholdAmount: $thresholdAmount, billingAgreement: $billingAgreement, tokenNotificationURL: $tokenNotificationURL)'; +} - /// A URL to web page where the user can update or delete the payment method for recurring - String get managementUrl; - /// A short localized description of the item - String get label; +} - /// The amount that is automatically applied to the account when the balance drops below the threshold amount. - String get reloadAmount; +/// @nodoc +abstract mixin class _$PaymentRequestTypeReloadCopyWith<$Res> implements $PaymentRequestTypeCopyWith<$Res> { + factory _$PaymentRequestTypeReloadCopyWith(_PaymentRequestTypeReload value, $Res Function(_PaymentRequestTypeReload) _then) = __$PaymentRequestTypeReloadCopyWithImpl; +@useResult +$Res call({ + String description, String managementUrl, String label, String reloadAmount, String thresholdAmount, String? billingAgreement, String? tokenNotificationURL +}); - /// The balance and account reaches before you apply the automatic reload amount. - String get thresholdAmount; - /// A localized billing agreement that Apple displays to user before authorizing the payment - String? get billingAgreement; - /// A URL you provide to receive life cycle notifications from Apple pay servers about the merchant token for recurring payment. - /// - /// For more info see receiving and handling merchant token notifications - String? get tokenNotificationURL; - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentRequestTypeReloadImplCopyWith<_$PaymentRequestTypeReloadImpl> - get copyWith => throw _privateConstructorUsedError; } - /// @nodoc -abstract class _$$PaymentRequestTypeMultiMerchantImplCopyWith<$Res> { - factory _$$PaymentRequestTypeMultiMerchantImplCopyWith( - _$PaymentRequestTypeMultiMerchantImpl value, - $Res Function(_$PaymentRequestTypeMultiMerchantImpl) then) = - __$$PaymentRequestTypeMultiMerchantImplCopyWithImpl<$Res>; - @useResult - $Res call({List merchants}); +class __$PaymentRequestTypeReloadCopyWithImpl<$Res> + implements _$PaymentRequestTypeReloadCopyWith<$Res> { + __$PaymentRequestTypeReloadCopyWithImpl(this._self, this._then); + + final _PaymentRequestTypeReload _self; + final $Res Function(_PaymentRequestTypeReload) _then; + +/// Create a copy of PaymentRequestType +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? description = null,Object? managementUrl = null,Object? label = null,Object? reloadAmount = null,Object? thresholdAmount = null,Object? billingAgreement = freezed,Object? tokenNotificationURL = freezed,}) { + return _then(_PaymentRequestTypeReload( +description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String,managementUrl: null == managementUrl ? _self.managementUrl : managementUrl // ignore: cast_nullable_to_non_nullable +as String,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,reloadAmount: null == reloadAmount ? _self.reloadAmount : reloadAmount // ignore: cast_nullable_to_non_nullable +as String,thresholdAmount: null == thresholdAmount ? _self.thresholdAmount : thresholdAmount // ignore: cast_nullable_to_non_nullable +as String,billingAgreement: freezed == billingAgreement ? _self.billingAgreement : billingAgreement // ignore: cast_nullable_to_non_nullable +as String?,tokenNotificationURL: freezed == tokenNotificationURL ? _self.tokenNotificationURL : tokenNotificationURL // ignore: cast_nullable_to_non_nullable +as String?, + )); } -/// @nodoc -class __$$PaymentRequestTypeMultiMerchantImplCopyWithImpl<$Res> - extends _$PaymentRequestTypeCopyWithImpl<$Res, - _$PaymentRequestTypeMultiMerchantImpl> - implements _$$PaymentRequestTypeMultiMerchantImplCopyWith<$Res> { - __$$PaymentRequestTypeMultiMerchantImplCopyWithImpl( - _$PaymentRequestTypeMultiMerchantImpl _value, - $Res Function(_$PaymentRequestTypeMultiMerchantImpl) _then) - : super(_value, _then); - - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchants = null, - }) { - return _then(_$PaymentRequestTypeMultiMerchantImpl( - merchants: null == merchants - ? _value._merchants - : merchants // ignore: cast_nullable_to_non_nullable - as List, - )); - } + } /// @nodoc @JsonSerializable() -class _$PaymentRequestTypeMultiMerchantImpl - implements _PaymentRequestTypeMultiMerchant { - const _$PaymentRequestTypeMultiMerchantImpl( - {required final List merchants, - final String? $type}) - : _merchants = merchants, - $type = $type ?? 'MultiMerchant'; - - factory _$PaymentRequestTypeMultiMerchantImpl.fromJson( - Map json) => - _$$PaymentRequestTypeMultiMerchantImplFromJson(json); - - final List _merchants; - @override - List get merchants { - if (_merchants is EqualUnmodifiableListView) return _merchants; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_merchants); - } - @JsonKey(name: 'type') - final String $type; +class _PaymentRequestTypeMultiMerchant implements PaymentRequestType { + const _PaymentRequestTypeMultiMerchant({required final List merchants, final String? $type}): _merchants = merchants,$type = $type ?? 'MultiMerchant'; + factory _PaymentRequestTypeMultiMerchant.fromJson(Map json) => _$PaymentRequestTypeMultiMerchantFromJson(json); - @override - String toString() { - return 'PaymentRequestType.multiMerchant(merchants: $merchants)'; - } + final List _merchants; + List get merchants { + if (_merchants is EqualUnmodifiableListView) return _merchants; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_merchants); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentRequestTypeMultiMerchantImpl && - const DeepCollectionEquality() - .equals(other._merchants, _merchants)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => - Object.hash(runtimeType, const DeepCollectionEquality().hash(_merchants)); - - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentRequestTypeMultiMerchantImplCopyWith< - _$PaymentRequestTypeMultiMerchantImpl> - get copyWith => __$$PaymentRequestTypeMultiMerchantImplCopyWithImpl< - _$PaymentRequestTypeMultiMerchantImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL) - recurring, - required TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL) - automaticReload, - required TResult Function(List merchants) - multiMerchant, - }) { - return multiMerchant(merchants); - } +@JsonKey(name: 'type') +final String $type; - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult? Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult? Function(List merchants)? multiMerchant, - }) { - return multiMerchant?.call(merchants); - } - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function( - String description, - String managementUrl, - RecurringCartSummaryItem billing, - RecurringCartSummaryItem? trialBilling, - String? billingAgreement, - String? tokenNotificationURL)? - recurring, - TResult Function( - String description, - String managementUrl, - String label, - String reloadAmount, - String thresholdAmount, - String? billingAgreement, - String? tokenNotificationURL)? - automaticReload, - TResult Function(List merchants)? multiMerchant, - required TResult orElse(), - }) { - if (multiMerchant != null) { - return multiMerchant(merchants); - } - return orElse(); - } +/// Create a copy of PaymentRequestType +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentRequestTypeMultiMerchantCopyWith<_PaymentRequestTypeMultiMerchant> get copyWith => __$PaymentRequestTypeMultiMerchantCopyWithImpl<_PaymentRequestTypeMultiMerchant>(this, _$identity); - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PaymentRequestTypeRecurring value) recurring, - required TResult Function(_PaymentRequestTypeReload value) automaticReload, - required TResult Function(_PaymentRequestTypeMultiMerchant value) - multiMerchant, - }) { - return multiMerchant(this); - } +@override +Map toJson() { + return _$PaymentRequestTypeMultiMerchantToJson(this, ); +} - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PaymentRequestTypeRecurring value)? recurring, - TResult? Function(_PaymentRequestTypeReload value)? automaticReload, - TResult? Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - }) { - return multiMerchant?.call(this); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentRequestTypeMultiMerchant&&const DeepCollectionEquality().equals(other._merchants, _merchants)); +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PaymentRequestTypeRecurring value)? recurring, - TResult Function(_PaymentRequestTypeReload value)? automaticReload, - TResult Function(_PaymentRequestTypeMultiMerchant value)? multiMerchant, - required TResult orElse(), - }) { - if (multiMerchant != null) { - return multiMerchant(this); - } - return orElse(); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_merchants)); - @override - Map toJson() { - return _$$PaymentRequestTypeMultiMerchantImplToJson( - this, - ); - } +@override +String toString() { + return 'PaymentRequestType.multiMerchant(merchants: $merchants)'; } -abstract class _PaymentRequestTypeMultiMerchant implements PaymentRequestType { - const factory _PaymentRequestTypeMultiMerchant( - {required final List merchants}) = - _$PaymentRequestTypeMultiMerchantImpl; - factory _PaymentRequestTypeMultiMerchant.fromJson(Map json) = - _$PaymentRequestTypeMultiMerchantImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$PaymentRequestTypeMultiMerchantCopyWith<$Res> implements $PaymentRequestTypeCopyWith<$Res> { + factory _$PaymentRequestTypeMultiMerchantCopyWith(_PaymentRequestTypeMultiMerchant value, $Res Function(_PaymentRequestTypeMultiMerchant) _then) = __$PaymentRequestTypeMultiMerchantCopyWithImpl; +@useResult +$Res call({ + List merchants +}); + + + + +} +/// @nodoc +class __$PaymentRequestTypeMultiMerchantCopyWithImpl<$Res> + implements _$PaymentRequestTypeMultiMerchantCopyWith<$Res> { + __$PaymentRequestTypeMultiMerchantCopyWithImpl(this._self, this._then); - List get merchants; + final _PaymentRequestTypeMultiMerchant _self; + final $Res Function(_PaymentRequestTypeMultiMerchant) _then; - /// Create a copy of PaymentRequestType - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentRequestTypeMultiMerchantImplCopyWith< - _$PaymentRequestTypeMultiMerchantImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PaymentRequestType +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? merchants = null,}) { + return _then(_PaymentRequestTypeMultiMerchant( +merchants: null == merchants ? _self._merchants : merchants // ignore: cast_nullable_to_non_nullable +as List, + )); } -ApplePayMultiMerchant _$ApplePayMultiMerchantFromJson( - Map json) { - return _ApplePayMultiMerchant.fromJson(json); + } + /// @nodoc mixin _$ApplePayMultiMerchant { - /// The apple pay merchant identifier - String get merchantIdentifier => throw _privateConstructorUsedError; - /// External identifier for the merchant - String get externalIdentifier => throw _privateConstructorUsedError; +/// The apple pay merchant identifier + String get merchantIdentifier;/// External identifier for the merchant + String get externalIdentifier;/// The merchant display name Apple pay associates with the payment token + String get merchantName;/// The merchant top level domain Apple Pay associates with teh payment token + String? get merchantDomain;/// Amount to authorize for the payment token + String get amount; +/// Create a copy of ApplePayMultiMerchant +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ApplePayMultiMerchantCopyWith get copyWith => _$ApplePayMultiMerchantCopyWithImpl(this as ApplePayMultiMerchant, _$identity); - /// The merchant display name Apple pay associates with the payment token - String get merchantName => throw _privateConstructorUsedError; + /// Serializes this ApplePayMultiMerchant to a JSON map. + Map toJson(); - /// The merchant top level domain Apple Pay associates with teh payment token - String? get merchantDomain => throw _privateConstructorUsedError; - /// Amount to authorize for the payment token - String get amount => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ApplePayMultiMerchant&&(identical(other.merchantIdentifier, merchantIdentifier) || other.merchantIdentifier == merchantIdentifier)&&(identical(other.externalIdentifier, externalIdentifier) || other.externalIdentifier == externalIdentifier)&&(identical(other.merchantName, merchantName) || other.merchantName == merchantName)&&(identical(other.merchantDomain, merchantDomain) || other.merchantDomain == merchantDomain)&&(identical(other.amount, amount) || other.amount == amount)); +} - /// Serializes this ApplePayMultiMerchant to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantIdentifier,externalIdentifier,merchantName,merchantDomain,amount); - /// Create a copy of ApplePayMultiMerchant - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ApplePayMultiMerchantCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'ApplePayMultiMerchant(merchantIdentifier: $merchantIdentifier, externalIdentifier: $externalIdentifier, merchantName: $merchantName, merchantDomain: $merchantDomain, amount: $amount)'; } -/// @nodoc -abstract class $ApplePayMultiMerchantCopyWith<$Res> { - factory $ApplePayMultiMerchantCopyWith(ApplePayMultiMerchant value, - $Res Function(ApplePayMultiMerchant) then) = - _$ApplePayMultiMerchantCopyWithImpl<$Res, ApplePayMultiMerchant>; - @useResult - $Res call( - {String merchantIdentifier, - String externalIdentifier, - String merchantName, - String? merchantDomain, - String amount}); + } /// @nodoc -class _$ApplePayMultiMerchantCopyWithImpl<$Res, - $Val extends ApplePayMultiMerchant> - implements $ApplePayMultiMerchantCopyWith<$Res> { - _$ApplePayMultiMerchantCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ApplePayMultiMerchant - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantIdentifier = null, - Object? externalIdentifier = null, - Object? merchantName = null, - Object? merchantDomain = freezed, - Object? amount = null, - }) { - return _then(_value.copyWith( - merchantIdentifier: null == merchantIdentifier - ? _value.merchantIdentifier - : merchantIdentifier // ignore: cast_nullable_to_non_nullable - as String, - externalIdentifier: null == externalIdentifier - ? _value.externalIdentifier - : externalIdentifier // ignore: cast_nullable_to_non_nullable - as String, - merchantName: null == merchantName - ? _value.merchantName - : merchantName // ignore: cast_nullable_to_non_nullable - as String, - merchantDomain: freezed == merchantDomain - ? _value.merchantDomain - : merchantDomain // ignore: cast_nullable_to_non_nullable - as String?, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } -} +abstract mixin class $ApplePayMultiMerchantCopyWith<$Res> { + factory $ApplePayMultiMerchantCopyWith(ApplePayMultiMerchant value, $Res Function(ApplePayMultiMerchant) _then) = _$ApplePayMultiMerchantCopyWithImpl; +@useResult +$Res call({ + String merchantIdentifier, String externalIdentifier, String merchantName, String? merchantDomain, String amount +}); + + + +} /// @nodoc -abstract class _$$ApplePayMultiMerchantImplCopyWith<$Res> +class _$ApplePayMultiMerchantCopyWithImpl<$Res> implements $ApplePayMultiMerchantCopyWith<$Res> { - factory _$$ApplePayMultiMerchantImplCopyWith( - _$ApplePayMultiMerchantImpl value, - $Res Function(_$ApplePayMultiMerchantImpl) then) = - __$$ApplePayMultiMerchantImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String merchantIdentifier, - String externalIdentifier, - String merchantName, - String? merchantDomain, - String amount}); + _$ApplePayMultiMerchantCopyWithImpl(this._self, this._then); + + final ApplePayMultiMerchant _self; + final $Res Function(ApplePayMultiMerchant) _then; + +/// Create a copy of ApplePayMultiMerchant +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? merchantIdentifier = null,Object? externalIdentifier = null,Object? merchantName = null,Object? merchantDomain = freezed,Object? amount = null,}) { + return _then(_self.copyWith( +merchantIdentifier: null == merchantIdentifier ? _self.merchantIdentifier : merchantIdentifier // ignore: cast_nullable_to_non_nullable +as String,externalIdentifier: null == externalIdentifier ? _self.externalIdentifier : externalIdentifier // ignore: cast_nullable_to_non_nullable +as String,merchantName: null == merchantName ? _self.merchantName : merchantName // ignore: cast_nullable_to_non_nullable +as String,merchantDomain: freezed == merchantDomain ? _self.merchantDomain : merchantDomain // ignore: cast_nullable_to_non_nullable +as String?,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ApplePayMultiMerchant]. +extension ApplePayMultiMerchantPatterns on ApplePayMultiMerchant { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ApplePayMultiMerchant value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ApplePayMultiMerchant() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ApplePayMultiMerchant value) $default,){ +final _that = this; +switch (_that) { +case _ApplePayMultiMerchant(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ApplePayMultiMerchant value)? $default,){ +final _that = this; +switch (_that) { +case _ApplePayMultiMerchant() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String merchantIdentifier, String externalIdentifier, String merchantName, String? merchantDomain, String amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ApplePayMultiMerchant() when $default != null: +return $default(_that.merchantIdentifier,_that.externalIdentifier,_that.merchantName,_that.merchantDomain,_that.amount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String merchantIdentifier, String externalIdentifier, String merchantName, String? merchantDomain, String amount) $default,) {final _that = this; +switch (_that) { +case _ApplePayMultiMerchant(): +return $default(_that.merchantIdentifier,_that.externalIdentifier,_that.merchantName,_that.merchantDomain,_that.amount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String merchantIdentifier, String externalIdentifier, String merchantName, String? merchantDomain, String amount)? $default,) {final _that = this; +switch (_that) { +case _ApplePayMultiMerchant() when $default != null: +return $default(_that.merchantIdentifier,_that.externalIdentifier,_that.merchantName,_that.merchantDomain,_that.amount);case _: + return null; + +} } -/// @nodoc -class __$$ApplePayMultiMerchantImplCopyWithImpl<$Res> - extends _$ApplePayMultiMerchantCopyWithImpl<$Res, - _$ApplePayMultiMerchantImpl> - implements _$$ApplePayMultiMerchantImplCopyWith<$Res> { - __$$ApplePayMultiMerchantImplCopyWithImpl(_$ApplePayMultiMerchantImpl _value, - $Res Function(_$ApplePayMultiMerchantImpl) _then) - : super(_value, _then); - - /// Create a copy of ApplePayMultiMerchant - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? merchantIdentifier = null, - Object? externalIdentifier = null, - Object? merchantName = null, - Object? merchantDomain = freezed, - Object? amount = null, - }) { - return _then(_$ApplePayMultiMerchantImpl( - merchantIdentifier: null == merchantIdentifier - ? _value.merchantIdentifier - : merchantIdentifier // ignore: cast_nullable_to_non_nullable - as String, - externalIdentifier: null == externalIdentifier - ? _value.externalIdentifier - : externalIdentifier // ignore: cast_nullable_to_non_nullable - as String, - merchantName: null == merchantName - ? _value.merchantName - : merchantName // ignore: cast_nullable_to_non_nullable - as String, - merchantDomain: freezed == merchantDomain - ? _value.merchantDomain - : merchantDomain // ignore: cast_nullable_to_non_nullable - as String?, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ApplePayMultiMerchantImpl implements _ApplePayMultiMerchant { - const _$ApplePayMultiMerchantImpl( - {required this.merchantIdentifier, - required this.externalIdentifier, - required this.merchantName, - this.merchantDomain, - required this.amount}); - - factory _$ApplePayMultiMerchantImpl.fromJson(Map json) => - _$$ApplePayMultiMerchantImplFromJson(json); - - /// The apple pay merchant identifier - @override - final String merchantIdentifier; - - /// External identifier for the merchant - @override - final String externalIdentifier; - - /// The merchant display name Apple pay associates with the payment token - @override - final String merchantName; - - /// The merchant top level domain Apple Pay associates with teh payment token - @override - final String? merchantDomain; - - /// Amount to authorize for the payment token - @override - final String amount; - - @override - String toString() { - return 'ApplePayMultiMerchant(merchantIdentifier: $merchantIdentifier, externalIdentifier: $externalIdentifier, merchantName: $merchantName, merchantDomain: $merchantDomain, amount: $amount)'; - } +class _ApplePayMultiMerchant implements ApplePayMultiMerchant { + const _ApplePayMultiMerchant({required this.merchantIdentifier, required this.externalIdentifier, required this.merchantName, this.merchantDomain, required this.amount}); + factory _ApplePayMultiMerchant.fromJson(Map json) => _$ApplePayMultiMerchantFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ApplePayMultiMerchantImpl && - (identical(other.merchantIdentifier, merchantIdentifier) || - other.merchantIdentifier == merchantIdentifier) && - (identical(other.externalIdentifier, externalIdentifier) || - other.externalIdentifier == externalIdentifier) && - (identical(other.merchantName, merchantName) || - other.merchantName == merchantName) && - (identical(other.merchantDomain, merchantDomain) || - other.merchantDomain == merchantDomain) && - (identical(other.amount, amount) || other.amount == amount)); - } +/// The apple pay merchant identifier +@override final String merchantIdentifier; +/// External identifier for the merchant +@override final String externalIdentifier; +/// The merchant display name Apple pay associates with the payment token +@override final String merchantName; +/// The merchant top level domain Apple Pay associates with teh payment token +@override final String? merchantDomain; +/// Amount to authorize for the payment token +@override final String amount; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, merchantIdentifier, - externalIdentifier, merchantName, merchantDomain, amount); - - /// Create a copy of ApplePayMultiMerchant - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ApplePayMultiMerchantImplCopyWith<_$ApplePayMultiMerchantImpl> - get copyWith => __$$ApplePayMultiMerchantImplCopyWithImpl< - _$ApplePayMultiMerchantImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ApplePayMultiMerchantImplToJson( - this, - ); - } +/// Create a copy of ApplePayMultiMerchant +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ApplePayMultiMerchantCopyWith<_ApplePayMultiMerchant> get copyWith => __$ApplePayMultiMerchantCopyWithImpl<_ApplePayMultiMerchant>(this, _$identity); + +@override +Map toJson() { + return _$ApplePayMultiMerchantToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApplePayMultiMerchant&&(identical(other.merchantIdentifier, merchantIdentifier) || other.merchantIdentifier == merchantIdentifier)&&(identical(other.externalIdentifier, externalIdentifier) || other.externalIdentifier == externalIdentifier)&&(identical(other.merchantName, merchantName) || other.merchantName == merchantName)&&(identical(other.merchantDomain, merchantDomain) || other.merchantDomain == merchantDomain)&&(identical(other.amount, amount) || other.amount == amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,merchantIdentifier,externalIdentifier,merchantName,merchantDomain,amount); + +@override +String toString() { + return 'ApplePayMultiMerchant(merchantIdentifier: $merchantIdentifier, externalIdentifier: $externalIdentifier, merchantName: $merchantName, merchantDomain: $merchantDomain, amount: $amount)'; } -abstract class _ApplePayMultiMerchant implements ApplePayMultiMerchant { - const factory _ApplePayMultiMerchant( - {required final String merchantIdentifier, - required final String externalIdentifier, - required final String merchantName, - final String? merchantDomain, - required final String amount}) = _$ApplePayMultiMerchantImpl; - factory _ApplePayMultiMerchant.fromJson(Map json) = - _$ApplePayMultiMerchantImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$ApplePayMultiMerchantCopyWith<$Res> implements $ApplePayMultiMerchantCopyWith<$Res> { + factory _$ApplePayMultiMerchantCopyWith(_ApplePayMultiMerchant value, $Res Function(_ApplePayMultiMerchant) _then) = __$ApplePayMultiMerchantCopyWithImpl; +@override @useResult +$Res call({ + String merchantIdentifier, String externalIdentifier, String merchantName, String? merchantDomain, String amount +}); - /// The apple pay merchant identifier - @override - String get merchantIdentifier; - /// External identifier for the merchant - @override - String get externalIdentifier; - /// The merchant display name Apple pay associates with the payment token - @override - String get merchantName; - /// The merchant top level domain Apple Pay associates with teh payment token - @override - String? get merchantDomain; +} +/// @nodoc +class __$ApplePayMultiMerchantCopyWithImpl<$Res> + implements _$ApplePayMultiMerchantCopyWith<$Res> { + __$ApplePayMultiMerchantCopyWithImpl(this._self, this._then); - /// Amount to authorize for the payment token - @override - String get amount; + final _ApplePayMultiMerchant _self; + final $Res Function(_ApplePayMultiMerchant) _then; - /// Create a copy of ApplePayMultiMerchant - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ApplePayMultiMerchantImplCopyWith<_$ApplePayMultiMerchantImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of ApplePayMultiMerchant +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? merchantIdentifier = null,Object? externalIdentifier = null,Object? merchantName = null,Object? merchantDomain = freezed,Object? amount = null,}) { + return _then(_ApplePayMultiMerchant( +merchantIdentifier: null == merchantIdentifier ? _self.merchantIdentifier : merchantIdentifier // ignore: cast_nullable_to_non_nullable +as String,externalIdentifier: null == externalIdentifier ? _self.externalIdentifier : externalIdentifier // ignore: cast_nullable_to_non_nullable +as String,merchantName: null == merchantName ? _self.merchantName : merchantName // ignore: cast_nullable_to_non_nullable +as String,merchantDomain: freezed == merchantDomain ? _self.merchantDomain : merchantDomain // ignore: cast_nullable_to_non_nullable +as String?,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as String, + )); } -PlatformPayOrderDetails _$PlatformPayOrderDetailsFromJson( - Map json) { - return _PlatformPayOrderDetails.fromJson(json); + } + /// @nodoc mixin _$PlatformPayOrderDetails { - /// eg: "com.myapp.order" - String get orderTypeIdentifier => throw _privateConstructorUsedError; - - /// eg: "ABC123-AAAA-1111" - String get orderIdentifier => throw _privateConstructorUsedError; - - /// eg: "https://my-backend.example.com/apple-order-tracking-backend" - String get webServiceUrl => throw _privateConstructorUsedError; - - /// eg: "abc123" - String get authenticationToken => throw _privateConstructorUsedError; - @optionalTypeArgs - TResult when({ - required TResult Function( - String orderTypeIdentifier, - String orderIdentifier, - String webServiceUrl, - String authenticationToken) - applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String orderTypeIdentifier, String orderIdentifier, - String webServiceUrl, String authenticationToken)? - applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String orderTypeIdentifier, String orderIdentifier, - String webServiceUrl, String authenticationToken)? - applePay, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult map({ - required TResult Function(_PlatformPayOrderDetails value) applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PlatformPayOrderDetails value)? applePay, - }) => - throw _privateConstructorUsedError; - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PlatformPayOrderDetails value)? applePay, - required TResult orElse(), - }) => - throw _privateConstructorUsedError; + +/// eg: "com.myapp.order" + String get orderTypeIdentifier;/// eg: "ABC123-AAAA-1111" + String get orderIdentifier;/// eg: "https://my-backend.example.com/apple-order-tracking-backend" + String get webServiceUrl;/// eg: "abc123" + String get authenticationToken; +/// Create a copy of PlatformPayOrderDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayOrderDetailsCopyWith get copyWith => _$PlatformPayOrderDetailsCopyWithImpl(this as PlatformPayOrderDetails, _$identity); /// Serializes this PlatformPayOrderDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of PlatformPayOrderDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPayOrderDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayOrderDetails&&(identical(other.orderTypeIdentifier, orderTypeIdentifier) || other.orderTypeIdentifier == orderTypeIdentifier)&&(identical(other.orderIdentifier, orderIdentifier) || other.orderIdentifier == orderIdentifier)&&(identical(other.webServiceUrl, webServiceUrl) || other.webServiceUrl == webServiceUrl)&&(identical(other.authenticationToken, authenticationToken) || other.authenticationToken == authenticationToken)); } -/// @nodoc -abstract class $PlatformPayOrderDetailsCopyWith<$Res> { - factory $PlatformPayOrderDetailsCopyWith(PlatformPayOrderDetails value, - $Res Function(PlatformPayOrderDetails) then) = - _$PlatformPayOrderDetailsCopyWithImpl<$Res, PlatformPayOrderDetails>; - @useResult - $Res call( - {String orderTypeIdentifier, - String orderIdentifier, - String webServiceUrl, - String authenticationToken}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,orderTypeIdentifier,orderIdentifier,webServiceUrl,authenticationToken); + +@override +String toString() { + return 'PlatformPayOrderDetails(orderTypeIdentifier: $orderTypeIdentifier, orderIdentifier: $orderIdentifier, webServiceUrl: $webServiceUrl, authenticationToken: $authenticationToken)'; } -/// @nodoc -class _$PlatformPayOrderDetailsCopyWithImpl<$Res, - $Val extends PlatformPayOrderDetails> - implements $PlatformPayOrderDetailsCopyWith<$Res> { - _$PlatformPayOrderDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPayOrderDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? orderTypeIdentifier = null, - Object? orderIdentifier = null, - Object? webServiceUrl = null, - Object? authenticationToken = null, - }) { - return _then(_value.copyWith( - orderTypeIdentifier: null == orderTypeIdentifier - ? _value.orderTypeIdentifier - : orderTypeIdentifier // ignore: cast_nullable_to_non_nullable - as String, - orderIdentifier: null == orderIdentifier - ? _value.orderIdentifier - : orderIdentifier // ignore: cast_nullable_to_non_nullable - as String, - webServiceUrl: null == webServiceUrl - ? _value.webServiceUrl - : webServiceUrl // ignore: cast_nullable_to_non_nullable - as String, - authenticationToken: null == authenticationToken - ? _value.authenticationToken - : authenticationToken // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } + } /// @nodoc -abstract class _$$PlatformPayOrderDetailsImplCopyWith<$Res> +abstract mixin class $PlatformPayOrderDetailsCopyWith<$Res> { + factory $PlatformPayOrderDetailsCopyWith(PlatformPayOrderDetails value, $Res Function(PlatformPayOrderDetails) _then) = _$PlatformPayOrderDetailsCopyWithImpl; +@useResult +$Res call({ + String orderTypeIdentifier, String orderIdentifier, String webServiceUrl, String authenticationToken +}); + + + + +} +/// @nodoc +class _$PlatformPayOrderDetailsCopyWithImpl<$Res> implements $PlatformPayOrderDetailsCopyWith<$Res> { - factory _$$PlatformPayOrderDetailsImplCopyWith( - _$PlatformPayOrderDetailsImpl value, - $Res Function(_$PlatformPayOrderDetailsImpl) then) = - __$$PlatformPayOrderDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String orderTypeIdentifier, - String orderIdentifier, - String webServiceUrl, - String authenticationToken}); + _$PlatformPayOrderDetailsCopyWithImpl(this._self, this._then); + + final PlatformPayOrderDetails _self; + final $Res Function(PlatformPayOrderDetails) _then; + +/// Create a copy of PlatformPayOrderDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? orderTypeIdentifier = null,Object? orderIdentifier = null,Object? webServiceUrl = null,Object? authenticationToken = null,}) { + return _then(_self.copyWith( +orderTypeIdentifier: null == orderTypeIdentifier ? _self.orderTypeIdentifier : orderTypeIdentifier // ignore: cast_nullable_to_non_nullable +as String,orderIdentifier: null == orderIdentifier ? _self.orderIdentifier : orderIdentifier // ignore: cast_nullable_to_non_nullable +as String,webServiceUrl: null == webServiceUrl ? _self.webServiceUrl : webServiceUrl // ignore: cast_nullable_to_non_nullable +as String,authenticationToken: null == authenticationToken ? _self.authenticationToken : authenticationToken // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PlatformPayOrderDetails]. +extension PlatformPayOrderDetailsPatterns on PlatformPayOrderDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _PlatformPayOrderDetails value)? applePay,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PlatformPayOrderDetails() when applePay != null: +return applePay(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _PlatformPayOrderDetails value) applePay,}){ +final _that = this; +switch (_that) { +case _PlatformPayOrderDetails(): +return applePay(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _PlatformPayOrderDetails value)? applePay,}){ +final _that = this; +switch (_that) { +case _PlatformPayOrderDetails() when applePay != null: +return applePay(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function( String orderTypeIdentifier, String orderIdentifier, String webServiceUrl, String authenticationToken)? applePay,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PlatformPayOrderDetails() when applePay != null: +return applePay(_that.orderTypeIdentifier,_that.orderIdentifier,_that.webServiceUrl,_that.authenticationToken);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function( String orderTypeIdentifier, String orderIdentifier, String webServiceUrl, String authenticationToken) applePay,}) {final _that = this; +switch (_that) { +case _PlatformPayOrderDetails(): +return applePay(_that.orderTypeIdentifier,_that.orderIdentifier,_that.webServiceUrl,_that.authenticationToken);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function( String orderTypeIdentifier, String orderIdentifier, String webServiceUrl, String authenticationToken)? applePay,}) {final _that = this; +switch (_that) { +case _PlatformPayOrderDetails() when applePay != null: +return applePay(_that.orderTypeIdentifier,_that.orderIdentifier,_that.webServiceUrl,_that.authenticationToken);case _: + return null; + +} } -/// @nodoc -class __$$PlatformPayOrderDetailsImplCopyWithImpl<$Res> - extends _$PlatformPayOrderDetailsCopyWithImpl<$Res, - _$PlatformPayOrderDetailsImpl> - implements _$$PlatformPayOrderDetailsImplCopyWith<$Res> { - __$$PlatformPayOrderDetailsImplCopyWithImpl( - _$PlatformPayOrderDetailsImpl _value, - $Res Function(_$PlatformPayOrderDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayOrderDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? orderTypeIdentifier = null, - Object? orderIdentifier = null, - Object? webServiceUrl = null, - Object? authenticationToken = null, - }) { - return _then(_$PlatformPayOrderDetailsImpl( - orderTypeIdentifier: null == orderTypeIdentifier - ? _value.orderTypeIdentifier - : orderTypeIdentifier // ignore: cast_nullable_to_non_nullable - as String, - orderIdentifier: null == orderIdentifier - ? _value.orderIdentifier - : orderIdentifier // ignore: cast_nullable_to_non_nullable - as String, - webServiceUrl: null == webServiceUrl - ? _value.webServiceUrl - : webServiceUrl // ignore: cast_nullable_to_non_nullable - as String, - authenticationToken: null == authenticationToken - ? _value.authenticationToken - : authenticationToken // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PlatformPayOrderDetailsImpl implements _PlatformPayOrderDetails { - const _$PlatformPayOrderDetailsImpl( - {required this.orderTypeIdentifier, - required this.orderIdentifier, - required this.webServiceUrl, - required this.authenticationToken}); - - factory _$PlatformPayOrderDetailsImpl.fromJson(Map json) => - _$$PlatformPayOrderDetailsImplFromJson(json); - - /// eg: "com.myapp.order" - @override - final String orderTypeIdentifier; - - /// eg: "ABC123-AAAA-1111" - @override - final String orderIdentifier; - - /// eg: "https://my-backend.example.com/apple-order-tracking-backend" - @override - final String webServiceUrl; - - /// eg: "abc123" - @override - final String authenticationToken; - - @override - String toString() { - return 'PlatformPayOrderDetails.applePay(orderTypeIdentifier: $orderTypeIdentifier, orderIdentifier: $orderIdentifier, webServiceUrl: $webServiceUrl, authenticationToken: $authenticationToken)'; - } +class _PlatformPayOrderDetails implements PlatformPayOrderDetails { + const _PlatformPayOrderDetails({required this.orderTypeIdentifier, required this.orderIdentifier, required this.webServiceUrl, required this.authenticationToken}); + factory _PlatformPayOrderDetails.fromJson(Map json) => _$PlatformPayOrderDetailsFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PlatformPayOrderDetailsImpl && - (identical(other.orderTypeIdentifier, orderTypeIdentifier) || - other.orderTypeIdentifier == orderTypeIdentifier) && - (identical(other.orderIdentifier, orderIdentifier) || - other.orderIdentifier == orderIdentifier) && - (identical(other.webServiceUrl, webServiceUrl) || - other.webServiceUrl == webServiceUrl) && - (identical(other.authenticationToken, authenticationToken) || - other.authenticationToken == authenticationToken)); - } +/// eg: "com.myapp.order" +@override final String orderTypeIdentifier; +/// eg: "ABC123-AAAA-1111" +@override final String orderIdentifier; +/// eg: "https://my-backend.example.com/apple-order-tracking-backend" +@override final String webServiceUrl; +/// eg: "abc123" +@override final String authenticationToken; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, orderTypeIdentifier, - orderIdentifier, webServiceUrl, authenticationToken); - - /// Create a copy of PlatformPayOrderDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PlatformPayOrderDetailsImplCopyWith<_$PlatformPayOrderDetailsImpl> - get copyWith => __$$PlatformPayOrderDetailsImplCopyWithImpl< - _$PlatformPayOrderDetailsImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - String orderTypeIdentifier, - String orderIdentifier, - String webServiceUrl, - String authenticationToken) - applePay, - }) { - return applePay(orderTypeIdentifier, orderIdentifier, webServiceUrl, - authenticationToken); - } +/// Create a copy of PlatformPayOrderDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PlatformPayOrderDetailsCopyWith<_PlatformPayOrderDetails> get copyWith => __$PlatformPayOrderDetailsCopyWithImpl<_PlatformPayOrderDetails>(this, _$identity); - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(String orderTypeIdentifier, String orderIdentifier, - String webServiceUrl, String authenticationToken)? - applePay, - }) { - return applePay?.call(orderTypeIdentifier, orderIdentifier, webServiceUrl, - authenticationToken); - } +@override +Map toJson() { + return _$PlatformPayOrderDetailsToJson(this, ); +} - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(String orderTypeIdentifier, String orderIdentifier, - String webServiceUrl, String authenticationToken)? - applePay, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(orderTypeIdentifier, orderIdentifier, webServiceUrl, - authenticationToken); - } - return orElse(); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PlatformPayOrderDetails&&(identical(other.orderTypeIdentifier, orderTypeIdentifier) || other.orderTypeIdentifier == orderTypeIdentifier)&&(identical(other.orderIdentifier, orderIdentifier) || other.orderIdentifier == orderIdentifier)&&(identical(other.webServiceUrl, webServiceUrl) || other.webServiceUrl == webServiceUrl)&&(identical(other.authenticationToken, authenticationToken) || other.authenticationToken == authenticationToken)); +} - @override - @optionalTypeArgs - TResult map({ - required TResult Function(_PlatformPayOrderDetails value) applePay, - }) { - return applePay(this); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,orderTypeIdentifier,orderIdentifier,webServiceUrl,authenticationToken); - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(_PlatformPayOrderDetails value)? applePay, - }) { - return applePay?.call(this); - } +@override +String toString() { + return 'PlatformPayOrderDetails.applePay(orderTypeIdentifier: $orderTypeIdentifier, orderIdentifier: $orderIdentifier, webServiceUrl: $webServiceUrl, authenticationToken: $authenticationToken)'; +} - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(_PlatformPayOrderDetails value)? applePay, - required TResult orElse(), - }) { - if (applePay != null) { - return applePay(this); - } - return orElse(); - } - @override - Map toJson() { - return _$$PlatformPayOrderDetailsImplToJson( - this, - ); - } } -abstract class _PlatformPayOrderDetails implements PlatformPayOrderDetails { - const factory _PlatformPayOrderDetails( - {required final String orderTypeIdentifier, - required final String orderIdentifier, - required final String webServiceUrl, - required final String authenticationToken}) = - _$PlatformPayOrderDetailsImpl; +/// @nodoc +abstract mixin class _$PlatformPayOrderDetailsCopyWith<$Res> implements $PlatformPayOrderDetailsCopyWith<$Res> { + factory _$PlatformPayOrderDetailsCopyWith(_PlatformPayOrderDetails value, $Res Function(_PlatformPayOrderDetails) _then) = __$PlatformPayOrderDetailsCopyWithImpl; +@override @useResult +$Res call({ + String orderTypeIdentifier, String orderIdentifier, String webServiceUrl, String authenticationToken +}); + + - factory _PlatformPayOrderDetails.fromJson(Map json) = - _$PlatformPayOrderDetailsImpl.fromJson; - /// eg: "com.myapp.order" - @override - String get orderTypeIdentifier; +} +/// @nodoc +class __$PlatformPayOrderDetailsCopyWithImpl<$Res> + implements _$PlatformPayOrderDetailsCopyWith<$Res> { + __$PlatformPayOrderDetailsCopyWithImpl(this._self, this._then); - /// eg: "ABC123-AAAA-1111" - @override - String get orderIdentifier; + final _PlatformPayOrderDetails _self; + final $Res Function(_PlatformPayOrderDetails) _then; - /// eg: "https://my-backend.example.com/apple-order-tracking-backend" - @override - String get webServiceUrl; +/// Create a copy of PlatformPayOrderDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? orderTypeIdentifier = null,Object? orderIdentifier = null,Object? webServiceUrl = null,Object? authenticationToken = null,}) { + return _then(_PlatformPayOrderDetails( +orderTypeIdentifier: null == orderTypeIdentifier ? _self.orderTypeIdentifier : orderTypeIdentifier // ignore: cast_nullable_to_non_nullable +as String,orderIdentifier: null == orderIdentifier ? _self.orderIdentifier : orderIdentifier // ignore: cast_nullable_to_non_nullable +as String,webServiceUrl: null == webServiceUrl ? _self.webServiceUrl : webServiceUrl // ignore: cast_nullable_to_non_nullable +as String,authenticationToken: null == authenticationToken ? _self.authenticationToken : authenticationToken // ignore: cast_nullable_to_non_nullable +as String, + )); +} - /// eg: "abc123" - @override - String get authenticationToken; - /// Create a copy of PlatformPayOrderDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PlatformPayOrderDetailsImplCopyWith<_$PlatformPayOrderDetailsImpl> - get copyWith => throw _privateConstructorUsedError; } -PlatformPayWebPaymentRequestCreateOptions - _$PlatformPayWebPaymentRequestCreateOptionsFromJson( - Map json) { - return _PaymentRequestCreateOptions.fromJson(json); +PlatformPayWebPaymentRequestCreateOptions _$PlatformPayWebPaymentRequestCreateOptionsFromJson( + Map json +) { + return _PaymentRequestCreateOptions.fromJson( + json + ); } /// @nodoc mixin _$PlatformPayWebPaymentRequestCreateOptions { - /// The two-letter country code of your Stripe account (e.g., US). - String get country => throw _privateConstructorUsedError; - /// Three character currency code (e.g., usd). - String get currency => throw _privateConstructorUsedError; +/// The two-letter country code of your Stripe account (e.g., US). + String get country;/// Three character currency code (e.g., usd). + String get currency;/// A PaymentItem object. This PaymentItem is shown to the customer in the browser’s payment interface. + PlatformPayWebPaymentItem get total;/// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. +/// Note that the sum of the line item amounts does not need to add up to the total amount above. + List get displayItems;/// By default, the browser‘s payment interface only asks the customer for actual payment information. A customer +/// name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object. +/// +/// We highly recommend you collect name as this also results in collection of billing address for Apple Pay. +/// The billing address can be used to perform address verification and block fraudulent payments. +/// For all other payment methods, the billing address is automatically collected when available. + bool get requestPayerName;/// See the requestPayerName option. + bool get requestPayerEmail;/// See the requestPayerName option. + bool get requestPayerPhone;/// Collect shipping address by setting this option to true. The address appears in the PaymentResponse. +/// +/// You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the +/// time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback. + bool get requestShipping;/// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. + List get shippingOptions;/// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option +/// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. + List get disableWallets; +/// Create a copy of PlatformPayWebPaymentRequestCreateOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayWebPaymentRequestCreateOptionsCopyWith get copyWith => _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl(this as PlatformPayWebPaymentRequestCreateOptions, _$identity); - /// A PaymentItem object. This PaymentItem is shown to the customer in the browser’s payment interface. - PlatformPayWebPaymentItem get total => throw _privateConstructorUsedError; + /// Serializes this PlatformPayWebPaymentRequestCreateOptions to a JSON map. + Map toJson(); - /// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. - /// Note that the sum of the line item amounts does not need to add up to the total amount above. - List get displayItems => - throw _privateConstructorUsedError; - /// By default, the browser‘s payment interface only asks the customer for actual payment information. A customer - /// name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object. - /// - /// We highly recommend you collect name as this also results in collection of billing address for Apple Pay. - /// The billing address can be used to perform address verification and block fraudulent payments. - /// For all other payment methods, the billing address is automatically collected when available. - bool get requestPayerName => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayWebPaymentRequestCreateOptions&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.total, total) || other.total == total)&&const DeepCollectionEquality().equals(other.displayItems, displayItems)&&(identical(other.requestPayerName, requestPayerName) || other.requestPayerName == requestPayerName)&&(identical(other.requestPayerEmail, requestPayerEmail) || other.requestPayerEmail == requestPayerEmail)&&(identical(other.requestPayerPhone, requestPayerPhone) || other.requestPayerPhone == requestPayerPhone)&&(identical(other.requestShipping, requestShipping) || other.requestShipping == requestShipping)&&const DeepCollectionEquality().equals(other.shippingOptions, shippingOptions)&&const DeepCollectionEquality().equals(other.disableWallets, disableWallets)); +} - /// See the requestPayerName option. - bool get requestPayerEmail => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,currency,total,const DeepCollectionEquality().hash(displayItems),requestPayerName,requestPayerEmail,requestPayerPhone,requestShipping,const DeepCollectionEquality().hash(shippingOptions),const DeepCollectionEquality().hash(disableWallets)); - /// See the requestPayerName option. - bool get requestPayerPhone => throw _privateConstructorUsedError; +@override +String toString() { + return 'PlatformPayWebPaymentRequestCreateOptions(country: $country, currency: $currency, total: $total, displayItems: $displayItems, requestPayerName: $requestPayerName, requestPayerEmail: $requestPayerEmail, requestPayerPhone: $requestPayerPhone, requestShipping: $requestShipping, shippingOptions: $shippingOptions, disableWallets: $disableWallets)'; +} - /// Collect shipping address by setting this option to true. The address appears in the PaymentResponse. - /// - /// You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the - /// time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback. - bool get requestShipping => throw _privateConstructorUsedError; - /// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. - List get shippingOptions => - throw _privateConstructorUsedError; +} - /// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option - /// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. - List get disableWallets => - throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> { + factory $PlatformPayWebPaymentRequestCreateOptionsCopyWith(PlatformPayWebPaymentRequestCreateOptions value, $Res Function(PlatformPayWebPaymentRequestCreateOptions) _then) = _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl; +@useResult +$Res call({ + String country, String currency, PlatformPayWebPaymentItem total, List displayItems, bool requestPayerName, bool requestPayerEmail, bool requestPayerPhone, bool requestShipping, List shippingOptions, List disableWallets +}); - /// Serializes this PlatformPayWebPaymentRequestCreateOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of PlatformPayWebPaymentRequestCreateOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPayWebPaymentRequestCreateOptionsCopyWith< - PlatformPayWebPaymentRequestCreateOptions> - get copyWith => throw _privateConstructorUsedError; -} +$PlatformPayWebPaymentItemCopyWith<$Res> get total; -/// @nodoc -abstract class $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> { - factory $PlatformPayWebPaymentRequestCreateOptionsCopyWith( - PlatformPayWebPaymentRequestCreateOptions value, - $Res Function(PlatformPayWebPaymentRequestCreateOptions) then) = - _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl<$Res, - PlatformPayWebPaymentRequestCreateOptions>; - @useResult - $Res call( - {String country, - String currency, - PlatformPayWebPaymentItem total, - List displayItems, - bool requestPayerName, - bool requestPayerEmail, - bool requestPayerPhone, - bool requestShipping, - List shippingOptions, - List disableWallets}); - - $PlatformPayWebPaymentItemCopyWith<$Res> get total; } - /// @nodoc -class _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl<$Res, - $Val extends PlatformPayWebPaymentRequestCreateOptions> +class _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl<$Res> implements $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> { - _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl( - this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPayWebPaymentRequestCreateOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? currency = null, - Object? total = null, - Object? displayItems = null, - Object? requestPayerName = null, - Object? requestPayerEmail = null, - Object? requestPayerPhone = null, - Object? requestShipping = null, - Object? shippingOptions = null, - Object? disableWallets = null, - }) { - return _then(_value.copyWith( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - total: null == total - ? _value.total - : total // ignore: cast_nullable_to_non_nullable - as PlatformPayWebPaymentItem, - displayItems: null == displayItems - ? _value.displayItems - : displayItems // ignore: cast_nullable_to_non_nullable - as List, - requestPayerName: null == requestPayerName - ? _value.requestPayerName - : requestPayerName // ignore: cast_nullable_to_non_nullable - as bool, - requestPayerEmail: null == requestPayerEmail - ? _value.requestPayerEmail - : requestPayerEmail // ignore: cast_nullable_to_non_nullable - as bool, - requestPayerPhone: null == requestPayerPhone - ? _value.requestPayerPhone - : requestPayerPhone // ignore: cast_nullable_to_non_nullable - as bool, - requestShipping: null == requestShipping - ? _value.requestShipping - : requestShipping // ignore: cast_nullable_to_non_nullable - as bool, - shippingOptions: null == shippingOptions - ? _value.shippingOptions - : shippingOptions // ignore: cast_nullable_to_non_nullable - as List, - disableWallets: null == disableWallets - ? _value.disableWallets - : disableWallets // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); - } + _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl(this._self, this._then); + + final PlatformPayWebPaymentRequestCreateOptions _self; + final $Res Function(PlatformPayWebPaymentRequestCreateOptions) _then; + +/// Create a copy of PlatformPayWebPaymentRequestCreateOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? country = null,Object? currency = null,Object? total = null,Object? displayItems = null,Object? requestPayerName = null,Object? requestPayerEmail = null,Object? requestPayerPhone = null,Object? requestShipping = null,Object? shippingOptions = null,Object? disableWallets = null,}) { + return _then(_self.copyWith( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,total: null == total ? _self.total : total // ignore: cast_nullable_to_non_nullable +as PlatformPayWebPaymentItem,displayItems: null == displayItems ? _self.displayItems : displayItems // ignore: cast_nullable_to_non_nullable +as List,requestPayerName: null == requestPayerName ? _self.requestPayerName : requestPayerName // ignore: cast_nullable_to_non_nullable +as bool,requestPayerEmail: null == requestPayerEmail ? _self.requestPayerEmail : requestPayerEmail // ignore: cast_nullable_to_non_nullable +as bool,requestPayerPhone: null == requestPayerPhone ? _self.requestPayerPhone : requestPayerPhone // ignore: cast_nullable_to_non_nullable +as bool,requestShipping: null == requestShipping ? _self.requestShipping : requestShipping // ignore: cast_nullable_to_non_nullable +as bool,shippingOptions: null == shippingOptions ? _self.shippingOptions : shippingOptions // ignore: cast_nullable_to_non_nullable +as List,disableWallets: null == disableWallets ? _self.disableWallets : disableWallets // ignore: cast_nullable_to_non_nullable +as List, + )); +} +/// Create a copy of PlatformPayWebPaymentRequestCreateOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PlatformPayWebPaymentItemCopyWith<$Res> get total { + + return $PlatformPayWebPaymentItemCopyWith<$Res>(_self.total, (value) { + return _then(_self.copyWith(total: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [PlatformPayWebPaymentRequestCreateOptions]. +extension PlatformPayWebPaymentRequestCreateOptionsPatterns on PlatformPayWebPaymentRequestCreateOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _PaymentRequestCreateOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _PaymentRequestCreateOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _PaymentRequestCreateOptions value) $default,){ +final _that = this; +switch (_that) { +case _PaymentRequestCreateOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _PaymentRequestCreateOptions value)? $default,){ +final _that = this; +switch (_that) { +case _PaymentRequestCreateOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String country, String currency, PlatformPayWebPaymentItem total, List displayItems, bool requestPayerName, bool requestPayerEmail, bool requestPayerPhone, bool requestShipping, List shippingOptions, List disableWallets)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _PaymentRequestCreateOptions() when $default != null: +return $default(_that.country,_that.currency,_that.total,_that.displayItems,_that.requestPayerName,_that.requestPayerEmail,_that.requestPayerPhone,_that.requestShipping,_that.shippingOptions,_that.disableWallets);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String country, String currency, PlatformPayWebPaymentItem total, List displayItems, bool requestPayerName, bool requestPayerEmail, bool requestPayerPhone, bool requestShipping, List shippingOptions, List disableWallets) $default,) {final _that = this; +switch (_that) { +case _PaymentRequestCreateOptions(): +return $default(_that.country,_that.currency,_that.total,_that.displayItems,_that.requestPayerName,_that.requestPayerEmail,_that.requestPayerPhone,_that.requestShipping,_that.shippingOptions,_that.disableWallets);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` - /// Create a copy of PlatformPayWebPaymentRequestCreateOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $PlatformPayWebPaymentItemCopyWith<$Res> get total { - return $PlatformPayWebPaymentItemCopyWith<$Res>(_value.total, (value) { - return _then(_value.copyWith(total: value) as $Val); - }); - } -} +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String country, String currency, PlatformPayWebPaymentItem total, List displayItems, bool requestPayerName, bool requestPayerEmail, bool requestPayerPhone, bool requestShipping, List shippingOptions, List disableWallets)? $default,) {final _that = this; +switch (_that) { +case _PaymentRequestCreateOptions() when $default != null: +return $default(_that.country,_that.currency,_that.total,_that.displayItems,_that.requestPayerName,_that.requestPayerEmail,_that.requestPayerPhone,_that.requestShipping,_that.shippingOptions,_that.disableWallets);case _: + return null; -/// @nodoc -abstract class _$$PaymentRequestCreateOptionsImplCopyWith<$Res> - implements $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> { - factory _$$PaymentRequestCreateOptionsImplCopyWith( - _$PaymentRequestCreateOptionsImpl value, - $Res Function(_$PaymentRequestCreateOptionsImpl) then) = - __$$PaymentRequestCreateOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String country, - String currency, - PlatformPayWebPaymentItem total, - List displayItems, - bool requestPayerName, - bool requestPayerEmail, - bool requestPayerPhone, - bool requestShipping, - List shippingOptions, - List disableWallets}); - - @override - $PlatformPayWebPaymentItemCopyWith<$Res> get total; +} } -/// @nodoc -class __$$PaymentRequestCreateOptionsImplCopyWithImpl<$Res> - extends _$PlatformPayWebPaymentRequestCreateOptionsCopyWithImpl<$Res, - _$PaymentRequestCreateOptionsImpl> - implements _$$PaymentRequestCreateOptionsImplCopyWith<$Res> { - __$$PaymentRequestCreateOptionsImplCopyWithImpl( - _$PaymentRequestCreateOptionsImpl _value, - $Res Function(_$PaymentRequestCreateOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayWebPaymentRequestCreateOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? country = null, - Object? currency = null, - Object? total = null, - Object? displayItems = null, - Object? requestPayerName = null, - Object? requestPayerEmail = null, - Object? requestPayerPhone = null, - Object? requestShipping = null, - Object? shippingOptions = null, - Object? disableWallets = null, - }) { - return _then(_$PaymentRequestCreateOptionsImpl( - country: null == country - ? _value.country - : country // ignore: cast_nullable_to_non_nullable - as String, - currency: null == currency - ? _value.currency - : currency // ignore: cast_nullable_to_non_nullable - as String, - total: null == total - ? _value.total - : total // ignore: cast_nullable_to_non_nullable - as PlatformPayWebPaymentItem, - displayItems: null == displayItems - ? _value._displayItems - : displayItems // ignore: cast_nullable_to_non_nullable - as List, - requestPayerName: null == requestPayerName - ? _value.requestPayerName - : requestPayerName // ignore: cast_nullable_to_non_nullable - as bool, - requestPayerEmail: null == requestPayerEmail - ? _value.requestPayerEmail - : requestPayerEmail // ignore: cast_nullable_to_non_nullable - as bool, - requestPayerPhone: null == requestPayerPhone - ? _value.requestPayerPhone - : requestPayerPhone // ignore: cast_nullable_to_non_nullable - as bool, - requestShipping: null == requestShipping - ? _value.requestShipping - : requestShipping // ignore: cast_nullable_to_non_nullable - as bool, - shippingOptions: null == shippingOptions - ? _value._shippingOptions - : shippingOptions // ignore: cast_nullable_to_non_nullable - as List, - disableWallets: null == disableWallets - ? _value._disableWallets - : disableWallets // ignore: cast_nullable_to_non_nullable - as List, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$PaymentRequestCreateOptionsImpl - implements _PaymentRequestCreateOptions { - const _$PaymentRequestCreateOptionsImpl( - {required this.country, - required this.currency, - required this.total, - final List displayItems = const [], - this.requestPayerName = false, - this.requestPayerEmail = false, - this.requestPayerPhone = false, - this.requestShipping = false, - final List shippingOptions = const [], - final List disableWallets = const []}) - : _displayItems = displayItems, - _shippingOptions = shippingOptions, - _disableWallets = disableWallets; - - factory _$PaymentRequestCreateOptionsImpl.fromJson( - Map json) => - _$$PaymentRequestCreateOptionsImplFromJson(json); - - /// The two-letter country code of your Stripe account (e.g., US). - @override - final String country; - - /// Three character currency code (e.g., usd). - @override - final String currency; - - /// A PaymentItem object. This PaymentItem is shown to the customer in the browser’s payment interface. - @override - final PlatformPayWebPaymentItem total; - - /// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. - /// Note that the sum of the line item amounts does not need to add up to the total amount above. - final List _displayItems; - - /// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. - /// Note that the sum of the line item amounts does not need to add up to the total amount above. - @override - @JsonKey() - List get displayItems { - if (_displayItems is EqualUnmodifiableListView) return _displayItems; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_displayItems); - } - - /// By default, the browser‘s payment interface only asks the customer for actual payment information. A customer - /// name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object. - /// - /// We highly recommend you collect name as this also results in collection of billing address for Apple Pay. - /// The billing address can be used to perform address verification and block fraudulent payments. - /// For all other payment methods, the billing address is automatically collected when available. - @override - @JsonKey() - final bool requestPayerName; - - /// See the requestPayerName option. - @override - @JsonKey() - final bool requestPayerEmail; - - /// See the requestPayerName option. - @override - @JsonKey() - final bool requestPayerPhone; - - /// Collect shipping address by setting this option to true. The address appears in the PaymentResponse. - /// - /// You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the - /// time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback. - @override - @JsonKey() - final bool requestShipping; - - /// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. - final List _shippingOptions; - - /// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. - @override - @JsonKey() - List get shippingOptions { - if (_shippingOptions is EqualUnmodifiableListView) return _shippingOptions; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_shippingOptions); - } +class _PaymentRequestCreateOptions implements PlatformPayWebPaymentRequestCreateOptions { + const _PaymentRequestCreateOptions({required this.country, required this.currency, required this.total, final List displayItems = const [], this.requestPayerName = false, this.requestPayerEmail = false, this.requestPayerPhone = false, this.requestShipping = false, final List shippingOptions = const [], final List disableWallets = const []}): _displayItems = displayItems,_shippingOptions = shippingOptions,_disableWallets = disableWallets; + factory _PaymentRequestCreateOptions.fromJson(Map json) => _$PaymentRequestCreateOptionsFromJson(json); - /// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option - /// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. - final List _disableWallets; - - /// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option - /// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. - @override - @JsonKey() - List get disableWallets { - if (_disableWallets is EqualUnmodifiableListView) return _disableWallets; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_disableWallets); - } - - @override - String toString() { - return 'PlatformPayWebPaymentRequestCreateOptions(country: $country, currency: $currency, total: $total, displayItems: $displayItems, requestPayerName: $requestPayerName, requestPayerEmail: $requestPayerEmail, requestPayerPhone: $requestPayerPhone, requestShipping: $requestShipping, shippingOptions: $shippingOptions, disableWallets: $disableWallets)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$PaymentRequestCreateOptionsImpl && - (identical(other.country, country) || other.country == country) && - (identical(other.currency, currency) || - other.currency == currency) && - (identical(other.total, total) || other.total == total) && - const DeepCollectionEquality() - .equals(other._displayItems, _displayItems) && - (identical(other.requestPayerName, requestPayerName) || - other.requestPayerName == requestPayerName) && - (identical(other.requestPayerEmail, requestPayerEmail) || - other.requestPayerEmail == requestPayerEmail) && - (identical(other.requestPayerPhone, requestPayerPhone) || - other.requestPayerPhone == requestPayerPhone) && - (identical(other.requestShipping, requestShipping) || - other.requestShipping == requestShipping) && - const DeepCollectionEquality() - .equals(other._shippingOptions, _shippingOptions) && - const DeepCollectionEquality() - .equals(other._disableWallets, _disableWallets)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - country, - currency, - total, - const DeepCollectionEquality().hash(_displayItems), - requestPayerName, - requestPayerEmail, - requestPayerPhone, - requestShipping, - const DeepCollectionEquality().hash(_shippingOptions), - const DeepCollectionEquality().hash(_disableWallets)); - - /// Create a copy of PlatformPayWebPaymentRequestCreateOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$PaymentRequestCreateOptionsImplCopyWith<_$PaymentRequestCreateOptionsImpl> - get copyWith => __$$PaymentRequestCreateOptionsImplCopyWithImpl< - _$PaymentRequestCreateOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$PaymentRequestCreateOptionsImplToJson( - this, - ); - } +/// The two-letter country code of your Stripe account (e.g., US). +@override final String country; +/// Three character currency code (e.g., usd). +@override final String currency; +/// A PaymentItem object. This PaymentItem is shown to the customer in the browser’s payment interface. +@override final PlatformPayWebPaymentItem total; +/// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. +/// Note that the sum of the line item amounts does not need to add up to the total amount above. + final List _displayItems; +/// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. +/// Note that the sum of the line item amounts does not need to add up to the total amount above. +@override@JsonKey() List get displayItems { + if (_displayItems is EqualUnmodifiableListView) return _displayItems; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_displayItems); +} + +/// By default, the browser‘s payment interface only asks the customer for actual payment information. A customer +/// name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object. +/// +/// We highly recommend you collect name as this also results in collection of billing address for Apple Pay. +/// The billing address can be used to perform address verification and block fraudulent payments. +/// For all other payment methods, the billing address is automatically collected when available. +@override@JsonKey() final bool requestPayerName; +/// See the requestPayerName option. +@override@JsonKey() final bool requestPayerEmail; +/// See the requestPayerName option. +@override@JsonKey() final bool requestPayerPhone; +/// Collect shipping address by setting this option to true. The address appears in the PaymentResponse. +/// +/// You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the +/// time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback. +@override@JsonKey() final bool requestShipping; +/// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. + final List _shippingOptions; +/// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. +@override@JsonKey() List get shippingOptions { + if (_shippingOptions is EqualUnmodifiableListView) return _shippingOptions; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_shippingOptions); +} + +/// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option +/// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. + final List _disableWallets; +/// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option +/// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. +@override@JsonKey() List get disableWallets { + if (_disableWallets is EqualUnmodifiableListView) return _disableWallets; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_disableWallets); +} + + +/// Create a copy of PlatformPayWebPaymentRequestCreateOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$PaymentRequestCreateOptionsCopyWith<_PaymentRequestCreateOptions> get copyWith => __$PaymentRequestCreateOptionsCopyWithImpl<_PaymentRequestCreateOptions>(this, _$identity); + +@override +Map toJson() { + return _$PaymentRequestCreateOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _PaymentRequestCreateOptions&&(identical(other.country, country) || other.country == country)&&(identical(other.currency, currency) || other.currency == currency)&&(identical(other.total, total) || other.total == total)&&const DeepCollectionEquality().equals(other._displayItems, _displayItems)&&(identical(other.requestPayerName, requestPayerName) || other.requestPayerName == requestPayerName)&&(identical(other.requestPayerEmail, requestPayerEmail) || other.requestPayerEmail == requestPayerEmail)&&(identical(other.requestPayerPhone, requestPayerPhone) || other.requestPayerPhone == requestPayerPhone)&&(identical(other.requestShipping, requestShipping) || other.requestShipping == requestShipping)&&const DeepCollectionEquality().equals(other._shippingOptions, _shippingOptions)&&const DeepCollectionEquality().equals(other._disableWallets, _disableWallets)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,country,currency,total,const DeepCollectionEquality().hash(_displayItems),requestPayerName,requestPayerEmail,requestPayerPhone,requestShipping,const DeepCollectionEquality().hash(_shippingOptions),const DeepCollectionEquality().hash(_disableWallets)); + +@override +String toString() { + return 'PlatformPayWebPaymentRequestCreateOptions(country: $country, currency: $currency, total: $total, displayItems: $displayItems, requestPayerName: $requestPayerName, requestPayerEmail: $requestPayerEmail, requestPayerPhone: $requestPayerPhone, requestShipping: $requestShipping, shippingOptions: $shippingOptions, disableWallets: $disableWallets)'; +} + + +} + +/// @nodoc +abstract mixin class _$PaymentRequestCreateOptionsCopyWith<$Res> implements $PlatformPayWebPaymentRequestCreateOptionsCopyWith<$Res> { + factory _$PaymentRequestCreateOptionsCopyWith(_PaymentRequestCreateOptions value, $Res Function(_PaymentRequestCreateOptions) _then) = __$PaymentRequestCreateOptionsCopyWithImpl; +@override @useResult +$Res call({ + String country, String currency, PlatformPayWebPaymentItem total, List displayItems, bool requestPayerName, bool requestPayerEmail, bool requestPayerPhone, bool requestShipping, List shippingOptions, List disableWallets +}); + + +@override $PlatformPayWebPaymentItemCopyWith<$Res> get total; + +} +/// @nodoc +class __$PaymentRequestCreateOptionsCopyWithImpl<$Res> + implements _$PaymentRequestCreateOptionsCopyWith<$Res> { + __$PaymentRequestCreateOptionsCopyWithImpl(this._self, this._then); + + final _PaymentRequestCreateOptions _self; + final $Res Function(_PaymentRequestCreateOptions) _then; + +/// Create a copy of PlatformPayWebPaymentRequestCreateOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? country = null,Object? currency = null,Object? total = null,Object? displayItems = null,Object? requestPayerName = null,Object? requestPayerEmail = null,Object? requestPayerPhone = null,Object? requestShipping = null,Object? shippingOptions = null,Object? disableWallets = null,}) { + return _then(_PaymentRequestCreateOptions( +country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable +as String,currency: null == currency ? _self.currency : currency // ignore: cast_nullable_to_non_nullable +as String,total: null == total ? _self.total : total // ignore: cast_nullable_to_non_nullable +as PlatformPayWebPaymentItem,displayItems: null == displayItems ? _self._displayItems : displayItems // ignore: cast_nullable_to_non_nullable +as List,requestPayerName: null == requestPayerName ? _self.requestPayerName : requestPayerName // ignore: cast_nullable_to_non_nullable +as bool,requestPayerEmail: null == requestPayerEmail ? _self.requestPayerEmail : requestPayerEmail // ignore: cast_nullable_to_non_nullable +as bool,requestPayerPhone: null == requestPayerPhone ? _self.requestPayerPhone : requestPayerPhone // ignore: cast_nullable_to_non_nullable +as bool,requestShipping: null == requestShipping ? _self.requestShipping : requestShipping // ignore: cast_nullable_to_non_nullable +as bool,shippingOptions: null == shippingOptions ? _self._shippingOptions : shippingOptions // ignore: cast_nullable_to_non_nullable +as List,disableWallets: null == disableWallets ? _self._disableWallets : disableWallets // ignore: cast_nullable_to_non_nullable +as List, + )); } -abstract class _PaymentRequestCreateOptions - implements PlatformPayWebPaymentRequestCreateOptions { - const factory _PaymentRequestCreateOptions( - {required final String country, - required final String currency, - required final PlatformPayWebPaymentItem total, - final List displayItems, - final bool requestPayerName, - final bool requestPayerEmail, - final bool requestPayerPhone, - final bool requestShipping, - final List shippingOptions, - final List disableWallets}) = - _$PaymentRequestCreateOptionsImpl; - - factory _PaymentRequestCreateOptions.fromJson(Map json) = - _$PaymentRequestCreateOptionsImpl.fromJson; - - /// The two-letter country code of your Stripe account (e.g., US). - @override - String get country; - - /// Three character currency code (e.g., usd). - @override - String get currency; - - /// A PaymentItem object. This PaymentItem is shown to the customer in the browser’s payment interface. - @override - PlatformPayWebPaymentItem get total; - - /// An array of PaymentItem objects. These objects are shown as line items in the browser’s payment interface. - /// Note that the sum of the line item amounts does not need to add up to the total amount above. - @override - List get displayItems; - - /// By default, the browser‘s payment interface only asks the customer for actual payment information. A customer - /// name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object. - /// - /// We highly recommend you collect name as this also results in collection of billing address for Apple Pay. - /// The billing address can be used to perform address verification and block fraudulent payments. - /// For all other payment methods, the billing address is automatically collected when available. - @override - bool get requestPayerName; - - /// See the requestPayerName option. - @override - bool get requestPayerEmail; - - /// See the requestPayerName option. - @override - bool get requestPayerPhone; - - /// Collect shipping address by setting this option to true. The address appears in the PaymentResponse. - /// - /// You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the - /// time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback. - @override - bool get requestShipping; - - /// An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option. - @override - List get shippingOptions; - - /// An array of wallet strings. Can be one or more of applePay, googlePay, link, and browserCard. Use this option - /// to disable Apple Pay, Google Pay, Link, and/or browser-saved cards. - @override - List get disableWallets; - - /// Create a copy of PlatformPayWebPaymentRequestCreateOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$PaymentRequestCreateOptionsImplCopyWith<_$PaymentRequestCreateOptionsImpl> - get copyWith => throw _privateConstructorUsedError; +/// Create a copy of PlatformPayWebPaymentRequestCreateOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$PlatformPayWebPaymentItemCopyWith<$Res> get total { + + return $PlatformPayWebPaymentItemCopyWith<$Res>(_self.total, (value) { + return _then(_self.copyWith(total: value)); + }); +} } PlatformPayWebShippingOption _$PlatformPayWebShippingOptionFromJson( - Map json) { - return _$ShippingOption.fromJson(json); + Map json +) { + return _$ShippingOption.fromJson( + json + ); } /// @nodoc mixin _$PlatformPayWebShippingOption { - /// A unique ID you create to keep track of this shipping option. You’ll be told the ID of the selected option - /// on changes and on completion. - String get id => throw _privateConstructorUsedError; - /// A short label for this shipping option. - String get label => throw _privateConstructorUsedError; +/// A unique ID you create to keep track of this shipping option. You’ll be told the ID of the selected option +/// on changes and on completion. + String get id;/// A short label for this shipping option. + String get label;/// A longer description of this shipping option. + String get detail;/// The amount to show for this shipping option. If the cost of this shipping option depends on the shipping address +/// the customer enters, listen for the shippingaddresschange event. + num get amount; +/// Create a copy of PlatformPayWebShippingOption +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayWebShippingOptionCopyWith get copyWith => _$PlatformPayWebShippingOptionCopyWithImpl(this as PlatformPayWebShippingOption, _$identity); - /// A longer description of this shipping option. - String get detail => throw _privateConstructorUsedError; + /// Serializes this PlatformPayWebShippingOption to a JSON map. + Map toJson(); - /// The amount to show for this shipping option. If the cost of this shipping option depends on the shipping address - /// the customer enters, listen for the shippingaddresschange event. - num get amount => throw _privateConstructorUsedError; - /// Serializes this PlatformPayWebShippingOption to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayWebShippingOption&&(identical(other.id, id) || other.id == id)&&(identical(other.label, label) || other.label == label)&&(identical(other.detail, detail) || other.detail == detail)&&(identical(other.amount, amount) || other.amount == amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,label,detail,amount); - /// Create a copy of PlatformPayWebShippingOption - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPayWebShippingOptionCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'PlatformPayWebShippingOption(id: $id, label: $label, detail: $detail, amount: $amount)'; } -/// @nodoc -abstract class $PlatformPayWebShippingOptionCopyWith<$Res> { - factory $PlatformPayWebShippingOptionCopyWith( - PlatformPayWebShippingOption value, - $Res Function(PlatformPayWebShippingOption) then) = - _$PlatformPayWebShippingOptionCopyWithImpl<$Res, - PlatformPayWebShippingOption>; - @useResult - $Res call({String id, String label, String detail, num amount}); + } /// @nodoc -class _$PlatformPayWebShippingOptionCopyWithImpl<$Res, - $Val extends PlatformPayWebShippingOption> - implements $PlatformPayWebShippingOptionCopyWith<$Res> { - _$PlatformPayWebShippingOptionCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPayWebShippingOption - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? label = null, - Object? detail = null, - Object? amount = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - detail: null == detail - ? _value.detail - : detail // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as num, - ) as $Val); - } -} +abstract mixin class $PlatformPayWebShippingOptionCopyWith<$Res> { + factory $PlatformPayWebShippingOptionCopyWith(PlatformPayWebShippingOption value, $Res Function(PlatformPayWebShippingOption) _then) = _$PlatformPayWebShippingOptionCopyWithImpl; +@useResult +$Res call({ + String id, String label, String detail, num amount +}); + + + +} /// @nodoc -abstract class _$$$ShippingOptionImplCopyWith<$Res> +class _$PlatformPayWebShippingOptionCopyWithImpl<$Res> implements $PlatformPayWebShippingOptionCopyWith<$Res> { - factory _$$$ShippingOptionImplCopyWith(_$$ShippingOptionImpl value, - $Res Function(_$$ShippingOptionImpl) then) = - __$$$ShippingOptionImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String id, String label, String detail, num amount}); + _$PlatformPayWebShippingOptionCopyWithImpl(this._self, this._then); + + final PlatformPayWebShippingOption _self; + final $Res Function(PlatformPayWebShippingOption) _then; + +/// Create a copy of PlatformPayWebShippingOption +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? label = null,Object? detail = null,Object? amount = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,detail: null == detail ? _self.detail : detail // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as num, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PlatformPayWebShippingOption]. +extension PlatformPayWebShippingOptionPatterns on PlatformPayWebShippingOption { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _$ShippingOption value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _$ShippingOption() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _$ShippingOption value) $default,){ +final _that = this; +switch (_that) { +case _$ShippingOption(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _$ShippingOption value)? $default,){ +final _that = this; +switch (_that) { +case _$ShippingOption() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String label, String detail, num amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _$ShippingOption() when $default != null: +return $default(_that.id,_that.label,_that.detail,_that.amount);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String label, String detail, num amount) $default,) {final _that = this; +switch (_that) { +case _$ShippingOption(): +return $default(_that.id,_that.label,_that.detail,_that.amount);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String label, String detail, num amount)? $default,) {final _that = this; +switch (_that) { +case _$ShippingOption() when $default != null: +return $default(_that.id,_that.label,_that.detail,_that.amount);case _: + return null; + +} } -/// @nodoc -class __$$$ShippingOptionImplCopyWithImpl<$Res> - extends _$PlatformPayWebShippingOptionCopyWithImpl<$Res, - _$$ShippingOptionImpl> implements _$$$ShippingOptionImplCopyWith<$Res> { - __$$$ShippingOptionImplCopyWithImpl( - _$$ShippingOptionImpl _value, $Res Function(_$$ShippingOptionImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayWebShippingOption - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? label = null, - Object? detail = null, - Object? amount = null, - }) { - return _then(_$$ShippingOptionImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - detail: null == detail - ? _value.detail - : detail // ignore: cast_nullable_to_non_nullable - as String, - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as num, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$$ShippingOptionImpl implements _$ShippingOption { - const _$$ShippingOptionImpl( - {required this.id, - required this.label, - required this.detail, - required this.amount}); - - factory _$$ShippingOptionImpl.fromJson(Map json) => - _$$$ShippingOptionImplFromJson(json); - - /// A unique ID you create to keep track of this shipping option. You’ll be told the ID of the selected option - /// on changes and on completion. - @override - final String id; - - /// A short label for this shipping option. - @override - final String label; - - /// A longer description of this shipping option. - @override - final String detail; - - /// The amount to show for this shipping option. If the cost of this shipping option depends on the shipping address - /// the customer enters, listen for the shippingaddresschange event. - @override - final num amount; - - @override - String toString() { - return 'PlatformPayWebShippingOption(id: $id, label: $label, detail: $detail, amount: $amount)'; - } +class _$ShippingOption implements PlatformPayWebShippingOption { + const _$ShippingOption({required this.id, required this.label, required this.detail, required this.amount}); + factory _$ShippingOption.fromJson(Map json) => _$$ShippingOptionFromJson(json); + +/// A unique ID you create to keep track of this shipping option. You’ll be told the ID of the selected option +/// on changes and on completion. +@override final String id; +/// A short label for this shipping option. +@override final String label; +/// A longer description of this shipping option. +@override final String detail; +/// The amount to show for this shipping option. If the cost of this shipping option depends on the shipping address +/// the customer enters, listen for the shippingaddresschange event. +@override final num amount; + +/// Create a copy of PlatformPayWebShippingOption +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$$ShippingOptionCopyWith<_$ShippingOption> get copyWith => __$$ShippingOptionCopyWithImpl<_$ShippingOption>(this, _$identity); + +@override +Map toJson() { + return _$$ShippingOptionToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _$ShippingOption&&(identical(other.id, id) || other.id == id)&&(identical(other.label, label) || other.label == label)&&(identical(other.detail, detail) || other.detail == detail)&&(identical(other.amount, amount) || other.amount == amount)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,label,detail,amount); + +@override +String toString() { + return 'PlatformPayWebShippingOption(id: $id, label: $label, detail: $detail, amount: $amount)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$$ShippingOptionImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.label, label) || other.label == label) && - (identical(other.detail, detail) || other.detail == detail) && - (identical(other.amount, amount) || other.amount == amount)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id, label, detail, amount); - - /// Create a copy of PlatformPayWebShippingOption - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$$ShippingOptionImplCopyWith<_$$ShippingOptionImpl> get copyWith => - __$$$ShippingOptionImplCopyWithImpl<_$$ShippingOptionImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$$ShippingOptionImplToJson( - this, - ); - } } -abstract class _$ShippingOption implements PlatformPayWebShippingOption { - const factory _$ShippingOption( - {required final String id, - required final String label, - required final String detail, - required final num amount}) = _$$ShippingOptionImpl; +/// @nodoc +abstract mixin class _$$ShippingOptionCopyWith<$Res> implements $PlatformPayWebShippingOptionCopyWith<$Res> { + factory _$$ShippingOptionCopyWith(_$ShippingOption value, $Res Function(_$ShippingOption) _then) = __$$ShippingOptionCopyWithImpl; +@override @useResult +$Res call({ + String id, String label, String detail, num amount +}); + + - factory _$ShippingOption.fromJson(Map json) = - _$$ShippingOptionImpl.fromJson; - /// A unique ID you create to keep track of this shipping option. You’ll be told the ID of the selected option - /// on changes and on completion. - @override - String get id; +} +/// @nodoc +class __$$ShippingOptionCopyWithImpl<$Res> + implements _$$ShippingOptionCopyWith<$Res> { + __$$ShippingOptionCopyWithImpl(this._self, this._then); - /// A short label for this shipping option. - @override - String get label; + final _$ShippingOption _self; + final $Res Function(_$ShippingOption) _then; - /// A longer description of this shipping option. - @override - String get detail; +/// Create a copy of PlatformPayWebShippingOption +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? label = null,Object? detail = null,Object? amount = null,}) { + return _then(_$ShippingOption( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,detail: null == detail ? _self.detail : detail // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as num, + )); +} - /// The amount to show for this shipping option. If the cost of this shipping option depends on the shipping address - /// the customer enters, listen for the shippingaddresschange event. - @override - num get amount; - /// Create a copy of PlatformPayWebShippingOption - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$$ShippingOptionImplCopyWith<_$$ShippingOptionImpl> get copyWith => - throw _privateConstructorUsedError; } PlatformPayWebPaymentItem _$PlatformPayWebPaymentItemFromJson( - Map json) { - return _$PaymentItem.fromJson(json); + Map json +) { + return _$PaymentItem.fromJson( + json + ); } /// @nodoc mixin _$PlatformPayWebPaymentItem { - /// The amount in the currency's subunit (e.g. cents, yen, etc.) - num get amount => throw _privateConstructorUsedError; - /// A name that the browser shows the customer in the payment interface. - String get label => throw _privateConstructorUsedError; - - /// If you might change this amount later (for example, after you have calculated shipping costs), set this to true. - /// Note that browsers treat this as a hint for how to display things, and not necessarily as something that will - /// prevent submission. - bool get pending => throw _privateConstructorUsedError; +/// The amount in the currency's subunit (e.g. cents, yen, etc.) + num get amount;/// A name that the browser shows the customer in the payment interface. + String get label;/// If you might change this amount later (for example, after you have calculated shipping costs), set this to true. +/// Note that browsers treat this as a hint for how to display things, and not necessarily as something that will +/// prevent submission. + bool get pending; +/// Create a copy of PlatformPayWebPaymentItem +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PlatformPayWebPaymentItemCopyWith get copyWith => _$PlatformPayWebPaymentItemCopyWithImpl(this as PlatformPayWebPaymentItem, _$identity); /// Serializes this PlatformPayWebPaymentItem to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of PlatformPayWebPaymentItem - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $PlatformPayWebPaymentItemCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PlatformPayWebPaymentItem&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.pending, pending) || other.pending == pending)); } -/// @nodoc -abstract class $PlatformPayWebPaymentItemCopyWith<$Res> { - factory $PlatformPayWebPaymentItemCopyWith(PlatformPayWebPaymentItem value, - $Res Function(PlatformPayWebPaymentItem) then) = - _$PlatformPayWebPaymentItemCopyWithImpl<$Res, PlatformPayWebPaymentItem>; - @useResult - $Res call({num amount, String label, bool pending}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,pending); + +@override +String toString() { + return 'PlatformPayWebPaymentItem(amount: $amount, label: $label, pending: $pending)'; } -/// @nodoc -class _$PlatformPayWebPaymentItemCopyWithImpl<$Res, - $Val extends PlatformPayWebPaymentItem> - implements $PlatformPayWebPaymentItemCopyWith<$Res> { - _$PlatformPayWebPaymentItemCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of PlatformPayWebPaymentItem - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? pending = null, - }) { - return _then(_value.copyWith( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as num, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - pending: null == pending - ? _value.pending - : pending // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } + } /// @nodoc -abstract class _$$$PaymentItemImplCopyWith<$Res> +abstract mixin class $PlatformPayWebPaymentItemCopyWith<$Res> { + factory $PlatformPayWebPaymentItemCopyWith(PlatformPayWebPaymentItem value, $Res Function(PlatformPayWebPaymentItem) _then) = _$PlatformPayWebPaymentItemCopyWithImpl; +@useResult +$Res call({ + num amount, String label, bool pending +}); + + + + +} +/// @nodoc +class _$PlatformPayWebPaymentItemCopyWithImpl<$Res> implements $PlatformPayWebPaymentItemCopyWith<$Res> { - factory _$$$PaymentItemImplCopyWith( - _$$PaymentItemImpl value, $Res Function(_$$PaymentItemImpl) then) = - __$$$PaymentItemImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({num amount, String label, bool pending}); + _$PlatformPayWebPaymentItemCopyWithImpl(this._self, this._then); + + final PlatformPayWebPaymentItem _self; + final $Res Function(PlatformPayWebPaymentItem) _then; + +/// Create a copy of PlatformPayWebPaymentItem +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? amount = null,Object? label = null,Object? pending = null,}) { + return _then(_self.copyWith( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as num,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,pending: null == pending ? _self.pending : pending // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [PlatformPayWebPaymentItem]. +extension PlatformPayWebPaymentItemPatterns on PlatformPayWebPaymentItem { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _$PaymentItem value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _$PaymentItem() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _$PaymentItem value) $default,){ +final _that = this; +switch (_that) { +case _$PaymentItem(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _$PaymentItem value)? $default,){ +final _that = this; +switch (_that) { +case _$PaymentItem() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( num amount, String label, bool pending)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _$PaymentItem() when $default != null: +return $default(_that.amount,_that.label,_that.pending);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( num amount, String label, bool pending) $default,) {final _that = this; +switch (_that) { +case _$PaymentItem(): +return $default(_that.amount,_that.label,_that.pending);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( num amount, String label, bool pending)? $default,) {final _that = this; +switch (_that) { +case _$PaymentItem() when $default != null: +return $default(_that.amount,_that.label,_that.pending);case _: + return null; + +} } -/// @nodoc -class __$$$PaymentItemImplCopyWithImpl<$Res> - extends _$PlatformPayWebPaymentItemCopyWithImpl<$Res, _$$PaymentItemImpl> - implements _$$$PaymentItemImplCopyWith<$Res> { - __$$$PaymentItemImplCopyWithImpl( - _$$PaymentItemImpl _value, $Res Function(_$$PaymentItemImpl) _then) - : super(_value, _then); - - /// Create a copy of PlatformPayWebPaymentItem - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? amount = null, - Object? label = null, - Object? pending = null, - }) { - return _then(_$$PaymentItemImpl( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as num, - label: null == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as String, - pending: null == pending - ? _value.pending - : pending // ignore: cast_nullable_to_non_nullable - as bool, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$$PaymentItemImpl implements _$PaymentItem { - const _$$PaymentItemImpl( - {required this.amount, required this.label, this.pending = false}); - - factory _$$PaymentItemImpl.fromJson(Map json) => - _$$$PaymentItemImplFromJson(json); - - /// The amount in the currency's subunit (e.g. cents, yen, etc.) - @override - final num amount; - - /// A name that the browser shows the customer in the payment interface. - @override - final String label; - - /// If you might change this amount later (for example, after you have calculated shipping costs), set this to true. - /// Note that browsers treat this as a hint for how to display things, and not necessarily as something that will - /// prevent submission. - @override - @JsonKey() - final bool pending; - - @override - String toString() { - return 'PlatformPayWebPaymentItem(amount: $amount, label: $label, pending: $pending)'; - } +class _$PaymentItem implements PlatformPayWebPaymentItem { + const _$PaymentItem({required this.amount, required this.label, this.pending = false}); + factory _$PaymentItem.fromJson(Map json) => _$$PaymentItemFromJson(json); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$$PaymentItemImpl && - (identical(other.amount, amount) || other.amount == amount) && - (identical(other.label, label) || other.label == label) && - (identical(other.pending, pending) || other.pending == pending)); - } +/// The amount in the currency's subunit (e.g. cents, yen, etc.) +@override final num amount; +/// A name that the browser shows the customer in the payment interface. +@override final String label; +/// If you might change this amount later (for example, after you have calculated shipping costs), set this to true. +/// Note that browsers treat this as a hint for how to display things, and not necessarily as something that will +/// prevent submission. +@override@JsonKey() final bool pending; - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, amount, label, pending); - - /// Create a copy of PlatformPayWebPaymentItem - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$$PaymentItemImplCopyWith<_$$PaymentItemImpl> get copyWith => - __$$$PaymentItemImplCopyWithImpl<_$$PaymentItemImpl>(this, _$identity); - - @override - Map toJson() { - return _$$$PaymentItemImplToJson( - this, - ); - } +/// Create a copy of PlatformPayWebPaymentItem +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$$PaymentItemCopyWith<_$PaymentItem> get copyWith => __$$PaymentItemCopyWithImpl<_$PaymentItem>(this, _$identity); + +@override +Map toJson() { + return _$$PaymentItemToJson(this, ); } -abstract class _$PaymentItem implements PlatformPayWebPaymentItem { - const factory _$PaymentItem( - {required final num amount, - required final String label, - final bool pending}) = _$$PaymentItemImpl; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _$PaymentItem&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.label, label) || other.label == label)&&(identical(other.pending, pending) || other.pending == pending)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,amount,label,pending); + +@override +String toString() { + return 'PlatformPayWebPaymentItem(amount: $amount, label: $label, pending: $pending)'; +} + + +} + +/// @nodoc +abstract mixin class _$$PaymentItemCopyWith<$Res> implements $PlatformPayWebPaymentItemCopyWith<$Res> { + factory _$$PaymentItemCopyWith(_$PaymentItem value, $Res Function(_$PaymentItem) _then) = __$$PaymentItemCopyWithImpl; +@override @useResult +$Res call({ + num amount, String label, bool pending +}); + + + - factory _$PaymentItem.fromJson(Map json) = - _$$PaymentItemImpl.fromJson; +} +/// @nodoc +class __$$PaymentItemCopyWithImpl<$Res> + implements _$$PaymentItemCopyWith<$Res> { + __$$PaymentItemCopyWithImpl(this._self, this._then); - /// The amount in the currency's subunit (e.g. cents, yen, etc.) - @override - num get amount; + final _$PaymentItem _self; + final $Res Function(_$PaymentItem) _then; - /// A name that the browser shows the customer in the payment interface. - @override - String get label; +/// Create a copy of PlatformPayWebPaymentItem +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? amount = null,Object? label = null,Object? pending = null,}) { + return _then(_$PaymentItem( +amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as num,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as String,pending: null == pending ? _self.pending : pending // ignore: cast_nullable_to_non_nullable +as bool, + )); +} - /// If you might change this amount later (for example, after you have calculated shipping costs), set this to true. - /// Note that browsers treat this as a hint for how to display things, and not necessarily as something that will - /// prevent submission. - @override - bool get pending; - /// Create a copy of PlatformPayWebPaymentItem - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$$PaymentItemImplCopyWith<_$$PaymentItemImpl> get copyWith => - throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/platform_pay.g.dart b/packages/stripe_platform_interface/lib/src/models/platform_pay.g.dart index b7198a04a..7b67e0d1d 100644 --- a/packages/stripe_platform_interface/lib/src/models/platform_pay.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/platform_pay.g.dart @@ -6,65 +6,63 @@ part of 'platform_pay.dart'; // JsonSerializableGenerator // ************************************************************************** -_$PlatformPayPaymentMethodImpl _$$PlatformPayPaymentMethodImplFromJson( - Map json) => - _$PlatformPayPaymentMethodImpl( - paymentMethod: - PaymentMethod.fromJson(json['paymentMethod'] as Map), - shippingContact: json['shippingContact'] == null - ? null - : PlatformPayShippingContact.fromJson( - json['shippingContact'] as Map), - ); - -Map _$$PlatformPayPaymentMethodImplToJson( - _$PlatformPayPaymentMethodImpl instance) => - { - 'paymentMethod': instance.paymentMethod.toJson(), - 'shippingContact': instance.shippingContact?.toJson(), - }; - -_$PlatformPaySheetUpdateParamsImpl _$$PlatformPaySheetUpdateParamsImplFromJson( - Map json) => - _$PlatformPaySheetUpdateParamsImpl( - summaryItems: (json['summaryItems'] as List) - .map((e) => - ApplePayCartSummaryItem.fromJson(e as Map)) - .toList(), - shippingMethods: (json['shippingMethods'] as List) - .map( - (e) => ApplePayShippingMethod.fromJson(e as Map)) - .toList(), - errors: (json['errors'] as List?) - ?.map((e) => ApplePaySheetError.fromJson(e as Map)) - .toList(), - ); +_PlatformPayPaymentMethod _$PlatformPayPaymentMethodFromJson( + Map json, +) => _PlatformPayPaymentMethod( + paymentMethod: PaymentMethod.fromJson( + json['paymentMethod'] as Map, + ), + shippingContact: json['shippingContact'] == null + ? null + : PlatformPayShippingContact.fromJson( + json['shippingContact'] as Map, + ), +); + +Map _$PlatformPayPaymentMethodToJson( + _PlatformPayPaymentMethod instance, +) => { + 'paymentMethod': instance.paymentMethod.toJson(), + 'shippingContact': instance.shippingContact?.toJson(), +}; -Map _$$PlatformPaySheetUpdateParamsImplToJson( - _$PlatformPaySheetUpdateParamsImpl instance) => - { - 'summaryItems': instance.summaryItems.map((e) => e.toJson()).toList(), - 'shippingMethods': - instance.shippingMethods.map((e) => e.toJson()).toList(), - 'errors': instance.errors?.map((e) => e.toJson()).toList(), - }; +_PlatformPaySheetUpdateParams _$PlatformPaySheetUpdateParamsFromJson( + Map json, +) => _PlatformPaySheetUpdateParams( + summaryItems: (json['summaryItems'] as List) + .map((e) => ApplePayCartSummaryItem.fromJson(e as Map)) + .toList(), + shippingMethods: (json['shippingMethods'] as List) + .map((e) => ApplePayShippingMethod.fromJson(e as Map)) + .toList(), + errors: (json['errors'] as List?) + ?.map((e) => ApplePaySheetError.fromJson(e as Map)) + .toList(), +); + +Map _$PlatformPaySheetUpdateParamsToJson( + _PlatformPaySheetUpdateParams instance, +) => { + 'summaryItems': instance.summaryItems.map((e) => e.toJson()).toList(), + 'shippingMethods': instance.shippingMethods.map((e) => e.toJson()).toList(), + 'errors': instance.errors?.map((e) => e.toJson()).toList(), +}; -_$ApplePaySheetErrorInvalidShippingImpl - _$$ApplePaySheetErrorInvalidShippingImplFromJson( - Map json) => - _$ApplePaySheetErrorInvalidShippingImpl( - field: $enumDecode(_$InvalidShippingFieldEnumMap, json['field']), - message: json['message'] as String?, - $type: json['errorType'] as String?, - ); - -Map _$$ApplePaySheetErrorInvalidShippingImplToJson( - _$ApplePaySheetErrorInvalidShippingImpl instance) => - { - 'field': _$InvalidShippingFieldEnumMap[instance.field]!, - 'message': instance.message, - 'errorType': instance.$type, - }; +_ApplePaySheetErrorInvalidShipping _$ApplePaySheetErrorInvalidShippingFromJson( + Map json, +) => _ApplePaySheetErrorInvalidShipping( + field: $enumDecode(_$InvalidShippingFieldEnumMap, json['field']), + message: json['message'] as String?, + $type: json['errorType'] as String?, +); + +Map _$ApplePaySheetErrorInvalidShippingToJson( + _ApplePaySheetErrorInvalidShipping instance, +) => { + 'field': _$InvalidShippingFieldEnumMap[instance.field]!, + 'message': instance.message, + 'errorType': instance.$type, +}; const _$InvalidShippingFieldEnumMap = { InvalidShippingField.Street: 'Street', @@ -77,227 +75,220 @@ const _$InvalidShippingFieldEnumMap = { InvalidShippingField.SubLocality: 'SubLocality', }; -_$ApplePaySheetErrorUnserviceableShippingImpl - _$$ApplePaySheetErrorUnserviceableShippingImplFromJson( - Map json) => - _$ApplePaySheetErrorUnserviceableShippingImpl( - message: json['message'] as String?, - $type: json['errorType'] as String?, - ); - -Map _$$ApplePaySheetErrorUnserviceableShippingImplToJson( - _$ApplePaySheetErrorUnserviceableShippingImpl instance) => - { - 'message': instance.message, - 'errorType': instance.$type, - }; - -_$ApplePaySheetErrorInvalidCouponCodeImpl - _$$ApplePaySheetErrorInvalidCouponCodeImplFromJson( - Map json) => - _$ApplePaySheetErrorInvalidCouponCodeImpl( - message: json['message'] as String?, - $type: json['errorType'] as String?, - ); - -Map _$$ApplePaySheetErrorInvalidCouponCodeImplToJson( - _$ApplePaySheetErrorInvalidCouponCodeImpl instance) => - { - 'message': instance.message, - 'errorType': instance.$type, - }; - -_$ApplePaySheetErrorExpiredCouponCodeImpl - _$$ApplePaySheetErrorExpiredCouponCodeImplFromJson( - Map json) => - _$ApplePaySheetErrorExpiredCouponCodeImpl( - message: json['message'] as String?, - $type: json['errorType'] as String?, - ); - -Map _$$ApplePaySheetErrorExpiredCouponCodeImplToJson( - _$ApplePaySheetErrorExpiredCouponCodeImpl instance) => - { - 'message': instance.message, - 'errorType': instance.$type, - }; +_ApplePaySheetErrorUnserviceableShipping +_$ApplePaySheetErrorUnserviceableShippingFromJson(Map json) => + _ApplePaySheetErrorUnserviceableShipping( + message: json['message'] as String?, + $type: json['errorType'] as String?, + ); -_$PlatformPayPaymentMethodParamsGooglePayImpl - _$$PlatformPayPaymentMethodParamsGooglePayImplFromJson( - Map json) => - _$PlatformPayPaymentMethodParamsGooglePayImpl( - googlePayParams: GooglePayParams.fromJson( - json['googlePayParams'] as Map), - googlePayPaymentMethodParams: GooglePayPaymentMethodParams.fromJson( - json['googlePayPaymentMethodParams'] as Map), - ); - -Map _$$PlatformPayPaymentMethodParamsGooglePayImplToJson( - _$PlatformPayPaymentMethodParamsGooglePayImpl instance) => - { - 'googlePayParams': instance.googlePayParams.toJson(), - 'googlePayPaymentMethodParams': - instance.googlePayPaymentMethodParams.toJson(), - }; +Map _$ApplePaySheetErrorUnserviceableShippingToJson( + _ApplePaySheetErrorUnserviceableShipping instance, +) => { + 'message': instance.message, + 'errorType': instance.$type, +}; -_$PlatformPayPaymentMethodParamsApplePayImpl - _$$PlatformPayPaymentMethodParamsApplePayImplFromJson( - Map json) => - _$PlatformPayPaymentMethodParamsApplePayImpl( - applePayParams: ApplePayParams.fromJson( - json['applePayParams'] as Map), - ); +_ApplePaySheetErrorInvalidCouponCode +_$ApplePaySheetErrorInvalidCouponCodeFromJson(Map json) => + _ApplePaySheetErrorInvalidCouponCode( + message: json['message'] as String?, + $type: json['errorType'] as String?, + ); -Map _$$PlatformPayPaymentMethodParamsApplePayImplToJson( - _$PlatformPayPaymentMethodParamsApplePayImpl instance) => - { - 'applePayParams': instance.applePayParams.toJson(), - }; +Map _$ApplePaySheetErrorInvalidCouponCodeToJson( + _ApplePaySheetErrorInvalidCouponCode instance, +) => { + 'message': instance.message, + 'errorType': instance.$type, +}; -_$PlatformPayPaymentMethodParamsWebImpl - _$$PlatformPayPaymentMethodParamsWebImplFromJson( - Map json) => - _$PlatformPayPaymentMethodParamsWebImpl( - options: PlatformPayWebPaymentRequestCreateOptions.fromJson( - json['options'] as Map), - ); +_ApplePaySheetErrorExpiredCouponCode +_$ApplePaySheetErrorExpiredCouponCodeFromJson(Map json) => + _ApplePaySheetErrorExpiredCouponCode( + message: json['message'] as String?, + $type: json['errorType'] as String?, + ); -Map _$$PlatformPayPaymentMethodParamsWebImplToJson( - _$PlatformPayPaymentMethodParamsWebImpl instance) => - { - 'options': instance.options.toJson(), - }; +Map _$ApplePaySheetErrorExpiredCouponCodeToJson( + _ApplePaySheetErrorExpiredCouponCode instance, +) => { + 'message': instance.message, + 'errorType': instance.$type, +}; -_$PlatformPayConfirmParamsGooglePayImpl - _$$PlatformPayConfirmParamsGooglePayImplFromJson( - Map json) => - _$PlatformPayConfirmParamsGooglePayImpl( - googlePay: GooglePayParams.fromJson( - json['googlePay'] as Map), - $type: json['runtimeType'] as String?, - ); - -Map _$$PlatformPayConfirmParamsGooglePayImplToJson( - _$PlatformPayConfirmParamsGooglePayImpl instance) => - { - 'googlePay': instance.googlePay.toJson(), - 'runtimeType': instance.$type, - }; +PlatformPayPaymentMethodParamsGooglePay +_$PlatformPayPaymentMethodParamsGooglePayFromJson(Map json) => + PlatformPayPaymentMethodParamsGooglePay( + googlePayParams: GooglePayParams.fromJson( + json['googlePayParams'] as Map, + ), + googlePayPaymentMethodParams: GooglePayPaymentMethodParams.fromJson( + json['googlePayPaymentMethodParams'] as Map, + ), + ); -_$PlatformPayConfirmParamsApplePayImpl - _$$PlatformPayConfirmParamsApplePayImplFromJson( - Map json) => - _$PlatformPayConfirmParamsApplePayImpl( - applePay: - ApplePayParams.fromJson(json['applePay'] as Map), - $type: json['runtimeType'] as String?, - ); - -Map _$$PlatformPayConfirmParamsApplePayImplToJson( - _$PlatformPayConfirmParamsApplePayImpl instance) => - { - 'applePay': instance.applePay.toJson(), - 'runtimeType': instance.$type, - }; +Map _$PlatformPayPaymentMethodParamsGooglePayToJson( + PlatformPayPaymentMethodParamsGooglePay instance, +) => { + 'googlePayParams': instance.googlePayParams.toJson(), + 'googlePayPaymentMethodParams': instance.googlePayPaymentMethodParams + .toJson(), +}; -_$PlatformPayConfirmParamsWebImpl _$$PlatformPayConfirmParamsWebImplFromJson( - Map json) => - _$PlatformPayConfirmParamsWebImpl( - options: PlatformPayWebPaymentRequestCreateOptions.fromJson( - json['options'] as Map), - $type: json['runtimeType'] as String?, +PlatformPayPaymentMethodParamsApplePay +_$PlatformPayPaymentMethodParamsApplePayFromJson(Map json) => + PlatformPayPaymentMethodParamsApplePay( + applePayParams: ApplePayParams.fromJson( + json['applePayParams'] as Map, + ), ); -Map _$$PlatformPayConfirmParamsWebImplToJson( - _$PlatformPayConfirmParamsWebImpl instance) => - { - 'options': instance.options.toJson(), - 'runtimeType': instance.$type, - }; +Map _$PlatformPayPaymentMethodParamsApplePayToJson( + PlatformPayPaymentMethodParamsApplePay instance, +) => {'applePayParams': instance.applePayParams.toJson()}; + +PlatformPayPaymentMethodParamsWeb _$PlatformPayPaymentMethodParamsWebFromJson( + Map json, +) => PlatformPayPaymentMethodParamsWeb( + options: PlatformPayWebPaymentRequestCreateOptions.fromJson( + json['options'] as Map, + ), +); + +Map _$PlatformPayPaymentMethodParamsWebToJson( + PlatformPayPaymentMethodParamsWeb instance, +) => {'options': instance.options.toJson()}; + +PlatformPayConfirmParamsGooglePay _$PlatformPayConfirmParamsGooglePayFromJson( + Map json, +) => PlatformPayConfirmParamsGooglePay( + googlePay: GooglePayParams.fromJson( + json['googlePay'] as Map, + ), + $type: json['runtimeType'] as String?, +); + +Map _$PlatformPayConfirmParamsGooglePayToJson( + PlatformPayConfirmParamsGooglePay instance, +) => { + 'googlePay': instance.googlePay.toJson(), + 'runtimeType': instance.$type, +}; -_$PlatformPayShippingContactImpl _$$PlatformPayShippingContactImplFromJson( - Map json) => - _$PlatformPayShippingContactImpl( - emailAddress: json['emailAddress'] as String?, - name: ApplePayContactName.fromJson(json['name'] as Map), - postalAddress: ApplePayPostalAddress.fromJson( - json['postalAddress'] as Map), - phoneNumber: json['phoneNumber'] as String?, - ); +PlatformPayConfirmParamsApplePay _$PlatformPayConfirmParamsApplePayFromJson( + Map json, +) => PlatformPayConfirmParamsApplePay( + applePay: ApplePayParams.fromJson(json['applePay'] as Map), + $type: json['runtimeType'] as String?, +); + +Map _$PlatformPayConfirmParamsApplePayToJson( + PlatformPayConfirmParamsApplePay instance, +) => { + 'applePay': instance.applePay.toJson(), + 'runtimeType': instance.$type, +}; -Map _$$PlatformPayShippingContactImplToJson( - _$PlatformPayShippingContactImpl instance) => - { - 'emailAddress': instance.emailAddress, - 'name': instance.name.toJson(), - 'postalAddress': instance.postalAddress.toJson(), - 'phoneNumber': instance.phoneNumber, - }; +PlatformPayConfirmParamsWeb _$PlatformPayConfirmParamsWebFromJson( + Map json, +) => PlatformPayConfirmParamsWeb( + options: PlatformPayWebPaymentRequestCreateOptions.fromJson( + json['options'] as Map, + ), + $type: json['runtimeType'] as String?, +); + +Map _$PlatformPayConfirmParamsWebToJson( + PlatformPayConfirmParamsWeb instance, +) => { + 'options': instance.options.toJson(), + 'runtimeType': instance.$type, +}; -_$ApplePayParamsImpl _$$ApplePayParamsImplFromJson(Map json) => - _$ApplePayParamsImpl( - merchantCountryCode: json['merchantCountryCode'] as String, - currencyCode: json['currencyCode'] as String, - additionalEnabledNetworks: - (json['additionalEnabledNetworks'] as List?) - ?.map((e) => e as String) - .toList(), - cartItems: (json['cartItems'] as List) - .map((e) => - ApplePayCartSummaryItem.fromJson(e as Map)) - .toList(), - requiredShippingAddressFields: - (json['requiredShippingAddressFields'] as List?) - ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) - .toList(), - requiredBillingContactFields: - (json['requiredBillingContactFields'] as List?) - ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) - .toList(), - shippingMethods: (json['shippingMethods'] as List?) - ?.map( - (e) => ApplePayShippingMethod.fromJson(e as Map)) - .toList(), - merchantCapabilities: (json['merchantCapabilities'] as List?) - ?.map((e) => $enumDecode(_$ApplePayMerchantCapabilityEnumMap, e)) - .toList(), - shippingType: $enumDecodeNullable( - _$ApplePayShippingTypeEnumMap, json['shippingType']), - supportedCountries: (json['supportedCountries'] as List?) - ?.map((e) => e as String) - .toList(), - supportsCouponCode: json['supportsCouponCode'] as bool?, - couponCode: json['couponCode'] as String?, - request: json['request'] == null - ? null - : PaymentRequestType.fromJson( - json['request'] as Map), - ); +_PlatformPayShippingContact _$PlatformPayShippingContactFromJson( + Map json, +) => _PlatformPayShippingContact( + emailAddress: json['emailAddress'] as String?, + name: ApplePayContactName.fromJson(json['name'] as Map), + postalAddress: ApplePayPostalAddress.fromJson( + json['postalAddress'] as Map, + ), + phoneNumber: json['phoneNumber'] as String?, +); + +Map _$PlatformPayShippingContactToJson( + _PlatformPayShippingContact instance, +) => { + 'emailAddress': instance.emailAddress, + 'name': instance.name.toJson(), + 'postalAddress': instance.postalAddress.toJson(), + 'phoneNumber': instance.phoneNumber, +}; -Map _$$ApplePayParamsImplToJson( - _$ApplePayParamsImpl instance) => - { - 'merchantCountryCode': instance.merchantCountryCode, - 'currencyCode': instance.currencyCode, - 'additionalEnabledNetworks': instance.additionalEnabledNetworks, - 'cartItems': instance.cartItems.map((e) => e.toJson()).toList(), - 'requiredShippingAddressFields': instance.requiredShippingAddressFields - ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) +_ApplePayParams _$ApplePayParamsFromJson( + Map json, +) => _ApplePayParams( + merchantCountryCode: json['merchantCountryCode'] as String, + currencyCode: json['currencyCode'] as String, + additionalEnabledNetworks: + (json['additionalEnabledNetworks'] as List?) + ?.map((e) => e as String) .toList(), - 'requiredBillingContactFields': instance.requiredBillingContactFields - ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) + cartItems: (json['cartItems'] as List) + .map((e) => ApplePayCartSummaryItem.fromJson(e as Map)) + .toList(), + requiredShippingAddressFields: + (json['requiredShippingAddressFields'] as List?) + ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) .toList(), - 'shippingMethods': - instance.shippingMethods?.map((e) => e.toJson()).toList(), - 'merchantCapabilities': instance.merchantCapabilities - ?.map((e) => _$ApplePayMerchantCapabilityEnumMap[e]!) + requiredBillingContactFields: + (json['requiredBillingContactFields'] as List?) + ?.map((e) => $enumDecode(_$ApplePayContactFieldsTypeEnumMap, e)) .toList(), - 'shippingType': _$ApplePayShippingTypeEnumMap[instance.shippingType], - 'supportedCountries': instance.supportedCountries, - 'supportsCouponCode': instance.supportsCouponCode, - 'couponCode': instance.couponCode, - 'request': instance.request?.toJson(), - }; + shippingMethods: (json['shippingMethods'] as List?) + ?.map((e) => ApplePayShippingMethod.fromJson(e as Map)) + .toList(), + merchantCapabilities: (json['merchantCapabilities'] as List?) + ?.map((e) => $enumDecode(_$ApplePayMerchantCapabilityEnumMap, e)) + .toList(), + shippingType: $enumDecodeNullable( + _$ApplePayShippingTypeEnumMap, + json['shippingType'], + ), + supportedCountries: (json['supportedCountries'] as List?) + ?.map((e) => e as String) + .toList(), + supportsCouponCode: json['supportsCouponCode'] as bool?, + couponCode: json['couponCode'] as String?, + request: json['request'] == null + ? null + : PaymentRequestType.fromJson(json['request'] as Map), +); + +Map _$ApplePayParamsToJson( + _ApplePayParams instance, +) => { + 'merchantCountryCode': instance.merchantCountryCode, + 'currencyCode': instance.currencyCode, + 'additionalEnabledNetworks': instance.additionalEnabledNetworks, + 'cartItems': instance.cartItems.map((e) => e.toJson()).toList(), + 'requiredShippingAddressFields': instance.requiredShippingAddressFields + ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) + .toList(), + 'requiredBillingContactFields': instance.requiredBillingContactFields + ?.map((e) => _$ApplePayContactFieldsTypeEnumMap[e]!) + .toList(), + 'shippingMethods': instance.shippingMethods?.map((e) => e.toJson()).toList(), + 'merchantCapabilities': instance.merchantCapabilities + ?.map((e) => _$ApplePayMerchantCapabilityEnumMap[e]!) + .toList(), + 'shippingType': _$ApplePayShippingTypeEnumMap[instance.shippingType], + 'supportedCountries': instance.supportedCountries, + 'supportsCouponCode': instance.supportsCouponCode, + 'couponCode': instance.couponCode, + 'request': instance.request?.toJson(), +}; const _$ApplePayContactFieldsTypeEnumMap = { ApplePayContactFieldsType.emailAddress: 'emailAddress', @@ -320,9 +311,8 @@ const _$ApplePayShippingTypeEnumMap = { ApplePayShippingType.shipping: 'shipping', }; -_$GooglePayParamsImpl _$$GooglePayParamsImplFromJson( - Map json) => - _$GooglePayParamsImpl( +_GooglePayParams _$GooglePayParamsFromJson(Map json) => + _GooglePayParams( testEnv: json['testEnv'] as bool? ?? false, merchantCountryCode: json['merchantCountryCode'] as String, currencyCode: json['currencyCode'] as String, @@ -332,11 +322,11 @@ _$GooglePayParamsImpl _$$GooglePayParamsImplFromJson( billingAddressConfig: json['billingAddressConfig'] == null ? null : GooglePayBillingAddressConfig.fromJson( - json['billingAddressConfig'] as Map), + json['billingAddressConfig'] as Map, + ), ); -Map _$$GooglePayParamsImplToJson( - _$GooglePayParamsImpl instance) => +Map _$GooglePayParamsToJson(_GooglePayParams instance) => { 'testEnv': instance.testEnv, 'merchantCountryCode': instance.merchantCountryCode, @@ -347,224 +337,230 @@ Map _$$GooglePayParamsImplToJson( 'billingAddressConfig': instance.billingAddressConfig?.toJson(), }; -_$GooglePayPaymentMethodParamsImpl _$$GooglePayPaymentMethodParamsImplFromJson( - Map json) => - _$GooglePayPaymentMethodParamsImpl( - existingPaymentMethodRequired: - json['existingPaymentMethodRequired'] as bool?, - amount: (json['amount'] as num).toInt(), - billingAddressConfig: json['billingAddressConfig'] == null - ? null - : GooglePayBillingAddressConfig.fromJson( - json['billingAddressConfig'] as Map), - shippingAddressConfig: json['shippingAddressConfig'] == null - ? null - : GooglePayShippingAddressConfig.fromJson( - json['shippingAddressConfig'] as Map), - ); - -Map _$$GooglePayPaymentMethodParamsImplToJson( - _$GooglePayPaymentMethodParamsImpl instance) => - { - 'existingPaymentMethodRequired': instance.existingPaymentMethodRequired, - 'amount': instance.amount, - 'billingAddressConfig': instance.billingAddressConfig?.toJson(), - 'shippingAddressConfig': instance.shippingAddressConfig?.toJson(), - }; +_GooglePayPaymentMethodParams _$GooglePayPaymentMethodParamsFromJson( + Map json, +) => _GooglePayPaymentMethodParams( + existingPaymentMethodRequired: json['existingPaymentMethodRequired'] as bool?, + amount: (json['amount'] as num).toInt(), + billingAddressConfig: json['billingAddressConfig'] == null + ? null + : GooglePayBillingAddressConfig.fromJson( + json['billingAddressConfig'] as Map, + ), + shippingAddressConfig: json['shippingAddressConfig'] == null + ? null + : GooglePayShippingAddressConfig.fromJson( + json['shippingAddressConfig'] as Map, + ), +); + +Map _$GooglePayPaymentMethodParamsToJson( + _GooglePayPaymentMethodParams instance, +) => { + 'existingPaymentMethodRequired': instance.existingPaymentMethodRequired, + 'amount': instance.amount, + 'billingAddressConfig': instance.billingAddressConfig?.toJson(), + 'shippingAddressConfig': instance.shippingAddressConfig?.toJson(), +}; -_$GooglePayBillingAddressConfigImpl - _$$GooglePayBillingAddressConfigImplFromJson(Map json) => - _$GooglePayBillingAddressConfigImpl( - isRequired: json['isRequired'] as bool?, - isPhoneNumberRequired: json['isPhoneNumberRequired'] as bool?, - format: $enumDecodeNullable( - _$BillingAddressFormatEnumMap, json['format']), - ); - -Map _$$GooglePayBillingAddressConfigImplToJson( - _$GooglePayBillingAddressConfigImpl instance) => - { - 'isRequired': instance.isRequired, - 'isPhoneNumberRequired': instance.isPhoneNumberRequired, - 'format': _$BillingAddressFormatEnumMap[instance.format], - }; +_GooglePayBillingAddressConfig _$GooglePayBillingAddressConfigFromJson( + Map json, +) => _GooglePayBillingAddressConfig( + isRequired: json['isRequired'] as bool?, + isPhoneNumberRequired: json['isPhoneNumberRequired'] as bool?, + format: $enumDecodeNullable(_$BillingAddressFormatEnumMap, json['format']), +); + +Map _$GooglePayBillingAddressConfigToJson( + _GooglePayBillingAddressConfig instance, +) => { + 'isRequired': instance.isRequired, + 'isPhoneNumberRequired': instance.isPhoneNumberRequired, + 'format': _$BillingAddressFormatEnumMap[instance.format], +}; const _$BillingAddressFormatEnumMap = { BillingAddressFormat.FULL: 'FULL', BillingAddressFormat.MIN: 'MIN', }; -_$GooglePayShippingAddressConfigImpl - _$$GooglePayShippingAddressConfigImplFromJson(Map json) => - _$GooglePayShippingAddressConfigImpl( - isRequired: json['isRequired'] as bool?, - isPhoneNumberRequired: json['isPhoneNumberRequired'] as bool?, - allowedCountryCodes: (json['allowedCountryCodes'] as List?) - ?.map((e) => e as String) - .toList(), - ); - -Map _$$GooglePayShippingAddressConfigImplToJson( - _$GooglePayShippingAddressConfigImpl instance) => - { - 'isRequired': instance.isRequired, - 'isPhoneNumberRequired': instance.isPhoneNumberRequired, - 'allowedCountryCodes': instance.allowedCountryCodes, - }; - -_$PaymentRequestTypeRecurringImpl _$$PaymentRequestTypeRecurringImplFromJson( - Map json) => - _$PaymentRequestTypeRecurringImpl( - description: json['description'] as String, - managementUrl: json['managementUrl'] as String, - billing: RecurringCartSummaryItem.fromJson( - json['billing'] as Map), - trialBilling: json['trialBilling'] == null - ? null - : RecurringCartSummaryItem.fromJson( - json['trialBilling'] as Map), - billingAgreement: json['billingAgreement'] as String?, - tokenNotificationURL: json['tokenNotificationURL'] as String?, - $type: json['type'] as String?, - ); - -Map _$$PaymentRequestTypeRecurringImplToJson( - _$PaymentRequestTypeRecurringImpl instance) => - { - 'description': instance.description, - 'managementUrl': instance.managementUrl, - 'billing': instance.billing.toJson(), - 'trialBilling': instance.trialBilling?.toJson(), - 'billingAgreement': instance.billingAgreement, - 'tokenNotificationURL': instance.tokenNotificationURL, - 'type': instance.$type, - }; - -_$PaymentRequestTypeReloadImpl _$$PaymentRequestTypeReloadImplFromJson( - Map json) => - _$PaymentRequestTypeReloadImpl( - description: json['description'] as String, - managementUrl: json['managementUrl'] as String, - label: json['label'] as String, - reloadAmount: json['reloadAmount'] as String, - thresholdAmount: json['thresholdAmount'] as String, - billingAgreement: json['billingAgreement'] as String?, - tokenNotificationURL: json['tokenNotificationURL'] as String?, - $type: json['type'] as String?, - ); - -Map _$$PaymentRequestTypeReloadImplToJson( - _$PaymentRequestTypeReloadImpl instance) => - { - 'description': instance.description, - 'managementUrl': instance.managementUrl, - 'label': instance.label, - 'reloadAmount': instance.reloadAmount, - 'thresholdAmount': instance.thresholdAmount, - 'billingAgreement': instance.billingAgreement, - 'tokenNotificationURL': instance.tokenNotificationURL, - 'type': instance.$type, - }; - -_$PaymentRequestTypeMultiMerchantImpl - _$$PaymentRequestTypeMultiMerchantImplFromJson(Map json) => - _$PaymentRequestTypeMultiMerchantImpl( - merchants: (json['merchants'] as List) - .map((e) => - ApplePayMultiMerchant.fromJson(e as Map)) - .toList(), - $type: json['type'] as String?, - ); - -Map _$$PaymentRequestTypeMultiMerchantImplToJson( - _$PaymentRequestTypeMultiMerchantImpl instance) => - { - 'merchants': instance.merchants, - 'type': instance.$type, - }; - -_$ApplePayMultiMerchantImpl _$$ApplePayMultiMerchantImplFromJson( - Map json) => - _$ApplePayMultiMerchantImpl( - merchantIdentifier: json['merchantIdentifier'] as String, - externalIdentifier: json['externalIdentifier'] as String, - merchantName: json['merchantName'] as String, - merchantDomain: json['merchantDomain'] as String?, - amount: json['amount'] as String, - ); +_GooglePayShippingAddressConfig _$GooglePayShippingAddressConfigFromJson( + Map json, +) => _GooglePayShippingAddressConfig( + isRequired: json['isRequired'] as bool?, + isPhoneNumberRequired: json['isPhoneNumberRequired'] as bool?, + allowedCountryCodes: (json['allowedCountryCodes'] as List?) + ?.map((e) => e as String) + .toList(), +); + +Map _$GooglePayShippingAddressConfigToJson( + _GooglePayShippingAddressConfig instance, +) => { + 'isRequired': instance.isRequired, + 'isPhoneNumberRequired': instance.isPhoneNumberRequired, + 'allowedCountryCodes': instance.allowedCountryCodes, +}; -Map _$$ApplePayMultiMerchantImplToJson( - _$ApplePayMultiMerchantImpl instance) => - { - 'merchantIdentifier': instance.merchantIdentifier, - 'externalIdentifier': instance.externalIdentifier, - 'merchantName': instance.merchantName, - 'merchantDomain': instance.merchantDomain, - 'amount': instance.amount, - }; +_PaymentRequestTypeRecurring _$PaymentRequestTypeRecurringFromJson( + Map json, +) => _PaymentRequestTypeRecurring( + description: json['description'] as String, + managementUrl: json['managementUrl'] as String, + billing: RecurringCartSummaryItem.fromJson( + json['billing'] as Map, + ), + trialBilling: json['trialBilling'] == null + ? null + : RecurringCartSummaryItem.fromJson( + json['trialBilling'] as Map, + ), + billingAgreement: json['billingAgreement'] as String?, + tokenNotificationURL: json['tokenNotificationURL'] as String?, + $type: json['type'] as String?, +); + +Map _$PaymentRequestTypeRecurringToJson( + _PaymentRequestTypeRecurring instance, +) => { + 'description': instance.description, + 'managementUrl': instance.managementUrl, + 'billing': instance.billing.toJson(), + 'trialBilling': instance.trialBilling?.toJson(), + 'billingAgreement': instance.billingAgreement, + 'tokenNotificationURL': instance.tokenNotificationURL, + 'type': instance.$type, +}; -_$PlatformPayOrderDetailsImpl _$$PlatformPayOrderDetailsImplFromJson( - Map json) => - _$PlatformPayOrderDetailsImpl( - orderTypeIdentifier: json['orderTypeIdentifier'] as String, - orderIdentifier: json['orderIdentifier'] as String, - webServiceUrl: json['webServiceUrl'] as String, - authenticationToken: json['authenticationToken'] as String, - ); +_PaymentRequestTypeReload _$PaymentRequestTypeReloadFromJson( + Map json, +) => _PaymentRequestTypeReload( + description: json['description'] as String, + managementUrl: json['managementUrl'] as String, + label: json['label'] as String, + reloadAmount: json['reloadAmount'] as String, + thresholdAmount: json['thresholdAmount'] as String, + billingAgreement: json['billingAgreement'] as String?, + tokenNotificationURL: json['tokenNotificationURL'] as String?, + $type: json['type'] as String?, +); + +Map _$PaymentRequestTypeReloadToJson( + _PaymentRequestTypeReload instance, +) => { + 'description': instance.description, + 'managementUrl': instance.managementUrl, + 'label': instance.label, + 'reloadAmount': instance.reloadAmount, + 'thresholdAmount': instance.thresholdAmount, + 'billingAgreement': instance.billingAgreement, + 'tokenNotificationURL': instance.tokenNotificationURL, + 'type': instance.$type, +}; -Map _$$PlatformPayOrderDetailsImplToJson( - _$PlatformPayOrderDetailsImpl instance) => - { - 'orderTypeIdentifier': instance.orderTypeIdentifier, - 'orderIdentifier': instance.orderIdentifier, - 'webServiceUrl': instance.webServiceUrl, - 'authenticationToken': instance.authenticationToken, - }; +_PaymentRequestTypeMultiMerchant _$PaymentRequestTypeMultiMerchantFromJson( + Map json, +) => _PaymentRequestTypeMultiMerchant( + merchants: (json['merchants'] as List) + .map((e) => ApplePayMultiMerchant.fromJson(e as Map)) + .toList(), + $type: json['type'] as String?, +); + +Map _$PaymentRequestTypeMultiMerchantToJson( + _PaymentRequestTypeMultiMerchant instance, +) => {'merchants': instance.merchants, 'type': instance.$type}; + +_ApplePayMultiMerchant _$ApplePayMultiMerchantFromJson( + Map json, +) => _ApplePayMultiMerchant( + merchantIdentifier: json['merchantIdentifier'] as String, + externalIdentifier: json['externalIdentifier'] as String, + merchantName: json['merchantName'] as String, + merchantDomain: json['merchantDomain'] as String?, + amount: json['amount'] as String, +); + +Map _$ApplePayMultiMerchantToJson( + _ApplePayMultiMerchant instance, +) => { + 'merchantIdentifier': instance.merchantIdentifier, + 'externalIdentifier': instance.externalIdentifier, + 'merchantName': instance.merchantName, + 'merchantDomain': instance.merchantDomain, + 'amount': instance.amount, +}; -_$PaymentRequestCreateOptionsImpl _$$PaymentRequestCreateOptionsImplFromJson( - Map json) => - _$PaymentRequestCreateOptionsImpl( - country: json['country'] as String, - currency: json['currency'] as String, - total: PlatformPayWebPaymentItem.fromJson( - json['total'] as Map), - displayItems: (json['displayItems'] as List?) - ?.map((e) => - PlatformPayWebPaymentItem.fromJson(e as Map)) - .toList() ?? - const [], - requestPayerName: json['requestPayerName'] as bool? ?? false, - requestPayerEmail: json['requestPayerEmail'] as bool? ?? false, - requestPayerPhone: json['requestPayerPhone'] as bool? ?? false, - requestShipping: json['requestShipping'] as bool? ?? false, - shippingOptions: (json['shippingOptions'] as List?) - ?.map((e) => PlatformPayWebShippingOption.fromJson( - e as Map)) - .toList() ?? - const [], - disableWallets: (json['disableWallets'] as List?) - ?.map((e) => $enumDecode(_$PlatformPayWebWalletTypeEnumMap, e)) - .toList() ?? - const [], - ); +_PlatformPayOrderDetails _$PlatformPayOrderDetailsFromJson( + Map json, +) => _PlatformPayOrderDetails( + orderTypeIdentifier: json['orderTypeIdentifier'] as String, + orderIdentifier: json['orderIdentifier'] as String, + webServiceUrl: json['webServiceUrl'] as String, + authenticationToken: json['authenticationToken'] as String, +); + +Map _$PlatformPayOrderDetailsToJson( + _PlatformPayOrderDetails instance, +) => { + 'orderTypeIdentifier': instance.orderTypeIdentifier, + 'orderIdentifier': instance.orderIdentifier, + 'webServiceUrl': instance.webServiceUrl, + 'authenticationToken': instance.authenticationToken, +}; -Map _$$PaymentRequestCreateOptionsImplToJson( - _$PaymentRequestCreateOptionsImpl instance) => - { - 'country': instance.country, - 'currency': instance.currency, - 'total': instance.total.toJson(), - 'displayItems': instance.displayItems.map((e) => e.toJson()).toList(), - 'requestPayerName': instance.requestPayerName, - 'requestPayerEmail': instance.requestPayerEmail, - 'requestPayerPhone': instance.requestPayerPhone, - 'requestShipping': instance.requestShipping, - 'shippingOptions': - instance.shippingOptions.map((e) => e.toJson()).toList(), - 'disableWallets': instance.disableWallets - .map((e) => _$PlatformPayWebWalletTypeEnumMap[e]!) - .toList(), - }; +_PaymentRequestCreateOptions _$PaymentRequestCreateOptionsFromJson( + Map json, +) => _PaymentRequestCreateOptions( + country: json['country'] as String, + currency: json['currency'] as String, + total: PlatformPayWebPaymentItem.fromJson( + json['total'] as Map, + ), + displayItems: + (json['displayItems'] as List?) + ?.map( + (e) => + PlatformPayWebPaymentItem.fromJson(e as Map), + ) + .toList() ?? + const [], + requestPayerName: json['requestPayerName'] as bool? ?? false, + requestPayerEmail: json['requestPayerEmail'] as bool? ?? false, + requestPayerPhone: json['requestPayerPhone'] as bool? ?? false, + requestShipping: json['requestShipping'] as bool? ?? false, + shippingOptions: + (json['shippingOptions'] as List?) + ?.map( + (e) => PlatformPayWebShippingOption.fromJson( + e as Map, + ), + ) + .toList() ?? + const [], + disableWallets: + (json['disableWallets'] as List?) + ?.map((e) => $enumDecode(_$PlatformPayWebWalletTypeEnumMap, e)) + .toList() ?? + const [], +); + +Map _$PaymentRequestCreateOptionsToJson( + _PaymentRequestCreateOptions instance, +) => { + 'country': instance.country, + 'currency': instance.currency, + 'total': instance.total.toJson(), + 'displayItems': instance.displayItems.map((e) => e.toJson()).toList(), + 'requestPayerName': instance.requestPayerName, + 'requestPayerEmail': instance.requestPayerEmail, + 'requestPayerPhone': instance.requestPayerPhone, + 'requestShipping': instance.requestShipping, + 'shippingOptions': instance.shippingOptions.map((e) => e.toJson()).toList(), + 'disableWallets': instance.disableWallets + .map((e) => _$PlatformPayWebWalletTypeEnumMap[e]!) + .toList(), +}; const _$PlatformPayWebWalletTypeEnumMap = { PlatformPayWebWalletType.applePay: 'applePay', @@ -573,17 +569,15 @@ const _$PlatformPayWebWalletTypeEnumMap = { PlatformPayWebWalletType.browserCard: 'browserCard', }; -_$$ShippingOptionImpl _$$$ShippingOptionImplFromJson( - Map json) => - _$$ShippingOptionImpl( +_$ShippingOption _$$ShippingOptionFromJson(Map json) => + _$ShippingOption( id: json['id'] as String, label: json['label'] as String, detail: json['detail'] as String, amount: json['amount'] as num, ); -Map _$$$ShippingOptionImplToJson( - _$$ShippingOptionImpl instance) => +Map _$$ShippingOptionToJson(_$ShippingOption instance) => { 'id': instance.id, 'label': instance.label, @@ -591,14 +585,14 @@ Map _$$$ShippingOptionImplToJson( 'amount': instance.amount, }; -_$$PaymentItemImpl _$$$PaymentItemImplFromJson(Map json) => - _$$PaymentItemImpl( +_$PaymentItem _$$PaymentItemFromJson(Map json) => + _$PaymentItem( amount: json['amount'] as num, label: json['label'] as String, pending: json['pending'] as bool? ?? false, ); -Map _$$$PaymentItemImplToJson(_$$PaymentItemImpl instance) => +Map _$$PaymentItemToJson(_$PaymentItem instance) => { 'amount': instance.amount, 'label': instance.label, diff --git a/packages/stripe_platform_interface/lib/src/models/push_provisioning.dart b/packages/stripe_platform_interface/lib/src/models/push_provisioning.dart index db88db503..b3e23fece 100644 --- a/packages/stripe_platform_interface/lib/src/models/push_provisioning.dart +++ b/packages/stripe_platform_interface/lib/src/models/push_provisioning.dart @@ -6,9 +6,8 @@ part 'push_provisioning.freezed.dart'; part 'push_provisioning.g.dart'; @freezed - /// Tokenized token for Google Pay. -class GooglePayCardToken with _$GooglePayCardToken { +abstract class GooglePayCardToken with _$GooglePayCardToken { @JsonSerializable(explicitToJson: true) const factory GooglePayCardToken({ /// The token reference ID., @@ -41,9 +40,8 @@ class GooglePayCardToken with _$GooglePayCardToken { } @freezed - /// The result of checking if a card is in the wallet. -class IsCardInWalletResult with _$IsCardInWalletResult { +abstract class IsCardInWalletResult with _$IsCardInWalletResult { @JsonSerializable(explicitToJson: true) const factory IsCardInWalletResult({ required bool isInWallet, @@ -55,9 +53,8 @@ class IsCardInWalletResult with _$IsCardInWalletResult { } @freezed - /// The result of checking if a card can be added to the wallet. -class CanAddCardToWalletResult with _$CanAddCardToWalletResult { +abstract class CanAddCardToWalletResult with _$CanAddCardToWalletResult { @JsonSerializable(explicitToJson: true) const factory CanAddCardToWalletResult({ required bool canAddCard, @@ -69,9 +66,8 @@ class CanAddCardToWalletResult with _$CanAddCardToWalletResult { } @freezed - /// The details if card can be added. -class CanAddCardToDetails with _$CanAddCardToDetails { +abstract class CanAddCardToDetails with _$CanAddCardToDetails { @JsonSerializable(explicitToJson: true) const factory CanAddCardToDetails({ GooglePayCardToken? token, @@ -83,9 +79,8 @@ class CanAddCardToDetails with _$CanAddCardToDetails { } @freezed - /// The params for checking if a card is in the wallet. -class CanAddCardToWalletParams with _$CanAddCardToWalletParams { +abstract class CanAddCardToWalletParams with _$CanAddCardToWalletParams { @JsonSerializable(explicitToJson: true) const factory CanAddCardToWalletParams({ ///The `primary_account_identifier` value from the issued card. Can be an empty string. diff --git a/packages/stripe_platform_interface/lib/src/models/push_provisioning.freezed.dart b/packages/stripe_platform_interface/lib/src/models/push_provisioning.freezed.dart index 44c5c7631..09908afa1 100644 --- a/packages/stripe_platform_interface/lib/src/models/push_provisioning.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/push_provisioning.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1199 +9,1461 @@ part of 'push_provisioning.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); +/// @nodoc +mixin _$GooglePayCardToken { + +/// The token reference ID., + String get id;/// Last four digits of the FPAN, + String get fpanLastFour;/// Last four digits of the DPAN, + String get dpanLastFour;/// The network of the card. + int get network;/// The service provider of the card. + int get serviceProvider;/// The name of the issuer., + String get issuer;/// The GooglePayCardTokenStatus., + GooglePayCardTokenStatus get status;/// Deprecated. Use fpanLastFour or dpanLastFour., + String get cardLastFour; +/// Create a copy of GooglePayCardToken +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GooglePayCardTokenCopyWith get copyWith => _$GooglePayCardTokenCopyWithImpl(this as GooglePayCardToken, _$identity); + + /// Serializes this GooglePayCardToken to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GooglePayCardToken&&(identical(other.id, id) || other.id == id)&&(identical(other.fpanLastFour, fpanLastFour) || other.fpanLastFour == fpanLastFour)&&(identical(other.dpanLastFour, dpanLastFour) || other.dpanLastFour == dpanLastFour)&&(identical(other.network, network) || other.network == network)&&(identical(other.serviceProvider, serviceProvider) || other.serviceProvider == serviceProvider)&&(identical(other.issuer, issuer) || other.issuer == issuer)&&(identical(other.status, status) || other.status == status)&&(identical(other.cardLastFour, cardLastFour) || other.cardLastFour == cardLastFour)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,fpanLastFour,dpanLastFour,network,serviceProvider,issuer,status,cardLastFour); + +@override +String toString() { + return 'GooglePayCardToken(id: $id, fpanLastFour: $fpanLastFour, dpanLastFour: $dpanLastFour, network: $network, serviceProvider: $serviceProvider, issuer: $issuer, status: $status, cardLastFour: $cardLastFour)'; +} + -GooglePayCardToken _$GooglePayCardTokenFromJson(Map json) { - return _GooglePayCardToken.fromJson(json); } /// @nodoc -mixin _$GooglePayCardToken { - /// The token reference ID., - String get id => throw _privateConstructorUsedError; +abstract mixin class $GooglePayCardTokenCopyWith<$Res> { + factory $GooglePayCardTokenCopyWith(GooglePayCardToken value, $Res Function(GooglePayCardToken) _then) = _$GooglePayCardTokenCopyWithImpl; +@useResult +$Res call({ + String id, String fpanLastFour, String dpanLastFour, int network, int serviceProvider, String issuer, GooglePayCardTokenStatus status, String cardLastFour +}); - /// Last four digits of the FPAN, - String get fpanLastFour => throw _privateConstructorUsedError; - /// Last four digits of the DPAN, - String get dpanLastFour => throw _privateConstructorUsedError; - /// The network of the card. - int get network => throw _privateConstructorUsedError; - /// The service provider of the card. - int get serviceProvider => throw _privateConstructorUsedError; +} +/// @nodoc +class _$GooglePayCardTokenCopyWithImpl<$Res> + implements $GooglePayCardTokenCopyWith<$Res> { + _$GooglePayCardTokenCopyWithImpl(this._self, this._then); + + final GooglePayCardToken _self; + final $Res Function(GooglePayCardToken) _then; + +/// Create a copy of GooglePayCardToken +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? fpanLastFour = null,Object? dpanLastFour = null,Object? network = null,Object? serviceProvider = null,Object? issuer = null,Object? status = null,Object? cardLastFour = null,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,fpanLastFour: null == fpanLastFour ? _self.fpanLastFour : fpanLastFour // ignore: cast_nullable_to_non_nullable +as String,dpanLastFour: null == dpanLastFour ? _self.dpanLastFour : dpanLastFour // ignore: cast_nullable_to_non_nullable +as String,network: null == network ? _self.network : network // ignore: cast_nullable_to_non_nullable +as int,serviceProvider: null == serviceProvider ? _self.serviceProvider : serviceProvider // ignore: cast_nullable_to_non_nullable +as int,issuer: null == issuer ? _self.issuer : issuer // ignore: cast_nullable_to_non_nullable +as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as GooglePayCardTokenStatus,cardLastFour: null == cardLastFour ? _self.cardLastFour : cardLastFour // ignore: cast_nullable_to_non_nullable +as String, + )); +} - /// The name of the issuer., - String get issuer => throw _privateConstructorUsedError; +} - /// The GooglePayCardTokenStatus., - GooglePayCardTokenStatus get status => throw _privateConstructorUsedError; - /// Deprecated. Use fpanLastFour or dpanLastFour., - String get cardLastFour => throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [GooglePayCardToken]. +extension GooglePayCardTokenPatterns on GooglePayCardToken { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _GooglePayCardToken value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GooglePayCardToken() when $default != null: +return $default(_that);case _: + return orElse(); - /// Serializes this GooglePayCardToken to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _GooglePayCardToken value) $default,){ +final _that = this; +switch (_that) { +case _GooglePayCardToken(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// Create a copy of GooglePayCardToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $GooglePayCardTokenCopyWith get copyWith => - throw _privateConstructorUsedError; } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _GooglePayCardToken value)? $default,){ +final _that = this; +switch (_that) { +case _GooglePayCardToken() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc -abstract class $GooglePayCardTokenCopyWith<$Res> { - factory $GooglePayCardTokenCopyWith( - GooglePayCardToken value, $Res Function(GooglePayCardToken) then) = - _$GooglePayCardTokenCopyWithImpl<$Res, GooglePayCardToken>; - @useResult - $Res call( - {String id, - String fpanLastFour, - String dpanLastFour, - int network, - int serviceProvider, - String issuer, - GooglePayCardTokenStatus status, - String cardLastFour}); } +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String fpanLastFour, String dpanLastFour, int network, int serviceProvider, String issuer, GooglePayCardTokenStatus status, String cardLastFour)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GooglePayCardToken() when $default != null: +return $default(_that.id,_that.fpanLastFour,_that.dpanLastFour,_that.network,_that.serviceProvider,_that.issuer,_that.status,_that.cardLastFour);case _: + return orElse(); -/// @nodoc -class _$GooglePayCardTokenCopyWithImpl<$Res, $Val extends GooglePayCardToken> - implements $GooglePayCardTokenCopyWith<$Res> { - _$GooglePayCardTokenCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of GooglePayCardToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? fpanLastFour = null, - Object? dpanLastFour = null, - Object? network = null, - Object? serviceProvider = null, - Object? issuer = null, - Object? status = null, - Object? cardLastFour = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - fpanLastFour: null == fpanLastFour - ? _value.fpanLastFour - : fpanLastFour // ignore: cast_nullable_to_non_nullable - as String, - dpanLastFour: null == dpanLastFour - ? _value.dpanLastFour - : dpanLastFour // ignore: cast_nullable_to_non_nullable - as String, - network: null == network - ? _value.network - : network // ignore: cast_nullable_to_non_nullable - as int, - serviceProvider: null == serviceProvider - ? _value.serviceProvider - : serviceProvider // ignore: cast_nullable_to_non_nullable - as int, - issuer: null == issuer - ? _value.issuer - : issuer // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as GooglePayCardTokenStatus, - cardLastFour: null == cardLastFour - ? _value.cardLastFour - : cardLastFour // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } } +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String fpanLastFour, String dpanLastFour, int network, int serviceProvider, String issuer, GooglePayCardTokenStatus status, String cardLastFour) $default,) {final _that = this; +switch (_that) { +case _GooglePayCardToken(): +return $default(_that.id,_that.fpanLastFour,_that.dpanLastFour,_that.network,_that.serviceProvider,_that.issuer,_that.status,_that.cardLastFour);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class _$$GooglePayCardTokenImplCopyWith<$Res> - implements $GooglePayCardTokenCopyWith<$Res> { - factory _$$GooglePayCardTokenImplCopyWith(_$GooglePayCardTokenImpl value, - $Res Function(_$GooglePayCardTokenImpl) then) = - __$$GooglePayCardTokenImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String fpanLastFour, - String dpanLastFour, - int network, - int serviceProvider, - String issuer, - GooglePayCardTokenStatus status, - String cardLastFour}); +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String fpanLastFour, String dpanLastFour, int network, int serviceProvider, String issuer, GooglePayCardTokenStatus status, String cardLastFour)? $default,) {final _that = this; +switch (_that) { +case _GooglePayCardToken() when $default != null: +return $default(_that.id,_that.fpanLastFour,_that.dpanLastFour,_that.network,_that.serviceProvider,_that.issuer,_that.status,_that.cardLastFour);case _: + return null; + +} } -/// @nodoc -class __$$GooglePayCardTokenImplCopyWithImpl<$Res> - extends _$GooglePayCardTokenCopyWithImpl<$Res, _$GooglePayCardTokenImpl> - implements _$$GooglePayCardTokenImplCopyWith<$Res> { - __$$GooglePayCardTokenImplCopyWithImpl(_$GooglePayCardTokenImpl _value, - $Res Function(_$GooglePayCardTokenImpl) _then) - : super(_value, _then); - - /// Create a copy of GooglePayCardToken - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? fpanLastFour = null, - Object? dpanLastFour = null, - Object? network = null, - Object? serviceProvider = null, - Object? issuer = null, - Object? status = null, - Object? cardLastFour = null, - }) { - return _then(_$GooglePayCardTokenImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - fpanLastFour: null == fpanLastFour - ? _value.fpanLastFour - : fpanLastFour // ignore: cast_nullable_to_non_nullable - as String, - dpanLastFour: null == dpanLastFour - ? _value.dpanLastFour - : dpanLastFour // ignore: cast_nullable_to_non_nullable - as String, - network: null == network - ? _value.network - : network // ignore: cast_nullable_to_non_nullable - as int, - serviceProvider: null == serviceProvider - ? _value.serviceProvider - : serviceProvider // ignore: cast_nullable_to_non_nullable - as int, - issuer: null == issuer - ? _value.issuer - : issuer // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as GooglePayCardTokenStatus, - cardLastFour: null == cardLastFour - ? _value.cardLastFour - : cardLastFour // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$GooglePayCardTokenImpl implements _GooglePayCardToken { - const _$GooglePayCardTokenImpl( - {required this.id, - required this.fpanLastFour, - required this.dpanLastFour, - required this.network, - required this.serviceProvider, - required this.issuer, - required this.status, - required this.cardLastFour}); - - factory _$GooglePayCardTokenImpl.fromJson(Map json) => - _$$GooglePayCardTokenImplFromJson(json); - - /// The token reference ID., - @override - final String id; - - /// Last four digits of the FPAN, - @override - final String fpanLastFour; - - /// Last four digits of the DPAN, - @override - final String dpanLastFour; - - /// The network of the card. - @override - final int network; - - /// The service provider of the card. - @override - final int serviceProvider; - - /// The name of the issuer., - @override - final String issuer; - - /// The GooglePayCardTokenStatus., - @override - final GooglePayCardTokenStatus status; - - /// Deprecated. Use fpanLastFour or dpanLastFour., - @override - final String cardLastFour; - - @override - String toString() { - return 'GooglePayCardToken(id: $id, fpanLastFour: $fpanLastFour, dpanLastFour: $dpanLastFour, network: $network, serviceProvider: $serviceProvider, issuer: $issuer, status: $status, cardLastFour: $cardLastFour)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GooglePayCardTokenImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.fpanLastFour, fpanLastFour) || - other.fpanLastFour == fpanLastFour) && - (identical(other.dpanLastFour, dpanLastFour) || - other.dpanLastFour == dpanLastFour) && - (identical(other.network, network) || other.network == network) && - (identical(other.serviceProvider, serviceProvider) || - other.serviceProvider == serviceProvider) && - (identical(other.issuer, issuer) || other.issuer == issuer) && - (identical(other.status, status) || other.status == status) && - (identical(other.cardLastFour, cardLastFour) || - other.cardLastFour == cardLastFour)); - } +class _GooglePayCardToken implements GooglePayCardToken { + const _GooglePayCardToken({required this.id, required this.fpanLastFour, required this.dpanLastFour, required this.network, required this.serviceProvider, required this.issuer, required this.status, required this.cardLastFour}); + factory _GooglePayCardToken.fromJson(Map json) => _$GooglePayCardTokenFromJson(json); + +/// The token reference ID., +@override final String id; +/// Last four digits of the FPAN, +@override final String fpanLastFour; +/// Last four digits of the DPAN, +@override final String dpanLastFour; +/// The network of the card. +@override final int network; +/// The service provider of the card. +@override final int serviceProvider; +/// The name of the issuer., +@override final String issuer; +/// The GooglePayCardTokenStatus., +@override final GooglePayCardTokenStatus status; +/// Deprecated. Use fpanLastFour or dpanLastFour., +@override final String cardLastFour; + +/// Create a copy of GooglePayCardToken +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GooglePayCardTokenCopyWith<_GooglePayCardToken> get copyWith => __$GooglePayCardTokenCopyWithImpl<_GooglePayCardToken>(this, _$identity); + +@override +Map toJson() { + return _$GooglePayCardTokenToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, id, fpanLastFour, dpanLastFour, - network, serviceProvider, issuer, status, cardLastFour); - - /// Create a copy of GooglePayCardToken - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$GooglePayCardTokenImplCopyWith<_$GooglePayCardTokenImpl> get copyWith => - __$$GooglePayCardTokenImplCopyWithImpl<_$GooglePayCardTokenImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$GooglePayCardTokenImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GooglePayCardToken&&(identical(other.id, id) || other.id == id)&&(identical(other.fpanLastFour, fpanLastFour) || other.fpanLastFour == fpanLastFour)&&(identical(other.dpanLastFour, dpanLastFour) || other.dpanLastFour == dpanLastFour)&&(identical(other.network, network) || other.network == network)&&(identical(other.serviceProvider, serviceProvider) || other.serviceProvider == serviceProvider)&&(identical(other.issuer, issuer) || other.issuer == issuer)&&(identical(other.status, status) || other.status == status)&&(identical(other.cardLastFour, cardLastFour) || other.cardLastFour == cardLastFour)); } -abstract class _GooglePayCardToken implements GooglePayCardToken { - const factory _GooglePayCardToken( - {required final String id, - required final String fpanLastFour, - required final String dpanLastFour, - required final int network, - required final int serviceProvider, - required final String issuer, - required final GooglePayCardTokenStatus status, - required final String cardLastFour}) = _$GooglePayCardTokenImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,fpanLastFour,dpanLastFour,network,serviceProvider,issuer,status,cardLastFour); - factory _GooglePayCardToken.fromJson(Map json) = - _$GooglePayCardTokenImpl.fromJson; +@override +String toString() { + return 'GooglePayCardToken(id: $id, fpanLastFour: $fpanLastFour, dpanLastFour: $dpanLastFour, network: $network, serviceProvider: $serviceProvider, issuer: $issuer, status: $status, cardLastFour: $cardLastFour)'; +} - /// The token reference ID., - @override - String get id; - /// Last four digits of the FPAN, - @override - String get fpanLastFour; +} - /// Last four digits of the DPAN, - @override - String get dpanLastFour; +/// @nodoc +abstract mixin class _$GooglePayCardTokenCopyWith<$Res> implements $GooglePayCardTokenCopyWith<$Res> { + factory _$GooglePayCardTokenCopyWith(_GooglePayCardToken value, $Res Function(_GooglePayCardToken) _then) = __$GooglePayCardTokenCopyWithImpl; +@override @useResult +$Res call({ + String id, String fpanLastFour, String dpanLastFour, int network, int serviceProvider, String issuer, GooglePayCardTokenStatus status, String cardLastFour +}); - /// The network of the card. - @override - int get network; - /// The service provider of the card. - @override - int get serviceProvider; - /// The name of the issuer., - @override - String get issuer; - /// The GooglePayCardTokenStatus., - @override - GooglePayCardTokenStatus get status; +} +/// @nodoc +class __$GooglePayCardTokenCopyWithImpl<$Res> + implements _$GooglePayCardTokenCopyWith<$Res> { + __$GooglePayCardTokenCopyWithImpl(this._self, this._then); + + final _GooglePayCardToken _self; + final $Res Function(_GooglePayCardToken) _then; + +/// Create a copy of GooglePayCardToken +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? fpanLastFour = null,Object? dpanLastFour = null,Object? network = null,Object? serviceProvider = null,Object? issuer = null,Object? status = null,Object? cardLastFour = null,}) { + return _then(_GooglePayCardToken( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,fpanLastFour: null == fpanLastFour ? _self.fpanLastFour : fpanLastFour // ignore: cast_nullable_to_non_nullable +as String,dpanLastFour: null == dpanLastFour ? _self.dpanLastFour : dpanLastFour // ignore: cast_nullable_to_non_nullable +as String,network: null == network ? _self.network : network // ignore: cast_nullable_to_non_nullable +as int,serviceProvider: null == serviceProvider ? _self.serviceProvider : serviceProvider // ignore: cast_nullable_to_non_nullable +as int,issuer: null == issuer ? _self.issuer : issuer // ignore: cast_nullable_to_non_nullable +as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as GooglePayCardTokenStatus,cardLastFour: null == cardLastFour ? _self.cardLastFour : cardLastFour // ignore: cast_nullable_to_non_nullable +as String, + )); +} - /// Deprecated. Use fpanLastFour or dpanLastFour., - @override - String get cardLastFour; - /// Create a copy of GooglePayCardToken - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$GooglePayCardTokenImplCopyWith<_$GooglePayCardTokenImpl> get copyWith => - throw _privateConstructorUsedError; } -IsCardInWalletResult _$IsCardInWalletResultFromJson(Map json) { - return _IsCardInWalletResult.fromJson(json); -} /// @nodoc mixin _$IsCardInWalletResult { - bool get isInWallet => throw _privateConstructorUsedError; - GooglePayCardToken? get token => throw _privateConstructorUsedError; + + bool get isInWallet; GooglePayCardToken? get token; +/// Create a copy of IsCardInWalletResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$IsCardInWalletResultCopyWith get copyWith => _$IsCardInWalletResultCopyWithImpl(this as IsCardInWalletResult, _$identity); /// Serializes this IsCardInWalletResult to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of IsCardInWalletResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $IsCardInWalletResultCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is IsCardInWalletResult&&(identical(other.isInWallet, isInWallet) || other.isInWallet == isInWallet)&&(identical(other.token, token) || other.token == token)); } -/// @nodoc -abstract class $IsCardInWalletResultCopyWith<$Res> { - factory $IsCardInWalletResultCopyWith(IsCardInWalletResult value, - $Res Function(IsCardInWalletResult) then) = - _$IsCardInWalletResultCopyWithImpl<$Res, IsCardInWalletResult>; - @useResult - $Res call({bool isInWallet, GooglePayCardToken? token}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isInWallet,token); - $GooglePayCardTokenCopyWith<$Res>? get token; +@override +String toString() { + return 'IsCardInWalletResult(isInWallet: $isInWallet, token: $token)'; } + +} + +/// @nodoc +abstract mixin class $IsCardInWalletResultCopyWith<$Res> { + factory $IsCardInWalletResultCopyWith(IsCardInWalletResult value, $Res Function(IsCardInWalletResult) _then) = _$IsCardInWalletResultCopyWithImpl; +@useResult +$Res call({ + bool isInWallet, GooglePayCardToken? token +}); + + +$GooglePayCardTokenCopyWith<$Res>? get token; + +} /// @nodoc -class _$IsCardInWalletResultCopyWithImpl<$Res, - $Val extends IsCardInWalletResult> +class _$IsCardInWalletResultCopyWithImpl<$Res> implements $IsCardInWalletResultCopyWith<$Res> { - _$IsCardInWalletResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of IsCardInWalletResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isInWallet = null, - Object? token = freezed, - }) { - return _then(_value.copyWith( - isInWallet: null == isInWallet - ? _value.isInWallet - : isInWallet // ignore: cast_nullable_to_non_nullable - as bool, - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as GooglePayCardToken?, - ) as $Val); + _$IsCardInWalletResultCopyWithImpl(this._self, this._then); + + final IsCardInWalletResult _self; + final $Res Function(IsCardInWalletResult) _then; + +/// Create a copy of IsCardInWalletResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isInWallet = null,Object? token = freezed,}) { + return _then(_self.copyWith( +isInWallet: null == isInWallet ? _self.isInWallet : isInWallet // ignore: cast_nullable_to_non_nullable +as bool,token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as GooglePayCardToken?, + )); +} +/// Create a copy of IsCardInWalletResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayCardTokenCopyWith<$Res>? get token { + if (_self.token == null) { + return null; } - /// Create a copy of IsCardInWalletResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayCardTokenCopyWith<$Res>? get token { - if (_value.token == null) { - return null; - } - - return $GooglePayCardTokenCopyWith<$Res>(_value.token!, (value) { - return _then(_value.copyWith(token: value) as $Val); - }); - } + return $GooglePayCardTokenCopyWith<$Res>(_self.token!, (value) { + return _then(_self.copyWith(token: value)); + }); +} } -/// @nodoc -abstract class _$$IsCardInWalletResultImplCopyWith<$Res> - implements $IsCardInWalletResultCopyWith<$Res> { - factory _$$IsCardInWalletResultImplCopyWith(_$IsCardInWalletResultImpl value, - $Res Function(_$IsCardInWalletResultImpl) then) = - __$$IsCardInWalletResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool isInWallet, GooglePayCardToken? token}); - @override - $GooglePayCardTokenCopyWith<$Res>? get token; +/// Adds pattern-matching-related methods to [IsCardInWalletResult]. +extension IsCardInWalletResultPatterns on IsCardInWalletResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _IsCardInWalletResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _IsCardInWalletResult() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _IsCardInWalletResult value) $default,){ +final _that = this; +switch (_that) { +case _IsCardInWalletResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _IsCardInWalletResult value)? $default,){ +final _that = this; +switch (_that) { +case _IsCardInWalletResult() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool isInWallet, GooglePayCardToken? token)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _IsCardInWalletResult() when $default != null: +return $default(_that.isInWallet,_that.token);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool isInWallet, GooglePayCardToken? token) $default,) {final _that = this; +switch (_that) { +case _IsCardInWalletResult(): +return $default(_that.isInWallet,_that.token);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool isInWallet, GooglePayCardToken? token)? $default,) {final _that = this; +switch (_that) { +case _IsCardInWalletResult() when $default != null: +return $default(_that.isInWallet,_that.token);case _: + return null; + +} } -/// @nodoc -class __$$IsCardInWalletResultImplCopyWithImpl<$Res> - extends _$IsCardInWalletResultCopyWithImpl<$Res, _$IsCardInWalletResultImpl> - implements _$$IsCardInWalletResultImplCopyWith<$Res> { - __$$IsCardInWalletResultImplCopyWithImpl(_$IsCardInWalletResultImpl _value, - $Res Function(_$IsCardInWalletResultImpl) _then) - : super(_value, _then); - - /// Create a copy of IsCardInWalletResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isInWallet = null, - Object? token = freezed, - }) { - return _then(_$IsCardInWalletResultImpl( - isInWallet: null == isInWallet - ? _value.isInWallet - : isInWallet // ignore: cast_nullable_to_non_nullable - as bool, - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as GooglePayCardToken?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$IsCardInWalletResultImpl implements _IsCardInWalletResult { - const _$IsCardInWalletResultImpl({required this.isInWallet, this.token}); +class _IsCardInWalletResult implements IsCardInWalletResult { + const _IsCardInWalletResult({required this.isInWallet, this.token}); + factory _IsCardInWalletResult.fromJson(Map json) => _$IsCardInWalletResultFromJson(json); + +@override final bool isInWallet; +@override final GooglePayCardToken? token; + +/// Create a copy of IsCardInWalletResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$IsCardInWalletResultCopyWith<_IsCardInWalletResult> get copyWith => __$IsCardInWalletResultCopyWithImpl<_IsCardInWalletResult>(this, _$identity); + +@override +Map toJson() { + return _$IsCardInWalletResultToJson(this, ); +} - factory _$IsCardInWalletResultImpl.fromJson(Map json) => - _$$IsCardInWalletResultImplFromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _IsCardInWalletResult&&(identical(other.isInWallet, isInWallet) || other.isInWallet == isInWallet)&&(identical(other.token, token) || other.token == token)); +} - @override - final bool isInWallet; - @override - final GooglePayCardToken? token; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isInWallet,token); - @override - String toString() { - return 'IsCardInWalletResult(isInWallet: $isInWallet, token: $token)'; - } +@override +String toString() { + return 'IsCardInWalletResult(isInWallet: $isInWallet, token: $token)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$IsCardInWalletResultImpl && - (identical(other.isInWallet, isInWallet) || - other.isInWallet == isInWallet) && - (identical(other.token, token) || other.token == token)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, isInWallet, token); - - /// Create a copy of IsCardInWalletResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$IsCardInWalletResultImplCopyWith<_$IsCardInWalletResultImpl> - get copyWith => - __$$IsCardInWalletResultImplCopyWithImpl<_$IsCardInWalletResultImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$IsCardInWalletResultImplToJson( - this, - ); - } } -abstract class _IsCardInWalletResult implements IsCardInWalletResult { - const factory _IsCardInWalletResult( - {required final bool isInWallet, - final GooglePayCardToken? token}) = _$IsCardInWalletResultImpl; +/// @nodoc +abstract mixin class _$IsCardInWalletResultCopyWith<$Res> implements $IsCardInWalletResultCopyWith<$Res> { + factory _$IsCardInWalletResultCopyWith(_IsCardInWalletResult value, $Res Function(_IsCardInWalletResult) _then) = __$IsCardInWalletResultCopyWithImpl; +@override @useResult +$Res call({ + bool isInWallet, GooglePayCardToken? token +}); - factory _IsCardInWalletResult.fromJson(Map json) = - _$IsCardInWalletResultImpl.fromJson; - @override - bool get isInWallet; - @override - GooglePayCardToken? get token; +@override $GooglePayCardTokenCopyWith<$Res>? get token; - /// Create a copy of IsCardInWalletResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$IsCardInWalletResultImplCopyWith<_$IsCardInWalletResultImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$IsCardInWalletResultCopyWithImpl<$Res> + implements _$IsCardInWalletResultCopyWith<$Res> { + __$IsCardInWalletResultCopyWithImpl(this._self, this._then); + + final _IsCardInWalletResult _self; + final $Res Function(_IsCardInWalletResult) _then; + +/// Create a copy of IsCardInWalletResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isInWallet = null,Object? token = freezed,}) { + return _then(_IsCardInWalletResult( +isInWallet: null == isInWallet ? _self.isInWallet : isInWallet // ignore: cast_nullable_to_non_nullable +as bool,token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as GooglePayCardToken?, + )); +} + +/// Create a copy of IsCardInWalletResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayCardTokenCopyWith<$Res>? get token { + if (_self.token == null) { + return null; + } -CanAddCardToWalletResult _$CanAddCardToWalletResultFromJson( - Map json) { - return _CanAddCardToWalletResult.fromJson(json); + return $GooglePayCardTokenCopyWith<$Res>(_self.token!, (value) { + return _then(_self.copyWith(token: value)); + }); } +} + /// @nodoc mixin _$CanAddCardToWalletResult { - bool get canAddCard => throw _privateConstructorUsedError; - CanAddCardToDetails? get details => throw _privateConstructorUsedError; + + bool get canAddCard; CanAddCardToDetails? get details; +/// Create a copy of CanAddCardToWalletResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CanAddCardToWalletResultCopyWith get copyWith => _$CanAddCardToWalletResultCopyWithImpl(this as CanAddCardToWalletResult, _$identity); /// Serializes this CanAddCardToWalletResult to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CanAddCardToWalletResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CanAddCardToWalletResultCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CanAddCardToWalletResult&&(identical(other.canAddCard, canAddCard) || other.canAddCard == canAddCard)&&(identical(other.details, details) || other.details == details)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,canAddCard,details); + +@override +String toString() { + return 'CanAddCardToWalletResult(canAddCard: $canAddCard, details: $details)'; } -/// @nodoc -abstract class $CanAddCardToWalletResultCopyWith<$Res> { - factory $CanAddCardToWalletResultCopyWith(CanAddCardToWalletResult value, - $Res Function(CanAddCardToWalletResult) then) = - _$CanAddCardToWalletResultCopyWithImpl<$Res, CanAddCardToWalletResult>; - @useResult - $Res call({bool canAddCard, CanAddCardToDetails? details}); - $CanAddCardToDetailsCopyWith<$Res>? get details; } /// @nodoc -class _$CanAddCardToWalletResultCopyWithImpl<$Res, - $Val extends CanAddCardToWalletResult> +abstract mixin class $CanAddCardToWalletResultCopyWith<$Res> { + factory $CanAddCardToWalletResultCopyWith(CanAddCardToWalletResult value, $Res Function(CanAddCardToWalletResult) _then) = _$CanAddCardToWalletResultCopyWithImpl; +@useResult +$Res call({ + bool canAddCard, CanAddCardToDetails? details +}); + + +$CanAddCardToDetailsCopyWith<$Res>? get details; + +} +/// @nodoc +class _$CanAddCardToWalletResultCopyWithImpl<$Res> implements $CanAddCardToWalletResultCopyWith<$Res> { - _$CanAddCardToWalletResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CanAddCardToWalletResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? canAddCard = null, - Object? details = freezed, - }) { - return _then(_value.copyWith( - canAddCard: null == canAddCard - ? _value.canAddCard - : canAddCard // ignore: cast_nullable_to_non_nullable - as bool, - details: freezed == details - ? _value.details - : details // ignore: cast_nullable_to_non_nullable - as CanAddCardToDetails?, - ) as $Val); + _$CanAddCardToWalletResultCopyWithImpl(this._self, this._then); + + final CanAddCardToWalletResult _self; + final $Res Function(CanAddCardToWalletResult) _then; + +/// Create a copy of CanAddCardToWalletResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? canAddCard = null,Object? details = freezed,}) { + return _then(_self.copyWith( +canAddCard: null == canAddCard ? _self.canAddCard : canAddCard // ignore: cast_nullable_to_non_nullable +as bool,details: freezed == details ? _self.details : details // ignore: cast_nullable_to_non_nullable +as CanAddCardToDetails?, + )); +} +/// Create a copy of CanAddCardToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CanAddCardToDetailsCopyWith<$Res>? get details { + if (_self.details == null) { + return null; } - /// Create a copy of CanAddCardToWalletResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $CanAddCardToDetailsCopyWith<$Res>? get details { - if (_value.details == null) { - return null; - } - - return $CanAddCardToDetailsCopyWith<$Res>(_value.details!, (value) { - return _then(_value.copyWith(details: value) as $Val); - }); - } + return $CanAddCardToDetailsCopyWith<$Res>(_self.details!, (value) { + return _then(_self.copyWith(details: value)); + }); +} } -/// @nodoc -abstract class _$$CanAddCardToWalletResultImplCopyWith<$Res> - implements $CanAddCardToWalletResultCopyWith<$Res> { - factory _$$CanAddCardToWalletResultImplCopyWith( - _$CanAddCardToWalletResultImpl value, - $Res Function(_$CanAddCardToWalletResultImpl) then) = - __$$CanAddCardToWalletResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool canAddCard, CanAddCardToDetails? details}); - @override - $CanAddCardToDetailsCopyWith<$Res>? get details; +/// Adds pattern-matching-related methods to [CanAddCardToWalletResult]. +extension CanAddCardToWalletResultPatterns on CanAddCardToWalletResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CanAddCardToWalletResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CanAddCardToWalletResult() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CanAddCardToWalletResult value) $default,){ +final _that = this; +switch (_that) { +case _CanAddCardToWalletResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CanAddCardToWalletResult value)? $default,){ +final _that = this; +switch (_that) { +case _CanAddCardToWalletResult() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool canAddCard, CanAddCardToDetails? details)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CanAddCardToWalletResult() when $default != null: +return $default(_that.canAddCard,_that.details);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool canAddCard, CanAddCardToDetails? details) $default,) {final _that = this; +switch (_that) { +case _CanAddCardToWalletResult(): +return $default(_that.canAddCard,_that.details);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool canAddCard, CanAddCardToDetails? details)? $default,) {final _that = this; +switch (_that) { +case _CanAddCardToWalletResult() when $default != null: +return $default(_that.canAddCard,_that.details);case _: + return null; + +} } -/// @nodoc -class __$$CanAddCardToWalletResultImplCopyWithImpl<$Res> - extends _$CanAddCardToWalletResultCopyWithImpl<$Res, - _$CanAddCardToWalletResultImpl> - implements _$$CanAddCardToWalletResultImplCopyWith<$Res> { - __$$CanAddCardToWalletResultImplCopyWithImpl( - _$CanAddCardToWalletResultImpl _value, - $Res Function(_$CanAddCardToWalletResultImpl) _then) - : super(_value, _then); - - /// Create a copy of CanAddCardToWalletResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? canAddCard = null, - Object? details = freezed, - }) { - return _then(_$CanAddCardToWalletResultImpl( - canAddCard: null == canAddCard - ? _value.canAddCard - : canAddCard // ignore: cast_nullable_to_non_nullable - as bool, - details: freezed == details - ? _value.details - : details // ignore: cast_nullable_to_non_nullable - as CanAddCardToDetails?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CanAddCardToWalletResultImpl implements _CanAddCardToWalletResult { - const _$CanAddCardToWalletResultImpl( - {required this.canAddCard, this.details}); +class _CanAddCardToWalletResult implements CanAddCardToWalletResult { + const _CanAddCardToWalletResult({required this.canAddCard, this.details}); + factory _CanAddCardToWalletResult.fromJson(Map json) => _$CanAddCardToWalletResultFromJson(json); + +@override final bool canAddCard; +@override final CanAddCardToDetails? details; + +/// Create a copy of CanAddCardToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CanAddCardToWalletResultCopyWith<_CanAddCardToWalletResult> get copyWith => __$CanAddCardToWalletResultCopyWithImpl<_CanAddCardToWalletResult>(this, _$identity); + +@override +Map toJson() { + return _$CanAddCardToWalletResultToJson(this, ); +} - factory _$CanAddCardToWalletResultImpl.fromJson(Map json) => - _$$CanAddCardToWalletResultImplFromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CanAddCardToWalletResult&&(identical(other.canAddCard, canAddCard) || other.canAddCard == canAddCard)&&(identical(other.details, details) || other.details == details)); +} - @override - final bool canAddCard; - @override - final CanAddCardToDetails? details; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,canAddCard,details); - @override - String toString() { - return 'CanAddCardToWalletResult(canAddCard: $canAddCard, details: $details)'; - } +@override +String toString() { + return 'CanAddCardToWalletResult(canAddCard: $canAddCard, details: $details)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CanAddCardToWalletResultImpl && - (identical(other.canAddCard, canAddCard) || - other.canAddCard == canAddCard) && - (identical(other.details, details) || other.details == details)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, canAddCard, details); - - /// Create a copy of CanAddCardToWalletResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CanAddCardToWalletResultImplCopyWith<_$CanAddCardToWalletResultImpl> - get copyWith => __$$CanAddCardToWalletResultImplCopyWithImpl< - _$CanAddCardToWalletResultImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CanAddCardToWalletResultImplToJson( - this, - ); - } } -abstract class _CanAddCardToWalletResult implements CanAddCardToWalletResult { - const factory _CanAddCardToWalletResult( - {required final bool canAddCard, - final CanAddCardToDetails? details}) = _$CanAddCardToWalletResultImpl; +/// @nodoc +abstract mixin class _$CanAddCardToWalletResultCopyWith<$Res> implements $CanAddCardToWalletResultCopyWith<$Res> { + factory _$CanAddCardToWalletResultCopyWith(_CanAddCardToWalletResult value, $Res Function(_CanAddCardToWalletResult) _then) = __$CanAddCardToWalletResultCopyWithImpl; +@override @useResult +$Res call({ + bool canAddCard, CanAddCardToDetails? details +}); - factory _CanAddCardToWalletResult.fromJson(Map json) = - _$CanAddCardToWalletResultImpl.fromJson; - @override - bool get canAddCard; - @override - CanAddCardToDetails? get details; +@override $CanAddCardToDetailsCopyWith<$Res>? get details; - /// Create a copy of CanAddCardToWalletResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CanAddCardToWalletResultImplCopyWith<_$CanAddCardToWalletResultImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$CanAddCardToWalletResultCopyWithImpl<$Res> + implements _$CanAddCardToWalletResultCopyWith<$Res> { + __$CanAddCardToWalletResultCopyWithImpl(this._self, this._then); + + final _CanAddCardToWalletResult _self; + final $Res Function(_CanAddCardToWalletResult) _then; + +/// Create a copy of CanAddCardToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? canAddCard = null,Object? details = freezed,}) { + return _then(_CanAddCardToWalletResult( +canAddCard: null == canAddCard ? _self.canAddCard : canAddCard // ignore: cast_nullable_to_non_nullable +as bool,details: freezed == details ? _self.details : details // ignore: cast_nullable_to_non_nullable +as CanAddCardToDetails?, + )); } -CanAddCardToDetails _$CanAddCardToDetailsFromJson(Map json) { - return _CanAddCardToDetails.fromJson(json); +/// Create a copy of CanAddCardToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CanAddCardToDetailsCopyWith<$Res>? get details { + if (_self.details == null) { + return null; + } + + return $CanAddCardToDetailsCopyWith<$Res>(_self.details!, (value) { + return _then(_self.copyWith(details: value)); + }); } +} + /// @nodoc mixin _$CanAddCardToDetails { - GooglePayCardToken? get token => throw _privateConstructorUsedError; - CanAddCardToWalletStatus? get status => throw _privateConstructorUsedError; + + GooglePayCardToken? get token; CanAddCardToWalletStatus? get status; +/// Create a copy of CanAddCardToDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CanAddCardToDetailsCopyWith get copyWith => _$CanAddCardToDetailsCopyWithImpl(this as CanAddCardToDetails, _$identity); /// Serializes this CanAddCardToDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of CanAddCardToDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CanAddCardToDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CanAddCardToDetails&&(identical(other.token, token) || other.token == token)&&(identical(other.status, status) || other.status == status)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,status); + +@override +String toString() { + return 'CanAddCardToDetails(token: $token, status: $status)'; } -/// @nodoc -abstract class $CanAddCardToDetailsCopyWith<$Res> { - factory $CanAddCardToDetailsCopyWith( - CanAddCardToDetails value, $Res Function(CanAddCardToDetails) then) = - _$CanAddCardToDetailsCopyWithImpl<$Res, CanAddCardToDetails>; - @useResult - $Res call({GooglePayCardToken? token, CanAddCardToWalletStatus? status}); - $GooglePayCardTokenCopyWith<$Res>? get token; } /// @nodoc -class _$CanAddCardToDetailsCopyWithImpl<$Res, $Val extends CanAddCardToDetails> +abstract mixin class $CanAddCardToDetailsCopyWith<$Res> { + factory $CanAddCardToDetailsCopyWith(CanAddCardToDetails value, $Res Function(CanAddCardToDetails) _then) = _$CanAddCardToDetailsCopyWithImpl; +@useResult +$Res call({ + GooglePayCardToken? token, CanAddCardToWalletStatus? status +}); + + +$GooglePayCardTokenCopyWith<$Res>? get token; + +} +/// @nodoc +class _$CanAddCardToDetailsCopyWithImpl<$Res> implements $CanAddCardToDetailsCopyWith<$Res> { - _$CanAddCardToDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CanAddCardToDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = freezed, - Object? status = freezed, - }) { - return _then(_value.copyWith( - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as GooglePayCardToken?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as CanAddCardToWalletStatus?, - ) as $Val); + _$CanAddCardToDetailsCopyWithImpl(this._self, this._then); + + final CanAddCardToDetails _self; + final $Res Function(CanAddCardToDetails) _then; + +/// Create a copy of CanAddCardToDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? token = freezed,Object? status = freezed,}) { + return _then(_self.copyWith( +token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as GooglePayCardToken?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as CanAddCardToWalletStatus?, + )); +} +/// Create a copy of CanAddCardToDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayCardTokenCopyWith<$Res>? get token { + if (_self.token == null) { + return null; } - /// Create a copy of CanAddCardToDetails - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $GooglePayCardTokenCopyWith<$Res>? get token { - if (_value.token == null) { - return null; - } - - return $GooglePayCardTokenCopyWith<$Res>(_value.token!, (value) { - return _then(_value.copyWith(token: value) as $Val); - }); - } + return $GooglePayCardTokenCopyWith<$Res>(_self.token!, (value) { + return _then(_self.copyWith(token: value)); + }); +} } -/// @nodoc -abstract class _$$CanAddCardToDetailsImplCopyWith<$Res> - implements $CanAddCardToDetailsCopyWith<$Res> { - factory _$$CanAddCardToDetailsImplCopyWith(_$CanAddCardToDetailsImpl value, - $Res Function(_$CanAddCardToDetailsImpl) then) = - __$$CanAddCardToDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({GooglePayCardToken? token, CanAddCardToWalletStatus? status}); - @override - $GooglePayCardTokenCopyWith<$Res>? get token; +/// Adds pattern-matching-related methods to [CanAddCardToDetails]. +extension CanAddCardToDetailsPatterns on CanAddCardToDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CanAddCardToDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CanAddCardToDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CanAddCardToDetails value) $default,){ +final _that = this; +switch (_that) { +case _CanAddCardToDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CanAddCardToDetails value)? $default,){ +final _that = this; +switch (_that) { +case _CanAddCardToDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( GooglePayCardToken? token, CanAddCardToWalletStatus? status)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CanAddCardToDetails() when $default != null: +return $default(_that.token,_that.status);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( GooglePayCardToken? token, CanAddCardToWalletStatus? status) $default,) {final _that = this; +switch (_that) { +case _CanAddCardToDetails(): +return $default(_that.token,_that.status);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( GooglePayCardToken? token, CanAddCardToWalletStatus? status)? $default,) {final _that = this; +switch (_that) { +case _CanAddCardToDetails() when $default != null: +return $default(_that.token,_that.status);case _: + return null; + +} } -/// @nodoc -class __$$CanAddCardToDetailsImplCopyWithImpl<$Res> - extends _$CanAddCardToDetailsCopyWithImpl<$Res, _$CanAddCardToDetailsImpl> - implements _$$CanAddCardToDetailsImplCopyWith<$Res> { - __$$CanAddCardToDetailsImplCopyWithImpl(_$CanAddCardToDetailsImpl _value, - $Res Function(_$CanAddCardToDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of CanAddCardToDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? token = freezed, - Object? status = freezed, - }) { - return _then(_$CanAddCardToDetailsImpl( - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as GooglePayCardToken?, - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as CanAddCardToWalletStatus?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CanAddCardToDetailsImpl implements _CanAddCardToDetails { - const _$CanAddCardToDetailsImpl({this.token, this.status}); +class _CanAddCardToDetails implements CanAddCardToDetails { + const _CanAddCardToDetails({this.token, this.status}); + factory _CanAddCardToDetails.fromJson(Map json) => _$CanAddCardToDetailsFromJson(json); + +@override final GooglePayCardToken? token; +@override final CanAddCardToWalletStatus? status; + +/// Create a copy of CanAddCardToDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CanAddCardToDetailsCopyWith<_CanAddCardToDetails> get copyWith => __$CanAddCardToDetailsCopyWithImpl<_CanAddCardToDetails>(this, _$identity); + +@override +Map toJson() { + return _$CanAddCardToDetailsToJson(this, ); +} - factory _$CanAddCardToDetailsImpl.fromJson(Map json) => - _$$CanAddCardToDetailsImplFromJson(json); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CanAddCardToDetails&&(identical(other.token, token) || other.token == token)&&(identical(other.status, status) || other.status == status)); +} - @override - final GooglePayCardToken? token; - @override - final CanAddCardToWalletStatus? status; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,token,status); - @override - String toString() { - return 'CanAddCardToDetails(token: $token, status: $status)'; - } +@override +String toString() { + return 'CanAddCardToDetails(token: $token, status: $status)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CanAddCardToDetailsImpl && - (identical(other.token, token) || other.token == token) && - (identical(other.status, status) || other.status == status)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, token, status); - - /// Create a copy of CanAddCardToDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CanAddCardToDetailsImplCopyWith<_$CanAddCardToDetailsImpl> get copyWith => - __$$CanAddCardToDetailsImplCopyWithImpl<_$CanAddCardToDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$CanAddCardToDetailsImplToJson( - this, - ); - } } -abstract class _CanAddCardToDetails implements CanAddCardToDetails { - const factory _CanAddCardToDetails( - {final GooglePayCardToken? token, - final CanAddCardToWalletStatus? status}) = _$CanAddCardToDetailsImpl; +/// @nodoc +abstract mixin class _$CanAddCardToDetailsCopyWith<$Res> implements $CanAddCardToDetailsCopyWith<$Res> { + factory _$CanAddCardToDetailsCopyWith(_CanAddCardToDetails value, $Res Function(_CanAddCardToDetails) _then) = __$CanAddCardToDetailsCopyWithImpl; +@override @useResult +$Res call({ + GooglePayCardToken? token, CanAddCardToWalletStatus? status +}); - factory _CanAddCardToDetails.fromJson(Map json) = - _$CanAddCardToDetailsImpl.fromJson; - @override - GooglePayCardToken? get token; - @override - CanAddCardToWalletStatus? get status; +@override $GooglePayCardTokenCopyWith<$Res>? get token; - /// Create a copy of CanAddCardToDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CanAddCardToDetailsImplCopyWith<_$CanAddCardToDetailsImpl> get copyWith => - throw _privateConstructorUsedError; +} +/// @nodoc +class __$CanAddCardToDetailsCopyWithImpl<$Res> + implements _$CanAddCardToDetailsCopyWith<$Res> { + __$CanAddCardToDetailsCopyWithImpl(this._self, this._then); + + final _CanAddCardToDetails _self; + final $Res Function(_CanAddCardToDetails) _then; + +/// Create a copy of CanAddCardToDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? token = freezed,Object? status = freezed,}) { + return _then(_CanAddCardToDetails( +token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as GooglePayCardToken?,status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as CanAddCardToWalletStatus?, + )); } -CanAddCardToWalletParams _$CanAddCardToWalletParamsFromJson( - Map json) { - return _CanAddCardToWalletParams.fromJson(json); +/// Create a copy of CanAddCardToDetails +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GooglePayCardTokenCopyWith<$Res>? get token { + if (_self.token == null) { + return null; + } + + return $GooglePayCardTokenCopyWith<$Res>(_self.token!, (value) { + return _then(_self.copyWith(token: value)); + }); +} } + /// @nodoc mixin _$CanAddCardToWalletParams { - ///The `primary_account_identifier` value from the issued card. Can be an empty string. - String? get primaryAccountIdentifier => throw _privateConstructorUsedError; - /// Last 4 digits of the card number. Required for Android. - String get cardLastFour => throw _privateConstructorUsedError; +///The `primary_account_identifier` value from the issued card. Can be an empty string. + String? get primaryAccountIdentifier;/// Last 4 digits of the card number. Required for Android. + String get cardLastFour;/// iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios + bool? get testEnv;/// iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. + bool? get hasPairedAppleWatch;/// Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. + bool? get supportsTapToPay; +/// Create a copy of CanAddCardToWalletParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CanAddCardToWalletParamsCopyWith get copyWith => _$CanAddCardToWalletParamsCopyWithImpl(this as CanAddCardToWalletParams, _$identity); - /// iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios - bool? get testEnv => throw _privateConstructorUsedError; + /// Serializes this CanAddCardToWalletParams to a JSON map. + Map toJson(); - /// iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. - bool? get hasPairedAppleWatch => throw _privateConstructorUsedError; - /// Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. - bool? get supportsTapToPay => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CanAddCardToWalletParams&&(identical(other.primaryAccountIdentifier, primaryAccountIdentifier) || other.primaryAccountIdentifier == primaryAccountIdentifier)&&(identical(other.cardLastFour, cardLastFour) || other.cardLastFour == cardLastFour)&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.hasPairedAppleWatch, hasPairedAppleWatch) || other.hasPairedAppleWatch == hasPairedAppleWatch)&&(identical(other.supportsTapToPay, supportsTapToPay) || other.supportsTapToPay == supportsTapToPay)); +} - /// Serializes this CanAddCardToWalletParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,primaryAccountIdentifier,cardLastFour,testEnv,hasPairedAppleWatch,supportsTapToPay); - /// Create a copy of CanAddCardToWalletParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CanAddCardToWalletParamsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +String toString() { + return 'CanAddCardToWalletParams(primaryAccountIdentifier: $primaryAccountIdentifier, cardLastFour: $cardLastFour, testEnv: $testEnv, hasPairedAppleWatch: $hasPairedAppleWatch, supportsTapToPay: $supportsTapToPay)'; } -/// @nodoc -abstract class $CanAddCardToWalletParamsCopyWith<$Res> { - factory $CanAddCardToWalletParamsCopyWith(CanAddCardToWalletParams value, - $Res Function(CanAddCardToWalletParams) then) = - _$CanAddCardToWalletParamsCopyWithImpl<$Res, CanAddCardToWalletParams>; - @useResult - $Res call( - {String? primaryAccountIdentifier, - String cardLastFour, - bool? testEnv, - bool? hasPairedAppleWatch, - bool? supportsTapToPay}); + } /// @nodoc -class _$CanAddCardToWalletParamsCopyWithImpl<$Res, - $Val extends CanAddCardToWalletParams> - implements $CanAddCardToWalletParamsCopyWith<$Res> { - _$CanAddCardToWalletParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CanAddCardToWalletParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? primaryAccountIdentifier = freezed, - Object? cardLastFour = null, - Object? testEnv = freezed, - Object? hasPairedAppleWatch = freezed, - Object? supportsTapToPay = freezed, - }) { - return _then(_value.copyWith( - primaryAccountIdentifier: freezed == primaryAccountIdentifier - ? _value.primaryAccountIdentifier - : primaryAccountIdentifier // ignore: cast_nullable_to_non_nullable - as String?, - cardLastFour: null == cardLastFour - ? _value.cardLastFour - : cardLastFour // ignore: cast_nullable_to_non_nullable - as String, - testEnv: freezed == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool?, - hasPairedAppleWatch: freezed == hasPairedAppleWatch - ? _value.hasPairedAppleWatch - : hasPairedAppleWatch // ignore: cast_nullable_to_non_nullable - as bool?, - supportsTapToPay: freezed == supportsTapToPay - ? _value.supportsTapToPay - : supportsTapToPay // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); - } -} +abstract mixin class $CanAddCardToWalletParamsCopyWith<$Res> { + factory $CanAddCardToWalletParamsCopyWith(CanAddCardToWalletParams value, $Res Function(CanAddCardToWalletParams) _then) = _$CanAddCardToWalletParamsCopyWithImpl; +@useResult +$Res call({ + String? primaryAccountIdentifier, String cardLastFour, bool? testEnv, bool? hasPairedAppleWatch, bool? supportsTapToPay +}); + + + +} /// @nodoc -abstract class _$$CanAddCardToWalletParamsImplCopyWith<$Res> +class _$CanAddCardToWalletParamsCopyWithImpl<$Res> implements $CanAddCardToWalletParamsCopyWith<$Res> { - factory _$$CanAddCardToWalletParamsImplCopyWith( - _$CanAddCardToWalletParamsImpl value, - $Res Function(_$CanAddCardToWalletParamsImpl) then) = - __$$CanAddCardToWalletParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? primaryAccountIdentifier, - String cardLastFour, - bool? testEnv, - bool? hasPairedAppleWatch, - bool? supportsTapToPay}); + _$CanAddCardToWalletParamsCopyWithImpl(this._self, this._then); + + final CanAddCardToWalletParams _self; + final $Res Function(CanAddCardToWalletParams) _then; + +/// Create a copy of CanAddCardToWalletParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? primaryAccountIdentifier = freezed,Object? cardLastFour = null,Object? testEnv = freezed,Object? hasPairedAppleWatch = freezed,Object? supportsTapToPay = freezed,}) { + return _then(_self.copyWith( +primaryAccountIdentifier: freezed == primaryAccountIdentifier ? _self.primaryAccountIdentifier : primaryAccountIdentifier // ignore: cast_nullable_to_non_nullable +as String?,cardLastFour: null == cardLastFour ? _self.cardLastFour : cardLastFour // ignore: cast_nullable_to_non_nullable +as String,testEnv: freezed == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool?,hasPairedAppleWatch: freezed == hasPairedAppleWatch ? _self.hasPairedAppleWatch : hasPairedAppleWatch // ignore: cast_nullable_to_non_nullable +as bool?,supportsTapToPay: freezed == supportsTapToPay ? _self.supportsTapToPay : supportsTapToPay // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CanAddCardToWalletParams]. +extension CanAddCardToWalletParamsPatterns on CanAddCardToWalletParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _CanAddCardToWalletParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CanAddCardToWalletParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _CanAddCardToWalletParams value) $default,){ +final _that = this; +switch (_that) { +case _CanAddCardToWalletParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _CanAddCardToWalletParams value)? $default,){ +final _that = this; +switch (_that) { +case _CanAddCardToWalletParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? primaryAccountIdentifier, String cardLastFour, bool? testEnv, bool? hasPairedAppleWatch, bool? supportsTapToPay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CanAddCardToWalletParams() when $default != null: +return $default(_that.primaryAccountIdentifier,_that.cardLastFour,_that.testEnv,_that.hasPairedAppleWatch,_that.supportsTapToPay);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? primaryAccountIdentifier, String cardLastFour, bool? testEnv, bool? hasPairedAppleWatch, bool? supportsTapToPay) $default,) {final _that = this; +switch (_that) { +case _CanAddCardToWalletParams(): +return $default(_that.primaryAccountIdentifier,_that.cardLastFour,_that.testEnv,_that.hasPairedAppleWatch,_that.supportsTapToPay);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? primaryAccountIdentifier, String cardLastFour, bool? testEnv, bool? hasPairedAppleWatch, bool? supportsTapToPay)? $default,) {final _that = this; +switch (_that) { +case _CanAddCardToWalletParams() when $default != null: +return $default(_that.primaryAccountIdentifier,_that.cardLastFour,_that.testEnv,_that.hasPairedAppleWatch,_that.supportsTapToPay);case _: + return null; + +} } -/// @nodoc -class __$$CanAddCardToWalletParamsImplCopyWithImpl<$Res> - extends _$CanAddCardToWalletParamsCopyWithImpl<$Res, - _$CanAddCardToWalletParamsImpl> - implements _$$CanAddCardToWalletParamsImplCopyWith<$Res> { - __$$CanAddCardToWalletParamsImplCopyWithImpl( - _$CanAddCardToWalletParamsImpl _value, - $Res Function(_$CanAddCardToWalletParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of CanAddCardToWalletParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? primaryAccountIdentifier = freezed, - Object? cardLastFour = null, - Object? testEnv = freezed, - Object? hasPairedAppleWatch = freezed, - Object? supportsTapToPay = freezed, - }) { - return _then(_$CanAddCardToWalletParamsImpl( - primaryAccountIdentifier: freezed == primaryAccountIdentifier - ? _value.primaryAccountIdentifier - : primaryAccountIdentifier // ignore: cast_nullable_to_non_nullable - as String?, - cardLastFour: null == cardLastFour - ? _value.cardLastFour - : cardLastFour // ignore: cast_nullable_to_non_nullable - as String, - testEnv: freezed == testEnv - ? _value.testEnv - : testEnv // ignore: cast_nullable_to_non_nullable - as bool?, - hasPairedAppleWatch: freezed == hasPairedAppleWatch - ? _value.hasPairedAppleWatch - : hasPairedAppleWatch // ignore: cast_nullable_to_non_nullable - as bool?, - supportsTapToPay: freezed == supportsTapToPay - ? _value.supportsTapToPay - : supportsTapToPay // ignore: cast_nullable_to_non_nullable - as bool?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$CanAddCardToWalletParamsImpl implements _CanAddCardToWalletParams { - const _$CanAddCardToWalletParamsImpl( - {this.primaryAccountIdentifier, - required this.cardLastFour, - this.testEnv, - this.hasPairedAppleWatch, - this.supportsTapToPay}); - - factory _$CanAddCardToWalletParamsImpl.fromJson(Map json) => - _$$CanAddCardToWalletParamsImplFromJson(json); - - ///The `primary_account_identifier` value from the issued card. Can be an empty string. - @override - final String? primaryAccountIdentifier; - - /// Last 4 digits of the card number. Required for Android. - @override - final String cardLastFour; - - /// iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios - @override - final bool? testEnv; - - /// iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. - @override - final bool? hasPairedAppleWatch; - - /// Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. - @override - final bool? supportsTapToPay; - - @override - String toString() { - return 'CanAddCardToWalletParams(primaryAccountIdentifier: $primaryAccountIdentifier, cardLastFour: $cardLastFour, testEnv: $testEnv, hasPairedAppleWatch: $hasPairedAppleWatch, supportsTapToPay: $supportsTapToPay)'; - } +class _CanAddCardToWalletParams implements CanAddCardToWalletParams { + const _CanAddCardToWalletParams({this.primaryAccountIdentifier, required this.cardLastFour, this.testEnv, this.hasPairedAppleWatch, this.supportsTapToPay}); + factory _CanAddCardToWalletParams.fromJson(Map json) => _$CanAddCardToWalletParamsFromJson(json); + +///The `primary_account_identifier` value from the issued card. Can be an empty string. +@override final String? primaryAccountIdentifier; +/// Last 4 digits of the card number. Required for Android. +@override final String cardLastFour; +/// iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios +@override final bool? testEnv; +/// iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. +@override final bool? hasPairedAppleWatch; +/// Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. +@override final bool? supportsTapToPay; + +/// Create a copy of CanAddCardToWalletParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CanAddCardToWalletParamsCopyWith<_CanAddCardToWalletParams> get copyWith => __$CanAddCardToWalletParamsCopyWithImpl<_CanAddCardToWalletParams>(this, _$identity); + +@override +Map toJson() { + return _$CanAddCardToWalletParamsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CanAddCardToWalletParamsImpl && - (identical( - other.primaryAccountIdentifier, primaryAccountIdentifier) || - other.primaryAccountIdentifier == primaryAccountIdentifier) && - (identical(other.cardLastFour, cardLastFour) || - other.cardLastFour == cardLastFour) && - (identical(other.testEnv, testEnv) || other.testEnv == testEnv) && - (identical(other.hasPairedAppleWatch, hasPairedAppleWatch) || - other.hasPairedAppleWatch == hasPairedAppleWatch) && - (identical(other.supportsTapToPay, supportsTapToPay) || - other.supportsTapToPay == supportsTapToPay)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CanAddCardToWalletParams&&(identical(other.primaryAccountIdentifier, primaryAccountIdentifier) || other.primaryAccountIdentifier == primaryAccountIdentifier)&&(identical(other.cardLastFour, cardLastFour) || other.cardLastFour == cardLastFour)&&(identical(other.testEnv, testEnv) || other.testEnv == testEnv)&&(identical(other.hasPairedAppleWatch, hasPairedAppleWatch) || other.hasPairedAppleWatch == hasPairedAppleWatch)&&(identical(other.supportsTapToPay, supportsTapToPay) || other.supportsTapToPay == supportsTapToPay)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, primaryAccountIdentifier, - cardLastFour, testEnv, hasPairedAppleWatch, supportsTapToPay); - - /// Create a copy of CanAddCardToWalletParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CanAddCardToWalletParamsImplCopyWith<_$CanAddCardToWalletParamsImpl> - get copyWith => __$$CanAddCardToWalletParamsImplCopyWithImpl< - _$CanAddCardToWalletParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CanAddCardToWalletParamsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,primaryAccountIdentifier,cardLastFour,testEnv,hasPairedAppleWatch,supportsTapToPay); + +@override +String toString() { + return 'CanAddCardToWalletParams(primaryAccountIdentifier: $primaryAccountIdentifier, cardLastFour: $cardLastFour, testEnv: $testEnv, hasPairedAppleWatch: $hasPairedAppleWatch, supportsTapToPay: $supportsTapToPay)'; } -abstract class _CanAddCardToWalletParams implements CanAddCardToWalletParams { - const factory _CanAddCardToWalletParams( - {final String? primaryAccountIdentifier, - required final String cardLastFour, - final bool? testEnv, - final bool? hasPairedAppleWatch, - final bool? supportsTapToPay}) = _$CanAddCardToWalletParamsImpl; - factory _CanAddCardToWalletParams.fromJson(Map json) = - _$CanAddCardToWalletParamsImpl.fromJson; +} - ///The `primary_account_identifier` value from the issued card. Can be an empty string. - @override - String? get primaryAccountIdentifier; +/// @nodoc +abstract mixin class _$CanAddCardToWalletParamsCopyWith<$Res> implements $CanAddCardToWalletParamsCopyWith<$Res> { + factory _$CanAddCardToWalletParamsCopyWith(_CanAddCardToWalletParams value, $Res Function(_CanAddCardToWalletParams) _then) = __$CanAddCardToWalletParamsCopyWithImpl; +@override @useResult +$Res call({ + String? primaryAccountIdentifier, String cardLastFour, bool? testEnv, bool? hasPairedAppleWatch, bool? supportsTapToPay +}); - /// Last 4 digits of the card number. Required for Android. - @override - String get cardLastFour; - /// iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios - @override - bool? get testEnv; - /// iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. - @override - bool? get hasPairedAppleWatch; - /// Android only, defaults to `true`. Set this to `false` if you'd like to allow users without NFC-enabled devices to add cards to the wallet. NFC is required for paying in stores. - @override - bool? get supportsTapToPay; +} +/// @nodoc +class __$CanAddCardToWalletParamsCopyWithImpl<$Res> + implements _$CanAddCardToWalletParamsCopyWith<$Res> { + __$CanAddCardToWalletParamsCopyWithImpl(this._self, this._then); + + final _CanAddCardToWalletParams _self; + final $Res Function(_CanAddCardToWalletParams) _then; + +/// Create a copy of CanAddCardToWalletParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? primaryAccountIdentifier = freezed,Object? cardLastFour = null,Object? testEnv = freezed,Object? hasPairedAppleWatch = freezed,Object? supportsTapToPay = freezed,}) { + return _then(_CanAddCardToWalletParams( +primaryAccountIdentifier: freezed == primaryAccountIdentifier ? _self.primaryAccountIdentifier : primaryAccountIdentifier // ignore: cast_nullable_to_non_nullable +as String?,cardLastFour: null == cardLastFour ? _self.cardLastFour : cardLastFour // ignore: cast_nullable_to_non_nullable +as String,testEnv: freezed == testEnv ? _self.testEnv : testEnv // ignore: cast_nullable_to_non_nullable +as bool?,hasPairedAppleWatch: freezed == hasPairedAppleWatch ? _self.hasPairedAppleWatch : hasPairedAppleWatch // ignore: cast_nullable_to_non_nullable +as bool?,supportsTapToPay: freezed == supportsTapToPay ? _self.supportsTapToPay : supportsTapToPay // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + - /// Create a copy of CanAddCardToWalletParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CanAddCardToWalletParamsImplCopyWith<_$CanAddCardToWalletParamsImpl> - get copyWith => throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/push_provisioning.g.dart b/packages/stripe_platform_interface/lib/src/models/push_provisioning.g.dart index e74306dcd..f2736205b 100644 --- a/packages/stripe_platform_interface/lib/src/models/push_provisioning.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/push_provisioning.g.dart @@ -6,9 +6,8 @@ part of 'push_provisioning.dart'; // JsonSerializableGenerator // ************************************************************************** -_$GooglePayCardTokenImpl _$$GooglePayCardTokenImplFromJson( - Map json) => - _$GooglePayCardTokenImpl( +_GooglePayCardToken _$GooglePayCardTokenFromJson(Map json) => + _GooglePayCardToken( id: json['id'] as String, fpanLastFour: json['fpanLastFour'] as String, dpanLastFour: json['dpanLastFour'] as String, @@ -19,8 +18,7 @@ _$GooglePayCardTokenImpl _$$GooglePayCardTokenImplFromJson( cardLastFour: json['cardLastFour'] as String, ); -Map _$$GooglePayCardTokenImplToJson( - _$GooglePayCardTokenImpl instance) => +Map _$GooglePayCardTokenToJson(_GooglePayCardToken instance) => { 'id': instance.id, 'fpanLastFour': instance.fpanLastFour, @@ -43,55 +41,55 @@ const _$GooglePayCardTokenStatusEnumMap = { GooglePayCardTokenStatus.TOKEN_STATE_UNTOKENIZED: 'TOKEN_STATE_UNTOKENIZED', }; -_$IsCardInWalletResultImpl _$$IsCardInWalletResultImplFromJson( - Map json) => - _$IsCardInWalletResultImpl( - isInWallet: json['isInWallet'] as bool, - token: json['token'] == null - ? null - : GooglePayCardToken.fromJson(json['token'] as Map), - ); +_IsCardInWalletResult _$IsCardInWalletResultFromJson( + Map json, +) => _IsCardInWalletResult( + isInWallet: json['isInWallet'] as bool, + token: json['token'] == null + ? null + : GooglePayCardToken.fromJson(json['token'] as Map), +); -Map _$$IsCardInWalletResultImplToJson( - _$IsCardInWalletResultImpl instance) => - { - 'isInWallet': instance.isInWallet, - 'token': instance.token?.toJson(), - }; +Map _$IsCardInWalletResultToJson( + _IsCardInWalletResult instance, +) => { + 'isInWallet': instance.isInWallet, + 'token': instance.token?.toJson(), +}; -_$CanAddCardToWalletResultImpl _$$CanAddCardToWalletResultImplFromJson( - Map json) => - _$CanAddCardToWalletResultImpl( - canAddCard: json['canAddCard'] as bool, - details: json['details'] == null - ? null - : CanAddCardToDetails.fromJson( - json['details'] as Map), - ); +_CanAddCardToWalletResult _$CanAddCardToWalletResultFromJson( + Map json, +) => _CanAddCardToWalletResult( + canAddCard: json['canAddCard'] as bool, + details: json['details'] == null + ? null + : CanAddCardToDetails.fromJson(json['details'] as Map), +); -Map _$$CanAddCardToWalletResultImplToJson( - _$CanAddCardToWalletResultImpl instance) => - { - 'canAddCard': instance.canAddCard, - 'details': instance.details?.toJson(), - }; +Map _$CanAddCardToWalletResultToJson( + _CanAddCardToWalletResult instance, +) => { + 'canAddCard': instance.canAddCard, + 'details': instance.details?.toJson(), +}; -_$CanAddCardToDetailsImpl _$$CanAddCardToDetailsImplFromJson( - Map json) => - _$CanAddCardToDetailsImpl( +_CanAddCardToDetails _$CanAddCardToDetailsFromJson(Map json) => + _CanAddCardToDetails( token: json['token'] == null ? null : GooglePayCardToken.fromJson(json['token'] as Map), status: $enumDecodeNullable( - _$CanAddCardToWalletStatusEnumMap, json['status']), + _$CanAddCardToWalletStatusEnumMap, + json['status'], + ), ); -Map _$$CanAddCardToDetailsImplToJson( - _$CanAddCardToDetailsImpl instance) => - { - 'token': instance.token?.toJson(), - 'status': _$CanAddCardToWalletStatusEnumMap[instance.status], - }; +Map _$CanAddCardToDetailsToJson( + _CanAddCardToDetails instance, +) => { + 'token': instance.token?.toJson(), + 'status': _$CanAddCardToWalletStatusEnumMap[instance.status], +}; const _$CanAddCardToWalletStatusEnumMap = { CanAddCardToWalletStatus.MISSING_CONFIGURATION: 'MISSING_CONFIGURATION', @@ -103,22 +101,22 @@ const _$CanAddCardToWalletStatusEnumMap = { 'CARD_EXISTS_ON_PAIRED_DEVICE', }; -_$CanAddCardToWalletParamsImpl _$$CanAddCardToWalletParamsImplFromJson( - Map json) => - _$CanAddCardToWalletParamsImpl( - primaryAccountIdentifier: json['primaryAccountIdentifier'] as String?, - cardLastFour: json['cardLastFour'] as String, - testEnv: json['testEnv'] as bool?, - hasPairedAppleWatch: json['hasPairedAppleWatch'] as bool?, - supportsTapToPay: json['supportsTapToPay'] as bool?, - ); +_CanAddCardToWalletParams _$CanAddCardToWalletParamsFromJson( + Map json, +) => _CanAddCardToWalletParams( + primaryAccountIdentifier: json['primaryAccountIdentifier'] as String?, + cardLastFour: json['cardLastFour'] as String, + testEnv: json['testEnv'] as bool?, + hasPairedAppleWatch: json['hasPairedAppleWatch'] as bool?, + supportsTapToPay: json['supportsTapToPay'] as bool?, +); -Map _$$CanAddCardToWalletParamsImplToJson( - _$CanAddCardToWalletParamsImpl instance) => - { - 'primaryAccountIdentifier': instance.primaryAccountIdentifier, - 'cardLastFour': instance.cardLastFour, - 'testEnv': instance.testEnv, - 'hasPairedAppleWatch': instance.hasPairedAppleWatch, - 'supportsTapToPay': instance.supportsTapToPay, - }; +Map _$CanAddCardToWalletParamsToJson( + _CanAddCardToWalletParams instance, +) => { + 'primaryAccountIdentifier': instance.primaryAccountIdentifier, + 'cardLastFour': instance.cardLastFour, + 'testEnv': instance.testEnv, + 'hasPairedAppleWatch': instance.hasPairedAppleWatch, + 'supportsTapToPay': instance.supportsTapToPay, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/setup_intent.dart b/packages/stripe_platform_interface/lib/src/models/setup_intent.dart index 723d86126..136611cd9 100644 --- a/packages/stripe_platform_interface/lib/src/models/setup_intent.dart +++ b/packages/stripe_platform_interface/lib/src/models/setup_intent.dart @@ -8,16 +8,14 @@ part 'setup_intent.g.dart'; // ignore_for_file: constant_identifier_names @freezed - /// SetupIntent information. /// /// A setup intent is used to setup and save customer payment information for /// future payments. -class SetupIntent with _$SetupIntent { +abstract class SetupIntent with _$SetupIntent { @JsonSerializable(explicitToJson: true) const factory SetupIntent({ /// Unique identifier. - required String id, /// Status of the intent. @@ -26,15 +24,12 @@ class SetupIntent with _$SetupIntent { required String status, /// Determines whether the intent is in live mode or in test mode. - required bool livemode, /// The client is secret is used for handling the payment from the Client side. - required String clientSecret, /// Id of the payment method used in this intent. - required String paymentMethodId, /// Indicates how the intent is used in the future. @@ -44,7 +39,6 @@ class SetupIntent with _$SetupIntent { required List paymentMethodTypes, /// Localized description that provides additional context to users. - String? description, /// Timestamp since epoch that represents the time the intent is created. @@ -66,9 +60,8 @@ class SetupIntent with _$SetupIntent { } @freezed - /// Incormation about the error that has occured since last payment confirmation. -class LastSetupError with _$LastSetupError { +abstract class LastSetupError with _$LastSetupError { @JsonSerializable(explicitToJson: true) const factory LastSetupError({ /// Code. diff --git a/packages/stripe_platform_interface/lib/src/models/setup_intent.freezed.dart b/packages/stripe_platform_interface/lib/src/models/setup_intent.freezed.dart index 2a1608748..315413bfd 100644 --- a/packages/stripe_platform_interface/lib/src/models/setup_intent.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/setup_intent.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,721 +9,681 @@ part of 'setup_intent.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -SetupIntent _$SetupIntentFromJson(Map json) { - return _SetupIntent.fromJson(json); -} - /// @nodoc mixin _$SetupIntent { - /// Unique identifier. - String get id => throw _privateConstructorUsedError; - - /// Status of the intent. - /// - /// See https://stripe.com/docs/payments/intents#intent-statuses. - String get status => throw _privateConstructorUsedError; - - /// Determines whether the intent is in live mode or in test mode. - bool get livemode => throw _privateConstructorUsedError; - /// The client is secret is used for handling the payment from the Client side. - String get clientSecret => throw _privateConstructorUsedError; +/// Unique identifier. + String get id;/// Status of the intent. +/// +/// See https://stripe.com/docs/payments/intents#intent-statuses. + String get status;/// Determines whether the intent is in live mode or in test mode. + bool get livemode;/// The client is secret is used for handling the payment from the Client side. + String get clientSecret;/// Id of the payment method used in this intent. + String get paymentMethodId;/// Indicates how the intent is used in the future. + String get usage;/// List of payment method types associated with this intent. + List get paymentMethodTypes;/// Localized description that provides additional context to users. + String? get description;/// Timestamp since epoch that represents the time the intent is created. + String? get created;/// Error encountered since last configmration. + LastSetupError? get lastSetupError;/// Additional action that needs to be taken in order to complete a payment +/// using the provided resource. + NextAction? get nextAction;/// Mandata data for this paymentintent. + MandateData? get mandateData; +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SetupIntentCopyWith get copyWith => _$SetupIntentCopyWithImpl(this as SetupIntent, _$identity); - /// Id of the payment method used in this intent. - String get paymentMethodId => throw _privateConstructorUsedError; + /// Serializes this SetupIntent to a JSON map. + Map toJson(); - /// Indicates how the intent is used in the future. - String get usage => throw _privateConstructorUsedError; - /// List of payment method types associated with this intent. - List get paymentMethodTypes => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SetupIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.status, status) || other.status == status)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.usage, usage) || other.usage == usage)&&const DeepCollectionEquality().equals(other.paymentMethodTypes, paymentMethodTypes)&&(identical(other.description, description) || other.description == description)&&(identical(other.created, created) || other.created == created)&&(identical(other.lastSetupError, lastSetupError) || other.lastSetupError == lastSetupError)&&(identical(other.nextAction, nextAction) || other.nextAction == nextAction)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)); +} - /// Localized description that provides additional context to users. - String? get description => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,status,livemode,clientSecret,paymentMethodId,usage,const DeepCollectionEquality().hash(paymentMethodTypes),description,created,lastSetupError,nextAction,mandateData); - /// Timestamp since epoch that represents the time the intent is created. - String? get created => throw _privateConstructorUsedError; +@override +String toString() { + return 'SetupIntent(id: $id, status: $status, livemode: $livemode, clientSecret: $clientSecret, paymentMethodId: $paymentMethodId, usage: $usage, paymentMethodTypes: $paymentMethodTypes, description: $description, created: $created, lastSetupError: $lastSetupError, nextAction: $nextAction, mandateData: $mandateData)'; +} - /// Error encountered since last configmration. - LastSetupError? get lastSetupError => throw _privateConstructorUsedError; - /// Additional action that needs to be taken in order to complete a payment - /// using the provided resource. - NextAction? get nextAction => throw _privateConstructorUsedError; +} - /// Mandata data for this paymentintent. - MandateData? get mandateData => throw _privateConstructorUsedError; +/// @nodoc +abstract mixin class $SetupIntentCopyWith<$Res> { + factory $SetupIntentCopyWith(SetupIntent value, $Res Function(SetupIntent) _then) = _$SetupIntentCopyWithImpl; +@useResult +$Res call({ + String id, String status, bool livemode, String clientSecret, String paymentMethodId, String usage, List paymentMethodTypes, String? description, String? created, LastSetupError? lastSetupError, NextAction? nextAction, MandateData? mandateData +}); - /// Serializes this SetupIntent to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $SetupIntentCopyWith get copyWith => - throw _privateConstructorUsedError; -} +$LastSetupErrorCopyWith<$Res>? get lastSetupError;$NextActionCopyWith<$Res>? get nextAction;$MandateDataCopyWith<$Res>? get mandateData; -/// @nodoc -abstract class $SetupIntentCopyWith<$Res> { - factory $SetupIntentCopyWith( - SetupIntent value, $Res Function(SetupIntent) then) = - _$SetupIntentCopyWithImpl<$Res, SetupIntent>; - @useResult - $Res call( - {String id, - String status, - bool livemode, - String clientSecret, - String paymentMethodId, - String usage, - List paymentMethodTypes, - String? description, - String? created, - LastSetupError? lastSetupError, - NextAction? nextAction, - MandateData? mandateData}); - - $LastSetupErrorCopyWith<$Res>? get lastSetupError; - $NextActionCopyWith<$Res>? get nextAction; - $MandateDataCopyWith<$Res>? get mandateData; } - /// @nodoc -class _$SetupIntentCopyWithImpl<$Res, $Val extends SetupIntent> +class _$SetupIntentCopyWithImpl<$Res> implements $SetupIntentCopyWith<$Res> { - _$SetupIntentCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? status = null, - Object? livemode = null, - Object? clientSecret = null, - Object? paymentMethodId = null, - Object? usage = null, - Object? paymentMethodTypes = null, - Object? description = freezed, - Object? created = freezed, - Object? lastSetupError = freezed, - Object? nextAction = freezed, - Object? mandateData = freezed, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - paymentMethodId: null == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String, - usage: null == usage - ? _value.usage - : usage // ignore: cast_nullable_to_non_nullable - as String, - paymentMethodTypes: null == paymentMethodTypes - ? _value.paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as String?, - lastSetupError: freezed == lastSetupError - ? _value.lastSetupError - : lastSetupError // ignore: cast_nullable_to_non_nullable - as LastSetupError?, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as NextAction?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - ) as $Val); + _$SetupIntentCopyWithImpl(this._self, this._then); + + final SetupIntent _self; + final $Res Function(SetupIntent) _then; + +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? status = null,Object? livemode = null,Object? clientSecret = null,Object? paymentMethodId = null,Object? usage = null,Object? paymentMethodTypes = null,Object? description = freezed,Object? created = freezed,Object? lastSetupError = freezed,Object? nextAction = freezed,Object? mandateData = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,paymentMethodId: null == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String,usage: null == usage ? _self.usage : usage // ignore: cast_nullable_to_non_nullable +as String,paymentMethodTypes: null == paymentMethodTypes ? _self.paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as String?,lastSetupError: freezed == lastSetupError ? _self.lastSetupError : lastSetupError // ignore: cast_nullable_to_non_nullable +as LastSetupError?,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as NextAction?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?, + )); +} +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LastSetupErrorCopyWith<$Res>? get lastSetupError { + if (_self.lastSetupError == null) { + return null; } - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $LastSetupErrorCopyWith<$Res>? get lastSetupError { - if (_value.lastSetupError == null) { - return null; - } - - return $LastSetupErrorCopyWith<$Res>(_value.lastSetupError!, (value) { - return _then(_value.copyWith(lastSetupError: value) as $Val); - }); + return $LastSetupErrorCopyWith<$Res>(_self.lastSetupError!, (value) { + return _then(_self.copyWith(lastSetupError: value)); + }); +}/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$NextActionCopyWith<$Res>? get nextAction { + if (_self.nextAction == null) { + return null; } - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $NextActionCopyWith<$Res>? get nextAction { - if (_value.nextAction == null) { - return null; - } - - return $NextActionCopyWith<$Res>(_value.nextAction!, (value) { - return _then(_value.copyWith(nextAction: value) as $Val); - }); + return $NextActionCopyWith<$Res>(_self.nextAction!, (value) { + return _then(_self.copyWith(nextAction: value)); + }); +}/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $MandateDataCopyWith<$Res>? get mandateData { - if (_value.mandateData == null) { - return null; - } - - return $MandateDataCopyWith<$Res>(_value.mandateData!, (value) { - return _then(_value.copyWith(mandateData: value) as $Val); - }); - } + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} } -/// @nodoc -abstract class _$$SetupIntentImplCopyWith<$Res> - implements $SetupIntentCopyWith<$Res> { - factory _$$SetupIntentImplCopyWith( - _$SetupIntentImpl value, $Res Function(_$SetupIntentImpl) then) = - __$$SetupIntentImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String id, - String status, - bool livemode, - String clientSecret, - String paymentMethodId, - String usage, - List paymentMethodTypes, - String? description, - String? created, - LastSetupError? lastSetupError, - NextAction? nextAction, - MandateData? mandateData}); - - @override - $LastSetupErrorCopyWith<$Res>? get lastSetupError; - @override - $NextActionCopyWith<$Res>? get nextAction; - @override - $MandateDataCopyWith<$Res>? get mandateData; + +/// Adds pattern-matching-related methods to [SetupIntent]. +extension SetupIntentPatterns on SetupIntent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SetupIntent value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SetupIntent value) $default,){ +final _that = this; +switch (_that) { +case _SetupIntent(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SetupIntent value)? $default,){ +final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String status, bool livemode, String clientSecret, String paymentMethodId, String usage, List paymentMethodTypes, String? description, String? created, LastSetupError? lastSetupError, NextAction? nextAction, MandateData? mandateData)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that.id,_that.status,_that.livemode,_that.clientSecret,_that.paymentMethodId,_that.usage,_that.paymentMethodTypes,_that.description,_that.created,_that.lastSetupError,_that.nextAction,_that.mandateData);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String id, String status, bool livemode, String clientSecret, String paymentMethodId, String usage, List paymentMethodTypes, String? description, String? created, LastSetupError? lastSetupError, NextAction? nextAction, MandateData? mandateData) $default,) {final _that = this; +switch (_that) { +case _SetupIntent(): +return $default(_that.id,_that.status,_that.livemode,_that.clientSecret,_that.paymentMethodId,_that.usage,_that.paymentMethodTypes,_that.description,_that.created,_that.lastSetupError,_that.nextAction,_that.mandateData);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String status, bool livemode, String clientSecret, String paymentMethodId, String usage, List paymentMethodTypes, String? description, String? created, LastSetupError? lastSetupError, NextAction? nextAction, MandateData? mandateData)? $default,) {final _that = this; +switch (_that) { +case _SetupIntent() when $default != null: +return $default(_that.id,_that.status,_that.livemode,_that.clientSecret,_that.paymentMethodId,_that.usage,_that.paymentMethodTypes,_that.description,_that.created,_that.lastSetupError,_that.nextAction,_that.mandateData);case _: + return null; + +} } -/// @nodoc -class __$$SetupIntentImplCopyWithImpl<$Res> - extends _$SetupIntentCopyWithImpl<$Res, _$SetupIntentImpl> - implements _$$SetupIntentImplCopyWith<$Res> { - __$$SetupIntentImplCopyWithImpl( - _$SetupIntentImpl _value, $Res Function(_$SetupIntentImpl) _then) - : super(_value, _then); - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - Object? status = null, - Object? livemode = null, - Object? clientSecret = null, - Object? paymentMethodId = null, - Object? usage = null, - Object? paymentMethodTypes = null, - Object? description = freezed, - Object? created = freezed, - Object? lastSetupError = freezed, - Object? nextAction = freezed, - Object? mandateData = freezed, - }) { - return _then(_$SetupIntentImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - livemode: null == livemode - ? _value.livemode - : livemode // ignore: cast_nullable_to_non_nullable - as bool, - clientSecret: null == clientSecret - ? _value.clientSecret - : clientSecret // ignore: cast_nullable_to_non_nullable - as String, - paymentMethodId: null == paymentMethodId - ? _value.paymentMethodId - : paymentMethodId // ignore: cast_nullable_to_non_nullable - as String, - usage: null == usage - ? _value.usage - : usage // ignore: cast_nullable_to_non_nullable - as String, - paymentMethodTypes: null == paymentMethodTypes - ? _value._paymentMethodTypes - : paymentMethodTypes // ignore: cast_nullable_to_non_nullable - as List, - description: freezed == description - ? _value.description - : description // ignore: cast_nullable_to_non_nullable - as String?, - created: freezed == created - ? _value.created - : created // ignore: cast_nullable_to_non_nullable - as String?, - lastSetupError: freezed == lastSetupError - ? _value.lastSetupError - : lastSetupError // ignore: cast_nullable_to_non_nullable - as LastSetupError?, - nextAction: freezed == nextAction - ? _value.nextAction - : nextAction // ignore: cast_nullable_to_non_nullable - as NextAction?, - mandateData: freezed == mandateData - ? _value.mandateData - : mandateData // ignore: cast_nullable_to_non_nullable - as MandateData?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$SetupIntentImpl implements _SetupIntent { - const _$SetupIntentImpl( - {required this.id, - required this.status, - required this.livemode, - required this.clientSecret, - required this.paymentMethodId, - required this.usage, - required final List paymentMethodTypes, - this.description, - this.created, - this.lastSetupError, - this.nextAction, - this.mandateData}) - : _paymentMethodTypes = paymentMethodTypes; - - factory _$SetupIntentImpl.fromJson(Map json) => - _$$SetupIntentImplFromJson(json); - - /// Unique identifier. - @override - final String id; - - /// Status of the intent. - /// - /// See https://stripe.com/docs/payments/intents#intent-statuses. - @override - final String status; - - /// Determines whether the intent is in live mode or in test mode. - @override - final bool livemode; - - /// The client is secret is used for handling the payment from the Client side. - @override - final String clientSecret; - - /// Id of the payment method used in this intent. - @override - final String paymentMethodId; - - /// Indicates how the intent is used in the future. - @override - final String usage; - - /// List of payment method types associated with this intent. - final List _paymentMethodTypes; - - /// List of payment method types associated with this intent. - @override - List get paymentMethodTypes { - if (_paymentMethodTypes is EqualUnmodifiableListView) - return _paymentMethodTypes; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_paymentMethodTypes); - } +class _SetupIntent implements SetupIntent { + const _SetupIntent({required this.id, required this.status, required this.livemode, required this.clientSecret, required this.paymentMethodId, required this.usage, required final List paymentMethodTypes, this.description, this.created, this.lastSetupError, this.nextAction, this.mandateData}): _paymentMethodTypes = paymentMethodTypes; + factory _SetupIntent.fromJson(Map json) => _$SetupIntentFromJson(json); + +/// Unique identifier. +@override final String id; +/// Status of the intent. +/// +/// See https://stripe.com/docs/payments/intents#intent-statuses. +@override final String status; +/// Determines whether the intent is in live mode or in test mode. +@override final bool livemode; +/// The client is secret is used for handling the payment from the Client side. +@override final String clientSecret; +/// Id of the payment method used in this intent. +@override final String paymentMethodId; +/// Indicates how the intent is used in the future. +@override final String usage; +/// List of payment method types associated with this intent. + final List _paymentMethodTypes; +/// List of payment method types associated with this intent. +@override List get paymentMethodTypes { + if (_paymentMethodTypes is EqualUnmodifiableListView) return _paymentMethodTypes; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_paymentMethodTypes); +} + +/// Localized description that provides additional context to users. +@override final String? description; +/// Timestamp since epoch that represents the time the intent is created. +@override final String? created; +/// Error encountered since last configmration. +@override final LastSetupError? lastSetupError; +/// Additional action that needs to be taken in order to complete a payment +/// using the provided resource. +@override final NextAction? nextAction; +/// Mandata data for this paymentintent. +@override final MandateData? mandateData; + +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SetupIntentCopyWith<_SetupIntent> get copyWith => __$SetupIntentCopyWithImpl<_SetupIntent>(this, _$identity); + +@override +Map toJson() { + return _$SetupIntentToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SetupIntent&&(identical(other.id, id) || other.id == id)&&(identical(other.status, status) || other.status == status)&&(identical(other.livemode, livemode) || other.livemode == livemode)&&(identical(other.clientSecret, clientSecret) || other.clientSecret == clientSecret)&&(identical(other.paymentMethodId, paymentMethodId) || other.paymentMethodId == paymentMethodId)&&(identical(other.usage, usage) || other.usage == usage)&&const DeepCollectionEquality().equals(other._paymentMethodTypes, _paymentMethodTypes)&&(identical(other.description, description) || other.description == description)&&(identical(other.created, created) || other.created == created)&&(identical(other.lastSetupError, lastSetupError) || other.lastSetupError == lastSetupError)&&(identical(other.nextAction, nextAction) || other.nextAction == nextAction)&&(identical(other.mandateData, mandateData) || other.mandateData == mandateData)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,status,livemode,clientSecret,paymentMethodId,usage,const DeepCollectionEquality().hash(_paymentMethodTypes),description,created,lastSetupError,nextAction,mandateData); + +@override +String toString() { + return 'SetupIntent(id: $id, status: $status, livemode: $livemode, clientSecret: $clientSecret, paymentMethodId: $paymentMethodId, usage: $usage, paymentMethodTypes: $paymentMethodTypes, description: $description, created: $created, lastSetupError: $lastSetupError, nextAction: $nextAction, mandateData: $mandateData)'; +} + - /// Localized description that provides additional context to users. - @override - final String? description; +} - /// Timestamp since epoch that represents the time the intent is created. - @override - final String? created; +/// @nodoc +abstract mixin class _$SetupIntentCopyWith<$Res> implements $SetupIntentCopyWith<$Res> { + factory _$SetupIntentCopyWith(_SetupIntent value, $Res Function(_SetupIntent) _then) = __$SetupIntentCopyWithImpl; +@override @useResult +$Res call({ + String id, String status, bool livemode, String clientSecret, String paymentMethodId, String usage, List paymentMethodTypes, String? description, String? created, LastSetupError? lastSetupError, NextAction? nextAction, MandateData? mandateData +}); - /// Error encountered since last configmration. - @override - final LastSetupError? lastSetupError; - /// Additional action that needs to be taken in order to complete a payment - /// using the provided resource. - @override - final NextAction? nextAction; +@override $LastSetupErrorCopyWith<$Res>? get lastSetupError;@override $NextActionCopyWith<$Res>? get nextAction;@override $MandateDataCopyWith<$Res>? get mandateData; - /// Mandata data for this paymentintent. - @override - final MandateData? mandateData; +} +/// @nodoc +class __$SetupIntentCopyWithImpl<$Res> + implements _$SetupIntentCopyWith<$Res> { + __$SetupIntentCopyWithImpl(this._self, this._then); + + final _SetupIntent _self; + final $Res Function(_SetupIntent) _then; + +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? status = null,Object? livemode = null,Object? clientSecret = null,Object? paymentMethodId = null,Object? usage = null,Object? paymentMethodTypes = null,Object? description = freezed,Object? created = freezed,Object? lastSetupError = freezed,Object? nextAction = freezed,Object? mandateData = freezed,}) { + return _then(_SetupIntent( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as String,livemode: null == livemode ? _self.livemode : livemode // ignore: cast_nullable_to_non_nullable +as bool,clientSecret: null == clientSecret ? _self.clientSecret : clientSecret // ignore: cast_nullable_to_non_nullable +as String,paymentMethodId: null == paymentMethodId ? _self.paymentMethodId : paymentMethodId // ignore: cast_nullable_to_non_nullable +as String,usage: null == usage ? _self.usage : usage // ignore: cast_nullable_to_non_nullable +as String,paymentMethodTypes: null == paymentMethodTypes ? _self._paymentMethodTypes : paymentMethodTypes // ignore: cast_nullable_to_non_nullable +as List,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable +as String?,created: freezed == created ? _self.created : created // ignore: cast_nullable_to_non_nullable +as String?,lastSetupError: freezed == lastSetupError ? _self.lastSetupError : lastSetupError // ignore: cast_nullable_to_non_nullable +as LastSetupError?,nextAction: freezed == nextAction ? _self.nextAction : nextAction // ignore: cast_nullable_to_non_nullable +as NextAction?,mandateData: freezed == mandateData ? _self.mandateData : mandateData // ignore: cast_nullable_to_non_nullable +as MandateData?, + )); +} - @override - String toString() { - return 'SetupIntent(id: $id, status: $status, livemode: $livemode, clientSecret: $clientSecret, paymentMethodId: $paymentMethodId, usage: $usage, paymentMethodTypes: $paymentMethodTypes, description: $description, created: $created, lastSetupError: $lastSetupError, nextAction: $nextAction, mandateData: $mandateData)'; +/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$LastSetupErrorCopyWith<$Res>? get lastSetupError { + if (_self.lastSetupError == null) { + return null; } - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SetupIntentImpl && - (identical(other.id, id) || other.id == id) && - (identical(other.status, status) || other.status == status) && - (identical(other.livemode, livemode) || - other.livemode == livemode) && - (identical(other.clientSecret, clientSecret) || - other.clientSecret == clientSecret) && - (identical(other.paymentMethodId, paymentMethodId) || - other.paymentMethodId == paymentMethodId) && - (identical(other.usage, usage) || other.usage == usage) && - const DeepCollectionEquality() - .equals(other._paymentMethodTypes, _paymentMethodTypes) && - (identical(other.description, description) || - other.description == description) && - (identical(other.created, created) || other.created == created) && - (identical(other.lastSetupError, lastSetupError) || - other.lastSetupError == lastSetupError) && - (identical(other.nextAction, nextAction) || - other.nextAction == nextAction) && - (identical(other.mandateData, mandateData) || - other.mandateData == mandateData)); + return $LastSetupErrorCopyWith<$Res>(_self.lastSetupError!, (value) { + return _then(_self.copyWith(lastSetupError: value)); + }); +}/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$NextActionCopyWith<$Res>? get nextAction { + if (_self.nextAction == null) { + return null; } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - id, - status, - livemode, - clientSecret, - paymentMethodId, - usage, - const DeepCollectionEquality().hash(_paymentMethodTypes), - description, - created, - lastSetupError, - nextAction, - mandateData); - - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SetupIntentImplCopyWith<_$SetupIntentImpl> get copyWith => - __$$SetupIntentImplCopyWithImpl<_$SetupIntentImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SetupIntentImplToJson( - this, - ); + return $NextActionCopyWith<$Res>(_self.nextAction!, (value) { + return _then(_self.copyWith(nextAction: value)); + }); +}/// Create a copy of SetupIntent +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$MandateDataCopyWith<$Res>? get mandateData { + if (_self.mandateData == null) { + return null; } + + return $MandateDataCopyWith<$Res>(_self.mandateData!, (value) { + return _then(_self.copyWith(mandateData: value)); + }); +} } -abstract class _SetupIntent implements SetupIntent { - const factory _SetupIntent( - {required final String id, - required final String status, - required final bool livemode, - required final String clientSecret, - required final String paymentMethodId, - required final String usage, - required final List paymentMethodTypes, - final String? description, - final String? created, - final LastSetupError? lastSetupError, - final NextAction? nextAction, - final MandateData? mandateData}) = _$SetupIntentImpl; - factory _SetupIntent.fromJson(Map json) = - _$SetupIntentImpl.fromJson; +/// @nodoc +mixin _$LastSetupError { - /// Unique identifier. - @override - String get id; +/// Code. + String get code;/// Message. + String get message; +/// Create a copy of LastSetupError +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$LastSetupErrorCopyWith get copyWith => _$LastSetupErrorCopyWithImpl(this as LastSetupError, _$identity); - /// Status of the intent. - /// - /// See https://stripe.com/docs/payments/intents#intent-statuses. - @override - String get status; + /// Serializes this LastSetupError to a JSON map. + Map toJson(); - /// Determines whether the intent is in live mode or in test mode. - @override - bool get livemode; - /// The client is secret is used for handling the payment from the Client side. - @override - String get clientSecret; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is LastSetupError&&(identical(other.code, code) || other.code == code)&&(identical(other.message, message) || other.message == message)); +} - /// Id of the payment method used in this intent. - @override - String get paymentMethodId; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,code,message); - /// Indicates how the intent is used in the future. - @override - String get usage; +@override +String toString() { + return 'LastSetupError(code: $code, message: $message)'; +} - /// List of payment method types associated with this intent. - @override - List get paymentMethodTypes; - /// Localized description that provides additional context to users. - @override - String? get description; +} - /// Timestamp since epoch that represents the time the intent is created. - @override - String? get created; +/// @nodoc +abstract mixin class $LastSetupErrorCopyWith<$Res> { + factory $LastSetupErrorCopyWith(LastSetupError value, $Res Function(LastSetupError) _then) = _$LastSetupErrorCopyWithImpl; +@useResult +$Res call({ + String code, String message +}); - /// Error encountered since last configmration. - @override - LastSetupError? get lastSetupError; - /// Additional action that needs to be taken in order to complete a payment - /// using the provided resource. - @override - NextAction? get nextAction; - /// Mandata data for this paymentintent. - @override - MandateData? get mandateData; - /// Create a copy of SetupIntent - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SetupIntentImplCopyWith<_$SetupIntentImpl> get copyWith => - throw _privateConstructorUsedError; +} +/// @nodoc +class _$LastSetupErrorCopyWithImpl<$Res> + implements $LastSetupErrorCopyWith<$Res> { + _$LastSetupErrorCopyWithImpl(this._self, this._then); + + final LastSetupError _self; + final $Res Function(LastSetupError) _then; + +/// Create a copy of LastSetupError +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? code = null,Object? message = null,}) { + return _then(_self.copyWith( +code: null == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as String,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String, + )); } -LastSetupError _$LastSetupErrorFromJson(Map json) { - return _LastSetupError.fromJson(json); } -/// @nodoc -mixin _$LastSetupError { - /// Code. - String get code => throw _privateConstructorUsedError; - /// Message. - String get message => throw _privateConstructorUsedError; +/// Adds pattern-matching-related methods to [LastSetupError]. +extension LastSetupErrorPatterns on LastSetupError { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _LastSetupError value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _LastSetupError() when $default != null: +return $default(_that);case _: + return orElse(); - /// Serializes this LastSetupError to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _LastSetupError value) $default,){ +final _that = this; +switch (_that) { +case _LastSetupError(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); - /// Create a copy of LastSetupError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $LastSetupErrorCopyWith get copyWith => - throw _privateConstructorUsedError; } +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _LastSetupError value)? $default,){ +final _that = this; +switch (_that) { +case _LastSetupError() when $default != null: +return $default(_that);case _: + return null; -/// @nodoc -abstract class $LastSetupErrorCopyWith<$Res> { - factory $LastSetupErrorCopyWith( - LastSetupError value, $Res Function(LastSetupError) then) = - _$LastSetupErrorCopyWithImpl<$Res, LastSetupError>; - @useResult - $Res call({String code, String message}); } +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String code, String message)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _LastSetupError() when $default != null: +return $default(_that.code,_that.message);case _: + return orElse(); -/// @nodoc -class _$LastSetupErrorCopyWithImpl<$Res, $Val extends LastSetupError> - implements $LastSetupErrorCopyWith<$Res> { - _$LastSetupErrorCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of LastSetupError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? code = null, - Object? message = null, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); - } } +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String code, String message) $default,) {final _that = this; +switch (_that) { +case _LastSetupError(): +return $default(_that.code,_that.message);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class _$$LastSetupErrorImplCopyWith<$Res> - implements $LastSetupErrorCopyWith<$Res> { - factory _$$LastSetupErrorImplCopyWith(_$LastSetupErrorImpl value, - $Res Function(_$LastSetupErrorImpl) then) = - __$$LastSetupErrorImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({String code, String message}); +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String code, String message)? $default,) {final _that = this; +switch (_that) { +case _LastSetupError() when $default != null: +return $default(_that.code,_that.message);case _: + return null; + +} } -/// @nodoc -class __$$LastSetupErrorImplCopyWithImpl<$Res> - extends _$LastSetupErrorCopyWithImpl<$Res, _$LastSetupErrorImpl> - implements _$$LastSetupErrorImplCopyWith<$Res> { - __$$LastSetupErrorImplCopyWithImpl( - _$LastSetupErrorImpl _value, $Res Function(_$LastSetupErrorImpl) _then) - : super(_value, _then); - - /// Create a copy of LastSetupError - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? code = null, - Object? message = null, - }) { - return _then(_$LastSetupErrorImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$LastSetupErrorImpl implements _LastSetupError { - const _$LastSetupErrorImpl({required this.code, required this.message}); - - factory _$LastSetupErrorImpl.fromJson(Map json) => - _$$LastSetupErrorImplFromJson(json); +class _LastSetupError implements LastSetupError { + const _LastSetupError({required this.code, required this.message}); + factory _LastSetupError.fromJson(Map json) => _$LastSetupErrorFromJson(json); + +/// Code. +@override final String code; +/// Message. +@override final String message; + +/// Create a copy of LastSetupError +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$LastSetupErrorCopyWith<_LastSetupError> get copyWith => __$LastSetupErrorCopyWithImpl<_LastSetupError>(this, _$identity); + +@override +Map toJson() { + return _$LastSetupErrorToJson(this, ); +} - /// Code. - @override - final String code; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _LastSetupError&&(identical(other.code, code) || other.code == code)&&(identical(other.message, message) || other.message == message)); +} - /// Message. - @override - final String message; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,code,message); - @override - String toString() { - return 'LastSetupError(code: $code, message: $message)'; - } +@override +String toString() { + return 'LastSetupError(code: $code, message: $message)'; +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$LastSetupErrorImpl && - (identical(other.code, code) || other.code == code) && - (identical(other.message, message) || other.message == message)); - } - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, code, message); - - /// Create a copy of LastSetupError - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$LastSetupErrorImplCopyWith<_$LastSetupErrorImpl> get copyWith => - __$$LastSetupErrorImplCopyWithImpl<_$LastSetupErrorImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$LastSetupErrorImplToJson( - this, - ); - } } -abstract class _LastSetupError implements LastSetupError { - const factory _LastSetupError( - {required final String code, - required final String message}) = _$LastSetupErrorImpl; +/// @nodoc +abstract mixin class _$LastSetupErrorCopyWith<$Res> implements $LastSetupErrorCopyWith<$Res> { + factory _$LastSetupErrorCopyWith(_LastSetupError value, $Res Function(_LastSetupError) _then) = __$LastSetupErrorCopyWithImpl; +@override @useResult +$Res call({ + String code, String message +}); + + - factory _LastSetupError.fromJson(Map json) = - _$LastSetupErrorImpl.fromJson; - /// Code. - @override - String get code; +} +/// @nodoc +class __$LastSetupErrorCopyWithImpl<$Res> + implements _$LastSetupErrorCopyWith<$Res> { + __$LastSetupErrorCopyWithImpl(this._self, this._then); + + final _LastSetupError _self; + final $Res Function(_LastSetupError) _then; + +/// Create a copy of LastSetupError +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? code = null,Object? message = null,}) { + return _then(_LastSetupError( +code: null == code ? _self.code : code // ignore: cast_nullable_to_non_nullable +as String,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String, + )); +} - /// Message. - @override - String get message; - /// Create a copy of LastSetupError - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$LastSetupErrorImplCopyWith<_$LastSetupErrorImpl> get copyWith => - throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart b/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart index 8ba1f5a2d..49c9c7420 100644 --- a/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/setup_intent.g.dart @@ -6,32 +6,30 @@ part of 'setup_intent.dart'; // JsonSerializableGenerator // ************************************************************************** -_$SetupIntentImpl _$$SetupIntentImplFromJson(Map json) => - _$SetupIntentImpl( - id: json['id'] as String, - status: json['status'] as String, - livemode: json['livemode'] as bool, - clientSecret: json['clientSecret'] as String, - paymentMethodId: json['paymentMethodId'] as String, - usage: json['usage'] as String, - paymentMethodTypes: (json['paymentMethodTypes'] as List) - .map((e) => $enumDecode(_$PaymentMethodTypeEnumMap, e)) - .toList(), - description: json['description'] as String?, - created: json['created'] as String?, - lastSetupError: json['lastSetupError'] == null - ? null - : LastSetupError.fromJson( - json['lastSetupError'] as Map), - nextAction: json['nextAction'] == null - ? null - : NextAction.fromJson(json['nextAction'] as Map), - mandateData: json['mandateData'] == null - ? null - : MandateData.fromJson(json['mandateData'] as Map), - ); +_SetupIntent _$SetupIntentFromJson(Map json) => _SetupIntent( + id: json['id'] as String, + status: json['status'] as String, + livemode: json['livemode'] as bool, + clientSecret: json['clientSecret'] as String, + paymentMethodId: json['paymentMethodId'] as String, + usage: json['usage'] as String, + paymentMethodTypes: (json['paymentMethodTypes'] as List) + .map((e) => $enumDecode(_$PaymentMethodTypeEnumMap, e)) + .toList(), + description: json['description'] as String?, + created: json['created'] as String?, + lastSetupError: json['lastSetupError'] == null + ? null + : LastSetupError.fromJson(json['lastSetupError'] as Map), + nextAction: json['nextAction'] == null + ? null + : NextAction.fromJson(json['nextAction'] as Map), + mandateData: json['mandateData'] == null + ? null + : MandateData.fromJson(json['mandateData'] as Map), +); -Map _$$SetupIntentImplToJson(_$SetupIntentImpl instance) => +Map _$SetupIntentToJson(_SetupIntent instance) => { 'id': instance.id, 'status': instance.status, @@ -67,7 +65,6 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.Bancontact: 'Bancontact', PaymentMethodType.Oxxo: 'Oxxo', PaymentMethodType.PayPal: 'PayPal', - PaymentMethodType.Sofort: 'Sofort', PaymentMethodType.Upi: 'Upi', PaymentMethodType.USBankAccount: 'USBankAccount', PaymentMethodType.RevolutPay: 'RevolutPay', @@ -75,15 +72,11 @@ const _$PaymentMethodTypeEnumMap = { PaymentMethodType.Unknown: 'Unknown', }; -_$LastSetupErrorImpl _$$LastSetupErrorImplFromJson(Map json) => - _$LastSetupErrorImpl( +_LastSetupError _$LastSetupErrorFromJson(Map json) => + _LastSetupError( code: json['code'] as String, message: json['message'] as String, ); -Map _$$LastSetupErrorImplToJson( - _$LastSetupErrorImpl instance) => - { - 'code': instance.code, - 'message': instance.message, - }; +Map _$LastSetupErrorToJson(_LastSetupError instance) => + {'code': instance.code, 'message': instance.message}; diff --git a/packages/stripe_platform_interface/lib/src/models/three_d_secure.dart b/packages/stripe_platform_interface/lib/src/models/three_d_secure.dart index adf12ef7c..894970ad9 100644 --- a/packages/stripe_platform_interface/lib/src/models/three_d_secure.dart +++ b/packages/stripe_platform_interface/lib/src/models/three_d_secure.dart @@ -5,7 +5,8 @@ part 'three_d_secure.g.dart'; /// Parameters to configure the 3d secure screen. @freezed -class ThreeDSecureConfigurationParams with _$ThreeDSecureConfigurationParams { +abstract class ThreeDSecureConfigurationParams + with _$ThreeDSecureConfigurationParams { @JsonSerializable(explicitToJson: true) const factory ThreeDSecureConfigurationParams({ /// Styling for the 3d secure navigation bar. @@ -18,11 +19,9 @@ class ThreeDSecureConfigurationParams with _$ThreeDSecureConfigurationParams { ThreeDSecureLabelThemeData? label, /// Styling for the 3d secure textfield. - ThreeDSecureTextFieldThemeData? textField, /// Styling for the 3d secure confirmation button. - ThreeDSecureButtonThemeData? submitButton, /// Styling for the 3d secure cancel button. @@ -43,9 +42,8 @@ class ThreeDSecureConfigurationParams with _$ThreeDSecureConfigurationParams { } @freezed - /// Styling info related to the 3d secure navigation bar. -class ThreeDSecureNavigationBarThemeData +abstract class ThreeDSecureNavigationBarThemeData with _$ThreeDSecureNavigationBarThemeData { @JsonSerializable(explicitToJson: true) const factory ThreeDSecureNavigationBarThemeData({ @@ -59,11 +57,9 @@ class ThreeDSecureNavigationBarThemeData String? textColor, /// Color in hex for the status bar. - String? statusBarColor, /// Color in hex to display navigation bar background. - String? backgroundColor, /// Font size of header text. @@ -71,23 +67,19 @@ class ThreeDSecureNavigationBarThemeData }) = _ThreeDSecureNavigationBarThemeData; factory ThreeDSecureNavigationBarThemeData.fromJson( - Map json) => - _$ThreeDSecureNavigationBarThemeDataFromJson(json); + Map json, + ) => _$ThreeDSecureNavigationBarThemeDataFromJson(json); } @freezed - /// Styling info related to the 3d secure label. - -class ThreeDSecureLabelThemeData with _$ThreeDSecureLabelThemeData { +abstract class ThreeDSecureLabelThemeData with _$ThreeDSecureLabelThemeData { @JsonSerializable(explicitToJson: true) const factory ThreeDSecureLabelThemeData({ /// Color in hex for header text. - String? headingTextColor, /// Color in hex for label text. - String? textColor, /// Font size for label text. @@ -102,10 +94,9 @@ class ThreeDSecureLabelThemeData with _$ThreeDSecureLabelThemeData { } @freezed - /// Styling info related to the 3d secure text field. - -class ThreeDSecureTextFieldThemeData with _$ThreeDSecureTextFieldThemeData { +abstract class ThreeDSecureTextFieldThemeData + with _$ThreeDSecureTextFieldThemeData { @JsonSerializable(explicitToJson: true) const factory ThreeDSecureTextFieldThemeData({ /// Color in hex for the border @@ -121,7 +112,6 @@ class ThreeDSecureTextFieldThemeData with _$ThreeDSecureTextFieldThemeData { String? textColor, /// Font size for the textfield text. - double? textFontSize, }) = _ThreeDSecureTextFieldThemeData; @@ -130,10 +120,8 @@ class ThreeDSecureTextFieldThemeData with _$ThreeDSecureTextFieldThemeData { } @freezed - /// Styling info related to the 3d secure button. - -class ThreeDSecureButtonThemeData with _$ThreeDSecureButtonThemeData { +abstract class ThreeDSecureButtonThemeData with _$ThreeDSecureButtonThemeData { @JsonSerializable(explicitToJson: true) const factory ThreeDSecureButtonThemeData({ /// Color in hex for button background diff --git a/packages/stripe_platform_interface/lib/src/models/three_d_secure.freezed.dart b/packages/stripe_platform_interface/lib/src/models/three_d_secure.freezed.dart index dddb4c26b..e4deb9875 100644 --- a/packages/stripe_platform_interface/lib/src/models/three_d_secure.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/three_d_secure.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,1636 +9,1632 @@ part of 'three_d_secure.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ThreeDSecureConfigurationParams _$ThreeDSecureConfigurationParamsFromJson( - Map json) { - return _ThreeDSecureConfigurationParams.fromJson(json); -} - /// @nodoc mixin _$ThreeDSecureConfigurationParams { - /// Styling for the 3d secure navigation bar. - ThreeDSecureNavigationBarThemeData get navigationBar => - throw _privateConstructorUsedError; - /// Desired timeout in milliseconds. - int? get timeout => throw _privateConstructorUsedError; +/// Styling for the 3d secure navigation bar. + ThreeDSecureNavigationBarThemeData get navigationBar;/// Desired timeout in milliseconds. + int? get timeout;/// Styling for the 3d secure label. + ThreeDSecureLabelThemeData? get label;/// Styling for the 3d secure textfield. + ThreeDSecureTextFieldThemeData? get textField;/// Styling for the 3d secure confirmation button. + ThreeDSecureButtonThemeData? get submitButton;/// Styling for the 3d secure cancel button. + ThreeDSecureButtonThemeData? get cancelButton;/// Styling for the 3d secure next button. + ThreeDSecureButtonThemeData? get nextButton;/// Styling for the 3d secure continue button. + ThreeDSecureButtonThemeData? get continueButton;/// Styling for the 3d secure resend button. + ThreeDSecureButtonThemeData? get resendButton; +/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThreeDSecureConfigurationParamsCopyWith get copyWith => _$ThreeDSecureConfigurationParamsCopyWithImpl(this as ThreeDSecureConfigurationParams, _$identity); - /// Styling for the 3d secure label. - ThreeDSecureLabelThemeData? get label => throw _privateConstructorUsedError; - - /// Styling for the 3d secure textfield. - ThreeDSecureTextFieldThemeData? get textField => - throw _privateConstructorUsedError; - - /// Styling for the 3d secure confirmation button. - ThreeDSecureButtonThemeData? get submitButton => - throw _privateConstructorUsedError; + /// Serializes this ThreeDSecureConfigurationParams to a JSON map. + Map toJson(); - /// Styling for the 3d secure cancel button. - ThreeDSecureButtonThemeData? get cancelButton => - throw _privateConstructorUsedError; - /// Styling for the 3d secure next button. - ThreeDSecureButtonThemeData? get nextButton => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThreeDSecureConfigurationParams&&(identical(other.navigationBar, navigationBar) || other.navigationBar == navigationBar)&&(identical(other.timeout, timeout) || other.timeout == timeout)&&(identical(other.label, label) || other.label == label)&&(identical(other.textField, textField) || other.textField == textField)&&(identical(other.submitButton, submitButton) || other.submitButton == submitButton)&&(identical(other.cancelButton, cancelButton) || other.cancelButton == cancelButton)&&(identical(other.nextButton, nextButton) || other.nextButton == nextButton)&&(identical(other.continueButton, continueButton) || other.continueButton == continueButton)&&(identical(other.resendButton, resendButton) || other.resendButton == resendButton)); +} - /// Styling for the 3d secure continue button. - ThreeDSecureButtonThemeData? get continueButton => - throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,navigationBar,timeout,label,textField,submitButton,cancelButton,nextButton,continueButton,resendButton); - /// Styling for the 3d secure resend button. - ThreeDSecureButtonThemeData? get resendButton => - throw _privateConstructorUsedError; +@override +String toString() { + return 'ThreeDSecureConfigurationParams(navigationBar: $navigationBar, timeout: $timeout, label: $label, textField: $textField, submitButton: $submitButton, cancelButton: $cancelButton, nextButton: $nextButton, continueButton: $continueButton, resendButton: $resendButton)'; +} - /// Serializes this ThreeDSecureConfigurationParams to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ThreeDSecureConfigurationParamsCopyWith - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $ThreeDSecureConfigurationParamsCopyWith<$Res> { - factory $ThreeDSecureConfigurationParamsCopyWith( - ThreeDSecureConfigurationParams value, - $Res Function(ThreeDSecureConfigurationParams) then) = - _$ThreeDSecureConfigurationParamsCopyWithImpl<$Res, - ThreeDSecureConfigurationParams>; - @useResult - $Res call( - {ThreeDSecureNavigationBarThemeData navigationBar, - int? timeout, - ThreeDSecureLabelThemeData? label, - ThreeDSecureTextFieldThemeData? textField, - ThreeDSecureButtonThemeData? submitButton, - ThreeDSecureButtonThemeData? cancelButton, - ThreeDSecureButtonThemeData? nextButton, - ThreeDSecureButtonThemeData? continueButton, - ThreeDSecureButtonThemeData? resendButton}); - - $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar; - $ThreeDSecureLabelThemeDataCopyWith<$Res>? get label; - $ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField; - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton; - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton; - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton; - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton; - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton; -} +abstract mixin class $ThreeDSecureConfigurationParamsCopyWith<$Res> { + factory $ThreeDSecureConfigurationParamsCopyWith(ThreeDSecureConfigurationParams value, $Res Function(ThreeDSecureConfigurationParams) _then) = _$ThreeDSecureConfigurationParamsCopyWithImpl; +@useResult +$Res call({ + ThreeDSecureNavigationBarThemeData navigationBar, int? timeout, ThreeDSecureLabelThemeData? label, ThreeDSecureTextFieldThemeData? textField, ThreeDSecureButtonThemeData? submitButton, ThreeDSecureButtonThemeData? cancelButton, ThreeDSecureButtonThemeData? nextButton, ThreeDSecureButtonThemeData? continueButton, ThreeDSecureButtonThemeData? resendButton +}); + +$ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar;$ThreeDSecureLabelThemeDataCopyWith<$Res>? get label;$ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField;$ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton;$ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton;$ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton;$ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton;$ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton; + +} /// @nodoc -class _$ThreeDSecureConfigurationParamsCopyWithImpl<$Res, - $Val extends ThreeDSecureConfigurationParams> +class _$ThreeDSecureConfigurationParamsCopyWithImpl<$Res> implements $ThreeDSecureConfigurationParamsCopyWith<$Res> { - _$ThreeDSecureConfigurationParamsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? navigationBar = null, - Object? timeout = freezed, - Object? label = freezed, - Object? textField = freezed, - Object? submitButton = freezed, - Object? cancelButton = freezed, - Object? nextButton = freezed, - Object? continueButton = freezed, - Object? resendButton = freezed, - }) { - return _then(_value.copyWith( - navigationBar: null == navigationBar - ? _value.navigationBar - : navigationBar // ignore: cast_nullable_to_non_nullable - as ThreeDSecureNavigationBarThemeData, - timeout: freezed == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as int?, - label: freezed == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as ThreeDSecureLabelThemeData?, - textField: freezed == textField - ? _value.textField - : textField // ignore: cast_nullable_to_non_nullable - as ThreeDSecureTextFieldThemeData?, - submitButton: freezed == submitButton - ? _value.submitButton - : submitButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - cancelButton: freezed == cancelButton - ? _value.cancelButton - : cancelButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - nextButton: freezed == nextButton - ? _value.nextButton - : nextButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - continueButton: freezed == continueButton - ? _value.continueButton - : continueButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - resendButton: freezed == resendButton - ? _value.resendButton - : resendButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - ) as $Val); + _$ThreeDSecureConfigurationParamsCopyWithImpl(this._self, this._then); + + final ThreeDSecureConfigurationParams _self; + final $Res Function(ThreeDSecureConfigurationParams) _then; + +/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? navigationBar = null,Object? timeout = freezed,Object? label = freezed,Object? textField = freezed,Object? submitButton = freezed,Object? cancelButton = freezed,Object? nextButton = freezed,Object? continueButton = freezed,Object? resendButton = freezed,}) { + return _then(_self.copyWith( +navigationBar: null == navigationBar ? _self.navigationBar : navigationBar // ignore: cast_nullable_to_non_nullable +as ThreeDSecureNavigationBarThemeData,timeout: freezed == timeout ? _self.timeout : timeout // ignore: cast_nullable_to_non_nullable +as int?,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as ThreeDSecureLabelThemeData?,textField: freezed == textField ? _self.textField : textField // ignore: cast_nullable_to_non_nullable +as ThreeDSecureTextFieldThemeData?,submitButton: freezed == submitButton ? _self.submitButton : submitButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,cancelButton: freezed == cancelButton ? _self.cancelButton : cancelButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,nextButton: freezed == nextButton ? _self.nextButton : nextButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,continueButton: freezed == continueButton ? _self.continueButton : continueButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,resendButton: freezed == resendButton ? _self.resendButton : resendButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?, + )); +} +/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar { + + return $ThreeDSecureNavigationBarThemeDataCopyWith<$Res>(_self.navigationBar, (value) { + return _then(_self.copyWith(navigationBar: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureLabelThemeDataCopyWith<$Res>? get label { + if (_self.label == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar { - return $ThreeDSecureNavigationBarThemeDataCopyWith<$Res>( - _value.navigationBar, (value) { - return _then(_value.copyWith(navigationBar: value) as $Val); - }); + return $ThreeDSecureLabelThemeDataCopyWith<$Res>(_self.label!, (value) { + return _then(_self.copyWith(label: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField { + if (_self.textField == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureLabelThemeDataCopyWith<$Res>? get label { - if (_value.label == null) { - return null; - } - - return $ThreeDSecureLabelThemeDataCopyWith<$Res>(_value.label!, (value) { - return _then(_value.copyWith(label: value) as $Val); - }); + return $ThreeDSecureTextFieldThemeDataCopyWith<$Res>(_self.textField!, (value) { + return _then(_self.copyWith(textField: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton { + if (_self.submitButton == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField { - if (_value.textField == null) { - return null; - } - - return $ThreeDSecureTextFieldThemeDataCopyWith<$Res>(_value.textField!, - (value) { - return _then(_value.copyWith(textField: value) as $Val); - }); + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.submitButton!, (value) { + return _then(_self.copyWith(submitButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton { + if (_self.cancelButton == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton { - if (_value.submitButton == null) { - return null; - } - - return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_value.submitButton!, - (value) { - return _then(_value.copyWith(submitButton: value) as $Val); - }); + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.cancelButton!, (value) { + return _then(_self.copyWith(cancelButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton { + if (_self.nextButton == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton { - if (_value.cancelButton == null) { - return null; - } - - return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_value.cancelButton!, - (value) { - return _then(_value.copyWith(cancelButton: value) as $Val); - }); + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.nextButton!, (value) { + return _then(_self.copyWith(nextButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton { + if (_self.continueButton == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton { - if (_value.nextButton == null) { - return null; - } - - return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_value.nextButton!, - (value) { - return _then(_value.copyWith(nextButton: value) as $Val); - }); + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.continueButton!, (value) { + return _then(_self.copyWith(continueButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton { + if (_self.resendButton == null) { + return null; } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton { - if (_value.continueButton == null) { - return null; - } - - return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_value.continueButton!, - (value) { - return _then(_value.copyWith(continueButton: value) as $Val); - }); - } + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.resendButton!, (value) { + return _then(_self.copyWith(resendButton: value)); + }); +} +} - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton { - if (_value.resendButton == null) { - return null; - } - - return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_value.resendButton!, - (value) { - return _then(_value.copyWith(resendButton: value) as $Val); - }); - } + +/// Adds pattern-matching-related methods to [ThreeDSecureConfigurationParams]. +extension ThreeDSecureConfigurationParamsPatterns on ThreeDSecureConfigurationParams { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ThreeDSecureConfigurationParams value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThreeDSecureConfigurationParams() when $default != null: +return $default(_that);case _: + return orElse(); + +} } +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ThreeDSecureConfigurationParams value) $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureConfigurationParams(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); -/// @nodoc -abstract class _$$ThreeDSecureConfigurationParamsImplCopyWith<$Res> - implements $ThreeDSecureConfigurationParamsCopyWith<$Res> { - factory _$$ThreeDSecureConfigurationParamsImplCopyWith( - _$ThreeDSecureConfigurationParamsImpl value, - $Res Function(_$ThreeDSecureConfigurationParamsImpl) then) = - __$$ThreeDSecureConfigurationParamsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ThreeDSecureNavigationBarThemeData navigationBar, - int? timeout, - ThreeDSecureLabelThemeData? label, - ThreeDSecureTextFieldThemeData? textField, - ThreeDSecureButtonThemeData? submitButton, - ThreeDSecureButtonThemeData? cancelButton, - ThreeDSecureButtonThemeData? nextButton, - ThreeDSecureButtonThemeData? continueButton, - ThreeDSecureButtonThemeData? resendButton}); - - @override - $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar; - @override - $ThreeDSecureLabelThemeDataCopyWith<$Res>? get label; - @override - $ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField; - @override - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton; - @override - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton; - @override - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton; - @override - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton; - @override - $ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton; +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ThreeDSecureConfigurationParams value)? $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureConfigurationParams() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ThreeDSecureNavigationBarThemeData navigationBar, int? timeout, ThreeDSecureLabelThemeData? label, ThreeDSecureTextFieldThemeData? textField, ThreeDSecureButtonThemeData? submitButton, ThreeDSecureButtonThemeData? cancelButton, ThreeDSecureButtonThemeData? nextButton, ThreeDSecureButtonThemeData? continueButton, ThreeDSecureButtonThemeData? resendButton)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThreeDSecureConfigurationParams() when $default != null: +return $default(_that.navigationBar,_that.timeout,_that.label,_that.textField,_that.submitButton,_that.cancelButton,_that.nextButton,_that.continueButton,_that.resendButton);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ThreeDSecureNavigationBarThemeData navigationBar, int? timeout, ThreeDSecureLabelThemeData? label, ThreeDSecureTextFieldThemeData? textField, ThreeDSecureButtonThemeData? submitButton, ThreeDSecureButtonThemeData? cancelButton, ThreeDSecureButtonThemeData? nextButton, ThreeDSecureButtonThemeData? continueButton, ThreeDSecureButtonThemeData? resendButton) $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureConfigurationParams(): +return $default(_that.navigationBar,_that.timeout,_that.label,_that.textField,_that.submitButton,_that.cancelButton,_that.nextButton,_that.continueButton,_that.resendButton);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ThreeDSecureNavigationBarThemeData navigationBar, int? timeout, ThreeDSecureLabelThemeData? label, ThreeDSecureTextFieldThemeData? textField, ThreeDSecureButtonThemeData? submitButton, ThreeDSecureButtonThemeData? cancelButton, ThreeDSecureButtonThemeData? nextButton, ThreeDSecureButtonThemeData? continueButton, ThreeDSecureButtonThemeData? resendButton)? $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureConfigurationParams() when $default != null: +return $default(_that.navigationBar,_that.timeout,_that.label,_that.textField,_that.submitButton,_that.cancelButton,_that.nextButton,_that.continueButton,_that.resendButton);case _: + return null; + +} } -/// @nodoc -class __$$ThreeDSecureConfigurationParamsImplCopyWithImpl<$Res> - extends _$ThreeDSecureConfigurationParamsCopyWithImpl<$Res, - _$ThreeDSecureConfigurationParamsImpl> - implements _$$ThreeDSecureConfigurationParamsImplCopyWith<$Res> { - __$$ThreeDSecureConfigurationParamsImplCopyWithImpl( - _$ThreeDSecureConfigurationParamsImpl _value, - $Res Function(_$ThreeDSecureConfigurationParamsImpl) _then) - : super(_value, _then); - - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? navigationBar = null, - Object? timeout = freezed, - Object? label = freezed, - Object? textField = freezed, - Object? submitButton = freezed, - Object? cancelButton = freezed, - Object? nextButton = freezed, - Object? continueButton = freezed, - Object? resendButton = freezed, - }) { - return _then(_$ThreeDSecureConfigurationParamsImpl( - navigationBar: null == navigationBar - ? _value.navigationBar - : navigationBar // ignore: cast_nullable_to_non_nullable - as ThreeDSecureNavigationBarThemeData, - timeout: freezed == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as int?, - label: freezed == label - ? _value.label - : label // ignore: cast_nullable_to_non_nullable - as ThreeDSecureLabelThemeData?, - textField: freezed == textField - ? _value.textField - : textField // ignore: cast_nullable_to_non_nullable - as ThreeDSecureTextFieldThemeData?, - submitButton: freezed == submitButton - ? _value.submitButton - : submitButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - cancelButton: freezed == cancelButton - ? _value.cancelButton - : cancelButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - nextButton: freezed == nextButton - ? _value.nextButton - : nextButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - continueButton: freezed == continueButton - ? _value.continueButton - : continueButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - resendButton: freezed == resendButton - ? _value.resendButton - : resendButton // ignore: cast_nullable_to_non_nullable - as ThreeDSecureButtonThemeData?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ThreeDSecureConfigurationParamsImpl - implements _ThreeDSecureConfigurationParams { - const _$ThreeDSecureConfigurationParamsImpl( - {required this.navigationBar, - this.timeout, - this.label, - this.textField, - this.submitButton, - this.cancelButton, - this.nextButton, - this.continueButton, - this.resendButton}); - - factory _$ThreeDSecureConfigurationParamsImpl.fromJson( - Map json) => - _$$ThreeDSecureConfigurationParamsImplFromJson(json); - - /// Styling for the 3d secure navigation bar. - @override - final ThreeDSecureNavigationBarThemeData navigationBar; - - /// Desired timeout in milliseconds. - @override - final int? timeout; - - /// Styling for the 3d secure label. - @override - final ThreeDSecureLabelThemeData? label; - - /// Styling for the 3d secure textfield. - @override - final ThreeDSecureTextFieldThemeData? textField; - - /// Styling for the 3d secure confirmation button. - @override - final ThreeDSecureButtonThemeData? submitButton; - - /// Styling for the 3d secure cancel button. - @override - final ThreeDSecureButtonThemeData? cancelButton; - - /// Styling for the 3d secure next button. - @override - final ThreeDSecureButtonThemeData? nextButton; - - /// Styling for the 3d secure continue button. - @override - final ThreeDSecureButtonThemeData? continueButton; - - /// Styling for the 3d secure resend button. - @override - final ThreeDSecureButtonThemeData? resendButton; - - @override - String toString() { - return 'ThreeDSecureConfigurationParams(navigationBar: $navigationBar, timeout: $timeout, label: $label, textField: $textField, submitButton: $submitButton, cancelButton: $cancelButton, nextButton: $nextButton, continueButton: $continueButton, resendButton: $resendButton)'; - } +class _ThreeDSecureConfigurationParams implements ThreeDSecureConfigurationParams { + const _ThreeDSecureConfigurationParams({required this.navigationBar, this.timeout, this.label, this.textField, this.submitButton, this.cancelButton, this.nextButton, this.continueButton, this.resendButton}); + factory _ThreeDSecureConfigurationParams.fromJson(Map json) => _$ThreeDSecureConfigurationParamsFromJson(json); + +/// Styling for the 3d secure navigation bar. +@override final ThreeDSecureNavigationBarThemeData navigationBar; +/// Desired timeout in milliseconds. +@override final int? timeout; +/// Styling for the 3d secure label. +@override final ThreeDSecureLabelThemeData? label; +/// Styling for the 3d secure textfield. +@override final ThreeDSecureTextFieldThemeData? textField; +/// Styling for the 3d secure confirmation button. +@override final ThreeDSecureButtonThemeData? submitButton; +/// Styling for the 3d secure cancel button. +@override final ThreeDSecureButtonThemeData? cancelButton; +/// Styling for the 3d secure next button. +@override final ThreeDSecureButtonThemeData? nextButton; +/// Styling for the 3d secure continue button. +@override final ThreeDSecureButtonThemeData? continueButton; +/// Styling for the 3d secure resend button. +@override final ThreeDSecureButtonThemeData? resendButton; + +/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThreeDSecureConfigurationParamsCopyWith<_ThreeDSecureConfigurationParams> get copyWith => __$ThreeDSecureConfigurationParamsCopyWithImpl<_ThreeDSecureConfigurationParams>(this, _$identity); + +@override +Map toJson() { + return _$ThreeDSecureConfigurationParamsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ThreeDSecureConfigurationParamsImpl && - (identical(other.navigationBar, navigationBar) || - other.navigationBar == navigationBar) && - (identical(other.timeout, timeout) || other.timeout == timeout) && - (identical(other.label, label) || other.label == label) && - (identical(other.textField, textField) || - other.textField == textField) && - (identical(other.submitButton, submitButton) || - other.submitButton == submitButton) && - (identical(other.cancelButton, cancelButton) || - other.cancelButton == cancelButton) && - (identical(other.nextButton, nextButton) || - other.nextButton == nextButton) && - (identical(other.continueButton, continueButton) || - other.continueButton == continueButton) && - (identical(other.resendButton, resendButton) || - other.resendButton == resendButton)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThreeDSecureConfigurationParams&&(identical(other.navigationBar, navigationBar) || other.navigationBar == navigationBar)&&(identical(other.timeout, timeout) || other.timeout == timeout)&&(identical(other.label, label) || other.label == label)&&(identical(other.textField, textField) || other.textField == textField)&&(identical(other.submitButton, submitButton) || other.submitButton == submitButton)&&(identical(other.cancelButton, cancelButton) || other.cancelButton == cancelButton)&&(identical(other.nextButton, nextButton) || other.nextButton == nextButton)&&(identical(other.continueButton, continueButton) || other.continueButton == continueButton)&&(identical(other.resendButton, resendButton) || other.resendButton == resendButton)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, - navigationBar, - timeout, - label, - textField, - submitButton, - cancelButton, - nextButton, - continueButton, - resendButton); - - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ThreeDSecureConfigurationParamsImplCopyWith< - _$ThreeDSecureConfigurationParamsImpl> - get copyWith => __$$ThreeDSecureConfigurationParamsImplCopyWithImpl< - _$ThreeDSecureConfigurationParamsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ThreeDSecureConfigurationParamsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,navigationBar,timeout,label,textField,submitButton,cancelButton,nextButton,continueButton,resendButton); + +@override +String toString() { + return 'ThreeDSecureConfigurationParams(navigationBar: $navigationBar, timeout: $timeout, label: $label, textField: $textField, submitButton: $submitButton, cancelButton: $cancelButton, nextButton: $nextButton, continueButton: $continueButton, resendButton: $resendButton)'; } -abstract class _ThreeDSecureConfigurationParams - implements ThreeDSecureConfigurationParams { - const factory _ThreeDSecureConfigurationParams( - {required final ThreeDSecureNavigationBarThemeData navigationBar, - final int? timeout, - final ThreeDSecureLabelThemeData? label, - final ThreeDSecureTextFieldThemeData? textField, - final ThreeDSecureButtonThemeData? submitButton, - final ThreeDSecureButtonThemeData? cancelButton, - final ThreeDSecureButtonThemeData? nextButton, - final ThreeDSecureButtonThemeData? continueButton, - final ThreeDSecureButtonThemeData? resendButton}) = - _$ThreeDSecureConfigurationParamsImpl; - factory _ThreeDSecureConfigurationParams.fromJson(Map json) = - _$ThreeDSecureConfigurationParamsImpl.fromJson; +} - /// Styling for the 3d secure navigation bar. - @override - ThreeDSecureNavigationBarThemeData get navigationBar; +/// @nodoc +abstract mixin class _$ThreeDSecureConfigurationParamsCopyWith<$Res> implements $ThreeDSecureConfigurationParamsCopyWith<$Res> { + factory _$ThreeDSecureConfigurationParamsCopyWith(_ThreeDSecureConfigurationParams value, $Res Function(_ThreeDSecureConfigurationParams) _then) = __$ThreeDSecureConfigurationParamsCopyWithImpl; +@override @useResult +$Res call({ + ThreeDSecureNavigationBarThemeData navigationBar, int? timeout, ThreeDSecureLabelThemeData? label, ThreeDSecureTextFieldThemeData? textField, ThreeDSecureButtonThemeData? submitButton, ThreeDSecureButtonThemeData? cancelButton, ThreeDSecureButtonThemeData? nextButton, ThreeDSecureButtonThemeData? continueButton, ThreeDSecureButtonThemeData? resendButton +}); - /// Desired timeout in milliseconds. - @override - int? get timeout; - /// Styling for the 3d secure label. - @override - ThreeDSecureLabelThemeData? get label; +@override $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar;@override $ThreeDSecureLabelThemeDataCopyWith<$Res>? get label;@override $ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField;@override $ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton;@override $ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton;@override $ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton;@override $ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton;@override $ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton; - /// Styling for the 3d secure textfield. - @override - ThreeDSecureTextFieldThemeData? get textField; +} +/// @nodoc +class __$ThreeDSecureConfigurationParamsCopyWithImpl<$Res> + implements _$ThreeDSecureConfigurationParamsCopyWith<$Res> { + __$ThreeDSecureConfigurationParamsCopyWithImpl(this._self, this._then); + + final _ThreeDSecureConfigurationParams _self; + final $Res Function(_ThreeDSecureConfigurationParams) _then; + +/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? navigationBar = null,Object? timeout = freezed,Object? label = freezed,Object? textField = freezed,Object? submitButton = freezed,Object? cancelButton = freezed,Object? nextButton = freezed,Object? continueButton = freezed,Object? resendButton = freezed,}) { + return _then(_ThreeDSecureConfigurationParams( +navigationBar: null == navigationBar ? _self.navigationBar : navigationBar // ignore: cast_nullable_to_non_nullable +as ThreeDSecureNavigationBarThemeData,timeout: freezed == timeout ? _self.timeout : timeout // ignore: cast_nullable_to_non_nullable +as int?,label: freezed == label ? _self.label : label // ignore: cast_nullable_to_non_nullable +as ThreeDSecureLabelThemeData?,textField: freezed == textField ? _self.textField : textField // ignore: cast_nullable_to_non_nullable +as ThreeDSecureTextFieldThemeData?,submitButton: freezed == submitButton ? _self.submitButton : submitButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,cancelButton: freezed == cancelButton ? _self.cancelButton : cancelButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,nextButton: freezed == nextButton ? _self.nextButton : nextButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,continueButton: freezed == continueButton ? _self.continueButton : continueButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?,resendButton: freezed == resendButton ? _self.resendButton : resendButton // ignore: cast_nullable_to_non_nullable +as ThreeDSecureButtonThemeData?, + )); +} - /// Styling for the 3d secure confirmation button. - @override - ThreeDSecureButtonThemeData? get submitButton; +/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureNavigationBarThemeDataCopyWith<$Res> get navigationBar { + + return $ThreeDSecureNavigationBarThemeDataCopyWith<$Res>(_self.navigationBar, (value) { + return _then(_self.copyWith(navigationBar: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureLabelThemeDataCopyWith<$Res>? get label { + if (_self.label == null) { + return null; + } - /// Styling for the 3d secure cancel button. - @override - ThreeDSecureButtonThemeData? get cancelButton; + return $ThreeDSecureLabelThemeDataCopyWith<$Res>(_self.label!, (value) { + return _then(_self.copyWith(label: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureTextFieldThemeDataCopyWith<$Res>? get textField { + if (_self.textField == null) { + return null; + } - /// Styling for the 3d secure next button. - @override - ThreeDSecureButtonThemeData? get nextButton; + return $ThreeDSecureTextFieldThemeDataCopyWith<$Res>(_self.textField!, (value) { + return _then(_self.copyWith(textField: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get submitButton { + if (_self.submitButton == null) { + return null; + } - /// Styling for the 3d secure continue button. - @override - ThreeDSecureButtonThemeData? get continueButton; + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.submitButton!, (value) { + return _then(_self.copyWith(submitButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get cancelButton { + if (_self.cancelButton == null) { + return null; + } - /// Styling for the 3d secure resend button. - @override - ThreeDSecureButtonThemeData? get resendButton; + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.cancelButton!, (value) { + return _then(_self.copyWith(cancelButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get nextButton { + if (_self.nextButton == null) { + return null; + } - /// Create a copy of ThreeDSecureConfigurationParams - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ThreeDSecureConfigurationParamsImplCopyWith< - _$ThreeDSecureConfigurationParamsImpl> - get copyWith => throw _privateConstructorUsedError; -} + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.nextButton!, (value) { + return _then(_self.copyWith(nextButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get continueButton { + if (_self.continueButton == null) { + return null; + } -ThreeDSecureNavigationBarThemeData _$ThreeDSecureNavigationBarThemeDataFromJson( - Map json) { - return _ThreeDSecureNavigationBarThemeData.fromJson(json); + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.continueButton!, (value) { + return _then(_self.copyWith(continueButton: value)); + }); +}/// Create a copy of ThreeDSecureConfigurationParams +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith<$Res>? get resendButton { + if (_self.resendButton == null) { + return null; + } + + return $ThreeDSecureButtonThemeDataCopyWith<$Res>(_self.resendButton!, (value) { + return _then(_self.copyWith(resendButton: value)); + }); } +} + /// @nodoc mixin _$ThreeDSecureNavigationBarThemeData { - /// Localised text of the header. - String? get headerText => throw _privateConstructorUsedError; - /// localised text of the button - String? get buttonText => throw _privateConstructorUsedError; +/// Localised text of the header. + String? get headerText;/// localised text of the button + String? get buttonText;/// Color in hex to display navigation bar header text. + String? get textColor;/// Color in hex for the status bar. + String? get statusBarColor;/// Color in hex to display navigation bar background. + String? get backgroundColor;/// Font size of header text. + double? get textFontSize; +/// Create a copy of ThreeDSecureNavigationBarThemeData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThreeDSecureNavigationBarThemeDataCopyWith get copyWith => _$ThreeDSecureNavigationBarThemeDataCopyWithImpl(this as ThreeDSecureNavigationBarThemeData, _$identity); - /// Color in hex to display navigation bar header text. - String? get textColor => throw _privateConstructorUsedError; + /// Serializes this ThreeDSecureNavigationBarThemeData to a JSON map. + Map toJson(); - /// Color in hex for the status bar. - String? get statusBarColor => throw _privateConstructorUsedError; - /// Color in hex to display navigation bar background. - String? get backgroundColor => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThreeDSecureNavigationBarThemeData&&(identical(other.headerText, headerText) || other.headerText == headerText)&&(identical(other.buttonText, buttonText) || other.buttonText == buttonText)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.statusBarColor, statusBarColor) || other.statusBarColor == statusBarColor)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)); +} - /// Font size of header text. - double? get textFontSize => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,headerText,buttonText,textColor,statusBarColor,backgroundColor,textFontSize); + +@override +String toString() { + return 'ThreeDSecureNavigationBarThemeData(headerText: $headerText, buttonText: $buttonText, textColor: $textColor, statusBarColor: $statusBarColor, backgroundColor: $backgroundColor, textFontSize: $textFontSize)'; +} - /// Serializes this ThreeDSecureNavigationBarThemeData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - /// Create a copy of ThreeDSecureNavigationBarThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ThreeDSecureNavigationBarThemeDataCopyWith< - ThreeDSecureNavigationBarThemeData> - get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> { - factory $ThreeDSecureNavigationBarThemeDataCopyWith( - ThreeDSecureNavigationBarThemeData value, - $Res Function(ThreeDSecureNavigationBarThemeData) then) = - _$ThreeDSecureNavigationBarThemeDataCopyWithImpl<$Res, - ThreeDSecureNavigationBarThemeData>; - @useResult - $Res call( - {String? headerText, - String? buttonText, - String? textColor, - String? statusBarColor, - String? backgroundColor, - double? textFontSize}); -} +abstract mixin class $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> { + factory $ThreeDSecureNavigationBarThemeDataCopyWith(ThreeDSecureNavigationBarThemeData value, $Res Function(ThreeDSecureNavigationBarThemeData) _then) = _$ThreeDSecureNavigationBarThemeDataCopyWithImpl; +@useResult +$Res call({ + String? headerText, String? buttonText, String? textColor, String? statusBarColor, String? backgroundColor, double? textFontSize +}); + + + +} /// @nodoc -class _$ThreeDSecureNavigationBarThemeDataCopyWithImpl<$Res, - $Val extends ThreeDSecureNavigationBarThemeData> +class _$ThreeDSecureNavigationBarThemeDataCopyWithImpl<$Res> implements $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> { - _$ThreeDSecureNavigationBarThemeDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ThreeDSecureNavigationBarThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? headerText = freezed, - Object? buttonText = freezed, - Object? textColor = freezed, - Object? statusBarColor = freezed, - Object? backgroundColor = freezed, - Object? textFontSize = freezed, - }) { - return _then(_value.copyWith( - headerText: freezed == headerText - ? _value.headerText - : headerText // ignore: cast_nullable_to_non_nullable - as String?, - buttonText: freezed == buttonText - ? _value.buttonText - : buttonText // ignore: cast_nullable_to_non_nullable - as String?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - statusBarColor: freezed == statusBarColor - ? _value.statusBarColor - : statusBarColor // ignore: cast_nullable_to_non_nullable - as String?, - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); - } + _$ThreeDSecureNavigationBarThemeDataCopyWithImpl(this._self, this._then); + + final ThreeDSecureNavigationBarThemeData _self; + final $Res Function(ThreeDSecureNavigationBarThemeData) _then; + +/// Create a copy of ThreeDSecureNavigationBarThemeData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? headerText = freezed,Object? buttonText = freezed,Object? textColor = freezed,Object? statusBarColor = freezed,Object? backgroundColor = freezed,Object? textFontSize = freezed,}) { + return _then(_self.copyWith( +headerText: freezed == headerText ? _self.headerText : headerText // ignore: cast_nullable_to_non_nullable +as String?,buttonText: freezed == buttonText ? _self.buttonText : buttonText // ignore: cast_nullable_to_non_nullable +as String?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,statusBarColor: freezed == statusBarColor ? _self.statusBarColor : statusBarColor // ignore: cast_nullable_to_non_nullable +as String?,backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); } -/// @nodoc -abstract class _$$ThreeDSecureNavigationBarThemeDataImplCopyWith<$Res> - implements $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> { - factory _$$ThreeDSecureNavigationBarThemeDataImplCopyWith( - _$ThreeDSecureNavigationBarThemeDataImpl value, - $Res Function(_$ThreeDSecureNavigationBarThemeDataImpl) then) = - __$$ThreeDSecureNavigationBarThemeDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? headerText, - String? buttonText, - String? textColor, - String? statusBarColor, - String? backgroundColor, - double? textFontSize}); } -/// @nodoc -class __$$ThreeDSecureNavigationBarThemeDataImplCopyWithImpl<$Res> - extends _$ThreeDSecureNavigationBarThemeDataCopyWithImpl<$Res, - _$ThreeDSecureNavigationBarThemeDataImpl> - implements _$$ThreeDSecureNavigationBarThemeDataImplCopyWith<$Res> { - __$$ThreeDSecureNavigationBarThemeDataImplCopyWithImpl( - _$ThreeDSecureNavigationBarThemeDataImpl _value, - $Res Function(_$ThreeDSecureNavigationBarThemeDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ThreeDSecureNavigationBarThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? headerText = freezed, - Object? buttonText = freezed, - Object? textColor = freezed, - Object? statusBarColor = freezed, - Object? backgroundColor = freezed, - Object? textFontSize = freezed, - }) { - return _then(_$ThreeDSecureNavigationBarThemeDataImpl( - headerText: freezed == headerText - ? _value.headerText - : headerText // ignore: cast_nullable_to_non_nullable - as String?, - buttonText: freezed == buttonText - ? _value.buttonText - : buttonText // ignore: cast_nullable_to_non_nullable - as String?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - statusBarColor: freezed == statusBarColor - ? _value.statusBarColor - : statusBarColor // ignore: cast_nullable_to_non_nullable - as String?, - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - )); - } + +/// Adds pattern-matching-related methods to [ThreeDSecureNavigationBarThemeData]. +extension ThreeDSecureNavigationBarThemeDataPatterns on ThreeDSecureNavigationBarThemeData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ThreeDSecureNavigationBarThemeData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThreeDSecureNavigationBarThemeData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ThreeDSecureNavigationBarThemeData value) $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureNavigationBarThemeData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ThreeDSecureNavigationBarThemeData value)? $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureNavigationBarThemeData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? headerText, String? buttonText, String? textColor, String? statusBarColor, String? backgroundColor, double? textFontSize)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThreeDSecureNavigationBarThemeData() when $default != null: +return $default(_that.headerText,_that.buttonText,_that.textColor,_that.statusBarColor,_that.backgroundColor,_that.textFontSize);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? headerText, String? buttonText, String? textColor, String? statusBarColor, String? backgroundColor, double? textFontSize) $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureNavigationBarThemeData(): +return $default(_that.headerText,_that.buttonText,_that.textColor,_that.statusBarColor,_that.backgroundColor,_that.textFontSize);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? headerText, String? buttonText, String? textColor, String? statusBarColor, String? backgroundColor, double? textFontSize)? $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureNavigationBarThemeData() when $default != null: +return $default(_that.headerText,_that.buttonText,_that.textColor,_that.statusBarColor,_that.backgroundColor,_that.textFontSize);case _: + return null; + +} +} + } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ThreeDSecureNavigationBarThemeDataImpl - implements _ThreeDSecureNavigationBarThemeData { - const _$ThreeDSecureNavigationBarThemeDataImpl( - {this.headerText, - this.buttonText, - this.textColor, - this.statusBarColor, - this.backgroundColor, - this.textFontSize}); - - factory _$ThreeDSecureNavigationBarThemeDataImpl.fromJson( - Map json) => - _$$ThreeDSecureNavigationBarThemeDataImplFromJson(json); - - /// Localised text of the header. - @override - final String? headerText; - - /// localised text of the button - @override - final String? buttonText; - - /// Color in hex to display navigation bar header text. - @override - final String? textColor; - - /// Color in hex for the status bar. - @override - final String? statusBarColor; - - /// Color in hex to display navigation bar background. - @override - final String? backgroundColor; - - /// Font size of header text. - @override - final double? textFontSize; - - @override - String toString() { - return 'ThreeDSecureNavigationBarThemeData(headerText: $headerText, buttonText: $buttonText, textColor: $textColor, statusBarColor: $statusBarColor, backgroundColor: $backgroundColor, textFontSize: $textFontSize)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ThreeDSecureNavigationBarThemeDataImpl && - (identical(other.headerText, headerText) || - other.headerText == headerText) && - (identical(other.buttonText, buttonText) || - other.buttonText == buttonText) && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.statusBarColor, statusBarColor) || - other.statusBarColor == statusBarColor) && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.textFontSize, textFontSize) || - other.textFontSize == textFontSize)); - } +class _ThreeDSecureNavigationBarThemeData implements ThreeDSecureNavigationBarThemeData { + const _ThreeDSecureNavigationBarThemeData({this.headerText, this.buttonText, this.textColor, this.statusBarColor, this.backgroundColor, this.textFontSize}); + factory _ThreeDSecureNavigationBarThemeData.fromJson(Map json) => _$ThreeDSecureNavigationBarThemeDataFromJson(json); + +/// Localised text of the header. +@override final String? headerText; +/// localised text of the button +@override final String? buttonText; +/// Color in hex to display navigation bar header text. +@override final String? textColor; +/// Color in hex for the status bar. +@override final String? statusBarColor; +/// Color in hex to display navigation bar background. +@override final String? backgroundColor; +/// Font size of header text. +@override final double? textFontSize; + +/// Create a copy of ThreeDSecureNavigationBarThemeData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThreeDSecureNavigationBarThemeDataCopyWith<_ThreeDSecureNavigationBarThemeData> get copyWith => __$ThreeDSecureNavigationBarThemeDataCopyWithImpl<_ThreeDSecureNavigationBarThemeData>(this, _$identity); + +@override +Map toJson() { + return _$ThreeDSecureNavigationBarThemeDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, headerText, buttonText, - textColor, statusBarColor, backgroundColor, textFontSize); - - /// Create a copy of ThreeDSecureNavigationBarThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ThreeDSecureNavigationBarThemeDataImplCopyWith< - _$ThreeDSecureNavigationBarThemeDataImpl> - get copyWith => __$$ThreeDSecureNavigationBarThemeDataImplCopyWithImpl< - _$ThreeDSecureNavigationBarThemeDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ThreeDSecureNavigationBarThemeDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThreeDSecureNavigationBarThemeData&&(identical(other.headerText, headerText) || other.headerText == headerText)&&(identical(other.buttonText, buttonText) || other.buttonText == buttonText)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.statusBarColor, statusBarColor) || other.statusBarColor == statusBarColor)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)); } -abstract class _ThreeDSecureNavigationBarThemeData - implements ThreeDSecureNavigationBarThemeData { - const factory _ThreeDSecureNavigationBarThemeData( - {final String? headerText, - final String? buttonText, - final String? textColor, - final String? statusBarColor, - final String? backgroundColor, - final double? textFontSize}) = _$ThreeDSecureNavigationBarThemeDataImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,headerText,buttonText,textColor,statusBarColor,backgroundColor,textFontSize); - factory _ThreeDSecureNavigationBarThemeData.fromJson( - Map json) = - _$ThreeDSecureNavigationBarThemeDataImpl.fromJson; +@override +String toString() { + return 'ThreeDSecureNavigationBarThemeData(headerText: $headerText, buttonText: $buttonText, textColor: $textColor, statusBarColor: $statusBarColor, backgroundColor: $backgroundColor, textFontSize: $textFontSize)'; +} - /// Localised text of the header. - @override - String? get headerText; - /// localised text of the button - @override - String? get buttonText; +} - /// Color in hex to display navigation bar header text. - @override - String? get textColor; +/// @nodoc +abstract mixin class _$ThreeDSecureNavigationBarThemeDataCopyWith<$Res> implements $ThreeDSecureNavigationBarThemeDataCopyWith<$Res> { + factory _$ThreeDSecureNavigationBarThemeDataCopyWith(_ThreeDSecureNavigationBarThemeData value, $Res Function(_ThreeDSecureNavigationBarThemeData) _then) = __$ThreeDSecureNavigationBarThemeDataCopyWithImpl; +@override @useResult +$Res call({ + String? headerText, String? buttonText, String? textColor, String? statusBarColor, String? backgroundColor, double? textFontSize +}); - /// Color in hex for the status bar. - @override - String? get statusBarColor; - /// Color in hex to display navigation bar background. - @override - String? get backgroundColor; - /// Font size of header text. - @override - double? get textFontSize; - /// Create a copy of ThreeDSecureNavigationBarThemeData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ThreeDSecureNavigationBarThemeDataImplCopyWith< - _$ThreeDSecureNavigationBarThemeDataImpl> - get copyWith => throw _privateConstructorUsedError; +} +/// @nodoc +class __$ThreeDSecureNavigationBarThemeDataCopyWithImpl<$Res> + implements _$ThreeDSecureNavigationBarThemeDataCopyWith<$Res> { + __$ThreeDSecureNavigationBarThemeDataCopyWithImpl(this._self, this._then); + + final _ThreeDSecureNavigationBarThemeData _self; + final $Res Function(_ThreeDSecureNavigationBarThemeData) _then; + +/// Create a copy of ThreeDSecureNavigationBarThemeData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? headerText = freezed,Object? buttonText = freezed,Object? textColor = freezed,Object? statusBarColor = freezed,Object? backgroundColor = freezed,Object? textFontSize = freezed,}) { + return _then(_ThreeDSecureNavigationBarThemeData( +headerText: freezed == headerText ? _self.headerText : headerText // ignore: cast_nullable_to_non_nullable +as String?,buttonText: freezed == buttonText ? _self.buttonText : buttonText // ignore: cast_nullable_to_non_nullable +as String?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,statusBarColor: freezed == statusBarColor ? _self.statusBarColor : statusBarColor // ignore: cast_nullable_to_non_nullable +as String?,backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); } -ThreeDSecureLabelThemeData _$ThreeDSecureLabelThemeDataFromJson( - Map json) { - return _ThreeDSecureLabelThemeData.fromJson(json); + } + /// @nodoc mixin _$ThreeDSecureLabelThemeData { - /// Color in hex for header text. - String? get headingTextColor => throw _privateConstructorUsedError; - /// Color in hex for label text. - String? get textColor => throw _privateConstructorUsedError; - - /// Font size for label text. - double? get textFontSize => - throw _privateConstructorUsedError; // Font size for header. - double? get headingFontSize => throw _privateConstructorUsedError; +/// Color in hex for header text. + String? get headingTextColor;/// Color in hex for label text. + String? get textColor;/// Font size for label text. + double? get textFontSize;// Font size for header. + double? get headingFontSize; +/// Create a copy of ThreeDSecureLabelThemeData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThreeDSecureLabelThemeDataCopyWith get copyWith => _$ThreeDSecureLabelThemeDataCopyWithImpl(this as ThreeDSecureLabelThemeData, _$identity); /// Serializes this ThreeDSecureLabelThemeData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of ThreeDSecureLabelThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ThreeDSecureLabelThemeDataCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThreeDSecureLabelThemeData&&(identical(other.headingTextColor, headingTextColor) || other.headingTextColor == headingTextColor)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)&&(identical(other.headingFontSize, headingFontSize) || other.headingFontSize == headingFontSize)); } -/// @nodoc -abstract class $ThreeDSecureLabelThemeDataCopyWith<$Res> { - factory $ThreeDSecureLabelThemeDataCopyWith(ThreeDSecureLabelThemeData value, - $Res Function(ThreeDSecureLabelThemeData) then) = - _$ThreeDSecureLabelThemeDataCopyWithImpl<$Res, - ThreeDSecureLabelThemeData>; - @useResult - $Res call( - {String? headingTextColor, - String? textColor, - double? textFontSize, - double? headingFontSize}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,headingTextColor,textColor,textFontSize,headingFontSize); + +@override +String toString() { + return 'ThreeDSecureLabelThemeData(headingTextColor: $headingTextColor, textColor: $textColor, textFontSize: $textFontSize, headingFontSize: $headingFontSize)'; } -/// @nodoc -class _$ThreeDSecureLabelThemeDataCopyWithImpl<$Res, - $Val extends ThreeDSecureLabelThemeData> - implements $ThreeDSecureLabelThemeDataCopyWith<$Res> { - _$ThreeDSecureLabelThemeDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ThreeDSecureLabelThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? headingTextColor = freezed, - Object? textColor = freezed, - Object? textFontSize = freezed, - Object? headingFontSize = freezed, - }) { - return _then(_value.copyWith( - headingTextColor: freezed == headingTextColor - ? _value.headingTextColor - : headingTextColor // ignore: cast_nullable_to_non_nullable - as String?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - headingFontSize: freezed == headingFontSize - ? _value.headingFontSize - : headingFontSize // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); - } + } /// @nodoc -abstract class _$$ThreeDSecureLabelThemeDataImplCopyWith<$Res> +abstract mixin class $ThreeDSecureLabelThemeDataCopyWith<$Res> { + factory $ThreeDSecureLabelThemeDataCopyWith(ThreeDSecureLabelThemeData value, $Res Function(ThreeDSecureLabelThemeData) _then) = _$ThreeDSecureLabelThemeDataCopyWithImpl; +@useResult +$Res call({ + String? headingTextColor, String? textColor, double? textFontSize, double? headingFontSize +}); + + + + +} +/// @nodoc +class _$ThreeDSecureLabelThemeDataCopyWithImpl<$Res> implements $ThreeDSecureLabelThemeDataCopyWith<$Res> { - factory _$$ThreeDSecureLabelThemeDataImplCopyWith( - _$ThreeDSecureLabelThemeDataImpl value, - $Res Function(_$ThreeDSecureLabelThemeDataImpl) then) = - __$$ThreeDSecureLabelThemeDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? headingTextColor, - String? textColor, - double? textFontSize, - double? headingFontSize}); + _$ThreeDSecureLabelThemeDataCopyWithImpl(this._self, this._then); + + final ThreeDSecureLabelThemeData _self; + final $Res Function(ThreeDSecureLabelThemeData) _then; + +/// Create a copy of ThreeDSecureLabelThemeData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? headingTextColor = freezed,Object? textColor = freezed,Object? textFontSize = freezed,Object? headingFontSize = freezed,}) { + return _then(_self.copyWith( +headingTextColor: freezed == headingTextColor ? _self.headingTextColor : headingTextColor // ignore: cast_nullable_to_non_nullable +as String?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?,headingFontSize: freezed == headingFontSize ? _self.headingFontSize : headingFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ThreeDSecureLabelThemeData]. +extension ThreeDSecureLabelThemeDataPatterns on ThreeDSecureLabelThemeData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ThreeDSecureLabelThemeData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThreeDSecureLabelThemeData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ThreeDSecureLabelThemeData value) $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureLabelThemeData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ThreeDSecureLabelThemeData value)? $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureLabelThemeData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? headingTextColor, String? textColor, double? textFontSize, double? headingFontSize)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThreeDSecureLabelThemeData() when $default != null: +return $default(_that.headingTextColor,_that.textColor,_that.textFontSize,_that.headingFontSize);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? headingTextColor, String? textColor, double? textFontSize, double? headingFontSize) $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureLabelThemeData(): +return $default(_that.headingTextColor,_that.textColor,_that.textFontSize,_that.headingFontSize);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? headingTextColor, String? textColor, double? textFontSize, double? headingFontSize)? $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureLabelThemeData() when $default != null: +return $default(_that.headingTextColor,_that.textColor,_that.textFontSize,_that.headingFontSize);case _: + return null; + +} } -/// @nodoc -class __$$ThreeDSecureLabelThemeDataImplCopyWithImpl<$Res> - extends _$ThreeDSecureLabelThemeDataCopyWithImpl<$Res, - _$ThreeDSecureLabelThemeDataImpl> - implements _$$ThreeDSecureLabelThemeDataImplCopyWith<$Res> { - __$$ThreeDSecureLabelThemeDataImplCopyWithImpl( - _$ThreeDSecureLabelThemeDataImpl _value, - $Res Function(_$ThreeDSecureLabelThemeDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ThreeDSecureLabelThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? headingTextColor = freezed, - Object? textColor = freezed, - Object? textFontSize = freezed, - Object? headingFontSize = freezed, - }) { - return _then(_$ThreeDSecureLabelThemeDataImpl( - headingTextColor: freezed == headingTextColor - ? _value.headingTextColor - : headingTextColor // ignore: cast_nullable_to_non_nullable - as String?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - headingFontSize: freezed == headingFontSize - ? _value.headingFontSize - : headingFontSize // ignore: cast_nullable_to_non_nullable - as double?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ThreeDSecureLabelThemeDataImpl implements _ThreeDSecureLabelThemeData { - const _$ThreeDSecureLabelThemeDataImpl( - {this.headingTextColor, - this.textColor, - this.textFontSize, - this.headingFontSize}); - - factory _$ThreeDSecureLabelThemeDataImpl.fromJson( - Map json) => - _$$ThreeDSecureLabelThemeDataImplFromJson(json); - - /// Color in hex for header text. - @override - final String? headingTextColor; - - /// Color in hex for label text. - @override - final String? textColor; - - /// Font size for label text. - @override - final double? textFontSize; +class _ThreeDSecureLabelThemeData implements ThreeDSecureLabelThemeData { + const _ThreeDSecureLabelThemeData({this.headingTextColor, this.textColor, this.textFontSize, this.headingFontSize}); + factory _ThreeDSecureLabelThemeData.fromJson(Map json) => _$ThreeDSecureLabelThemeDataFromJson(json); + +/// Color in hex for header text. +@override final String? headingTextColor; +/// Color in hex for label text. +@override final String? textColor; +/// Font size for label text. +@override final double? textFontSize; // Font size for header. - @override - final double? headingFontSize; +@override final double? headingFontSize; - @override - String toString() { - return 'ThreeDSecureLabelThemeData(headingTextColor: $headingTextColor, textColor: $textColor, textFontSize: $textFontSize, headingFontSize: $headingFontSize)'; - } +/// Create a copy of ThreeDSecureLabelThemeData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThreeDSecureLabelThemeDataCopyWith<_ThreeDSecureLabelThemeData> get copyWith => __$ThreeDSecureLabelThemeDataCopyWithImpl<_ThreeDSecureLabelThemeData>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ThreeDSecureLabelThemeDataImpl && - (identical(other.headingTextColor, headingTextColor) || - other.headingTextColor == headingTextColor) && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.textFontSize, textFontSize) || - other.textFontSize == textFontSize) && - (identical(other.headingFontSize, headingFontSize) || - other.headingFontSize == headingFontSize)); - } +@override +Map toJson() { + return _$ThreeDSecureLabelThemeDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, headingTextColor, textColor, textFontSize, headingFontSize); - - /// Create a copy of ThreeDSecureLabelThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ThreeDSecureLabelThemeDataImplCopyWith<_$ThreeDSecureLabelThemeDataImpl> - get copyWith => __$$ThreeDSecureLabelThemeDataImplCopyWithImpl< - _$ThreeDSecureLabelThemeDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ThreeDSecureLabelThemeDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThreeDSecureLabelThemeData&&(identical(other.headingTextColor, headingTextColor) || other.headingTextColor == headingTextColor)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)&&(identical(other.headingFontSize, headingFontSize) || other.headingFontSize == headingFontSize)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,headingTextColor,textColor,textFontSize,headingFontSize); + +@override +String toString() { + return 'ThreeDSecureLabelThemeData(headingTextColor: $headingTextColor, textColor: $textColor, textFontSize: $textFontSize, headingFontSize: $headingFontSize)'; } -abstract class _ThreeDSecureLabelThemeData - implements ThreeDSecureLabelThemeData { - const factory _ThreeDSecureLabelThemeData( - {final String? headingTextColor, - final String? textColor, - final double? textFontSize, - final double? headingFontSize}) = _$ThreeDSecureLabelThemeDataImpl; - factory _ThreeDSecureLabelThemeData.fromJson(Map json) = - _$ThreeDSecureLabelThemeDataImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$ThreeDSecureLabelThemeDataCopyWith<$Res> implements $ThreeDSecureLabelThemeDataCopyWith<$Res> { + factory _$ThreeDSecureLabelThemeDataCopyWith(_ThreeDSecureLabelThemeData value, $Res Function(_ThreeDSecureLabelThemeData) _then) = __$ThreeDSecureLabelThemeDataCopyWithImpl; +@override @useResult +$Res call({ + String? headingTextColor, String? textColor, double? textFontSize, double? headingFontSize +}); - /// Color in hex for header text. - @override - String? get headingTextColor; - /// Color in hex for label text. - @override - String? get textColor; - /// Font size for label text. - @override - double? get textFontSize; // Font size for header. - @override - double? get headingFontSize; - /// Create a copy of ThreeDSecureLabelThemeData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ThreeDSecureLabelThemeDataImplCopyWith<_$ThreeDSecureLabelThemeDataImpl> - get copyWith => throw _privateConstructorUsedError; } +/// @nodoc +class __$ThreeDSecureLabelThemeDataCopyWithImpl<$Res> + implements _$ThreeDSecureLabelThemeDataCopyWith<$Res> { + __$ThreeDSecureLabelThemeDataCopyWithImpl(this._self, this._then); + + final _ThreeDSecureLabelThemeData _self; + final $Res Function(_ThreeDSecureLabelThemeData) _then; + +/// Create a copy of ThreeDSecureLabelThemeData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? headingTextColor = freezed,Object? textColor = freezed,Object? textFontSize = freezed,Object? headingFontSize = freezed,}) { + return _then(_ThreeDSecureLabelThemeData( +headingTextColor: freezed == headingTextColor ? _self.headingTextColor : headingTextColor // ignore: cast_nullable_to_non_nullable +as String?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?,headingFontSize: freezed == headingFontSize ? _self.headingFontSize : headingFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + -ThreeDSecureTextFieldThemeData _$ThreeDSecureTextFieldThemeDataFromJson( - Map json) { - return _ThreeDSecureTextFieldThemeData.fromJson(json); } + /// @nodoc mixin _$ThreeDSecureTextFieldThemeData { - /// Color in hex for the border - String? get borderColor => throw _privateConstructorUsedError; - /// Thickness of the textfield border. - double? get borderWidth => throw _privateConstructorUsedError; +/// Color in hex for the border + String? get borderColor;/// Thickness of the textfield border. + double? get borderWidth;/// Radius for the textfield corners. + double? get cornerRadius;/// Color in hex for the textfield value. + String? get textColor;/// Font size for the textfield text. + double? get textFontSize; +/// Create a copy of ThreeDSecureTextFieldThemeData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThreeDSecureTextFieldThemeDataCopyWith get copyWith => _$ThreeDSecureTextFieldThemeDataCopyWithImpl(this as ThreeDSecureTextFieldThemeData, _$identity); - /// Radius for the textfield corners. - double? get cornerRadius => throw _privateConstructorUsedError; + /// Serializes this ThreeDSecureTextFieldThemeData to a JSON map. + Map toJson(); - /// Color in hex for the textfield value. - String? get textColor => throw _privateConstructorUsedError; - /// Font size for the textfield text. - double? get textFontSize => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThreeDSecureTextFieldThemeData&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.cornerRadius, cornerRadius) || other.cornerRadius == cornerRadius)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)); +} - /// Serializes this ThreeDSecureTextFieldThemeData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,borderColor,borderWidth,cornerRadius,textColor,textFontSize); - /// Create a copy of ThreeDSecureTextFieldThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ThreeDSecureTextFieldThemeDataCopyWith - get copyWith => throw _privateConstructorUsedError; +@override +String toString() { + return 'ThreeDSecureTextFieldThemeData(borderColor: $borderColor, borderWidth: $borderWidth, cornerRadius: $cornerRadius, textColor: $textColor, textFontSize: $textFontSize)'; } -/// @nodoc -abstract class $ThreeDSecureTextFieldThemeDataCopyWith<$Res> { - factory $ThreeDSecureTextFieldThemeDataCopyWith( - ThreeDSecureTextFieldThemeData value, - $Res Function(ThreeDSecureTextFieldThemeData) then) = - _$ThreeDSecureTextFieldThemeDataCopyWithImpl<$Res, - ThreeDSecureTextFieldThemeData>; - @useResult - $Res call( - {String? borderColor, - double? borderWidth, - double? cornerRadius, - String? textColor, - double? textFontSize}); + } /// @nodoc -class _$ThreeDSecureTextFieldThemeDataCopyWithImpl<$Res, - $Val extends ThreeDSecureTextFieldThemeData> - implements $ThreeDSecureTextFieldThemeDataCopyWith<$Res> { - _$ThreeDSecureTextFieldThemeDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ThreeDSecureTextFieldThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? borderColor = freezed, - Object? borderWidth = freezed, - Object? cornerRadius = freezed, - Object? textColor = freezed, - Object? textFontSize = freezed, - }) { - return _then(_value.copyWith( - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as String?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as double?, - cornerRadius: freezed == cornerRadius - ? _value.cornerRadius - : cornerRadius // ignore: cast_nullable_to_non_nullable - as double?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); - } -} +abstract mixin class $ThreeDSecureTextFieldThemeDataCopyWith<$Res> { + factory $ThreeDSecureTextFieldThemeDataCopyWith(ThreeDSecureTextFieldThemeData value, $Res Function(ThreeDSecureTextFieldThemeData) _then) = _$ThreeDSecureTextFieldThemeDataCopyWithImpl; +@useResult +$Res call({ + String? borderColor, double? borderWidth, double? cornerRadius, String? textColor, double? textFontSize +}); + + + +} /// @nodoc -abstract class _$$ThreeDSecureTextFieldThemeDataImplCopyWith<$Res> +class _$ThreeDSecureTextFieldThemeDataCopyWithImpl<$Res> implements $ThreeDSecureTextFieldThemeDataCopyWith<$Res> { - factory _$$ThreeDSecureTextFieldThemeDataImplCopyWith( - _$ThreeDSecureTextFieldThemeDataImpl value, - $Res Function(_$ThreeDSecureTextFieldThemeDataImpl) then) = - __$$ThreeDSecureTextFieldThemeDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? borderColor, - double? borderWidth, - double? cornerRadius, - String? textColor, - double? textFontSize}); + _$ThreeDSecureTextFieldThemeDataCopyWithImpl(this._self, this._then); + + final ThreeDSecureTextFieldThemeData _self; + final $Res Function(ThreeDSecureTextFieldThemeData) _then; + +/// Create a copy of ThreeDSecureTextFieldThemeData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? borderColor = freezed,Object? borderWidth = freezed,Object? cornerRadius = freezed,Object? textColor = freezed,Object? textFontSize = freezed,}) { + return _then(_self.copyWith( +borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as String?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as double?,cornerRadius: freezed == cornerRadius ? _self.cornerRadius : cornerRadius // ignore: cast_nullable_to_non_nullable +as double?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ThreeDSecureTextFieldThemeData]. +extension ThreeDSecureTextFieldThemeDataPatterns on ThreeDSecureTextFieldThemeData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ThreeDSecureTextFieldThemeData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThreeDSecureTextFieldThemeData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ThreeDSecureTextFieldThemeData value) $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureTextFieldThemeData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ThreeDSecureTextFieldThemeData value)? $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureTextFieldThemeData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? borderColor, double? borderWidth, double? cornerRadius, String? textColor, double? textFontSize)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThreeDSecureTextFieldThemeData() when $default != null: +return $default(_that.borderColor,_that.borderWidth,_that.cornerRadius,_that.textColor,_that.textFontSize);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? borderColor, double? borderWidth, double? cornerRadius, String? textColor, double? textFontSize) $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureTextFieldThemeData(): +return $default(_that.borderColor,_that.borderWidth,_that.cornerRadius,_that.textColor,_that.textFontSize);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? borderColor, double? borderWidth, double? cornerRadius, String? textColor, double? textFontSize)? $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureTextFieldThemeData() when $default != null: +return $default(_that.borderColor,_that.borderWidth,_that.cornerRadius,_that.textColor,_that.textFontSize);case _: + return null; + +} } -/// @nodoc -class __$$ThreeDSecureTextFieldThemeDataImplCopyWithImpl<$Res> - extends _$ThreeDSecureTextFieldThemeDataCopyWithImpl<$Res, - _$ThreeDSecureTextFieldThemeDataImpl> - implements _$$ThreeDSecureTextFieldThemeDataImplCopyWith<$Res> { - __$$ThreeDSecureTextFieldThemeDataImplCopyWithImpl( - _$ThreeDSecureTextFieldThemeDataImpl _value, - $Res Function(_$ThreeDSecureTextFieldThemeDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ThreeDSecureTextFieldThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? borderColor = freezed, - Object? borderWidth = freezed, - Object? cornerRadius = freezed, - Object? textColor = freezed, - Object? textFontSize = freezed, - }) { - return _then(_$ThreeDSecureTextFieldThemeDataImpl( - borderColor: freezed == borderColor - ? _value.borderColor - : borderColor // ignore: cast_nullable_to_non_nullable - as String?, - borderWidth: freezed == borderWidth - ? _value.borderWidth - : borderWidth // ignore: cast_nullable_to_non_nullable - as double?, - cornerRadius: freezed == cornerRadius - ? _value.cornerRadius - : cornerRadius // ignore: cast_nullable_to_non_nullable - as double?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ThreeDSecureTextFieldThemeDataImpl - implements _ThreeDSecureTextFieldThemeData { - const _$ThreeDSecureTextFieldThemeDataImpl( - {this.borderColor, - this.borderWidth, - this.cornerRadius, - this.textColor, - this.textFontSize}); - - factory _$ThreeDSecureTextFieldThemeDataImpl.fromJson( - Map json) => - _$$ThreeDSecureTextFieldThemeDataImplFromJson(json); - - /// Color in hex for the border - @override - final String? borderColor; - - /// Thickness of the textfield border. - @override - final double? borderWidth; - - /// Radius for the textfield corners. - @override - final double? cornerRadius; - - /// Color in hex for the textfield value. - @override - final String? textColor; - - /// Font size for the textfield text. - @override - final double? textFontSize; - - @override - String toString() { - return 'ThreeDSecureTextFieldThemeData(borderColor: $borderColor, borderWidth: $borderWidth, cornerRadius: $cornerRadius, textColor: $textColor, textFontSize: $textFontSize)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ThreeDSecureTextFieldThemeDataImpl && - (identical(other.borderColor, borderColor) || - other.borderColor == borderColor) && - (identical(other.borderWidth, borderWidth) || - other.borderWidth == borderWidth) && - (identical(other.cornerRadius, cornerRadius) || - other.cornerRadius == cornerRadius) && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.textFontSize, textFontSize) || - other.textFontSize == textFontSize)); - } +class _ThreeDSecureTextFieldThemeData implements ThreeDSecureTextFieldThemeData { + const _ThreeDSecureTextFieldThemeData({this.borderColor, this.borderWidth, this.cornerRadius, this.textColor, this.textFontSize}); + factory _ThreeDSecureTextFieldThemeData.fromJson(Map json) => _$ThreeDSecureTextFieldThemeDataFromJson(json); + +/// Color in hex for the border +@override final String? borderColor; +/// Thickness of the textfield border. +@override final double? borderWidth; +/// Radius for the textfield corners. +@override final double? cornerRadius; +/// Color in hex for the textfield value. +@override final String? textColor; +/// Font size for the textfield text. +@override final double? textFontSize; + +/// Create a copy of ThreeDSecureTextFieldThemeData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThreeDSecureTextFieldThemeDataCopyWith<_ThreeDSecureTextFieldThemeData> get copyWith => __$ThreeDSecureTextFieldThemeDataCopyWithImpl<_ThreeDSecureTextFieldThemeData>(this, _$identity); + +@override +Map toJson() { + return _$ThreeDSecureTextFieldThemeDataToJson(this, ); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, borderColor, borderWidth, - cornerRadius, textColor, textFontSize); - - /// Create a copy of ThreeDSecureTextFieldThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ThreeDSecureTextFieldThemeDataImplCopyWith< - _$ThreeDSecureTextFieldThemeDataImpl> - get copyWith => __$$ThreeDSecureTextFieldThemeDataImplCopyWithImpl< - _$ThreeDSecureTextFieldThemeDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ThreeDSecureTextFieldThemeDataImplToJson( - this, - ); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThreeDSecureTextFieldThemeData&&(identical(other.borderColor, borderColor) || other.borderColor == borderColor)&&(identical(other.borderWidth, borderWidth) || other.borderWidth == borderWidth)&&(identical(other.cornerRadius, cornerRadius) || other.cornerRadius == cornerRadius)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)); } -abstract class _ThreeDSecureTextFieldThemeData - implements ThreeDSecureTextFieldThemeData { - const factory _ThreeDSecureTextFieldThemeData( - {final String? borderColor, - final double? borderWidth, - final double? cornerRadius, - final String? textColor, - final double? textFontSize}) = _$ThreeDSecureTextFieldThemeDataImpl; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,borderColor,borderWidth,cornerRadius,textColor,textFontSize); - factory _ThreeDSecureTextFieldThemeData.fromJson(Map json) = - _$ThreeDSecureTextFieldThemeDataImpl.fromJson; +@override +String toString() { + return 'ThreeDSecureTextFieldThemeData(borderColor: $borderColor, borderWidth: $borderWidth, cornerRadius: $cornerRadius, textColor: $textColor, textFontSize: $textFontSize)'; +} - /// Color in hex for the border - @override - String? get borderColor; - /// Thickness of the textfield border. - @override - double? get borderWidth; +} - /// Radius for the textfield corners. - @override - double? get cornerRadius; +/// @nodoc +abstract mixin class _$ThreeDSecureTextFieldThemeDataCopyWith<$Res> implements $ThreeDSecureTextFieldThemeDataCopyWith<$Res> { + factory _$ThreeDSecureTextFieldThemeDataCopyWith(_ThreeDSecureTextFieldThemeData value, $Res Function(_ThreeDSecureTextFieldThemeData) _then) = __$ThreeDSecureTextFieldThemeDataCopyWithImpl; +@override @useResult +$Res call({ + String? borderColor, double? borderWidth, double? cornerRadius, String? textColor, double? textFontSize +}); - /// Color in hex for the textfield value. - @override - String? get textColor; - /// Font size for the textfield text. - @override - double? get textFontSize; - /// Create a copy of ThreeDSecureTextFieldThemeData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ThreeDSecureTextFieldThemeDataImplCopyWith< - _$ThreeDSecureTextFieldThemeDataImpl> - get copyWith => throw _privateConstructorUsedError; + +} +/// @nodoc +class __$ThreeDSecureTextFieldThemeDataCopyWithImpl<$Res> + implements _$ThreeDSecureTextFieldThemeDataCopyWith<$Res> { + __$ThreeDSecureTextFieldThemeDataCopyWithImpl(this._self, this._then); + + final _ThreeDSecureTextFieldThemeData _self; + final $Res Function(_ThreeDSecureTextFieldThemeData) _then; + +/// Create a copy of ThreeDSecureTextFieldThemeData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? borderColor = freezed,Object? borderWidth = freezed,Object? cornerRadius = freezed,Object? textColor = freezed,Object? textFontSize = freezed,}) { + return _then(_ThreeDSecureTextFieldThemeData( +borderColor: freezed == borderColor ? _self.borderColor : borderColor // ignore: cast_nullable_to_non_nullable +as String?,borderWidth: freezed == borderWidth ? _self.borderWidth : borderWidth // ignore: cast_nullable_to_non_nullable +as double?,cornerRadius: freezed == cornerRadius ? _self.cornerRadius : cornerRadius // ignore: cast_nullable_to_non_nullable +as double?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); } -ThreeDSecureButtonThemeData _$ThreeDSecureButtonThemeDataFromJson( - Map json) { - return _ThreeDSecureButtonThemeData.fromJson(json); + } + /// @nodoc mixin _$ThreeDSecureButtonThemeData { - /// Color in hex for button background - String? get backgroundColor => throw _privateConstructorUsedError; - /// Button corner radius. - double? get cornerRadius => throw _privateConstructorUsedError; +/// Color in hex for button background + String? get backgroundColor;/// Button corner radius. + double? get cornerRadius;/// Color in hex for button text. + String? get textColor;/// Font size for the button text. + double? get textFontSize; +/// Create a copy of ThreeDSecureButtonThemeData +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThreeDSecureButtonThemeDataCopyWith get copyWith => _$ThreeDSecureButtonThemeDataCopyWithImpl(this as ThreeDSecureButtonThemeData, _$identity); - /// Color in hex for button text. - String? get textColor => throw _privateConstructorUsedError; + /// Serializes this ThreeDSecureButtonThemeData to a JSON map. + Map toJson(); - /// Font size for the button text. - double? get textFontSize => throw _privateConstructorUsedError; - /// Serializes this ThreeDSecureButtonThemeData to a JSON map. - Map toJson() => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThreeDSecureButtonThemeData&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.cornerRadius, cornerRadius) || other.cornerRadius == cornerRadius)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)); +} - /// Create a copy of ThreeDSecureButtonThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ThreeDSecureButtonThemeDataCopyWith - get copyWith => throw _privateConstructorUsedError; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,backgroundColor,cornerRadius,textColor,textFontSize); + +@override +String toString() { + return 'ThreeDSecureButtonThemeData(backgroundColor: $backgroundColor, cornerRadius: $cornerRadius, textColor: $textColor, textFontSize: $textFontSize)'; } -/// @nodoc -abstract class $ThreeDSecureButtonThemeDataCopyWith<$Res> { - factory $ThreeDSecureButtonThemeDataCopyWith( - ThreeDSecureButtonThemeData value, - $Res Function(ThreeDSecureButtonThemeData) then) = - _$ThreeDSecureButtonThemeDataCopyWithImpl<$Res, - ThreeDSecureButtonThemeData>; - @useResult - $Res call( - {String? backgroundColor, - double? cornerRadius, - String? textColor, - double? textFontSize}); + } /// @nodoc -class _$ThreeDSecureButtonThemeDataCopyWithImpl<$Res, - $Val extends ThreeDSecureButtonThemeData> - implements $ThreeDSecureButtonThemeDataCopyWith<$Res> { - _$ThreeDSecureButtonThemeDataCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ThreeDSecureButtonThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? backgroundColor = freezed, - Object? cornerRadius = freezed, - Object? textColor = freezed, - Object? textFontSize = freezed, - }) { - return _then(_value.copyWith( - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as String?, - cornerRadius: freezed == cornerRadius - ? _value.cornerRadius - : cornerRadius // ignore: cast_nullable_to_non_nullable - as double?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); - } -} +abstract mixin class $ThreeDSecureButtonThemeDataCopyWith<$Res> { + factory $ThreeDSecureButtonThemeDataCopyWith(ThreeDSecureButtonThemeData value, $Res Function(ThreeDSecureButtonThemeData) _then) = _$ThreeDSecureButtonThemeDataCopyWithImpl; +@useResult +$Res call({ + String? backgroundColor, double? cornerRadius, String? textColor, double? textFontSize +}); + + + +} /// @nodoc -abstract class _$$ThreeDSecureButtonThemeDataImplCopyWith<$Res> +class _$ThreeDSecureButtonThemeDataCopyWithImpl<$Res> implements $ThreeDSecureButtonThemeDataCopyWith<$Res> { - factory _$$ThreeDSecureButtonThemeDataImplCopyWith( - _$ThreeDSecureButtonThemeDataImpl value, - $Res Function(_$ThreeDSecureButtonThemeDataImpl) then) = - __$$ThreeDSecureButtonThemeDataImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {String? backgroundColor, - double? cornerRadius, - String? textColor, - double? textFontSize}); + _$ThreeDSecureButtonThemeDataCopyWithImpl(this._self, this._then); + + final ThreeDSecureButtonThemeData _self; + final $Res Function(ThreeDSecureButtonThemeData) _then; + +/// Create a copy of ThreeDSecureButtonThemeData +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? backgroundColor = freezed,Object? cornerRadius = freezed,Object? textColor = freezed,Object? textFontSize = freezed,}) { + return _then(_self.copyWith( +backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as String?,cornerRadius: freezed == cornerRadius ? _self.cornerRadius : cornerRadius // ignore: cast_nullable_to_non_nullable +as double?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ThreeDSecureButtonThemeData]. +extension ThreeDSecureButtonThemeDataPatterns on ThreeDSecureButtonThemeData { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ThreeDSecureButtonThemeData value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThreeDSecureButtonThemeData() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ThreeDSecureButtonThemeData value) $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureButtonThemeData(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ThreeDSecureButtonThemeData value)? $default,){ +final _that = this; +switch (_that) { +case _ThreeDSecureButtonThemeData() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( String? backgroundColor, double? cornerRadius, String? textColor, double? textFontSize)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThreeDSecureButtonThemeData() when $default != null: +return $default(_that.backgroundColor,_that.cornerRadius,_that.textColor,_that.textFontSize);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( String? backgroundColor, double? cornerRadius, String? textColor, double? textFontSize) $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureButtonThemeData(): +return $default(_that.backgroundColor,_that.cornerRadius,_that.textColor,_that.textFontSize);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? backgroundColor, double? cornerRadius, String? textColor, double? textFontSize)? $default,) {final _that = this; +switch (_that) { +case _ThreeDSecureButtonThemeData() when $default != null: +return $default(_that.backgroundColor,_that.cornerRadius,_that.textColor,_that.textFontSize);case _: + return null; + +} } -/// @nodoc -class __$$ThreeDSecureButtonThemeDataImplCopyWithImpl<$Res> - extends _$ThreeDSecureButtonThemeDataCopyWithImpl<$Res, - _$ThreeDSecureButtonThemeDataImpl> - implements _$$ThreeDSecureButtonThemeDataImplCopyWith<$Res> { - __$$ThreeDSecureButtonThemeDataImplCopyWithImpl( - _$ThreeDSecureButtonThemeDataImpl _value, - $Res Function(_$ThreeDSecureButtonThemeDataImpl) _then) - : super(_value, _then); - - /// Create a copy of ThreeDSecureButtonThemeData - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? backgroundColor = freezed, - Object? cornerRadius = freezed, - Object? textColor = freezed, - Object? textFontSize = freezed, - }) { - return _then(_$ThreeDSecureButtonThemeDataImpl( - backgroundColor: freezed == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as String?, - cornerRadius: freezed == cornerRadius - ? _value.cornerRadius - : cornerRadius // ignore: cast_nullable_to_non_nullable - as double?, - textColor: freezed == textColor - ? _value.textColor - : textColor // ignore: cast_nullable_to_non_nullable - as String?, - textFontSize: freezed == textFontSize - ? _value.textFontSize - : textFontSize // ignore: cast_nullable_to_non_nullable - as double?, - )); - } } /// @nodoc @JsonSerializable(explicitToJson: true) -class _$ThreeDSecureButtonThemeDataImpl - implements _ThreeDSecureButtonThemeData { - const _$ThreeDSecureButtonThemeDataImpl( - {this.backgroundColor, - this.cornerRadius, - this.textColor, - this.textFontSize}); - - factory _$ThreeDSecureButtonThemeDataImpl.fromJson( - Map json) => - _$$ThreeDSecureButtonThemeDataImplFromJson(json); - - /// Color in hex for button background - @override - final String? backgroundColor; - - /// Button corner radius. - @override - final double? cornerRadius; - - /// Color in hex for button text. - @override - final String? textColor; - - /// Font size for the button text. - @override - final double? textFontSize; - - @override - String toString() { - return 'ThreeDSecureButtonThemeData(backgroundColor: $backgroundColor, cornerRadius: $cornerRadius, textColor: $textColor, textFontSize: $textFontSize)'; - } +class _ThreeDSecureButtonThemeData implements ThreeDSecureButtonThemeData { + const _ThreeDSecureButtonThemeData({this.backgroundColor, this.cornerRadius, this.textColor, this.textFontSize}); + factory _ThreeDSecureButtonThemeData.fromJson(Map json) => _$ThreeDSecureButtonThemeDataFromJson(json); + +/// Color in hex for button background +@override final String? backgroundColor; +/// Button corner radius. +@override final double? cornerRadius; +/// Color in hex for button text. +@override final String? textColor; +/// Font size for the button text. +@override final double? textFontSize; + +/// Create a copy of ThreeDSecureButtonThemeData +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThreeDSecureButtonThemeDataCopyWith<_ThreeDSecureButtonThemeData> get copyWith => __$ThreeDSecureButtonThemeDataCopyWithImpl<_ThreeDSecureButtonThemeData>(this, _$identity); + +@override +Map toJson() { + return _$ThreeDSecureButtonThemeDataToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ThreeDSecureButtonThemeDataImpl && - (identical(other.backgroundColor, backgroundColor) || - other.backgroundColor == backgroundColor) && - (identical(other.cornerRadius, cornerRadius) || - other.cornerRadius == cornerRadius) && - (identical(other.textColor, textColor) || - other.textColor == textColor) && - (identical(other.textFontSize, textFontSize) || - other.textFontSize == textFontSize)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThreeDSecureButtonThemeData&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.cornerRadius, cornerRadius) || other.cornerRadius == cornerRadius)&&(identical(other.textColor, textColor) || other.textColor == textColor)&&(identical(other.textFontSize, textFontSize) || other.textFontSize == textFontSize)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, backgroundColor, cornerRadius, textColor, textFontSize); - - /// Create a copy of ThreeDSecureButtonThemeData - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ThreeDSecureButtonThemeDataImplCopyWith<_$ThreeDSecureButtonThemeDataImpl> - get copyWith => __$$ThreeDSecureButtonThemeDataImplCopyWithImpl< - _$ThreeDSecureButtonThemeDataImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ThreeDSecureButtonThemeDataImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,backgroundColor,cornerRadius,textColor,textFontSize); + +@override +String toString() { + return 'ThreeDSecureButtonThemeData(backgroundColor: $backgroundColor, cornerRadius: $cornerRadius, textColor: $textColor, textFontSize: $textFontSize)'; } -abstract class _ThreeDSecureButtonThemeData - implements ThreeDSecureButtonThemeData { - const factory _ThreeDSecureButtonThemeData( - {final String? backgroundColor, - final double? cornerRadius, - final String? textColor, - final double? textFontSize}) = _$ThreeDSecureButtonThemeDataImpl; - factory _ThreeDSecureButtonThemeData.fromJson(Map json) = - _$ThreeDSecureButtonThemeDataImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$ThreeDSecureButtonThemeDataCopyWith<$Res> implements $ThreeDSecureButtonThemeDataCopyWith<$Res> { + factory _$ThreeDSecureButtonThemeDataCopyWith(_ThreeDSecureButtonThemeData value, $Res Function(_ThreeDSecureButtonThemeData) _then) = __$ThreeDSecureButtonThemeDataCopyWithImpl; +@override @useResult +$Res call({ + String? backgroundColor, double? cornerRadius, String? textColor, double? textFontSize +}); + - /// Color in hex for button background - @override - String? get backgroundColor; - /// Button corner radius. - @override - double? get cornerRadius; - /// Color in hex for button text. - @override - String? get textColor; +} +/// @nodoc +class __$ThreeDSecureButtonThemeDataCopyWithImpl<$Res> + implements _$ThreeDSecureButtonThemeDataCopyWith<$Res> { + __$ThreeDSecureButtonThemeDataCopyWithImpl(this._self, this._then); + + final _ThreeDSecureButtonThemeData _self; + final $Res Function(_ThreeDSecureButtonThemeData) _then; + +/// Create a copy of ThreeDSecureButtonThemeData +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? backgroundColor = freezed,Object? cornerRadius = freezed,Object? textColor = freezed,Object? textFontSize = freezed,}) { + return _then(_ThreeDSecureButtonThemeData( +backgroundColor: freezed == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable +as String?,cornerRadius: freezed == cornerRadius ? _self.cornerRadius : cornerRadius // ignore: cast_nullable_to_non_nullable +as double?,textColor: freezed == textColor ? _self.textColor : textColor // ignore: cast_nullable_to_non_nullable +as String?,textFontSize: freezed == textFontSize ? _self.textFontSize : textFontSize // ignore: cast_nullable_to_non_nullable +as double?, + )); +} - /// Font size for the button text. - @override - double? get textFontSize; - /// Create a copy of ThreeDSecureButtonThemeData - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ThreeDSecureButtonThemeDataImplCopyWith<_$ThreeDSecureButtonThemeDataImpl> - get copyWith => throw _privateConstructorUsedError; } + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/three_d_secure.g.dart b/packages/stripe_platform_interface/lib/src/models/three_d_secure.g.dart index 685fd0e80..3d82e7997 100644 --- a/packages/stripe_platform_interface/lib/src/models/three_d_secure.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/three_d_secure.g.dart @@ -6,131 +6,138 @@ part of 'three_d_secure.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ThreeDSecureConfigurationParamsImpl - _$$ThreeDSecureConfigurationParamsImplFromJson(Map json) => - _$ThreeDSecureConfigurationParamsImpl( - navigationBar: ThreeDSecureNavigationBarThemeData.fromJson( - json['navigationBar'] as Map), - timeout: (json['timeout'] as num?)?.toInt(), - label: json['label'] == null - ? null - : ThreeDSecureLabelThemeData.fromJson( - json['label'] as Map), - textField: json['textField'] == null - ? null - : ThreeDSecureTextFieldThemeData.fromJson( - json['textField'] as Map), - submitButton: json['submitButton'] == null - ? null - : ThreeDSecureButtonThemeData.fromJson( - json['submitButton'] as Map), - cancelButton: json['cancelButton'] == null - ? null - : ThreeDSecureButtonThemeData.fromJson( - json['cancelButton'] as Map), - nextButton: json['nextButton'] == null - ? null - : ThreeDSecureButtonThemeData.fromJson( - json['nextButton'] as Map), - continueButton: json['continueButton'] == null - ? null - : ThreeDSecureButtonThemeData.fromJson( - json['continueButton'] as Map), - resendButton: json['resendButton'] == null - ? null - : ThreeDSecureButtonThemeData.fromJson( - json['resendButton'] as Map), - ); +_ThreeDSecureConfigurationParams _$ThreeDSecureConfigurationParamsFromJson( + Map json, +) => _ThreeDSecureConfigurationParams( + navigationBar: ThreeDSecureNavigationBarThemeData.fromJson( + json['navigationBar'] as Map, + ), + timeout: (json['timeout'] as num?)?.toInt(), + label: json['label'] == null + ? null + : ThreeDSecureLabelThemeData.fromJson( + json['label'] as Map, + ), + textField: json['textField'] == null + ? null + : ThreeDSecureTextFieldThemeData.fromJson( + json['textField'] as Map, + ), + submitButton: json['submitButton'] == null + ? null + : ThreeDSecureButtonThemeData.fromJson( + json['submitButton'] as Map, + ), + cancelButton: json['cancelButton'] == null + ? null + : ThreeDSecureButtonThemeData.fromJson( + json['cancelButton'] as Map, + ), + nextButton: json['nextButton'] == null + ? null + : ThreeDSecureButtonThemeData.fromJson( + json['nextButton'] as Map, + ), + continueButton: json['continueButton'] == null + ? null + : ThreeDSecureButtonThemeData.fromJson( + json['continueButton'] as Map, + ), + resendButton: json['resendButton'] == null + ? null + : ThreeDSecureButtonThemeData.fromJson( + json['resendButton'] as Map, + ), +); -Map _$$ThreeDSecureConfigurationParamsImplToJson( - _$ThreeDSecureConfigurationParamsImpl instance) => - { - 'navigationBar': instance.navigationBar.toJson(), - 'timeout': instance.timeout, - 'label': instance.label?.toJson(), - 'textField': instance.textField?.toJson(), - 'submitButton': instance.submitButton?.toJson(), - 'cancelButton': instance.cancelButton?.toJson(), - 'nextButton': instance.nextButton?.toJson(), - 'continueButton': instance.continueButton?.toJson(), - 'resendButton': instance.resendButton?.toJson(), - }; +Map _$ThreeDSecureConfigurationParamsToJson( + _ThreeDSecureConfigurationParams instance, +) => { + 'navigationBar': instance.navigationBar.toJson(), + 'timeout': instance.timeout, + 'label': instance.label?.toJson(), + 'textField': instance.textField?.toJson(), + 'submitButton': instance.submitButton?.toJson(), + 'cancelButton': instance.cancelButton?.toJson(), + 'nextButton': instance.nextButton?.toJson(), + 'continueButton': instance.continueButton?.toJson(), + 'resendButton': instance.resendButton?.toJson(), +}; -_$ThreeDSecureNavigationBarThemeDataImpl - _$$ThreeDSecureNavigationBarThemeDataImplFromJson( - Map json) => - _$ThreeDSecureNavigationBarThemeDataImpl( - headerText: json['headerText'] as String?, - buttonText: json['buttonText'] as String?, - textColor: json['textColor'] as String?, - statusBarColor: json['statusBarColor'] as String?, - backgroundColor: json['backgroundColor'] as String?, - textFontSize: (json['textFontSize'] as num?)?.toDouble(), - ); - -Map _$$ThreeDSecureNavigationBarThemeDataImplToJson( - _$ThreeDSecureNavigationBarThemeDataImpl instance) => - { - 'headerText': instance.headerText, - 'buttonText': instance.buttonText, - 'textColor': instance.textColor, - 'statusBarColor': instance.statusBarColor, - 'backgroundColor': instance.backgroundColor, - 'textFontSize': instance.textFontSize, - }; - -_$ThreeDSecureLabelThemeDataImpl _$$ThreeDSecureLabelThemeDataImplFromJson( - Map json) => - _$ThreeDSecureLabelThemeDataImpl( - headingTextColor: json['headingTextColor'] as String?, +_ThreeDSecureNavigationBarThemeData +_$ThreeDSecureNavigationBarThemeDataFromJson(Map json) => + _ThreeDSecureNavigationBarThemeData( + headerText: json['headerText'] as String?, + buttonText: json['buttonText'] as String?, textColor: json['textColor'] as String?, + statusBarColor: json['statusBarColor'] as String?, + backgroundColor: json['backgroundColor'] as String?, textFontSize: (json['textFontSize'] as num?)?.toDouble(), - headingFontSize: (json['headingFontSize'] as num?)?.toDouble(), ); -Map _$$ThreeDSecureLabelThemeDataImplToJson( - _$ThreeDSecureLabelThemeDataImpl instance) => - { - 'headingTextColor': instance.headingTextColor, - 'textColor': instance.textColor, - 'textFontSize': instance.textFontSize, - 'headingFontSize': instance.headingFontSize, - }; +Map _$ThreeDSecureNavigationBarThemeDataToJson( + _ThreeDSecureNavigationBarThemeData instance, +) => { + 'headerText': instance.headerText, + 'buttonText': instance.buttonText, + 'textColor': instance.textColor, + 'statusBarColor': instance.statusBarColor, + 'backgroundColor': instance.backgroundColor, + 'textFontSize': instance.textFontSize, +}; -_$ThreeDSecureTextFieldThemeDataImpl - _$$ThreeDSecureTextFieldThemeDataImplFromJson(Map json) => - _$ThreeDSecureTextFieldThemeDataImpl( - borderColor: json['borderColor'] as String?, - borderWidth: (json['borderWidth'] as num?)?.toDouble(), - cornerRadius: (json['cornerRadius'] as num?)?.toDouble(), - textColor: json['textColor'] as String?, - textFontSize: (json['textFontSize'] as num?)?.toDouble(), - ); +_ThreeDSecureLabelThemeData _$ThreeDSecureLabelThemeDataFromJson( + Map json, +) => _ThreeDSecureLabelThemeData( + headingTextColor: json['headingTextColor'] as String?, + textColor: json['textColor'] as String?, + textFontSize: (json['textFontSize'] as num?)?.toDouble(), + headingFontSize: (json['headingFontSize'] as num?)?.toDouble(), +); -Map _$$ThreeDSecureTextFieldThemeDataImplToJson( - _$ThreeDSecureTextFieldThemeDataImpl instance) => - { - 'borderColor': instance.borderColor, - 'borderWidth': instance.borderWidth, - 'cornerRadius': instance.cornerRadius, - 'textColor': instance.textColor, - 'textFontSize': instance.textFontSize, - }; +Map _$ThreeDSecureLabelThemeDataToJson( + _ThreeDSecureLabelThemeData instance, +) => { + 'headingTextColor': instance.headingTextColor, + 'textColor': instance.textColor, + 'textFontSize': instance.textFontSize, + 'headingFontSize': instance.headingFontSize, +}; -_$ThreeDSecureButtonThemeDataImpl _$$ThreeDSecureButtonThemeDataImplFromJson( - Map json) => - _$ThreeDSecureButtonThemeDataImpl( - backgroundColor: json['backgroundColor'] as String?, - cornerRadius: (json['cornerRadius'] as num?)?.toDouble(), - textColor: json['textColor'] as String?, - textFontSize: (json['textFontSize'] as num?)?.toDouble(), - ); +_ThreeDSecureTextFieldThemeData _$ThreeDSecureTextFieldThemeDataFromJson( + Map json, +) => _ThreeDSecureTextFieldThemeData( + borderColor: json['borderColor'] as String?, + borderWidth: (json['borderWidth'] as num?)?.toDouble(), + cornerRadius: (json['cornerRadius'] as num?)?.toDouble(), + textColor: json['textColor'] as String?, + textFontSize: (json['textFontSize'] as num?)?.toDouble(), +); + +Map _$ThreeDSecureTextFieldThemeDataToJson( + _ThreeDSecureTextFieldThemeData instance, +) => { + 'borderColor': instance.borderColor, + 'borderWidth': instance.borderWidth, + 'cornerRadius': instance.cornerRadius, + 'textColor': instance.textColor, + 'textFontSize': instance.textFontSize, +}; + +_ThreeDSecureButtonThemeData _$ThreeDSecureButtonThemeDataFromJson( + Map json, +) => _ThreeDSecureButtonThemeData( + backgroundColor: json['backgroundColor'] as String?, + cornerRadius: (json['cornerRadius'] as num?)?.toDouble(), + textColor: json['textColor'] as String?, + textFontSize: (json['textFontSize'] as num?)?.toDouble(), +); -Map _$$ThreeDSecureButtonThemeDataImplToJson( - _$ThreeDSecureButtonThemeDataImpl instance) => - { - 'backgroundColor': instance.backgroundColor, - 'cornerRadius': instance.cornerRadius, - 'textColor': instance.textColor, - 'textFontSize': instance.textFontSize, - }; +Map _$ThreeDSecureButtonThemeDataToJson( + _ThreeDSecureButtonThemeData instance, +) => { + 'backgroundColor': instance.backgroundColor, + 'cornerRadius': instance.cornerRadius, + 'textColor': instance.textColor, + 'textFontSize': instance.textFontSize, +}; diff --git a/packages/stripe_platform_interface/lib/src/models/wallet.dart b/packages/stripe_platform_interface/lib/src/models/wallet.dart index 6248dacf2..562cc51ba 100644 --- a/packages/stripe_platform_interface/lib/src/models/wallet.dart +++ b/packages/stripe_platform_interface/lib/src/models/wallet.dart @@ -19,9 +19,8 @@ enum CanAddToWalletErrorStatus { } @freezed - /// The result when asking the Stripe sdk to add a card to wallet -class AddToWalletResult with _$AddToWalletResult { +abstract class AddToWalletResult with _$AddToWalletResult { const factory AddToWalletResult({ /// Whether or not the card can be added to the wallet required bool canAddToWallet, @@ -32,9 +31,8 @@ class AddToWalletResult with _$AddToWalletResult { } @freezed - /// The Details object that provides some additional result -class AddToWalletDetails with _$AddToWalletDetails { +abstract class AddToWalletDetails with _$AddToWalletDetails { const factory AddToWalletDetails({ /// The status of the can add to wallet request in case it failed. CanAddToWalletErrorStatus? status, diff --git a/packages/stripe_platform_interface/lib/src/models/wallet.freezed.dart b/packages/stripe_platform_interface/lib/src/models/wallet.freezed.dart index 2638c401f..bba3d7e15 100644 --- a/packages/stripe_platform_interface/lib/src/models/wallet.freezed.dart +++ b/packages/stripe_platform_interface/lib/src/models/wallet.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,360 +9,564 @@ part of 'wallet.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - /// @nodoc mixin _$AddToWalletResult { - /// Whether or not the card can be added to the wallet - bool get canAddToWallet => throw _privateConstructorUsedError; - /// additional details from the add to wallet request - AddToWalletDetails? get details => throw _privateConstructorUsedError; +/// Whether or not the card can be added to the wallet + bool get canAddToWallet;/// additional details from the add to wallet request + AddToWalletDetails? get details; +/// Create a copy of AddToWalletResult +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddToWalletResultCopyWith get copyWith => _$AddToWalletResultCopyWithImpl(this as AddToWalletResult, _$identity); - /// Create a copy of AddToWalletResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AddToWalletResultCopyWith get copyWith => - throw _privateConstructorUsedError; + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AddToWalletResult&&(identical(other.canAddToWallet, canAddToWallet) || other.canAddToWallet == canAddToWallet)&&(identical(other.details, details) || other.details == details)); +} + + +@override +int get hashCode => Object.hash(runtimeType,canAddToWallet,details); + +@override +String toString() { + return 'AddToWalletResult(canAddToWallet: $canAddToWallet, details: $details)'; } -/// @nodoc -abstract class $AddToWalletResultCopyWith<$Res> { - factory $AddToWalletResultCopyWith( - AddToWalletResult value, $Res Function(AddToWalletResult) then) = - _$AddToWalletResultCopyWithImpl<$Res, AddToWalletResult>; - @useResult - $Res call({bool canAddToWallet, AddToWalletDetails? details}); - $AddToWalletDetailsCopyWith<$Res>? get details; } /// @nodoc -class _$AddToWalletResultCopyWithImpl<$Res, $Val extends AddToWalletResult> +abstract mixin class $AddToWalletResultCopyWith<$Res> { + factory $AddToWalletResultCopyWith(AddToWalletResult value, $Res Function(AddToWalletResult) _then) = _$AddToWalletResultCopyWithImpl; +@useResult +$Res call({ + bool canAddToWallet, AddToWalletDetails? details +}); + + +$AddToWalletDetailsCopyWith<$Res>? get details; + +} +/// @nodoc +class _$AddToWalletResultCopyWithImpl<$Res> implements $AddToWalletResultCopyWith<$Res> { - _$AddToWalletResultCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AddToWalletResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? canAddToWallet = null, - Object? details = freezed, - }) { - return _then(_value.copyWith( - canAddToWallet: null == canAddToWallet - ? _value.canAddToWallet - : canAddToWallet // ignore: cast_nullable_to_non_nullable - as bool, - details: freezed == details - ? _value.details - : details // ignore: cast_nullable_to_non_nullable - as AddToWalletDetails?, - ) as $Val); + _$AddToWalletResultCopyWithImpl(this._self, this._then); + + final AddToWalletResult _self; + final $Res Function(AddToWalletResult) _then; + +/// Create a copy of AddToWalletResult +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? canAddToWallet = null,Object? details = freezed,}) { + return _then(_self.copyWith( +canAddToWallet: null == canAddToWallet ? _self.canAddToWallet : canAddToWallet // ignore: cast_nullable_to_non_nullable +as bool,details: freezed == details ? _self.details : details // ignore: cast_nullable_to_non_nullable +as AddToWalletDetails?, + )); +} +/// Create a copy of AddToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddToWalletDetailsCopyWith<$Res>? get details { + if (_self.details == null) { + return null; } - /// Create a copy of AddToWalletResult - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $AddToWalletDetailsCopyWith<$Res>? get details { - if (_value.details == null) { - return null; - } - - return $AddToWalletDetailsCopyWith<$Res>(_value.details!, (value) { - return _then(_value.copyWith(details: value) as $Val); - }); - } + return $AddToWalletDetailsCopyWith<$Res>(_self.details!, (value) { + return _then(_self.copyWith(details: value)); + }); +} } -/// @nodoc -abstract class _$$AddToWalletResultImplCopyWith<$Res> - implements $AddToWalletResultCopyWith<$Res> { - factory _$$AddToWalletResultImplCopyWith(_$AddToWalletResultImpl value, - $Res Function(_$AddToWalletResultImpl) then) = - __$$AddToWalletResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool canAddToWallet, AddToWalletDetails? details}); - @override - $AddToWalletDetailsCopyWith<$Res>? get details; +/// Adds pattern-matching-related methods to [AddToWalletResult]. +extension AddToWalletResultPatterns on AddToWalletResult { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AddToWalletResult value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AddToWalletResult() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AddToWalletResult value) $default,){ +final _that = this; +switch (_that) { +case _AddToWalletResult(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AddToWalletResult value)? $default,){ +final _that = this; +switch (_that) { +case _AddToWalletResult() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( bool canAddToWallet, AddToWalletDetails? details)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AddToWalletResult() when $default != null: +return $default(_that.canAddToWallet,_that.details);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( bool canAddToWallet, AddToWalletDetails? details) $default,) {final _that = this; +switch (_that) { +case _AddToWalletResult(): +return $default(_that.canAddToWallet,_that.details);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( bool canAddToWallet, AddToWalletDetails? details)? $default,) {final _that = this; +switch (_that) { +case _AddToWalletResult() when $default != null: +return $default(_that.canAddToWallet,_that.details);case _: + return null; + +} } -/// @nodoc -class __$$AddToWalletResultImplCopyWithImpl<$Res> - extends _$AddToWalletResultCopyWithImpl<$Res, _$AddToWalletResultImpl> - implements _$$AddToWalletResultImplCopyWith<$Res> { - __$$AddToWalletResultImplCopyWithImpl(_$AddToWalletResultImpl _value, - $Res Function(_$AddToWalletResultImpl) _then) - : super(_value, _then); - - /// Create a copy of AddToWalletResult - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? canAddToWallet = null, - Object? details = freezed, - }) { - return _then(_$AddToWalletResultImpl( - canAddToWallet: null == canAddToWallet - ? _value.canAddToWallet - : canAddToWallet // ignore: cast_nullable_to_non_nullable - as bool, - details: freezed == details - ? _value.details - : details // ignore: cast_nullable_to_non_nullable - as AddToWalletDetails?, - )); - } } /// @nodoc -class _$AddToWalletResultImpl implements _AddToWalletResult { - const _$AddToWalletResultImpl({required this.canAddToWallet, this.details}); - /// Whether or not the card can be added to the wallet - @override - final bool canAddToWallet; +class _AddToWalletResult implements AddToWalletResult { + const _AddToWalletResult({required this.canAddToWallet, this.details}); + - /// additional details from the add to wallet request - @override - final AddToWalletDetails? details; +/// Whether or not the card can be added to the wallet +@override final bool canAddToWallet; +/// additional details from the add to wallet request +@override final AddToWalletDetails? details; - @override - String toString() { - return 'AddToWalletResult(canAddToWallet: $canAddToWallet, details: $details)'; - } +/// Create a copy of AddToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddToWalletResultCopyWith<_AddToWalletResult> get copyWith => __$AddToWalletResultCopyWithImpl<_AddToWalletResult>(this, _$identity); - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AddToWalletResultImpl && - (identical(other.canAddToWallet, canAddToWallet) || - other.canAddToWallet == canAddToWallet) && - (identical(other.details, details) || other.details == details)); - } - @override - int get hashCode => Object.hash(runtimeType, canAddToWallet, details); - /// Create a copy of AddToWalletResult - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AddToWalletResultImplCopyWith<_$AddToWalletResultImpl> get copyWith => - __$$AddToWalletResultImplCopyWithImpl<_$AddToWalletResultImpl>( - this, _$identity); +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddToWalletResult&&(identical(other.canAddToWallet, canAddToWallet) || other.canAddToWallet == canAddToWallet)&&(identical(other.details, details) || other.details == details)); } -abstract class _AddToWalletResult implements AddToWalletResult { - const factory _AddToWalletResult( - {required final bool canAddToWallet, - final AddToWalletDetails? details}) = _$AddToWalletResultImpl; - /// Whether or not the card can be added to the wallet - @override - bool get canAddToWallet; +@override +int get hashCode => Object.hash(runtimeType,canAddToWallet,details); + +@override +String toString() { + return 'AddToWalletResult(canAddToWallet: $canAddToWallet, details: $details)'; +} - /// additional details from the add to wallet request - @override - AddToWalletDetails? get details; - /// Create a copy of AddToWalletResult - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AddToWalletResultImplCopyWith<_$AddToWalletResultImpl> get copyWith => - throw _privateConstructorUsedError; } -AddToWalletDetails _$AddToWalletDetailsFromJson(Map json) { - return _AddToWalletDetails.fromJson(json); +/// @nodoc +abstract mixin class _$AddToWalletResultCopyWith<$Res> implements $AddToWalletResultCopyWith<$Res> { + factory _$AddToWalletResultCopyWith(_AddToWalletResult value, $Res Function(_AddToWalletResult) _then) = __$AddToWalletResultCopyWithImpl; +@override @useResult +$Res call({ + bool canAddToWallet, AddToWalletDetails? details +}); + + +@override $AddToWalletDetailsCopyWith<$Res>? get details; + +} +/// @nodoc +class __$AddToWalletResultCopyWithImpl<$Res> + implements _$AddToWalletResultCopyWith<$Res> { + __$AddToWalletResultCopyWithImpl(this._self, this._then); + + final _AddToWalletResult _self; + final $Res Function(_AddToWalletResult) _then; + +/// Create a copy of AddToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? canAddToWallet = null,Object? details = freezed,}) { + return _then(_AddToWalletResult( +canAddToWallet: null == canAddToWallet ? _self.canAddToWallet : canAddToWallet // ignore: cast_nullable_to_non_nullable +as bool,details: freezed == details ? _self.details : details // ignore: cast_nullable_to_non_nullable +as AddToWalletDetails?, + )); +} + +/// Create a copy of AddToWalletResult +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$AddToWalletDetailsCopyWith<$Res>? get details { + if (_self.details == null) { + return null; + } + + return $AddToWalletDetailsCopyWith<$Res>(_self.details!, (value) { + return _then(_self.copyWith(details: value)); + }); +} } + /// @nodoc mixin _$AddToWalletDetails { - /// The status of the can add to wallet request in case it failed. - CanAddToWalletErrorStatus? get status => throw _privateConstructorUsedError; - /// The card token - String? get token => throw _privateConstructorUsedError; +/// The status of the can add to wallet request in case it failed. + CanAddToWalletErrorStatus? get status;/// The card token + String? get token; +/// Create a copy of AddToWalletDetails +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$AddToWalletDetailsCopyWith get copyWith => _$AddToWalletDetailsCopyWithImpl(this as AddToWalletDetails, _$identity); /// Serializes this AddToWalletDetails to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); + - /// Create a copy of AddToWalletDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $AddToWalletDetailsCopyWith get copyWith => - throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is AddToWalletDetails&&(identical(other.status, status) || other.status == status)&&(identical(other.token, token) || other.token == token)); } -/// @nodoc -abstract class $AddToWalletDetailsCopyWith<$Res> { - factory $AddToWalletDetailsCopyWith( - AddToWalletDetails value, $Res Function(AddToWalletDetails) then) = - _$AddToWalletDetailsCopyWithImpl<$Res, AddToWalletDetails>; - @useResult - $Res call({CanAddToWalletErrorStatus? status, String? token}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,status,token); + +@override +String toString() { + return 'AddToWalletDetails(status: $status, token: $token)'; } -/// @nodoc -class _$AddToWalletDetailsCopyWithImpl<$Res, $Val extends AddToWalletDetails> - implements $AddToWalletDetailsCopyWith<$Res> { - _$AddToWalletDetailsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of AddToWalletDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? status = freezed, - Object? token = freezed, - }) { - return _then(_value.copyWith( - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as CanAddToWalletErrorStatus?, - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } + } /// @nodoc -abstract class _$$AddToWalletDetailsImplCopyWith<$Res> +abstract mixin class $AddToWalletDetailsCopyWith<$Res> { + factory $AddToWalletDetailsCopyWith(AddToWalletDetails value, $Res Function(AddToWalletDetails) _then) = _$AddToWalletDetailsCopyWithImpl; +@useResult +$Res call({ + CanAddToWalletErrorStatus? status, String? token +}); + + + + +} +/// @nodoc +class _$AddToWalletDetailsCopyWithImpl<$Res> implements $AddToWalletDetailsCopyWith<$Res> { - factory _$$AddToWalletDetailsImplCopyWith(_$AddToWalletDetailsImpl value, - $Res Function(_$AddToWalletDetailsImpl) then) = - __$$AddToWalletDetailsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({CanAddToWalletErrorStatus? status, String? token}); + _$AddToWalletDetailsCopyWithImpl(this._self, this._then); + + final AddToWalletDetails _self; + final $Res Function(AddToWalletDetails) _then; + +/// Create a copy of AddToWalletDetails +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? status = freezed,Object? token = freezed,}) { + return _then(_self.copyWith( +status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as CanAddToWalletErrorStatus?,token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [AddToWalletDetails]. +extension AddToWalletDetailsPatterns on AddToWalletDetails { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _AddToWalletDetails value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _AddToWalletDetails() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _AddToWalletDetails value) $default,){ +final _that = this; +switch (_that) { +case _AddToWalletDetails(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AddToWalletDetails value)? $default,){ +final _that = this; +switch (_that) { +case _AddToWalletDetails() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( CanAddToWalletErrorStatus? status, String? token)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _AddToWalletDetails() when $default != null: +return $default(_that.status,_that.token);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( CanAddToWalletErrorStatus? status, String? token) $default,) {final _that = this; +switch (_that) { +case _AddToWalletDetails(): +return $default(_that.status,_that.token);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( CanAddToWalletErrorStatus? status, String? token)? $default,) {final _that = this; +switch (_that) { +case _AddToWalletDetails() when $default != null: +return $default(_that.status,_that.token);case _: + return null; + +} } -/// @nodoc -class __$$AddToWalletDetailsImplCopyWithImpl<$Res> - extends _$AddToWalletDetailsCopyWithImpl<$Res, _$AddToWalletDetailsImpl> - implements _$$AddToWalletDetailsImplCopyWith<$Res> { - __$$AddToWalletDetailsImplCopyWithImpl(_$AddToWalletDetailsImpl _value, - $Res Function(_$AddToWalletDetailsImpl) _then) - : super(_value, _then); - - /// Create a copy of AddToWalletDetails - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? status = freezed, - Object? token = freezed, - }) { - return _then(_$AddToWalletDetailsImpl( - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as CanAddToWalletErrorStatus?, - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String?, - )); - } } /// @nodoc @JsonSerializable() -class _$AddToWalletDetailsImpl implements _AddToWalletDetails { - const _$AddToWalletDetailsImpl({this.status, this.token}); - factory _$AddToWalletDetailsImpl.fromJson(Map json) => - _$$AddToWalletDetailsImplFromJson(json); +class _AddToWalletDetails implements AddToWalletDetails { + const _AddToWalletDetails({this.status, this.token}); + factory _AddToWalletDetails.fromJson(Map json) => _$AddToWalletDetailsFromJson(json); - /// The status of the can add to wallet request in case it failed. - @override - final CanAddToWalletErrorStatus? status; +/// The status of the can add to wallet request in case it failed. +@override final CanAddToWalletErrorStatus? status; +/// The card token +@override final String? token; - /// The card token - @override - final String? token; +/// Create a copy of AddToWalletDetails +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$AddToWalletDetailsCopyWith<_AddToWalletDetails> get copyWith => __$AddToWalletDetailsCopyWithImpl<_AddToWalletDetails>(this, _$identity); - @override - String toString() { - return 'AddToWalletDetails(status: $status, token: $token)'; - } +@override +Map toJson() { + return _$AddToWalletDetailsToJson(this, ); +} - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$AddToWalletDetailsImpl && - (identical(other.status, status) || other.status == status) && - (identical(other.token, token) || other.token == token)); - } +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddToWalletDetails&&(identical(other.status, status) || other.status == status)&&(identical(other.token, token) || other.token == token)); +} - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, status, token); - - /// Create a copy of AddToWalletDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$AddToWalletDetailsImplCopyWith<_$AddToWalletDetailsImpl> get copyWith => - __$$AddToWalletDetailsImplCopyWithImpl<_$AddToWalletDetailsImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$AddToWalletDetailsImplToJson( - this, - ); - } +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,status,token); + +@override +String toString() { + return 'AddToWalletDetails(status: $status, token: $token)'; } -abstract class _AddToWalletDetails implements AddToWalletDetails { - const factory _AddToWalletDetails( - {final CanAddToWalletErrorStatus? status, - final String? token}) = _$AddToWalletDetailsImpl; - factory _AddToWalletDetails.fromJson(Map json) = - _$AddToWalletDetailsImpl.fromJson; +} + +/// @nodoc +abstract mixin class _$AddToWalletDetailsCopyWith<$Res> implements $AddToWalletDetailsCopyWith<$Res> { + factory _$AddToWalletDetailsCopyWith(_AddToWalletDetails value, $Res Function(_AddToWalletDetails) _then) = __$AddToWalletDetailsCopyWithImpl; +@override @useResult +$Res call({ + CanAddToWalletErrorStatus? status, String? token +}); + - /// The status of the can add to wallet request in case it failed. - @override - CanAddToWalletErrorStatus? get status; - /// The card token - @override - String? get token; - /// Create a copy of AddToWalletDetails - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$AddToWalletDetailsImplCopyWith<_$AddToWalletDetailsImpl> get copyWith => - throw _privateConstructorUsedError; } +/// @nodoc +class __$AddToWalletDetailsCopyWithImpl<$Res> + implements _$AddToWalletDetailsCopyWith<$Res> { + __$AddToWalletDetailsCopyWithImpl(this._self, this._then); + + final _AddToWalletDetails _self; + final $Res Function(_AddToWalletDetails) _then; + +/// Create a copy of AddToWalletDetails +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? status = freezed,Object? token = freezed,}) { + return _then(_AddToWalletDetails( +status: freezed == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as CanAddToWalletErrorStatus?,token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/stripe_platform_interface/lib/src/models/wallet.g.dart b/packages/stripe_platform_interface/lib/src/models/wallet.g.dart index 2b647fea1..e204af8e7 100644 --- a/packages/stripe_platform_interface/lib/src/models/wallet.g.dart +++ b/packages/stripe_platform_interface/lib/src/models/wallet.g.dart @@ -6,16 +6,16 @@ part of 'wallet.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AddToWalletDetailsImpl _$$AddToWalletDetailsImplFromJson( - Map json) => - _$AddToWalletDetailsImpl( +_AddToWalletDetails _$AddToWalletDetailsFromJson(Map json) => + _AddToWalletDetails( status: $enumDecodeNullable( - _$CanAddToWalletErrorStatusEnumMap, json['status']), + _$CanAddToWalletErrorStatusEnumMap, + json['status'], + ), token: json['token'] as String?, ); -Map _$$AddToWalletDetailsImplToJson( - _$AddToWalletDetailsImpl instance) => +Map _$AddToWalletDetailsToJson(_AddToWalletDetails instance) => { 'status': _$CanAddToWalletErrorStatusEnumMap[instance.status], 'token': instance.token, diff --git a/packages/stripe_platform_interface/lib/src/result_parser.dart b/packages/stripe_platform_interface/lib/src/result_parser.dart index 5ca0550ea..657b902c4 100644 --- a/packages/stripe_platform_interface/lib/src/result_parser.dart +++ b/packages/stripe_platform_interface/lib/src/result_parser.dart @@ -1,13 +1,13 @@ import 'package:stripe_platform_interface/stripe_platform_interface.dart'; class ResultParser { - const ResultParser({ - required T Function(Map) parseJson, - }) : _parseJson = parseJson; + const ResultParser({required T Function(Map) parseJson}) + : _parseJson = parseJson; - T parse( - {required Map result, - required String successResultKey}) { + T parse({ + required Map result, + required String successResultKey, + }) { final successResponse = result[successResultKey]; if (successResponse != null) { diff --git a/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart b/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart index 423208e3d..0853e6ef7 100644 --- a/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart +++ b/packages/stripe_platform_interface/lib/src/stripe_platform_interface.dart @@ -39,12 +39,15 @@ abstract class StripePlatform extends PlatformInterface { PaymentMethodOptions? options, ]); - Future handleNextAction(String paymentIntentClientSecret, - {String? returnURL}); + Future handleNextAction( + String paymentIntentClientSecret, { + String? returnURL, + }); Future handleNextActionForSetupIntent( - String setupIntentClientSecret, - {String? returnURL}); + String setupIntentClientSecret, { + String? returnURL, + }); Future confirmPayment( String paymentIntentClientSecret, @@ -56,7 +59,8 @@ abstract class StripePlatform extends PlatformInterface { /// Configure the payment sheet using [SetupPaymentSheetParameters] as config. Future initPaymentSheet( - SetupPaymentSheetParameters params); + SetupPaymentSheetParameters params, + ); /// Display the payment sheet. Future presentPaymentSheet({ @@ -71,7 +75,8 @@ abstract class StripePlatform extends PlatformInterface { /// Configure the payment sheet using [CustomerSheetInitParams] as config. Future initCustomerSheet( - CustomerSheetInitParams params); + CustomerSheetInitParams params, + ); /// Display the customersheet sheet. Future presentCustomerSheet({ @@ -92,13 +97,15 @@ abstract class StripePlatform extends PlatformInterface { @Deprecated('This method is deprecated use [isPlatformPaySupported] instead') Future googlePayIsSupported(IsGooglePaySupportedParams params); Future createGooglePayPaymentMethod( - CreateGooglePayPaymentParams params); + CreateGooglePayPaymentParams params, + ); @Deprecated('use the new method [CanAddCardToWalletParams] instead') Future canAddToWallet(String last4); Future canAddCardToWallet( - CanAddCardToWalletParams params); + CanAddCardToWalletParams params, + ); Future isCardInWallet(String cardLastFour); @@ -126,11 +133,13 @@ abstract class StripePlatform extends PlatformInterface { bool usesDeprecatedTokenFlow = false, }); - Future updatePlatformSheet( - {required PlatformPaySheetUpdateParams params}); + Future updatePlatformSheet({ + required PlatformPaySheetUpdateParams params, + }); - Future configurePlatformOrderTracking( - {required PlatformPayOrderDetails orderDetails}); + Future configurePlatformOrderTracking({ + required PlatformPayOrderDetails orderDetails, + }); /// Creates a token for card details. /// @@ -204,7 +213,7 @@ abstract class StripePlatform extends PlatformInterface { Key? key, required VoidCallback onPressed, required PlatformPayWebPaymentRequestCreateOptions - paymentRequestCreateOptions, + paymentRequestCreateOptions, BoxConstraints? constraints, PlatformButtonType? type, PlatformButtonStyle? style, diff --git a/packages/stripe_platform_interface/lib/stripe_platform_interface.dart b/packages/stripe_platform_interface/lib/stripe_platform_interface.dart index a5e41735a..00fde05a8 100644 --- a/packages/stripe_platform_interface/lib/stripe_platform_interface.dart +++ b/packages/stripe_platform_interface/lib/stripe_platform_interface.dart @@ -1,4 +1,4 @@ -library stripe_platform_interface; +library; export 'src/card_edit_controller.dart'; export 'src/models/address_sheet.dart'; diff --git a/packages/stripe_platform_interface/pubspec.yaml b/packages/stripe_platform_interface/pubspec.yaml index 9690ce3e5..731fc5468 100644 --- a/packages/stripe_platform_interface/pubspec.yaml +++ b/packages/stripe_platform_interface/pubspec.yaml @@ -5,14 +5,14 @@ repository: https://github.com/flutter-stripe/flutter_stripe homepage: https://pub.dev/packages/flutter_stripe environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.0.0" + sdk: ">=3.8.1 <4.0.0" + flutter: ">=3.22.0" dependencies: flutter: sdk: flutter - freezed_annotation: ^2.4.1 - json_annotation: ^4.8.1 + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 meta: ^1.10.0 plugin_platform_interface: ^2.1.7 @@ -20,6 +20,6 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - freezed: ^2.4.5 + freezed: ^3.2.0 json_serializable: ^6.7.1 - flutter_lints: ^4.0.0 + flutter_lints: ^6.0.0 diff --git a/packages/stripe_platform_interface/test/method_channel_mock.dart b/packages/stripe_platform_interface/test/method_channel_mock.dart index 203e6a96c..07422f20b 100644 --- a/packages/stripe_platform_interface/test/method_channel_mock.dart +++ b/packages/stripe_platform_interface/test/method_channel_mock.dart @@ -26,8 +26,10 @@ class MethodChannelMock { log.add(methodCall); if (methodCall.method != method) { - throw MissingPluginException('No implementation found for method ' - '$method on channel ${methodChannel.name}'); + throw MissingPluginException( + 'No implementation found for method ' + '$method on channel ${methodChannel.name}', + ); } return Future.delayed(delay, () { diff --git a/packages/stripe_platform_interface/test/method_channel_stripe_test.dart b/packages/stripe_platform_interface/test/method_channel_stripe_test.dart index 3e357438d..ac1113dac 100644 --- a/packages/stripe_platform_interface/test/method_channel_stripe_test.dart +++ b/packages/stripe_platform_interface/test/method_channel_stripe_test.dart @@ -28,9 +28,9 @@ void main() { test('It completetes successfully', () async { final completer = Completer(); - await sut.initialise(publishableKey: 'publishableKey').then( - (_) => completer.complete(), - ); + await sut + .initialise(publishableKey: 'publishableKey') + .then((_) => completer.complete()); expect(completer.isCompleted, true); }); }); @@ -47,14 +47,17 @@ void main() { channelName: methodChannelName, method: 'createPaymentMethod', result: { - "paymentMethod": - PaymentMethodTestInstance.create('id1').jsonMap() + "paymentMethod": PaymentMethodTestInstance.create( + 'id1', + ).jsonMap(), }, ).methodChannel, ); - result = await sut.createPaymentMethod(const PaymentMethodParams.card( - paymentMethodData: PaymentMethodData(), - )); + result = await sut.createPaymentMethod( + const PaymentMethodParams.card( + paymentMethodData: PaymentMethodData(), + ), + ); }); test('It returns payment method', () { @@ -68,20 +71,22 @@ void main() { platformIsIos: true, platformIsAndroid: false, methodChannel: MethodChannelMock( - channelName: methodChannelName, - method: 'createPaymentMethod', - result: createErrorResponse('whoops')) - .methodChannel, + channelName: methodChannelName, + method: 'createPaymentMethod', + result: createErrorResponse('whoops'), + ).methodChannel, ); }); test('It returns payment method', () async { expect( - () async => - await sut.createPaymentMethod(const PaymentMethodParams.card( - paymentMethodData: PaymentMethodData(), - )), - throwsA(isInstanceOf())); + () async => await sut.createPaymentMethod( + const PaymentMethodParams.card( + paymentMethodData: PaymentMethodData(), + ), + ), + throwsA(isInstanceOf()), + ); }); }); }); @@ -101,8 +106,8 @@ void main() { 'id': 'cvcResultToken', 'type': 'Card', 'livemode': true, - 'created': '1630670419' - } + 'created': '1630670419', + }, }, ).methodChannel, ); @@ -126,19 +131,21 @@ void main() { channelName: methodChannelName, method: 'confirmPayment', result: { - "paymentIntent": - PaymentIntentTestInstance.create('id1').toJsonMap() + "paymentIntent": PaymentIntentTestInstance.create( + 'id1', + ).toJsonMap(), }, ).methodChannel, ); result = await sut.confirmPayment( - 'secret', - const PaymentMethodParams.card( - paymentMethodData: PaymentMethodData(), - ), - const PaymentMethodOptions( - setupFutureUsage: PaymentIntentsFutureUsage.OffSession, - )); + 'secret', + const PaymentMethodParams.card( + paymentMethodData: PaymentMethodData(), + ), + const PaymentMethodOptions( + setupFutureUsage: PaymentIntentsFutureUsage.OffSession, + ), + ); }); test('It returns payment intent', () { @@ -185,8 +192,9 @@ void main() { channelName: methodChannelName, method: 'confirmSetupIntent', result: { - "setupIntent": - SetupIntentTestInstance.create('id1').toJsonMap('id1') + "setupIntent": SetupIntentTestInstance.create( + 'id1', + ).toJsonMap('id1'), }, ).methodChannel, ); @@ -236,8 +244,9 @@ void main() { channelName: methodChannelName, method: 'handleNextAction', result: { - "paymentIntent": - PaymentIntentTestInstance.create('id1').toJsonMap() + "paymentIntent": PaymentIntentTestInstance.create( + 'id1', + ).toJsonMap(), }, ).methodChannel, ); @@ -282,8 +291,9 @@ void main() { channelName: methodChannelName, method: 'retrievePaymentIntent', result: { - "paymentIntent": - PaymentIntentTestInstance.create('id1').toJsonMap() + "paymentIntent": PaymentIntentTestInstance.create( + 'id1', + ).toJsonMap(), }, ).methodChannel, ); @@ -307,8 +317,10 @@ void main() { ); }); test('It returns paymentintent', () async { - expect(() async => await sut.retrievePaymentIntent('clientSecret'), - throwsA(const TypeMatcher())); + expect( + () async => await sut.retrievePaymentIntent('clientSecret'), + throwsA(const TypeMatcher()), + ); }); }); }); @@ -329,7 +341,8 @@ void main() { await sut .initPaymentSheet( const SetupPaymentSheetParameters( - paymentIntentClientSecret: 'paymentIntentClientSecret'), + paymentIntentClientSecret: 'paymentIntentClientSecret', + ), ) .then((_) => completer.complete()); }); @@ -401,8 +414,10 @@ void main() { }); test('It throws StripePlatformEsception', () async { - expectLater(() async => await sut.presentPaymentSheet(), - throwsA(isInstanceOf())); + expectLater( + () async => await sut.presentPaymentSheet(), + throwsA(isInstanceOf()), + ); }); }); @@ -418,8 +433,9 @@ void main() { result: true, ).methodChannel, ); - result = await sut - .googlePayIsSupported(const IsGooglePaySupportedParams()); + result = await sut.googlePayIsSupported( + const IsGooglePaySupportedParams(), + ); }); test('It returns result', () { @@ -439,8 +455,9 @@ void main() { result: true, ).methodChannel, ); - result = await sut - .googlePayIsSupported(const IsGooglePaySupportedParams()); + result = await sut.googlePayIsSupported( + const IsGooglePaySupportedParams(), + ); }); test('It returns false', () { @@ -460,9 +477,9 @@ void main() { result: {}, ).methodChannel, ); - await sut - .confirmPaymentSheetPayment() - .then((value) => completer.complete()); + await sut.confirmPaymentSheetPayment().then( + (value) => completer.complete(), + ); }); test('It completes operation', () { @@ -476,16 +493,18 @@ void main() { platformIsIos: false, platformIsAndroid: true, methodChannel: MethodChannelMock( - channelName: methodChannelName, - method: 'confirmPaymentSheetPayment', - result: createErrorResponse('whoops')) - .methodChannel, + channelName: methodChannelName, + method: 'confirmPaymentSheetPayment', + result: createErrorResponse('whoops'), + ).methodChannel, ); }); test('It returns failure', () async { - expectLater(() async => await sut.confirmPaymentSheetPayment(), - throwsA(isInstanceOf())); + expectLater( + () async => await sut.confirmPaymentSheetPayment(), + throwsA(isInstanceOf()), + ); }); }); }); @@ -504,10 +523,10 @@ void main() { platformIsIos: false, platformIsAndroid: true, methodChannel: MethodChannelMock( - channelName: methodChannelName, - method: 'createToken', - result: TokenDataTestInstance.create('tokenId').jsonMap()) - .methodChannel, + channelName: methodChannelName, + method: 'createToken', + result: TokenDataTestInstance.create('tokenId').jsonMap(), + ).methodChannel, ); result = await sut.createToken(params); @@ -533,10 +552,9 @@ void main() { test('It returns correct data', () async { expect( - () async => await sut.createToken(params), - throwsA( - const TypeMatcher(), - )); + () async => await sut.createToken(params), + throwsA(const TypeMatcher()), + ); }); }); }); @@ -552,10 +570,7 @@ void main() { method: 'canAddCardToWallet', result: { 'canAddCard': false, - 'details': { - 'token': 'foo', - 'status': 'CARD_ALREADY_EXISTS', - } + 'details': {'token': 'foo', 'status': 'CARD_ALREADY_EXISTS'}, }, ).methodChannel, ); @@ -568,8 +583,9 @@ void main() { const AddToWalletResult( canAddToWallet: false, details: AddToWalletDetails( - status: CanAddToWalletErrorStatus.CARD_ALREADY_EXISTS, - token: 'foo'), + status: CanAddToWalletErrorStatus.CARD_ALREADY_EXISTS, + token: 'foo', + ), ), ); }); @@ -591,8 +607,9 @@ void main() { await sut .initCustomerSheet( const CustomerSheetInitParams( - customerId: 'customerId', - customerEphemeralKeySecret: 'customerEphemeralKeySecret'), + customerId: 'customerId', + customerEphemeralKeySecret: 'customerEphemeralKeySecret', + ), ) .then((_) => completer.complete()); }); diff --git a/packages/stripe_platform_interface/test/test_data.dart b/packages/stripe_platform_interface/test/test_data.dart index 32ea7798b..9bdc658cc 100644 --- a/packages/stripe_platform_interface/test/test_data.dart +++ b/packages/stripe_platform_interface/test/test_data.dart @@ -2,159 +2,158 @@ import 'package:stripe_platform_interface/stripe_platform_interface.dart'; extension PaymentMethodTestInstance on PaymentMethod { static PaymentMethod create(String id) => PaymentMethod( - id: id, - livemode: false, - paymentMethodType: 'paymentType', - billingDetails: const BillingDetails(), - card: const Card(), - sepaDebit: const SepaDebit(), - bacsDebit: const BacsDebit(), - auBecsDebit: const AuBecsDebit(), - sofort: const Sofort(), - ideal: const Ideal(), - fpx: const Fpx(), - upi: const Upi(), - usBankAccount: const UsBankAccount( - accountHolderType: BankAccountHolderType.Individual, - accountType: UsBankAccountType.Checking, - ), - ); + id: id, + livemode: false, + paymentMethodType: 'paymentType', + billingDetails: const BillingDetails(), + card: const Card(), + sepaDebit: const SepaDebit(), + bacsDebit: const BacsDebit(), + auBecsDebit: const AuBecsDebit(), + ideal: const Ideal(), + fpx: const Fpx(), + upi: const Upi(), + usBankAccount: const UsBankAccount( + accountHolderType: BankAccountHolderType.Individual, + accountType: UsBankAccountType.Checking, + ), + ); Map jsonMap() => { - 'id': id, - 'livemode': livemode, - 'paymentMethodType': paymentMethodType, - 'billingDetails': { - 'email': billingDetails.email, - 'address': billingDetails.address, - 'phone': billingDetails.phone, - 'name': billingDetails.name - }, - 'USBankAccount': { - 'routingNumber': usBankAccount.routingNumber, - 'last4': usBankAccount.last4, - 'accountHolderType': usBankAccount.accountHolderType?.name, - 'accountType': usBankAccount.accountType?.name, - 'bankName': usBankAccount.bankName, - 'fingerprint': usBankAccount.fingerprint, - 'linkedAccount': usBankAccount.linkedAccount, - }, - 'Card': { - 'brand': card.brand, - 'country': card.country, - 'expYear': card.expYear, - 'expMonth': card.expMonth, - 'funding': card.funding, - 'last4': card.last4, - }, - 'SepaDebit': { - 'country': sepaDebit.country, - 'bankCode': sepaDebit.bankCode, - 'fingerprint': sepaDebit.fingerprint, - 'last4': sepaDebit.last4 - }, - 'BacsDebit': { - 'sortCode': bacsDebit.sortCode, - 'fingerprint': bacsDebit.fingerprint, - 'last4': bacsDebit.last4 - }, - 'AuBecsDebit': { - 'fingerprint': auBecsDebit.fingerprint, - 'last4': auBecsDebit.last4, - 'bsbNumber': auBecsDebit.bsbNumber, - }, - 'Sofort': {'country': sofort.country}, - 'Ideal': { - 'bankIdentifierCode': ideal.bankIdentifierCode, - 'bank': ideal.bank - }, - 'Fpx': {'bank': fpx.bank, 'accountHolderType': fpx.accountHolderType}, - 'Upi': {'vpa': upi.vpa}, - 'customerId': customerId, - }; + 'id': id, + 'livemode': livemode, + 'paymentMethodType': paymentMethodType, + 'billingDetails': { + 'email': billingDetails.email, + 'address': billingDetails.address, + 'phone': billingDetails.phone, + 'name': billingDetails.name, + }, + 'USBankAccount': { + 'routingNumber': usBankAccount.routingNumber, + 'last4': usBankAccount.last4, + 'accountHolderType': usBankAccount.accountHolderType?.name, + 'accountType': usBankAccount.accountType?.name, + 'bankName': usBankAccount.bankName, + 'fingerprint': usBankAccount.fingerprint, + 'linkedAccount': usBankAccount.linkedAccount, + }, + 'Card': { + 'brand': card.brand, + 'country': card.country, + 'expYear': card.expYear, + 'expMonth': card.expMonth, + 'funding': card.funding, + 'last4': card.last4, + }, + 'SepaDebit': { + 'country': sepaDebit.country, + 'bankCode': sepaDebit.bankCode, + 'fingerprint': sepaDebit.fingerprint, + 'last4': sepaDebit.last4, + }, + 'BacsDebit': { + 'sortCode': bacsDebit.sortCode, + 'fingerprint': bacsDebit.fingerprint, + 'last4': bacsDebit.last4, + }, + 'AuBecsDebit': { + 'fingerprint': auBecsDebit.fingerprint, + 'last4': auBecsDebit.last4, + 'bsbNumber': auBecsDebit.bsbNumber, + }, + 'Ideal': { + 'bankIdentifierCode': ideal.bankIdentifierCode, + 'bank': ideal.bank, + }, + 'Fpx': {'bank': fpx.bank, 'accountHolderType': fpx.accountHolderType}, + 'Upi': {'vpa': upi.vpa}, + 'customerId': customerId, + }; } extension PaymentIntentTestInstance on PaymentIntent { static PaymentIntent create(String id) => PaymentIntent( - id: id, - amount: 100, - created: '10', - currency: 'Usd', - status: PaymentIntentsStatus.Succeeded, - clientSecret: 'clientSecret', - livemode: false, - paymentMethodId: 'paymentMethodId', - captureMethod: CaptureMethod.Automatic, - confirmationMethod: ConfirmationMethod.Automatic, - ); + id: id, + amount: 100, + created: '10', + currency: 'Usd', + status: PaymentIntentsStatus.Succeeded, + clientSecret: 'clientSecret', + livemode: false, + paymentMethodId: 'paymentMethodId', + captureMethod: CaptureMethod.Automatic, + confirmationMethod: ConfirmationMethod.Automatic, + ); Map toJsonMap() => { - 'id': id, - 'amount': amount, - 'created': created, - 'currency': currency, - 'status': status.name, - 'clientSecret': clientSecret, - 'livemode': livemode, - 'paymentMethodId': paymentMethodId, - 'captureMethod': captureMethod.name, - 'confirmationMethod': confirmationMethod.name, - 'description': description, - 'receiptEmail': receiptEmail, - 'canceledAt': canceledAt, - 'shipping': shipping, - }; + 'id': id, + 'amount': amount, + 'created': created, + 'currency': currency, + 'status': status.name, + 'clientSecret': clientSecret, + 'livemode': livemode, + 'paymentMethodId': paymentMethodId, + 'captureMethod': captureMethod.name, + 'confirmationMethod': confirmationMethod.name, + 'description': description, + 'receiptEmail': receiptEmail, + 'canceledAt': canceledAt, + 'shipping': shipping, + }; } extension SetupIntentTestInstance on SetupIntent { static SetupIntent create(String id) => SetupIntent( - id: id, - status: 'success', - livemode: false, - clientSecret: 'clientSecret', - paymentMethodId: 'paymentMethodId', - usage: 'usage', - paymentMethodTypes: [PaymentMethodType.Card]); + id: id, + status: 'success', + livemode: false, + clientSecret: 'clientSecret', + paymentMethodId: 'paymentMethodId', + usage: 'usage', + paymentMethodTypes: [PaymentMethodType.Card], + ); Map toJsonMap(String id) => { - 'id': id, - 'status': status, - 'livemode': livemode, - 'clientSecret': clientSecret, - 'paymentMethodId': paymentMethodId, - 'usage': usage, - 'paymentMethodTypes': paymentMethodTypes.map((e) => e.name).toList(), - 'description': description, - 'created': created, - 'lastSetupError': lastSetupError, - }; + 'id': id, + 'status': status, + 'livemode': livemode, + 'clientSecret': clientSecret, + 'paymentMethodId': paymentMethodId, + 'usage': usage, + 'paymentMethodTypes': paymentMethodTypes.map((e) => e.name).toList(), + 'description': description, + 'created': created, + 'lastSetupError': lastSetupError, + }; } extension TokenDataTestInstance on TokenData { static TokenData create(String id) => TokenData( - id: id, - created: '1337', - type: TokenType.Card, - livemode: false, - card: const CardData(brand: 'Visa'), - ); + id: id, + created: '1337', + type: TokenType.Card, + livemode: false, + card: const CardData(brand: 'Visa'), + ); Map jsonMap() => { - 'token': { - 'id': id, - 'livemode': livemode, - 'type': type.name, - 'created': created, - 'card': { - 'brand': card?.brand, - 'country': card?.country, - 'expYear': card?.expYear, - 'expMonth': card?.expMonth, - 'funding': card?.funding, - 'last4': card?.last4, - }, - } - }; + 'token': { + 'id': id, + 'livemode': livemode, + 'type': type.name, + 'created': created, + 'card': { + 'brand': card?.brand, + 'country': card?.country, + 'expYear': card?.expYear, + 'expMonth': card?.expMonth, + 'funding': card?.funding, + 'last4': card?.last4, + }, + }, + }; } Map createErrorResponse(String message) { @@ -165,7 +164,7 @@ Map createErrorResponse(String message) { "code": "Failed", "localizedMessage": "foo", "type": null, - "message": message + "message": message, }, }; } diff --git a/packages/stripe_web/lib/src/models/confirm_payment_options.dart b/packages/stripe_web/lib/src/models/confirm_payment_options.dart index 0238c8da1..6826a74c7 100644 --- a/packages/stripe_web/lib/src/models/confirm_payment_options.dart +++ b/packages/stripe_web/lib/src/models/confirm_payment_options.dart @@ -7,7 +7,7 @@ part 'confirm_payment_options.freezed.dart'; part 'confirm_payment_options.g.dart'; @freezed -class ConfirmPaymentElementOptions with _$ConfirmPaymentElementOptions { +abstract class ConfirmPaymentElementOptions with _$ConfirmPaymentElementOptions { const factory ConfirmPaymentElementOptions({ /// Parameters that will be passed on to the Stripe API. /// Refer to the Payment Intents API for a full list of parameters. diff --git a/packages/stripe_web/lib/src/models/confirm_payment_options.freezed.dart b/packages/stripe_web/lib/src/models/confirm_payment_options.freezed.dart index fcbf0a786..90f364d0e 100644 --- a/packages/stripe_web/lib/src/models/confirm_payment_options.freezed.dart +++ b/packages/stripe_web/lib/src/models/confirm_payment_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,250 +9,314 @@ part of 'confirm_payment_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -ConfirmPaymentElementOptions _$ConfirmPaymentElementOptionsFromJson( - Map json) { - return _ConfirmPaymentElementOptions.fromJson(json); -} - /// @nodoc mixin _$ConfirmPaymentElementOptions { - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - ConfirmPaymentParams get confirmParams => throw _privateConstructorUsedError; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - PaymentConfirmationRedirect? get redirect => - throw _privateConstructorUsedError; + +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. + ConfirmPaymentParams get confirmParams;/// By default, stripe.confirmPayment will always redirect to your +/// return_url after a successful confirmation. +/// If you set redirect: "if_required", then stripe.confirmPayment will +/// only redirect if your user chooses a redirect-based payment method. +/// +/// Note: Setting if_required requires that you handle successful +/// confirmations for redirect-based and non-redirect based payment +/// methods separately. When a non-redirect based payment method is +/// successfully confirmed, stripe.confirmPayment will resolve with a +/// {paymentIntent} object. + PaymentConfirmationRedirect? get redirect; +/// Create a copy of ConfirmPaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmPaymentElementOptionsCopyWith get copyWith => _$ConfirmPaymentElementOptionsCopyWithImpl(this as ConfirmPaymentElementOptions, _$identity); /// Serializes this ConfirmPaymentElementOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmPaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmPaymentElementOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmPaymentElementOptions&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); } -/// @nodoc -abstract class $ConfirmPaymentElementOptionsCopyWith<$Res> { - factory $ConfirmPaymentElementOptionsCopyWith( - ConfirmPaymentElementOptions value, - $Res Function(ConfirmPaymentElementOptions) then) = - _$ConfirmPaymentElementOptionsCopyWithImpl<$Res, - ConfirmPaymentElementOptions>; - @useResult - $Res call( - {ConfirmPaymentParams confirmParams, - PaymentConfirmationRedirect? redirect}); - - $ConfirmPaymentParamsCopyWith<$Res> get confirmParams; +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,confirmParams,redirect); + +@override +String toString() { + return 'ConfirmPaymentElementOptions(confirmParams: $confirmParams, redirect: $redirect)'; } -/// @nodoc -class _$ConfirmPaymentElementOptionsCopyWithImpl<$Res, - $Val extends ConfirmPaymentElementOptions> - implements $ConfirmPaymentElementOptionsCopyWith<$Res> { - _$ConfirmPaymentElementOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmPaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_value.copyWith( - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmPaymentParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as PaymentConfirmationRedirect?, - ) as $Val); - } - - /// Create a copy of ConfirmPaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ConfirmPaymentParamsCopyWith<$Res> get confirmParams { - return $ConfirmPaymentParamsCopyWith<$Res>(_value.confirmParams, (value) { - return _then(_value.copyWith(confirmParams: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$ConfirmPaymentElementOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmPaymentElementOptionsCopyWith<$Res> { + factory $ConfirmPaymentElementOptionsCopyWith(ConfirmPaymentElementOptions value, $Res Function(ConfirmPaymentElementOptions) _then) = _$ConfirmPaymentElementOptionsCopyWithImpl; +@useResult +$Res call({ + ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect +}); + + +$ConfirmPaymentParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class _$ConfirmPaymentElementOptionsCopyWithImpl<$Res> implements $ConfirmPaymentElementOptionsCopyWith<$Res> { - factory _$$ConfirmPaymentElementOptionsImplCopyWith( - _$ConfirmPaymentElementOptionsImpl value, - $Res Function(_$ConfirmPaymentElementOptionsImpl) then) = - __$$ConfirmPaymentElementOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ConfirmPaymentParams confirmParams, - PaymentConfirmationRedirect? redirect}); - - @override - $ConfirmPaymentParamsCopyWith<$Res> get confirmParams; + _$ConfirmPaymentElementOptionsCopyWithImpl(this._self, this._then); + + final ConfirmPaymentElementOptions _self; + final $Res Function(ConfirmPaymentElementOptions) _then; + +/// Create a copy of ConfirmPaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_self.copyWith( +confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmPaymentParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as PaymentConfirmationRedirect?, + )); +} +/// Create a copy of ConfirmPaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmPaymentParamsCopyWith<$Res> get confirmParams { + + return $ConfirmPaymentParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ConfirmPaymentElementOptions]. +extension ConfirmPaymentElementOptionsPatterns on ConfirmPaymentElementOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _ConfirmPaymentElementOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ConfirmPaymentElementOptions() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _ConfirmPaymentElementOptions value) $default,){ +final _that = this; +switch (_that) { +case _ConfirmPaymentElementOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ConfirmPaymentElementOptions value)? $default,){ +final _that = this; +switch (_that) { +case _ConfirmPaymentElementOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ConfirmPaymentElementOptions() when $default != null: +return $default(_that.confirmParams,_that.redirect);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect) $default,) {final _that = this; +switch (_that) { +case _ConfirmPaymentElementOptions(): +return $default(_that.confirmParams,_that.redirect);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect)? $default,) {final _that = this; +switch (_that) { +case _ConfirmPaymentElementOptions() when $default != null: +return $default(_that.confirmParams,_that.redirect);case _: + return null; + +} } -/// @nodoc -class __$$ConfirmPaymentElementOptionsImplCopyWithImpl<$Res> - extends _$ConfirmPaymentElementOptionsCopyWithImpl<$Res, - _$ConfirmPaymentElementOptionsImpl> - implements _$$ConfirmPaymentElementOptionsImplCopyWith<$Res> { - __$$ConfirmPaymentElementOptionsImplCopyWithImpl( - _$ConfirmPaymentElementOptionsImpl _value, - $Res Function(_$ConfirmPaymentElementOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmPaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_$ConfirmPaymentElementOptionsImpl( - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmPaymentParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as PaymentConfirmationRedirect?, - )); - } } /// @nodoc @JsonSerializable() -class _$ConfirmPaymentElementOptionsImpl - implements _ConfirmPaymentElementOptions { - const _$ConfirmPaymentElementOptionsImpl( - {required this.confirmParams, this.redirect}); - - factory _$ConfirmPaymentElementOptionsImpl.fromJson( - Map json) => - _$$ConfirmPaymentElementOptionsImplFromJson(json); - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - final ConfirmPaymentParams confirmParams; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - @override - final PaymentConfirmationRedirect? redirect; - - @override - String toString() { - return 'ConfirmPaymentElementOptions(confirmParams: $confirmParams, redirect: $redirect)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmPaymentElementOptionsImpl && - (identical(other.confirmParams, confirmParams) || - other.confirmParams == confirmParams) && - (identical(other.redirect, redirect) || - other.redirect == redirect)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, confirmParams, redirect); - - /// Create a copy of ConfirmPaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmPaymentElementOptionsImplCopyWith< - _$ConfirmPaymentElementOptionsImpl> - get copyWith => __$$ConfirmPaymentElementOptionsImplCopyWithImpl< - _$ConfirmPaymentElementOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$ConfirmPaymentElementOptionsImplToJson( - this, - ); - } + +class _ConfirmPaymentElementOptions implements ConfirmPaymentElementOptions { + const _ConfirmPaymentElementOptions({required this.confirmParams, this.redirect}); + factory _ConfirmPaymentElementOptions.fromJson(Map json) => _$ConfirmPaymentElementOptionsFromJson(json); + +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. +@override final ConfirmPaymentParams confirmParams; +/// By default, stripe.confirmPayment will always redirect to your +/// return_url after a successful confirmation. +/// If you set redirect: "if_required", then stripe.confirmPayment will +/// only redirect if your user chooses a redirect-based payment method. +/// +/// Note: Setting if_required requires that you handle successful +/// confirmations for redirect-based and non-redirect based payment +/// methods separately. When a non-redirect based payment method is +/// successfully confirmed, stripe.confirmPayment will resolve with a +/// {paymentIntent} object. +@override final PaymentConfirmationRedirect? redirect; + +/// Create a copy of ConfirmPaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ConfirmPaymentElementOptionsCopyWith<_ConfirmPaymentElementOptions> get copyWith => __$ConfirmPaymentElementOptionsCopyWithImpl<_ConfirmPaymentElementOptions>(this, _$identity); + +@override +Map toJson() { + return _$ConfirmPaymentElementOptionsToJson(this, ); } -abstract class _ConfirmPaymentElementOptions - implements ConfirmPaymentElementOptions { - const factory _ConfirmPaymentElementOptions( - {required final ConfirmPaymentParams confirmParams, - final PaymentConfirmationRedirect? redirect}) = - _$ConfirmPaymentElementOptionsImpl; - - factory _ConfirmPaymentElementOptions.fromJson(Map json) = - _$ConfirmPaymentElementOptionsImpl.fromJson; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Payment Intents API for a full list of parameters. - @override - ConfirmPaymentParams get confirmParams; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - @override - PaymentConfirmationRedirect? get redirect; - - /// Create a copy of ConfirmPaymentElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmPaymentElementOptionsImplCopyWith< - _$ConfirmPaymentElementOptionsImpl> - get copyWith => throw _privateConstructorUsedError; +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConfirmPaymentElementOptions&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); } + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,confirmParams,redirect); + +@override +String toString() { + return 'ConfirmPaymentElementOptions(confirmParams: $confirmParams, redirect: $redirect)'; +} + + +} + +/// @nodoc +abstract mixin class _$ConfirmPaymentElementOptionsCopyWith<$Res> implements $ConfirmPaymentElementOptionsCopyWith<$Res> { + factory _$ConfirmPaymentElementOptionsCopyWith(_ConfirmPaymentElementOptions value, $Res Function(_ConfirmPaymentElementOptions) _then) = __$ConfirmPaymentElementOptionsCopyWithImpl; +@override @useResult +$Res call({ + ConfirmPaymentParams confirmParams, PaymentConfirmationRedirect? redirect +}); + + +@override $ConfirmPaymentParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class __$ConfirmPaymentElementOptionsCopyWithImpl<$Res> + implements _$ConfirmPaymentElementOptionsCopyWith<$Res> { + __$ConfirmPaymentElementOptionsCopyWithImpl(this._self, this._then); + + final _ConfirmPaymentElementOptions _self; + final $Res Function(_ConfirmPaymentElementOptions) _then; + +/// Create a copy of ConfirmPaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_ConfirmPaymentElementOptions( +confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmPaymentParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as PaymentConfirmationRedirect?, + )); +} + +/// Create a copy of ConfirmPaymentElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmPaymentParamsCopyWith<$Res> get confirmParams { + + return $ConfirmPaymentParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + +// dart format on diff --git a/packages/stripe_web/lib/src/models/confirm_payment_options.g.dart b/packages/stripe_web/lib/src/models/confirm_payment_options.g.dart index c2d2df858..534513af9 100644 --- a/packages/stripe_web/lib/src/models/confirm_payment_options.g.dart +++ b/packages/stripe_web/lib/src/models/confirm_payment_options.g.dart @@ -6,31 +6,24 @@ part of 'confirm_payment_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ConfirmPaymentElementOptionsImpl _$$ConfirmPaymentElementOptionsImplFromJson( - Map json) => - _$ConfirmPaymentElementOptionsImpl( - confirmParams: ConfirmPaymentParams.fromJson( - Map.from(json['confirmParams'] as Map)), - redirect: $enumDecodeNullable( - _$PaymentConfirmationRedirectEnumMap, json['redirect']), - ); +_ConfirmPaymentElementOptions _$ConfirmPaymentElementOptionsFromJson( + Map json, +) => _ConfirmPaymentElementOptions( + confirmParams: ConfirmPaymentParams.fromJson( + Map.from(json['confirmParams'] as Map), + ), + redirect: $enumDecodeNullable( + _$PaymentConfirmationRedirectEnumMap, + json['redirect'], + ), +); -Map _$$ConfirmPaymentElementOptionsImplToJson( - _$ConfirmPaymentElementOptionsImpl instance) { - final val = { - 'confirmParams': instance.confirmParams.toJson(), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'redirect', _$PaymentConfirmationRedirectEnumMap[instance.redirect]); - return val; -} +Map _$ConfirmPaymentElementOptionsToJson( + _ConfirmPaymentElementOptions instance, +) => { + 'confirmParams': instance.confirmParams.toJson(), + 'redirect': ?_$PaymentConfirmationRedirectEnumMap[instance.redirect], +}; const _$PaymentConfirmationRedirectEnumMap = { PaymentConfirmationRedirect.always: 'always', diff --git a/packages/stripe_web/lib/src/models/confirm_setup_options.dart b/packages/stripe_web/lib/src/models/confirm_setup_options.dart index 21ef60c9d..5d6bf0251 100644 --- a/packages/stripe_web/lib/src/models/confirm_setup_options.dart +++ b/packages/stripe_web/lib/src/models/confirm_setup_options.dart @@ -7,7 +7,7 @@ part 'confirm_setup_options.freezed.dart'; part 'confirm_setup_options.g.dart'; @freezed -class ConfirmSetupElementOptions with _$ConfirmSetupElementOptions { +abstract class ConfirmSetupElementOptions with _$ConfirmSetupElementOptions { const factory ConfirmSetupElementOptions({ /// Parameters that will be passed on to the Stripe API. /// Refer to the Payment Intents API for a full list of parameters. diff --git a/packages/stripe_web/lib/src/models/confirm_setup_options.freezed.dart b/packages/stripe_web/lib/src/models/confirm_setup_options.freezed.dart index a5fb605bd..5c47c6f00 100644 --- a/packages/stripe_web/lib/src/models/confirm_setup_options.freezed.dart +++ b/packages/stripe_web/lib/src/models/confirm_setup_options.freezed.dart @@ -1,5 +1,5 @@ -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark @@ -9,243 +9,309 @@ part of 'confirm_setup_options.dart'; // FreezedGenerator // ************************************************************************** +// dart format off T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - ConfirmSetupElementOptions _$ConfirmSetupElementOptionsFromJson( - Map json) { - return _SetupPaymentElementOptions.fromJson(json); + Map json +) { + return _SetupPaymentElementOptions.fromJson( + json + ); } /// @nodoc mixin _$ConfirmSetupElementOptions { - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Setup Intents API for a full list of parameters. - ConfirmSetupParams get confirmParams => throw _privateConstructorUsedError; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - SetupConfirmationRedirect? get redirect => throw _privateConstructorUsedError; + +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. + ConfirmSetupParams get confirmParams;/// By default, stripe.confirmPayment will always redirect to +/// your return_url after a successful confirmation. +/// If you set redirect: "if_required", then stripe.confirmPayment +/// will only redirect if your user chooses a redirect-based payment method. + SetupConfirmationRedirect? get redirect; +/// Create a copy of ConfirmSetupElementOptions +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ConfirmSetupElementOptionsCopyWith get copyWith => _$ConfirmSetupElementOptionsCopyWithImpl(this as ConfirmSetupElementOptions, _$identity); /// Serializes this ConfirmSetupElementOptions to a JSON map. - Map toJson() => throw _privateConstructorUsedError; + Map toJson(); - /// Create a copy of ConfirmSetupElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmSetupElementOptionsCopyWith - get copyWith => throw _privateConstructorUsedError; + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConfirmSetupElementOptions&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); } -/// @nodoc -abstract class $ConfirmSetupElementOptionsCopyWith<$Res> { - factory $ConfirmSetupElementOptionsCopyWith(ConfirmSetupElementOptions value, - $Res Function(ConfirmSetupElementOptions) then) = - _$ConfirmSetupElementOptionsCopyWithImpl<$Res, - ConfirmSetupElementOptions>; - @useResult - $Res call( - {ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect}); +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,confirmParams,redirect); - $ConfirmSetupParamsCopyWith<$Res> get confirmParams; +@override +String toString() { + return 'ConfirmSetupElementOptions(confirmParams: $confirmParams, redirect: $redirect)'; } -/// @nodoc -class _$ConfirmSetupElementOptionsCopyWithImpl<$Res, - $Val extends ConfirmSetupElementOptions> - implements $ConfirmSetupElementOptionsCopyWith<$Res> { - _$ConfirmSetupElementOptionsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmSetupElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_value.copyWith( - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmSetupParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as SetupConfirmationRedirect?, - ) as $Val); - } - - /// Create a copy of ConfirmSetupElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $ConfirmSetupParamsCopyWith<$Res> get confirmParams { - return $ConfirmSetupParamsCopyWith<$Res>(_value.confirmParams, (value) { - return _then(_value.copyWith(confirmParams: value) as $Val); - }); - } + } /// @nodoc -abstract class _$$SetupPaymentElementOptionsImplCopyWith<$Res> +abstract mixin class $ConfirmSetupElementOptionsCopyWith<$Res> { + factory $ConfirmSetupElementOptionsCopyWith(ConfirmSetupElementOptions value, $Res Function(ConfirmSetupElementOptions) _then) = _$ConfirmSetupElementOptionsCopyWithImpl; +@useResult +$Res call({ + ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect +}); + + +$ConfirmSetupParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class _$ConfirmSetupElementOptionsCopyWithImpl<$Res> implements $ConfirmSetupElementOptionsCopyWith<$Res> { - factory _$$SetupPaymentElementOptionsImplCopyWith( - _$SetupPaymentElementOptionsImpl value, - $Res Function(_$SetupPaymentElementOptionsImpl) then) = - __$$SetupPaymentElementOptionsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect}); + _$ConfirmSetupElementOptionsCopyWithImpl(this._self, this._then); + + final ConfirmSetupElementOptions _self; + final $Res Function(ConfirmSetupElementOptions) _then; + +/// Create a copy of ConfirmSetupElementOptions +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_self.copyWith( +confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmSetupParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as SetupConfirmationRedirect?, + )); +} +/// Create a copy of ConfirmSetupElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmSetupParamsCopyWith<$Res> get confirmParams { + + return $ConfirmSetupParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [ConfirmSetupElementOptions]. +extension ConfirmSetupElementOptionsPatterns on ConfirmSetupElementOptions { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _SetupPaymentElementOptions value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _SetupPaymentElementOptions() when $default != null: +return $default(_that);case _: + return orElse(); - @override - $ConfirmSetupParamsCopyWith<$Res> get confirmParams; +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _SetupPaymentElementOptions value) $default,){ +final _that = this; +switch (_that) { +case _SetupPaymentElementOptions(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SetupPaymentElementOptions value)? $default,){ +final _that = this; +switch (_that) { +case _SetupPaymentElementOptions() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _SetupPaymentElementOptions() when $default != null: +return $default(_that.confirmParams,_that.redirect);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect) $default,) {final _that = this; +switch (_that) { +case _SetupPaymentElementOptions(): +return $default(_that.confirmParams,_that.redirect);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect)? $default,) {final _that = this; +switch (_that) { +case _SetupPaymentElementOptions() when $default != null: +return $default(_that.confirmParams,_that.redirect);case _: + return null; + +} } -/// @nodoc -class __$$SetupPaymentElementOptionsImplCopyWithImpl<$Res> - extends _$ConfirmSetupElementOptionsCopyWithImpl<$Res, - _$SetupPaymentElementOptionsImpl> - implements _$$SetupPaymentElementOptionsImplCopyWith<$Res> { - __$$SetupPaymentElementOptionsImplCopyWithImpl( - _$SetupPaymentElementOptionsImpl _value, - $Res Function(_$SetupPaymentElementOptionsImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmSetupElementOptions - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? confirmParams = null, - Object? redirect = freezed, - }) { - return _then(_$SetupPaymentElementOptionsImpl( - confirmParams: null == confirmParams - ? _value.confirmParams - : confirmParams // ignore: cast_nullable_to_non_nullable - as ConfirmSetupParams, - redirect: freezed == redirect - ? _value.redirect - : redirect // ignore: cast_nullable_to_non_nullable - as SetupConfirmationRedirect?, - )); - } } /// @nodoc @JsonSerializable() -class _$SetupPaymentElementOptionsImpl implements _SetupPaymentElementOptions { - const _$SetupPaymentElementOptionsImpl( - {required this.confirmParams, this.redirect}); - - factory _$SetupPaymentElementOptionsImpl.fromJson( - Map json) => - _$$SetupPaymentElementOptionsImplFromJson(json); - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Setup Intents API for a full list of parameters. - @override - final ConfirmSetupParams confirmParams; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - @override - final SetupConfirmationRedirect? redirect; - - @override - String toString() { - return 'ConfirmSetupElementOptions(confirmParams: $confirmParams, redirect: $redirect)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$SetupPaymentElementOptionsImpl && - (identical(other.confirmParams, confirmParams) || - other.confirmParams == confirmParams) && - (identical(other.redirect, redirect) || - other.redirect == redirect)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, confirmParams, redirect); - - /// Create a copy of ConfirmSetupElementOptions - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$SetupPaymentElementOptionsImplCopyWith<_$SetupPaymentElementOptionsImpl> - get copyWith => __$$SetupPaymentElementOptionsImplCopyWithImpl< - _$SetupPaymentElementOptionsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$SetupPaymentElementOptionsImplToJson( - this, - ); - } -} - -abstract class _SetupPaymentElementOptions - implements ConfirmSetupElementOptions { - const factory _SetupPaymentElementOptions( - {required final ConfirmSetupParams confirmParams, - final SetupConfirmationRedirect? redirect}) = - _$SetupPaymentElementOptionsImpl; - - factory _SetupPaymentElementOptions.fromJson(Map json) = - _$SetupPaymentElementOptionsImpl.fromJson; - - /// Parameters that will be passed on to the Stripe API. - /// Refer to the Setup Intents API for a full list of parameters. - @override - ConfirmSetupParams get confirmParams; - - /// By default, stripe.confirmPayment will always redirect to your - /// return_url after a successful confirmation. - /// If you set redirect: "if_required", then stripe.confirmPayment will - /// only redirect if your user chooses a redirect-based payment method. - /// - /// Note: Setting if_required requires that you handle successful - /// confirmations for redirect-based and non-redirect based payment - /// methods separately. When a non-redirect based payment method is - /// successfully confirmed, stripe.confirmPayment will resolve with a - /// {paymentIntent} object. - @override - SetupConfirmationRedirect? get redirect; - - /// Create a copy of ConfirmSetupElementOptions - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$SetupPaymentElementOptionsImplCopyWith<_$SetupPaymentElementOptionsImpl> - get copyWith => throw _privateConstructorUsedError; + +class _SetupPaymentElementOptions implements ConfirmSetupElementOptions { + const _SetupPaymentElementOptions({required this.confirmParams, this.redirect}); + factory _SetupPaymentElementOptions.fromJson(Map json) => _$SetupPaymentElementOptionsFromJson(json); + +/// Parameters that will be passed on to the Stripe API. +/// Refer to the Payment Intents API for a full list of parameters. +@override final ConfirmSetupParams confirmParams; +/// By default, stripe.confirmPayment will always redirect to +/// your return_url after a successful confirmation. +/// If you set redirect: "if_required", then stripe.confirmPayment +/// will only redirect if your user chooses a redirect-based payment method. +@override final SetupConfirmationRedirect? redirect; + +/// Create a copy of ConfirmSetupElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$SetupPaymentElementOptionsCopyWith<_SetupPaymentElementOptions> get copyWith => __$SetupPaymentElementOptionsCopyWithImpl<_SetupPaymentElementOptions>(this, _$identity); + +@override +Map toJson() { + return _$SetupPaymentElementOptionsToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SetupPaymentElementOptions&&(identical(other.confirmParams, confirmParams) || other.confirmParams == confirmParams)&&(identical(other.redirect, redirect) || other.redirect == redirect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,confirmParams,redirect); + +@override +String toString() { + return 'ConfirmSetupElementOptions(confirmParams: $confirmParams, redirect: $redirect)'; } + + +} + +/// @nodoc +abstract mixin class _$SetupPaymentElementOptionsCopyWith<$Res> implements $ConfirmSetupElementOptionsCopyWith<$Res> { + factory _$SetupPaymentElementOptionsCopyWith(_SetupPaymentElementOptions value, $Res Function(_SetupPaymentElementOptions) _then) = __$SetupPaymentElementOptionsCopyWithImpl; +@override @useResult +$Res call({ + ConfirmSetupParams confirmParams, SetupConfirmationRedirect? redirect +}); + + +@override $ConfirmSetupParamsCopyWith<$Res> get confirmParams; + +} +/// @nodoc +class __$SetupPaymentElementOptionsCopyWithImpl<$Res> + implements _$SetupPaymentElementOptionsCopyWith<$Res> { + __$SetupPaymentElementOptionsCopyWithImpl(this._self, this._then); + + final _SetupPaymentElementOptions _self; + final $Res Function(_SetupPaymentElementOptions) _then; + +/// Create a copy of ConfirmSetupElementOptions +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? confirmParams = null,Object? redirect = freezed,}) { + return _then(_SetupPaymentElementOptions( +confirmParams: null == confirmParams ? _self.confirmParams : confirmParams // ignore: cast_nullable_to_non_nullable +as ConfirmSetupParams,redirect: freezed == redirect ? _self.redirect : redirect // ignore: cast_nullable_to_non_nullable +as SetupConfirmationRedirect?, + )); +} + +/// Create a copy of ConfirmSetupElementOptions +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$ConfirmSetupParamsCopyWith<$Res> get confirmParams { + + return $ConfirmSetupParamsCopyWith<$Res>(_self.confirmParams, (value) { + return _then(_self.copyWith(confirmParams: value)); + }); +} +} + +// dart format on diff --git a/packages/stripe_web/lib/src/models/confirm_setup_options.g.dart b/packages/stripe_web/lib/src/models/confirm_setup_options.g.dart index 39911f9d0..95e9f68d2 100644 --- a/packages/stripe_web/lib/src/models/confirm_setup_options.g.dart +++ b/packages/stripe_web/lib/src/models/confirm_setup_options.g.dart @@ -6,31 +6,23 @@ part of 'confirm_setup_options.dart'; // JsonSerializableGenerator // ************************************************************************** -_$SetupPaymentElementOptionsImpl _$$SetupPaymentElementOptionsImplFromJson( - Map json) => - _$SetupPaymentElementOptionsImpl( +_SetupPaymentElementOptions _$SetupPaymentElementOptionsFromJson(Map json) => + _SetupPaymentElementOptions( confirmParams: ConfirmSetupParams.fromJson( - Map.from(json['confirmParams'] as Map)), + Map.from(json['confirmParams'] as Map), + ), redirect: $enumDecodeNullable( - _$SetupConfirmationRedirectEnumMap, json['redirect']), + _$SetupConfirmationRedirectEnumMap, + json['redirect'], + ), ); -Map _$$SetupPaymentElementOptionsImplToJson( - _$SetupPaymentElementOptionsImpl instance) { - final val = { - 'confirmParams': instance.confirmParams.toJson(), - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull( - 'redirect', _$SetupConfirmationRedirectEnumMap[instance.redirect]); - return val; -} +Map _$SetupPaymentElementOptionsToJson( + _SetupPaymentElementOptions instance, +) => { + 'confirmParams': instance.confirmParams.toJson(), + 'redirect': ?_$SetupConfirmationRedirectEnumMap[instance.redirect], +}; const _$SetupConfirmationRedirectEnumMap = { SetupConfirmationRedirect.always: 'always', diff --git a/packages/stripe_web/lib/src/parser/payment_methods.dart b/packages/stripe_web/lib/src/parser/payment_methods.dart index f8d84db84..23f12114e 100644 --- a/packages/stripe_web/lib/src/parser/payment_methods.dart +++ b/packages/stripe_web/lib/src/parser/payment_methods.dart @@ -16,7 +16,6 @@ extension PaymentMethodParser on js.PaymentMethod { fpx: const Fpx(), ideal: const Ideal(), sepaDebit: const SepaDebit(), - sofort: const Sofort(), upi: const Upi(), usBankAccount: const UsBankAccount( accountHolderType: BankAccountHolderType.Unknown, diff --git a/packages/stripe_web/pubspec.yaml b/packages/stripe_web/pubspec.yaml index 2d7cab3a3..c96006474 100644 --- a/packages/stripe_web/pubspec.yaml +++ b/packages/stripe_web/pubspec.yaml @@ -4,7 +4,7 @@ version: 6.5.1 homepage: https://github.com/flutter-stripe/flutter_stripe environment: - sdk: ">=3.3.0 <4.0.0" + sdk: ">=3.8.1 <4.0.0" flutter: ">=3.0.0" dependencies: @@ -12,7 +12,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - freezed_annotation: ^2.0.3 + freezed_annotation: ^3.1.0 stripe_platform_interface: ^11.5.0 stripe_js: ^6.4.0 web: ^1.0.0 @@ -21,9 +21,9 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.3.2 - freezed: ^2.3.5 + freezed: ^3.2.0 json_serializable: ^6.5.4 - lints: ^4.0.0 + lints: ^6.0.0 flutter: plugin: diff --git a/pubspec.yaml b/pubspec.yaml index a69e58888..35f8b5140 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: stripe_workspace environment: - sdk: '>=3.0.0 <4.0.0' + sdk: '>=3.8.1 <4.0.0' dev_dependencies: melos: ^3.1.0