|
1 | 1 | // Copyright 2013 The Flutter Authors. All rights reserved.
|
2 | 2 | // Use of this source code is governed by a BSD-style license that can be
|
3 | 3 | // found in the LICENSE file.
|
4 |
| -// Autogenerated from Pigeon (v22.6.2), do not edit directly. |
| 4 | +// Autogenerated from Pigeon (v22.7.2), do not edit directly. |
5 | 5 | // See also: https://pub.dev/packages/pigeon
|
6 | 6 |
|
7 | 7 | import Foundation
|
@@ -457,6 +457,10 @@ protocol InteractiveMediaAdsLibraryPigeonProxyApiDelegate {
|
457 | 457 | /// `IMACompanionDelegate` to the Dart `InstanceManager` and make calls to Dart.
|
458 | 458 | func pigeonApiIMACompanionDelegate(_ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar)
|
459 | 459 | -> PigeonApiIMACompanionDelegate
|
| 460 | + /// An implementation of [PigeonApiIMAAdPodInfo] used to add a new Dart instance of |
| 461 | + /// `IMAAdPodInfo` to the Dart `InstanceManager` and make calls to Dart. |
| 462 | + func pigeonApiIMAAdPodInfo(_ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar) |
| 463 | + -> PigeonApiIMAAdPodInfo |
460 | 464 | }
|
461 | 465 |
|
462 | 466 | extension InteractiveMediaAdsLibraryPigeonProxyApiDelegate {
|
@@ -844,6 +848,17 @@ private class InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter:
|
844 | 848 | return
|
845 | 849 | }
|
846 | 850 |
|
| 851 | + if let instance = value as? IMAAdPodInfo { |
| 852 | + pigeonRegistrar.apiDelegate.pigeonApiIMAAdPodInfo(pigeonRegistrar).pigeonNewInstance( |
| 853 | + pigeonInstance: instance |
| 854 | + ) { _ in } |
| 855 | + super.writeByte(128) |
| 856 | + super.writeValue( |
| 857 | + pigeonRegistrar.instanceManager.identifierWithStrongReference( |
| 858 | + forInstance: instance as AnyObject)!) |
| 859 | + return |
| 860 | + } |
| 861 | + |
847 | 862 | if let instance = value as AnyObject?,
|
848 | 863 | pigeonRegistrar.instanceManager.containsInstance(instance)
|
849 | 864 | {
|
@@ -3564,7 +3579,7 @@ final class PigeonApiIMACompanionAdSlot: PigeonApiProtocolIMACompanionAdSlot {
|
3564 | 3579 | pigeonDefaultConstructorChannel.setMessageHandler(nil)
|
3565 | 3580 | }
|
3566 | 3581 | let sizeChannel = FlutterBasicMessageChannel(
|
3567 |
| - name: "dev.flutter.pigeon.interactive_media_ads.IMACompanionAdSlot.pigeon_defaultConstructor", |
| 3582 | + name: "dev.flutter.pigeon.interactive_media_ads.IMACompanionAdSlot.size", |
3568 | 3583 | binaryMessenger: binaryMessenger, codec: codec)
|
3569 | 3584 | if let api = api {
|
3570 | 3585 | sizeChannel.setMessageHandler { message, reply in
|
@@ -3822,3 +3837,108 @@ final class PigeonApiIMACompanionDelegate: PigeonApiProtocolIMACompanionDelegate
|
3822 | 3837 | }
|
3823 | 3838 |
|
3824 | 3839 | }
|
| 3840 | +protocol PigeonApiDelegateIMAAdPodInfo { |
| 3841 | + /// The position of this ad within an ad pod. |
| 3842 | + /// |
| 3843 | + /// Will be 1 for standalone ads. |
| 3844 | + func adPosition(pigeonApi: PigeonApiIMAAdPodInfo, pigeonInstance: IMAAdPodInfo) throws -> Int64 |
| 3845 | + /// The maximum duration of the pod in seconds. |
| 3846 | + /// |
| 3847 | + /// For unknown duration, -1 is returned. |
| 3848 | + func maxDuration(pigeonApi: PigeonApiIMAAdPodInfo, pigeonInstance: IMAAdPodInfo) throws -> Double |
| 3849 | + /// Returns the index of the ad pod. |
| 3850 | + /// |
| 3851 | + /// Client side: For a preroll pod, returns 0. For midrolls, returns 1, 2,…, |
| 3852 | + /// N. For a postroll pod, returns -1. Defaults to 0 if this ad is not part of |
| 3853 | + /// a pod, or this pod is not part of a playlist. |
| 3854 | + /// |
| 3855 | + /// DAI VOD: Returns the index of the ad pod. For a preroll pod, returns 0. |
| 3856 | + /// For midrolls, returns 1, 2,…,N. For a postroll pod, returns N+1…N+X. |
| 3857 | + /// Defaults to 0 if this ad is not part of a pod, or this pod is not part of |
| 3858 | + /// a playlist. |
| 3859 | + /// |
| 3860 | + /// DAI live stream: For a preroll pod, returns 0. For midrolls, returns the |
| 3861 | + /// break ID. Returns -2 if pod index cannot be determined (internal error). |
| 3862 | + func podIndex(pigeonApi: PigeonApiIMAAdPodInfo, pigeonInstance: IMAAdPodInfo) throws -> Int64 |
| 3863 | + /// The position of the pod in the content in seconds. |
| 3864 | + /// |
| 3865 | + /// Pre-roll returns 0, post-roll returns -1 and mid-rolls return the |
| 3866 | + /// scheduled time of the pod. |
| 3867 | + func timeOffset(pigeonApi: PigeonApiIMAAdPodInfo, pigeonInstance: IMAAdPodInfo) throws -> Double |
| 3868 | + /// Total number of ads in the pod this ad belongs to. |
| 3869 | + /// |
| 3870 | + /// Will be 1 for standalone ads. |
| 3871 | + func totalAds(pigeonApi: PigeonApiIMAAdPodInfo, pigeonInstance: IMAAdPodInfo) throws -> Int64 |
| 3872 | + /// Specifies whether the ad is a bumper. |
| 3873 | + /// |
| 3874 | + /// Bumpers are short videos used to open and close ad breaks. |
| 3875 | + func isBumper(pigeonApi: PigeonApiIMAAdPodInfo, pigeonInstance: IMAAdPodInfo) throws -> Bool |
| 3876 | +} |
| 3877 | + |
| 3878 | +protocol PigeonApiProtocolIMAAdPodInfo { |
| 3879 | +} |
| 3880 | + |
| 3881 | +final class PigeonApiIMAAdPodInfo: PigeonApiProtocolIMAAdPodInfo { |
| 3882 | + unowned let pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar |
| 3883 | + let pigeonDelegate: PigeonApiDelegateIMAAdPodInfo |
| 3884 | + init( |
| 3885 | + pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar, |
| 3886 | + delegate: PigeonApiDelegateIMAAdPodInfo |
| 3887 | + ) { |
| 3888 | + self.pigeonRegistrar = pigeonRegistrar |
| 3889 | + self.pigeonDelegate = delegate |
| 3890 | + } |
| 3891 | + ///Creates a Dart instance of IMAAdPodInfo and attaches it to [pigeonInstance]. |
| 3892 | + func pigeonNewInstance( |
| 3893 | + pigeonInstance: IMAAdPodInfo, completion: @escaping (Result<Void, PigeonError>) -> Void |
| 3894 | + ) { |
| 3895 | + if pigeonRegistrar.ignoreCallsToDart { |
| 3896 | + completion( |
| 3897 | + .failure( |
| 3898 | + PigeonError( |
| 3899 | + code: "ignore-calls-error", |
| 3900 | + message: "Calls to Dart are being ignored.", details: ""))) |
| 3901 | + return |
| 3902 | + } |
| 3903 | + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { |
| 3904 | + completion(.success(Void())) |
| 3905 | + return |
| 3906 | + } |
| 3907 | + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( |
| 3908 | + pigeonInstance as AnyObject) |
| 3909 | + let adPositionArg = try! pigeonDelegate.adPosition( |
| 3910 | + pigeonApi: self, pigeonInstance: pigeonInstance) |
| 3911 | + let maxDurationArg = try! pigeonDelegate.maxDuration( |
| 3912 | + pigeonApi: self, pigeonInstance: pigeonInstance) |
| 3913 | + let podIndexArg = try! pigeonDelegate.podIndex(pigeonApi: self, pigeonInstance: pigeonInstance) |
| 3914 | + let timeOffsetArg = try! pigeonDelegate.timeOffset( |
| 3915 | + pigeonApi: self, pigeonInstance: pigeonInstance) |
| 3916 | + let totalAdsArg = try! pigeonDelegate.totalAds(pigeonApi: self, pigeonInstance: pigeonInstance) |
| 3917 | + let isBumperArg = try! pigeonDelegate.isBumper(pigeonApi: self, pigeonInstance: pigeonInstance) |
| 3918 | + let binaryMessenger = pigeonRegistrar.binaryMessenger |
| 3919 | + let codec = pigeonRegistrar.codec |
| 3920 | + let channelName: String = |
| 3921 | + "dev.flutter.pigeon.interactive_media_ads.IMAAdPodInfo.pigeon_newInstance" |
| 3922 | + let channel = FlutterBasicMessageChannel( |
| 3923 | + name: channelName, binaryMessenger: binaryMessenger, codec: codec) |
| 3924 | + channel.sendMessage( |
| 3925 | + [ |
| 3926 | + pigeonIdentifierArg, adPositionArg, maxDurationArg, podIndexArg, timeOffsetArg, totalAdsArg, |
| 3927 | + isBumperArg, |
| 3928 | + ] as [Any?] |
| 3929 | + ) { response in |
| 3930 | + guard let listResponse = response as? [Any?] else { |
| 3931 | + completion(.failure(createConnectionError(withChannelName: channelName))) |
| 3932 | + return |
| 3933 | + } |
| 3934 | + if listResponse.count > 1 { |
| 3935 | + let code: String = listResponse[0] as! String |
| 3936 | + let message: String? = nilOrValue(listResponse[1]) |
| 3937 | + let details: String? = nilOrValue(listResponse[2]) |
| 3938 | + completion(.failure(PigeonError(code: code, message: message, details: details))) |
| 3939 | + } else { |
| 3940 | + completion(.success(Void())) |
| 3941 | + } |
| 3942 | + } |
| 3943 | + } |
| 3944 | +} |
0 commit comments