diff --git a/.github/workflows/patrol-prepare.yaml b/.github/workflows/patrol-prepare.yaml index 6d8c6bac6..6b669996d 100644 --- a/.github/workflows/patrol-prepare.yaml +++ b/.github/workflows/patrol-prepare.yaml @@ -154,13 +154,14 @@ jobs: - name: Run unit tests working-directory: packages/patrol/example/ios run: | + set -o pipefail xcodebuild test \ -workspace Runner.xcworkspace \ -scheme Runner \ -only-testing RunnerTests \ -configuration Debug \ -sdk iphoneos -destination 'platform=iOS Simulator,name=iPhone 14' \ - -derivedDataPath ../build/ios_unit | xcbeautify + -derivedDataPath ../build/ios_unit | xcbeautify --renderer github-actions prepare-flutter: name: Flutter ${{ matrix.flutter-version }} diff --git a/.github/workflows/patrol_gen-prepare.yaml b/.github/workflows/patrol_gen-prepare.yaml new file mode 100644 index 000000000..f8a7ab0d3 --- /dev/null +++ b/.github/workflows/patrol_gen-prepare.yaml @@ -0,0 +1,41 @@ +name: patrol_gen prepare + +on: + workflow_dispatch: + pull_request: + paths: + - 'packages/patrol_gen/**' + +jobs: + prepare: + name: Flutter ${{ matrix.flutter-version }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + sdk: ['3.0.0', stable] + + defaults: + run: + working-directory: packages/patrol_gen + + steps: + - name: Clone repository + uses: actions/checkout@v3 + + - name: Set up Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: ${{ matrix.sdk }} + + - name: dart pub get + run: dart pub get + + - name: dart analyze + if: success() || failure() + run: dart analyze + + - name: dart format + if: success() || failure() + run: dart format --set-exit-if-changed . diff --git a/.github/workflows/test-android-device.yaml b/.github/workflows/test-android-device.yaml index eb44186c6..e53ea4a75 100644 --- a/.github/workflows/test-android-device.yaml +++ b/.github/workflows/test-android-device.yaml @@ -47,7 +47,7 @@ jobs: uses: google-github-actions/setup-gcloud@v1 - name: Gradle cache - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2 with: generate-job-summary: false diff --git a/.github/workflows/test-android-emulator-2.yaml b/.github/workflows/test-android-emulator-2.yaml deleted file mode 100644 index 539f677da..000000000 --- a/.github/workflows/test-android-emulator-2.yaml +++ /dev/null @@ -1,128 +0,0 @@ -name: test android emulator 2 - -on: - workflow_dispatch: - -env: - ANDROID_IMAGE: system-images;android-31;default;x86_64 - -jobs: - main: - name: Test on Android Emulator - runs-on: macos-latest - timeout-minutes: 60 - - defaults: - run: - working-directory: ${{ github.workspace }}/packages/patrol/example - - steps: - - name: Clone repository - uses: actions/checkout@v3 - with: - lfs: true - - - name: Set up Java - run: export JAVA_HOME="$JAVA_HOME_11_X64" - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - - name: Preload Flutter artifacts - run: flutter precache - - - name: Install patrol_cli - run: | - dart pub global activate \ - --source git https://github.com/leancodepl/patrol.git \ - --git-path packages/patrol_cli \ - --git-ref patrol_cli-v - - - name: Download TestButler - run: curl -f -o ~/test-butler-2.2.1.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk - - - name: Install ffmpeg - uses: FedericoCarboni/setup-ffmpeg@v2 - id: setup-ffmpeg - - - name: Install sponge - run: brew install sponge 1>/dev/null 2>&1 - - - name: Generate gradlew - run: | - flutter build apk --target lib/main_dev.dart --debug --flavor=does-not-exist & - buildpid="$!" - while [ ! -e "android/gradlew" ]; do - echo "waiting for gradlew to generate..." - sleep 2 - done - kill $buildpid - - - name: Install cmdline-tools - run: | - cd - curl -LO https://dl.google.com/android/repository/commandlinetools-mac-9477386_latest.zip - brew install unzip 1>/dev/null 2>&1 - unzip commandlinetools-mac-9477386_latest.zip - - mkdir ~/android-sdk - mkdir ~/android-sdk/cmdline-tools - mkdir ~/android-sdk/platforms # we just need empty folder - mkdir ~/android-sdk/cmdline-tools/latest - mv -v ~/cmdline-tools/* ~/android-sdk/cmdline-tools/latest - - echo "$HOME/android-sdk/cmdline-tools/latest/bin" >> $GITHUB_PATH - - - name: Install SDKs with sdkmanager - run: | - yes | sdkmanager --licenses > /dev/null - sdkmanager "emulator" > /dev/null - sdkmanager "platform-tools" > /dev/null - sdkmanager "$ANDROID_IMAGE" > /dev/null - sdkmanager "build-tools;30.0.3" > /dev/null - - echo "$HOME/android-sdk/emulator" >> $GITHUB_PATH - echo "$HOME/android-sdk/platform-tools" >> $GITHUB_PATH - - echo "ANDROID_SDK_ROOT=$HOME/android-sdk" >> $GITHUB_ENV - echo "ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV - flutter config --android-sdk "$HOME/android-sdk" - - - name: Create and configure emulator - run: | - avdmanager -s create avd -n MyAVD -k "$ANDROID_IMAGE" - echo "hw.gpu.enabled=yes" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.gpu.mode=swiftshader_indirect" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.ramSize=4096" >> ~/.android/avd/MyAVD.avd/config.ini - echo "disk.dataPartition.size=6G" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.camera.back=virtualscene" >> ~/.android/avd/MyAVD.avd/config.ini - echo "vm.heapSize=576" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.lcd.density=440" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.lcd.height=2220" >> ~/.android/avd/MyAVD.avd/config.ini - echo "hw.lcd.width=1080" >> ~/.android/avd/MyAVD.avd/config.ini - - - name: Run emulator and tests - run: ${{ github.workspace }}/.github/scripts/run-emulator-and-tests.sh - - - name: Upload flutter logs to artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: flutter-logs - path: flutter-logs - - - name: Upload tests summary to artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: tests-summary - path: tests-summary - - - name: Upload screenrecordings to artifacts - if: always() - uses: actions/upload-artifact@v3 - with: - name: screenrecord.mp4 - path: screenrecords/screenrecord.mp4 diff --git a/.github/workflows/test-android-emulator-webview.yaml b/.github/workflows/test-android-emulator-webview.yaml index 5a3734586..f3e06d921 100644 --- a/.github/workflows/test-android-emulator-webview.yaml +++ b/.github/workflows/test-android-emulator-webview.yaml @@ -35,7 +35,7 @@ jobs: java-version: 17 - name: Gradle cache - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2 with: generate-job-summary: false diff --git a/.github/workflows/test-android-emulator.yaml b/.github/workflows/test-android-emulator.yaml index ae67ec21d..38cd19ecc 100644 --- a/.github/workflows/test-android-emulator.yaml +++ b/.github/workflows/test-android-emulator.yaml @@ -36,7 +36,7 @@ jobs: java-version: 17 - name: Gradle cache - uses: gradle/gradle-build-action@v2.8.0 + uses: gradle/gradle-build-action@v2 with: generate-job-summary: false diff --git a/.github/workflows/test-ios-device.yaml b/.github/workflows/test-ios-device.yaml index 3b0f3fa41..56ac3047e 100644 --- a/.github/workflows/test-ios-device.yaml +++ b/.github/workflows/test-ios-device.yaml @@ -21,7 +21,7 @@ jobs: matrix: flutter_version: ['3.13.x'] device_model: ['iphone14pro'] - os_version: ['16.5'] + os_version: ['16.6'] os: [iOS] defaults: @@ -61,7 +61,7 @@ jobs: - name: Authenticate to Google Cloud uses: google-github-actions/auth@v1 with: - credentials_json: '${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY_JSON }}' + credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY_JSON }} - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v1 @@ -99,10 +99,6 @@ jobs: - name: Build tests run: patrol build ios --release --exclude ${{ env.EXCLUDED_TESTS }} --verbose - - name: Compress test files to zip - working-directory: packages/patrol/example/build/ios_integ/Build/Products - run: zip -r ios_tests.zip Release-iphoneos/*.app *.xctestrun - - name: Upload APKs to Firebase Test Lab and wait for tests to finish id: tests_step env: diff --git a/contracts.proto b/contracts.proto deleted file mode 100644 index 58842f1ec..000000000 --- a/contracts.proto +++ /dev/null @@ -1,225 +0,0 @@ -syntax = "proto3"; -package patrol; - -option java_package = "pl.leancode.patrol.contracts"; - -service PatrolAppService { - rpc listDartTests(Empty) returns (ListDartTestsResponse) {} - rpc runDartTest(RunDartTestRequest) returns (RunDartTestResponse) {} -} - -message ListDartTestsResponse { - DartTestGroup group = 1; -} - -message DartTestGroup { - string name = 1; - repeated DartTestCase tests = 2; - repeated DartTestGroup groups = 3; -} - -message DartTestCase { - string name = 1; -} - -message RunDartTestRequest { - string name = 1; -} - -message RunDartTestResponse { - enum Result { - SUCCESS = 0; - SKIPPED = 1; - FAILURE = 2; - } - - Result result = 1; - optional string details = 2; -} - -service NativeAutomator { - rpc initialize(Empty) returns (Empty) {} - rpc configure(ConfigureRequest) returns (Empty) {} - - // general - rpc pressHome(Empty) returns (Empty) {} - rpc pressBack(Empty) returns (Empty) {} - rpc pressRecentApps(Empty) returns (Empty) {} - rpc doublePressRecentApps(Empty) returns (Empty) {} - rpc openApp(OpenAppRequest) returns (Empty) {} - rpc openQuickSettings(OpenQuickSettingsRequest) returns (Empty) {} - - // general UI interaction - rpc getNativeViews(GetNativeViewsRequest) returns (GetNativeViewsResponse) {} - rpc tap(TapRequest) returns (Empty) {} - rpc doubleTap(TapRequest) returns (Empty) {} - rpc enterText(EnterTextRequest) returns (Empty) {} - rpc swipe(SwipeRequest) returns (Empty) {} - rpc waitUntilVisible(WaitUntilVisibleRequest) returns (Empty) {} - - // services - rpc enableAirplaneMode(Empty) returns (Empty) {} - rpc disableAirplaneMode(Empty) returns (Empty) {} - rpc enableWiFi(Empty) returns (Empty) {} - rpc disableWiFi(Empty) returns (Empty) {} - rpc enableCellular(Empty) returns (Empty) {} - rpc disableCellular(Empty) returns (Empty) {} - rpc enableBluetooth(Empty) returns (Empty) {} - rpc disableBluetooth(Empty) returns (Empty) {} - rpc enableDarkMode(DarkModeRequest) returns (Empty) {} - rpc disableDarkMode(DarkModeRequest) returns (Empty) {} - - // notifications - rpc openNotifications(Empty) returns (Empty) {} - rpc closeNotifications(Empty) returns (Empty) {} - rpc closeHeadsUpNotification(Empty) returns (Empty) {} - rpc getNotifications(GetNotificationsRequest) returns (GetNotificationsResponse) {} - rpc tapOnNotification(TapOnNotificationRequest) returns (Empty) {} - - // permissions - rpc isPermissionDialogVisible(PermissionDialogVisibleRequest) returns (PermissionDialogVisibleResponse) {} - rpc handlePermissionDialog(HandlePermissionRequest) returns (Empty) {} - rpc setLocationAccuracy(SetLocationAccuracyRequest) returns (Empty) {} - - // other - rpc debug(Empty) returns (Empty) {} - - // TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - rpc markPatrolAppServiceReady(Empty) returns (Empty) {} -} - -message ConfigureRequest { - uint64 findTimeoutMillis = 1; -} - -message OpenAppRequest { string appId = 1; } - -message TapOnNotificationRequest { - oneof findBy { - uint32 index = 1; - Selector selector = 2; - } -} - -// We're defining our own Empty instead of using google.protobuf.Empty because -// the Dart plugin can't easily generate it. -// -// See: -// * https://github.com/google/protobuf.dart/issues/170 -message Empty {} - -message OpenQuickSettingsRequest {} - -message DarkModeRequest { string appId = 1; } - -message GetNativeViewsRequest { - Selector selector = 1; - string appId = 2; -} -message GetNativeViewsResponse { repeated NativeView nativeViews = 2;} - -message GetNotificationsRequest {} -message GetNotificationsResponse { repeated Notification notifications = 2; } - -message TapRequest { - Selector selector = 1; - string appId = 2; -} - -message EnterTextRequest { - string data = 1; - string appId = 2; - oneof findBy { - uint32 index = 3; - Selector selector = 4; - } - KeyboardBehavior keyboardBehavior = 5; - - enum KeyboardBehavior { - SHOW_AND_DISMISS = 0; - ALTERNATIVE = 1; - } -} - -message SwipeRequest { - float startX = 1; - float startY = 2; - float endX = 3; - float endY = 4; - uint32 steps = 5; - string appId = 6; -} - -message WaitUntilVisibleRequest { - Selector selector = 1; - string appId = 2; -} - -message HandlePermissionRequest { - Code code = 1; - - enum Code { - WHILE_USING = 0; - ONLY_THIS_TIME = 1; - DENIED = 2; - } -} - -message SetLocationAccuracyRequest { - LocationAccuracy locationAccuracy = 1; - - enum LocationAccuracy { - COARSE = 0; - FINE = 1; - } -} - -message PermissionDialogVisibleRequest { - uint64 timeoutMillis = 1; -} - -message PermissionDialogVisibleResponse { - bool visible = 1; -} - -message Selector { - optional string text = 1; - optional string textStartsWith = 2; - optional string textContains = 3; - optional string className = 4; - optional string contentDescription = 5; - optional string contentDescriptionStartsWith = 6; - optional string contentDescriptionContains = 7; - optional string resourceId = 8; - optional uint32 instance = 9; - optional bool enabled = 10; - optional bool focused = 11; - optional string pkg = 12; -} - -// Represents a native UI control. -// -// On Android, this is `android.view.View`. -message NativeView { - string className = 1; - string text = 2; - string contentDescription = 3; - bool focused = 4; - bool enabled = 5; - int32 childCount = 6; - string resourceName = 7; - string applicationPackage = 8; - repeated NativeView children = 9; -} - -// Represents a notification visible in the notification shade. -message Notification { - optional string appName = 1; - string title = 2; - string content = 3; - string raw = 4; -} - -message SubmitTestResultsRequest { - map results = 1; -} diff --git a/gen_from_schema b/gen_from_schema new file mode 100755 index 000000000..4185e992b --- /dev/null +++ b/gen_from_schema @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +# gen_from_schema generates classes from schema.dart for every used language +# (Dart, Swift, Kotlin/Java) in the appropriate directory. + +cd "$(dirname "$0")" || exit + +schema="./schema.dart" +patrol_package="./packages/patrol" +patrol_dart_out_dir="lib/src/native/contracts" + +ios_out="$patrol_package/ios/Classes/AutomatorServer" +dart_out="$patrol_package/$patrol_dart_out_dir" + +android_out="$patrol_package/android/src/main/kotlin/pl/leancode/patrol/contracts" +android_package="pl.leancode.patrol.contracts" + +dart run packages/patrol_gen/bin/main.dart "$schema" "$dart_out" "$ios_out" "$android_out" "$android_package" + +cd "${patrol_package}" +dart run build_runner build --delete-conflicting-outputs --build-filter="$patrol_dart_out_dir/*.dart" diff --git a/gen_protobufs b/gen_protobufs deleted file mode 100755 index 07d59ea05..000000000 --- a/gen_protobufs +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# gen_protobufs generates Protocol Buffers classes for every used language -# (Dart, Swift, Kotlin/Java) in the appropriate directory. -# -# To use it, you need to have the following programs in your $PATH: -# -# * protoc -# -# * Dart plugin (https://pub.dev/packages/protoc_plugin) -# -# * Swift plugin (https://github.com/apple/swift-protobuf) -# -# * Java plugin (https://github.com/grpc/grpc-java) -# -# * Kotlin plugin (https://github.com/grpc/grpc-kotlin/tree/master/compiler) - -cd "$(dirname "$0")" || exit - -SRC_DIR="." -PROTO_PATH="./contracts.proto" - -mkdir -p ./patrol/packages/patrol/android/src/main/kotlin -mkdir -p ./packages/patrol/ios/Classes/AutomatorServer - -dart_out="./packages/patrol/lib/src/native/contracts" -java_out="packages/patrol/android/src/main/kotlin" -kotlin_out="$java_out" -swift_out="./packages/patrol/ios/Classes/AutomatorServer" - -protoc \ - --dart_out="grpc:$dart_out" \ - -I="$SRC_DIR" \ - "$PROTO_PATH" - -protoc \ - --java_out="lite:$java_out" \ - --kotlin_out="lite:$kotlin_out" \ - --grpc-java_out="lite:$java_out" \ - --grpckt_out="lite:$kotlin_out" \ - "$PROTO_PATH" - -protoc \ - --swift_out="$swift_out" \ - --grpc-swift_out="$swift_out" \ - --swift_opt=Visibility=Public \ - "$PROTO_PATH" diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index dbb8aca2b..368254a12 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -1,3 +1,25 @@ +## 2.3.0-dev.4 + +- Fix test name label blocking hit testing (#1731) + +## 2.3.0-dev.3 + +- Fix problem with Gradle build failing unless correct `packagingOptions {}` are + specified (#1709) (#1711) + +## 2.3.0-dev.2 + +- Replace Protocol Buffers and gRPC with a custom code generation solution that + is more lightweight (#1681) + +This version requires version 2.2.0-dev.2 of `patrol_cli` package. + +## 2.3.0-dev.1 + +- Add support for `group()` (#1634) + +This version requires version 2.2.0-dev.1 of `patrol_cli` package. + ## 2.2.5 - Fix `grantPermissionOnlyThisTime()` crashing on Android <11 (#1698) diff --git a/packages/patrol/analysis_options.yaml b/packages/patrol/analysis_options.yaml index 724b4595e..76a7fea8a 100644 --- a/packages/patrol/analysis_options.yaml +++ b/packages/patrol/analysis_options.yaml @@ -9,3 +9,4 @@ analyzer: - lib/**/*.pbjson.dart - lib/**/*.pbserver.dart - lib/**/*.pbgrpc.dart + - lib/**/*.g.dart diff --git a/packages/patrol/android/build.gradle b/packages/patrol/android/build.gradle index 15084de39..681dd2537 100644 --- a/packages/patrol/android/build.gradle +++ b/packages/patrol/android/build.gradle @@ -13,12 +13,14 @@ buildscript { classpath "com.android.tools.build:gradle:7.4.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" } } apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "org.jlleitschuh.gradle.ktlint" +apply plugin: "kotlinx-serialization" ktlint { filter { @@ -63,12 +65,11 @@ android { api "androidx.test.espresso:espresso-core:3.5.0" api "androidx.test.uiautomator:uiautomator:2.2.0" - implementation "com.google.protobuf:protobuf-kotlin-lite:3.21.7" - implementation "io.grpc:grpc-protobuf-lite:1.49.2" - implementation "io.grpc:grpc-stub:1.49.2" - implementation "io.grpc:grpc-kotlin-stub:1.3.0" - implementation "io.grpc:grpc-okhttp:1.49.2" - implementation "javax.annotation:javax.annotation-api:1.3.2" + implementation platform("org.http4k:http4k-bom:5.7.4.0") + implementation "org.http4k:http4k-core" + implementation "com.squareup.okhttp:okhttp:2.7.5" // See https://github.com/square/okhttp/issues/8031 + implementation "org.http4k:http4k-server-ktorcio" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" testImplementation "org.jetbrains.kotlin:kotlin-test" } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt index a0046f375..a1098bf6d 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/Automator.kt @@ -15,40 +15,24 @@ import androidx.test.uiautomator.UiObject import androidx.test.uiautomator.UiObject2 import androidx.test.uiautomator.UiObjectNotFoundException import androidx.test.uiautomator.UiSelector -import pl.leancode.patrol.contracts.Contracts -import pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior -import pl.leancode.patrol.contracts.nativeView -import pl.leancode.patrol.contracts.notification +import pl.leancode.patrol.contracts.Contracts.KeyboardBehavior +import pl.leancode.patrol.contracts.Contracts.NativeView +import pl.leancode.patrol.contracts.Contracts.Notification +import pl.leancode.patrol.contracts.Contracts.Selector import kotlin.math.roundToInt -private fun fromUiObject2(obj: UiObject2): Contracts.NativeView { - return nativeView { - if (obj.className != null) { - className = obj.className - } - - if (obj.text != null) { - text = obj.text - } - - if (obj.contentDescription != null) { - contentDescription = obj.contentDescription - } - - focused = obj.isFocused - enabled = obj.isEnabled - childCount = obj.childCount - - if (obj.resourceName != null) { - resourceName = obj.resourceName - } - - if (obj.applicationPackage != null) { - applicationPackage = obj.applicationPackage - } - - children.addAll(obj.children?.map { fromUiObject2(it) } ?: listOf()) - } +private fun fromUiObject2(obj: UiObject2): NativeView { + return NativeView( + className = obj.className, + text = obj.text, + contentDescription = obj.contentDescription, + focused = obj.isFocused, + enabled = obj.isEnabled, + childCount = obj.childCount.toLong(), + resourceName = obj.resourceName, + applicationPackage = obj.applicationPackage, + children = obj.children?.map { fromUiObject2(it) } ?: listOf() + ) } class Automator private constructor() { @@ -155,7 +139,7 @@ class Automator private constructor() { fun disableBluetooth(): Unit = throw NotImplementedError("disableBluetooth") - fun getNativeViews(selector: BySelector): List { + fun getNativeViews(selector: BySelector): List { Logger.d("getNativeViews()") val uiObjects2 = uiDevice.findObjects(selector) @@ -206,13 +190,13 @@ class Automator private constructor() { val uiSelector = UiSelector().className(EditText::class.java).instance(index) val uiObject = uiDevice.findObject(uiSelector) - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { uiObject.click() } uiObject.text = text - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { pressBack() // Hide keyboard. } } @@ -232,13 +216,13 @@ class Automator private constructor() { val uiObject = uiDevice.findObject(uiSelector).getFromParent(UiSelector().className(EditText::class.java)) - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { uiObject.click() } uiObject.text = text - if (keyboardBehavior == KeyboardBehavior.SHOW_AND_DISMISS) { + if (keyboardBehavior == KeyboardBehavior.showAndDismiss) { pressBack() // Hide keyboard. } } @@ -310,7 +294,7 @@ class Automator private constructor() { delay() } - fun getNotifications(): List { + fun getNotifications(): List { Logger.d("getNotifications()") val notificationContainers = mutableListOf() @@ -332,31 +316,29 @@ class Automator private constructor() { Logger.d("Found ${notificationContainers.size} notifications") - val notifications = mutableListOf() + val notifications = mutableListOf() for (notificationContainer in notificationContainers) { - val notification = notification { - val appName = notificationContainer.findObject(By.res("android:id/app_name_text"))?.text - if (appName != null) { - this.appName = appName - } + val appName = notificationContainer.findObject(By.res("android:id/app_name_text"))?.text - val title = notificationContainer.findObject(By.res("android:id/title"))?.text - ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_title"))?.text - if (title != null) { - this.title = title - } else { - Logger.e("Could not find title text") - } + val content = notificationContainer.findObject(By.res("android:id/text"))?.text + ?: notificationContainer.findObject(By.res("android:id/big_text"))?.text + ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_text"))?.text + if (content == null) { + Logger.e("Could not find content text") + } - val content = notificationContainer.findObject(By.res("android:id/text"))?.text - ?: notificationContainer.findObject(By.res("android:id/big_text"))?.text - ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_text"))?.text - if (content != null) { - this.content = content - } else { - Logger.e("Could not find content text") - } + val title = notificationContainer.findObject(By.res("android:id/title"))?.text + ?: notificationContainer.findObject(By.res("com.android.systemui:id/notification_title"))?.text + if (title == null) { + Logger.e("Could not find title text") } + + val notification = Notification( + appName = appName, + content = content ?: "", + title = title ?: "" + ) + notifications.add(notification) } @@ -367,8 +349,10 @@ class Automator private constructor() { Logger.d("tapOnNotification($index)") try { - val query = Contracts.Selector.newBuilder().setResourceId("android:id/status_bar_latest_event_content") - .setInstance(index).build() + val query = Selector( + resourceId = "android:id/status_bar_latest_event_content", + instance = index.toLong() + ) val obj = uiDevice.findObject(query.toUiSelector()) obj.click() } catch (err: UiObjectNotFoundException) { diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt index 74e85a48b..6ea616c19 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt @@ -1,230 +1,213 @@ package pl.leancode.patrol -import pl.leancode.patrol.contracts.Contracts -import pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase.INDEX -import pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase.SELECTOR -import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.DENIED -import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.ONLY_THIS_TIME -import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.WHILE_USING -import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.COARSE -import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.FINE -import pl.leancode.patrol.contracts.NativeAutomatorGrpcKt -import pl.leancode.patrol.contracts.empty -import pl.leancode.patrol.contracts.getNativeViewsResponse -import pl.leancode.patrol.contracts.getNotificationsResponse -import pl.leancode.patrol.contracts.permissionDialogVisibleResponse - -typealias Empty = Contracts.Empty - -class AutomatorServer(private val automation: Automator) : NativeAutomatorGrpcKt.NativeAutomatorCoroutineImplBase() { - - override suspend fun initialize(request: Empty): Empty { +import pl.leancode.patrol.contracts.Contracts.ConfigureRequest +import pl.leancode.patrol.contracts.Contracts.DarkModeRequest +import pl.leancode.patrol.contracts.Contracts.EnterTextRequest +import pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest +import pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse +import pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest +import pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse +import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest +import pl.leancode.patrol.contracts.Contracts.HandlePermissionRequestCode +import pl.leancode.patrol.contracts.Contracts.OpenAppRequest +import pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest +import pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest +import pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse +import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest +import pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequestLocationAccuracy +import pl.leancode.patrol.contracts.Contracts.SwipeRequest +import pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest +import pl.leancode.patrol.contracts.Contracts.TapRequest +import pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest +import pl.leancode.patrol.contracts.NativeAutomatorServer + +class AutomatorServer(private val automation: Automator) : NativeAutomatorServer() { + + override fun initialize() { automation.initialize() - return empty { } } - override suspend fun configure(request: Contracts.ConfigureRequest): Empty { + override fun configure(request: ConfigureRequest) { automation.configure(waitForSelectorTimeout = request.findTimeoutMillis) - return empty { } } - override suspend fun pressHome(request: Empty): Empty { + override fun pressHome() { automation.pressHome() - return empty { } } - override suspend fun pressBack(request: Empty): Empty { + override fun pressBack() { automation.pressBack() - return empty { } } - override suspend fun pressRecentApps(request: Empty): Empty { + override fun pressRecentApps() { automation.pressRecentApps() - return empty { } } - override suspend fun doublePressRecentApps(request: Empty): Empty { + override fun doublePressRecentApps() { automation.pressDoubleRecentApps() - return empty { } } - override suspend fun openApp(request: Contracts.OpenAppRequest): Empty { + override fun openApp(request: OpenAppRequest) { automation.openApp(request.appId) - return empty { } } - override suspend fun openNotifications(request: Empty): Empty { + override fun openNotifications() { automation.openNotifications() - return empty { } } - override suspend fun closeNotifications(request: Empty): Empty { + override fun closeNotifications() { automation.closeNotifications() - return empty { } } - override suspend fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest): Empty { + override fun closeHeadsUpNotification() { + // iOS only + } + + override fun openQuickSettings(request: OpenQuickSettingsRequest) { automation.openQuickSettings() - return empty { } } - override suspend fun enableDarkMode(request: Contracts.DarkModeRequest): Empty { + override fun enableDarkMode(request: DarkModeRequest) { automation.enableDarkMode() - return empty { } } - override suspend fun disableDarkMode(request: Contracts.DarkModeRequest): Empty { + override fun disableDarkMode(request: DarkModeRequest) { automation.disableDarkMode() - return empty { } } - override suspend fun enableAirplaneMode(request: Empty): Empty { + override fun enableAirplaneMode() { automation.enableAirplaneMode() - return empty {} } - override suspend fun disableAirplaneMode(request: Empty): Empty { + override fun disableAirplaneMode() { automation.disableAirplaneMode() - return empty {} } - override suspend fun enableCellular(request: Empty): Empty { + override fun enableCellular() { automation.enableCellular() - return empty { } } - override suspend fun disableCellular(request: Empty): Empty { + override fun disableCellular() { automation.disableCellular() - return empty { } } - override suspend fun enableWiFi(request: Empty): Empty { + override fun enableWiFi() { automation.enableWifi() - return empty { } } - override suspend fun disableWiFi(request: Empty): Empty { + override fun disableWiFi() { automation.disableWifi() - return empty { } } - override suspend fun enableBluetooth(request: Empty): Empty { + override fun enableBluetooth() { automation.enableBluetooth() - return empty { } } - override suspend fun disableBluetooth(request: Empty): Empty { + override fun disableBluetooth() { automation.disableBluetooth() - return empty { } } - override suspend fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse { + override fun getNativeViews(request: GetNativeViewsRequest): GetNativeViewsResponse { val views = automation.getNativeViews(request.selector.toBySelector()) - return getNativeViewsResponse { nativeViews.addAll(views) } + return GetNativeViewsResponse( + nativeViews = views + ) } - override suspend fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse { + override fun getNotifications(request: GetNotificationsRequest): GetNotificationsResponse { val notifs = automation.getNotifications() - return getNotificationsResponse { notifications.addAll(notifs) } + return GetNotificationsResponse(notifs) } - override suspend fun tap(request: Contracts.TapRequest): Empty { + override fun tap(request: TapRequest) { automation.tap( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance + index = request.selector.instance?.toInt() ?: 0 ) - - return empty { } } - override suspend fun doubleTap(request: Contracts.TapRequest): Empty { + override fun doubleTap(request: TapRequest) { automation.doubleTap( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance + index = request.selector.instance?.toInt() ?: 0 ) - - return empty { } } - override suspend fun enterText(request: Contracts.EnterTextRequest): Empty { - when (request.findByCase) { - INDEX -> automation.enterText( + override fun enterText(request: EnterTextRequest) { + if (request.index != null) { + automation.enterText( text = request.data, - index = request.index, + index = request.index.toInt(), keyboardBehavior = request.keyboardBehavior ) - - SELECTOR -> automation.enterText( + } else if (request.selector != null) { + automation.enterText( text = request.data, uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance, + index = request.selector.instance?.toInt() ?: 0, keyboardBehavior = request.keyboardBehavior ) - - else -> throw PatrolException("enterText(): neither index nor selector are set") + } else { + throw PatrolException("enterText(): neither index nor selector are set") } - - return empty { } } - override suspend fun swipe(request: Contracts.SwipeRequest): Empty { + override fun swipe(request: SwipeRequest) { automation.swipe( - startX = request.startX, - startY = request.startY, - endX = request.endX, - endY = request.endY, - steps = request.steps + startX = request.startX.toFloat(), + startY = request.startY.toFloat(), + endX = request.endX.toFloat(), + endY = request.endY.toFloat(), + steps = request.steps.toInt() ) - return empty { } } - override suspend fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest): Empty { + override fun waitUntilVisible(request: WaitUntilVisibleRequest) { automation.waitUntilVisible( uiSelector = request.selector.toUiSelector(), bySelector = request.selector.toBySelector(), - index = request.selector.instance + index = request.selector.instance?.toInt() ?: 0 ) - return empty { } } - override suspend fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse { + override fun isPermissionDialogVisible(request: PermissionDialogVisibleRequest): PermissionDialogVisibleResponse { val visible = automation.isPermissionDialogVisible(timeout = request.timeoutMillis) - return permissionDialogVisibleResponse { this.visible = visible } + return PermissionDialogVisibleResponse(visible) } - override suspend fun handlePermissionDialog(request: Contracts.HandlePermissionRequest): Empty { + override fun handlePermissionDialog(request: HandlePermissionRequest) { when (request.code) { - WHILE_USING -> automation.allowPermissionWhileUsingApp() - ONLY_THIS_TIME -> automation.allowPermissionOnce() - DENIED -> automation.denyPermission() - else -> throw PatrolException("handlePermissionDialog(): bad permission code") + HandlePermissionRequestCode.whileUsing -> automation.allowPermissionWhileUsingApp() + HandlePermissionRequestCode.onlyThisTime -> automation.allowPermissionOnce() + HandlePermissionRequestCode.denied -> automation.denyPermission() } - return empty { } } - override suspend fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest): Empty { + override fun setLocationAccuracy(request: SetLocationAccuracyRequest) { when (request.locationAccuracy) { - COARSE -> automation.selectCoarseLocation() - FINE -> automation.selectFineLocation() - else -> throw PatrolException("setLocationAccuracy(): bad location accuracy") + SetLocationAccuracyRequestLocationAccuracy.coarse -> automation.selectCoarseLocation() + SetLocationAccuracyRequestLocationAccuracy.fine -> automation.selectFineLocation() } - return empty { } } - override suspend fun tapOnNotification(request: Contracts.TapOnNotificationRequest): Empty { - when (request.findByCase) { - Contracts.TapOnNotificationRequest.FindByCase.INDEX -> automation.tapOnNotification(request.index) - Contracts.TapOnNotificationRequest.FindByCase.SELECTOR -> automation.tapOnNotification(request.selector.toUiSelector()) - else -> throw PatrolException("tapOnNotification(): neither index nor selector are set") + override fun debug() { + // iOS only + } + + override fun tapOnNotification(request: TapOnNotificationRequest) { + if (request.index != null) { + automation.tapOnNotification(request.index.toInt()) + } else if (request.selector != null) { + automation.tapOnNotification(request.selector.toUiSelector()) + } else { + throw PatrolException("tapOnNotification(): neither index nor selector are set") } - return empty { } } - override suspend fun markPatrolAppServiceReady(request: Empty): Empty { - PatrolServer.appReady.set(true) - return empty { } + override fun markPatrolAppServiceReady() { + PatrolServer.appReady.open() } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java index 7149b1395..e799bfcf7 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/BrowserstackPatrolJUnitRunner.java @@ -1,7 +1,7 @@ package pl.leancode.patrol; import android.util.Log; -import io.grpc.StatusRuntimeException; +import pl.leancode.patrol.contracts.PatrolAppServiceClientException; import java.net.Inet4Address; import java.net.NetworkInterface; @@ -18,10 +18,12 @@ public PatrolAppServiceClient createAppServiceClient() { try { client.listDartTests(); - } catch (StatusRuntimeException ex) { + + //TODO verify in a project where we use Browserstack + } catch (PatrolAppServiceClientException ex) { ex.printStackTrace(); // If the client on localhost:8082 fails, let's apply the wokraround - Logger.INSTANCE.i("StatusRuntimeException in createAppServiceClient " + ex.getMessage()); + Logger.INSTANCE.i("PatrolAppServiceClientException in createAppServiceClient " + ex.getMessage()); Logger.INSTANCE.i("LOOPBACK: " + getLoopback()); client = new PatrolAppServiceClient(getLoopback()); } @@ -38,7 +40,7 @@ public String getLoopback() { if (Objects.equals(i.getDisplayName(), "tun0")) { for (java.net.InterfaceAddress a : i.getInterfaceAddresses()) { if (a.getAddress() instanceof Inet4Address) { - return a.getAddress().toString().substring(1) + ":8082"; + return a.getAddress().toString().substring(1); } } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt index 30d74952e..99d810776 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/ContractsExtensions.kt @@ -3,10 +3,11 @@ package pl.leancode.patrol import androidx.test.uiautomator.By import androidx.test.uiautomator.BySelector import androidx.test.uiautomator.UiSelector -import pl.leancode.patrol.contracts.Contracts -import pl.leancode.patrol.contracts.Contracts.DartTestGroup +import pl.leancode.patrol.contracts.Contracts.DartGroupEntry +import pl.leancode.patrol.contracts.Contracts.GroupEntryType +import pl.leancode.patrol.contracts.Contracts.Selector -private fun Contracts.Selector.isEmpty(): Boolean { +private fun Selector.isEmpty(): Boolean { return ( !hasText() && !hasTextStartsWith() && @@ -23,7 +24,7 @@ private fun Contracts.Selector.isEmpty(): Boolean { ) } -fun Contracts.Selector.toUiSelector(): UiSelector { +fun Selector.toUiSelector(): UiSelector { var selector = UiSelector() if (hasText()) { @@ -59,15 +60,15 @@ fun Contracts.Selector.toUiSelector(): UiSelector { } if (hasInstance()) { - selector = selector.instance(instance) + selector = selector.instance(instance!!.toInt()) } if (hasEnabled()) { - selector = selector.enabled(enabled) + selector = selector.enabled(enabled!!) } if (hasFocused()) { - selector = selector.focused(focused) + selector = selector.focused(focused!!) } if (hasPkg()) { @@ -77,7 +78,7 @@ fun Contracts.Selector.toUiSelector(): UiSelector { return selector } -fun Contracts.Selector.toBySelector(): BySelector { +fun Selector.toBySelector(): BySelector { if (isEmpty()) { throw PatrolException("Selector is empty") } @@ -94,44 +95,45 @@ fun Contracts.Selector.toBySelector(): BySelector { var matchedFocused = false var matchedPkg = false - var bySelector = if (hasText()) { - matchedText = true - By.text(text) - } else if (hasTextStartsWith()) { - matchedTextStartsWith = true - By.textStartsWith(textStartsWith) - } else if (hasTextContains()) { - matchedTextContains = true - By.textContains(textContains) - } else if (hasClassName()) { - matchedClassName = true - By.clazz(className) - } else if (hasContentDescription()) { - matchedContentDescription = true - By.desc(contentDescription) - } else if (hasContentDescriptionStartsWith()) { - matchedContentDescriptionStartsWith = true - By.descStartsWith(contentDescriptionStartsWith) - } else if (hasContentDescriptionContains()) { - matchedContentDescriptionContains = true - By.descContains(contentDescriptionContains) - } else if (hasResourceId()) { - matchedResourceId = true - By.res(resourceId) - } else if (hasInstance()) { - throw IllegalArgumentException("instance() argument is not supported for BySelector") - } else if (hasEnabled()) { - matchedEnabled = true - By.enabled(enabled) - } else if (hasFocused()) { - matchedFocused = true - By.focused(focused) - } else if (hasPkg()) { - matchedPkg = true - By.pkg(pkg) - } else { - throw IllegalArgumentException("SelectorQuery is empty") - } + var bySelector = + if (hasText()) { + matchedText = true + By.text(text) + } else if (hasTextStartsWith()) { + matchedTextStartsWith = true + By.textStartsWith(textStartsWith) + } else if (hasTextContains()) { + matchedTextContains = true + By.textContains(textContains) + } else if (hasClassName()) { + matchedClassName = true + By.clazz(className) + } else if (hasContentDescription()) { + matchedContentDescription = true + By.desc(contentDescription) + } else if (hasContentDescriptionStartsWith()) { + matchedContentDescriptionStartsWith = true + By.descStartsWith(contentDescriptionStartsWith) + } else if (hasContentDescriptionContains()) { + matchedContentDescriptionContains = true + By.descContains(contentDescriptionContains) + } else if (hasResourceId()) { + matchedResourceId = true + By.res(resourceId) + } else if (hasInstance()) { + throw IllegalArgumentException("instance() argument is not supported for BySelector") + } else if (hasEnabled()) { + matchedEnabled = true + By.enabled(enabled!!) + } else if (hasFocused()) { + matchedFocused = true + By.focused(focused!!) + } else if (hasPkg()) { + matchedPkg = true + By.pkg(pkg) + } else { + throw IllegalArgumentException("SelectorQuery is empty") + } if (!matchedText && hasText()) { bySelector = By.copy(bySelector).text(text) @@ -170,11 +172,11 @@ fun Contracts.Selector.toBySelector(): BySelector { } if (!matchedEnabled && hasEnabled()) { - bySelector = bySelector.enabled(enabled) + bySelector = bySelector.enabled(enabled!!) } if (!matchedFocused && hasFocused()) { - bySelector = bySelector.focused(focused) + bySelector = bySelector.focused(focused!!) } if (!matchedPkg && hasPkg()) { @@ -184,21 +186,28 @@ fun Contracts.Selector.toBySelector(): BySelector { return bySelector } -fun DartTestGroup.listFlatDartFiles(): List { - val files = mutableListOf() - for (group in groupsList) { - files.addAll(group.listGroups()) - } - - return files -} - -// Recursively lists groups in this group. -private fun DartTestGroup.listGroups(): List { - val groups = mutableListOf(this.name) - for (group in groupsList) { - groups.addAll(group.listGroups()) - } - - return groups +/** + * Flattens the structure of a DartTestSuite into a flat list of tests. + */ +fun DartGroupEntry.listTestsFlat(parentGroupName: String = ""): List { + val tests = mutableListOf() + + for (test in entries) { + if (test.type == GroupEntryType.test) { + if (parentGroupName.isEmpty()) { + // This case is invalid, because every test will have at least 1 named group - its filename. + throw IllegalStateException("Invariant violated: test $test has no named parent group") + } + + tests.add(test.copy(name = "$parentGroupName ${test.name}")) + } else if (test.type == GroupEntryType.group) { + if (parentGroupName.isEmpty()) { + tests.addAll(test.listTestsFlat(parentGroupName = test.name)) + } else { + tests.addAll(test.listTestsFlat(parentGroupName = "$parentGroupName ${test.name}")) + } + } + } + + return tests } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt deleted file mode 100644 index 815ee49b3..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/LoggerInterceptor.kt +++ /dev/null @@ -1,66 +0,0 @@ -package pl.leancode.patrol - -import androidx.test.uiautomator.UiObjectNotFoundException -import io.grpc.ForwardingServerCall -import io.grpc.Metadata -import io.grpc.ServerCall -import io.grpc.ServerCallHandler -import io.grpc.ServerInterceptor -import io.grpc.Status - -class LoggerInterceptor : ServerInterceptor { - - private class ExceptionTranslatingServerCall( - delegate: ServerCall - ) : ForwardingServerCall.SimpleForwardingServerCall(delegate) { - - private fun handleErrorStatus(exception: Throwable?): Status { - val newStatus = when (exception) { - is UiObjectNotFoundException -> { - Status - .NOT_FOUND - .withDescription("selector ${exception.message} found nothing") - } - - is NotImplementedError -> { - Status - .UNIMPLEMENTED - .withDescription("method ${exception.message}() is not implemented on Android") - } - - else -> { - Status - .UNKNOWN - .withDescription("unknown error has occurred") - .augmentDescription(exception?.stackTraceToString()) - } - } - - return newStatus.withCause(exception) - } - - override fun close(status: Status, trailers: Metadata) { - if (status.isOk) { - return super.close(status, trailers) - } - val cause = status.cause - - val newStatus = if (status.code == Status.Code.UNKNOWN) { - Logger.e("Error handling gRPC endpoint", cause) - handleErrorStatus(cause) - } else { - status - } - - super.close(newStatus, trailers) - } - } - - override fun interceptCall( - call: ServerCall, - headers: Metadata, - next: ServerCallHandler - ): ServerCall.Listener { - return next.startCall(ExceptionTranslatingServerCall(call), headers) - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java deleted file mode 100644 index 68caee0b4..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.java +++ /dev/null @@ -1,42 +0,0 @@ -package pl.leancode.patrol; - -import io.grpc.Grpc; -import io.grpc.InsecureChannelCredentials; -import io.grpc.ManagedChannel; -import io.grpc.StatusRuntimeException; -import pl.leancode.patrol.contracts.PatrolAppServiceGrpc; - -import static pl.leancode.patrol.contracts.Contracts.*; - -/** - * Enables querying Dart tests, running them, waiting for them to finish, and getting their results - */ -public class PatrolAppServiceClient { - - private final PatrolAppServiceGrpc.PatrolAppServiceBlockingStub blockingStub; - - public PatrolAppServiceClient() { - String target = "localhost:8082"; // TODO: Document this value better - Logger.INSTANCE.i("Created PatrolAppServiceClient with default target: " + target); - ManagedChannel channel = Grpc.newChannelBuilder(target, InsecureChannelCredentials.create()).build(); - blockingStub = PatrolAppServiceGrpc.newBlockingStub(channel); - } - - public PatrolAppServiceClient(String target) { - Logger.INSTANCE.i("Created PatrolAppServiceClient, target: " + target); - ManagedChannel channel = Grpc.newChannelBuilder(target, InsecureChannelCredentials.create()).build(); - blockingStub = PatrolAppServiceGrpc.newBlockingStub(channel); - } - - public DartTestGroup listDartTests() throws StatusRuntimeException { - Empty request = Empty.newBuilder().build(); - ListDartTestsResponse response = blockingStub.listDartTests(request); - - return response.getGroup(); - } - - public RunDartTestResponse runDartTest(String name) throws StatusRuntimeException { - RunDartTestRequest request = RunDartTestRequest.newBuilder().setName(name).build(); - return blockingStub.runDartTest(request); - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt new file mode 100644 index 000000000..7bdfa7bad --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolAppServiceClient.kt @@ -0,0 +1,41 @@ +package pl.leancode.patrol + +import pl.leancode.patrol.contracts.Contracts +import pl.leancode.patrol.contracts.PatrolAppServiceClientException +import java.util.concurrent.TimeUnit +import pl.leancode.patrol.contracts.PatrolAppServiceClient as Client + +/** + * Enables querying Dart tests, running them, waiting for them to finish, and getting their results + */ +class PatrolAppServiceClient { + + private var client: Client + + // https://github.com/leancodepl/patrol/issues/1683 + private val timeout = 2L + private val timeUnit = TimeUnit.HOURS + + constructor() { + client = Client(address = "localhost", port = 8082, timeout = timeout, timeUnit = timeUnit) + Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") + } + + constructor(address: String) { + client = Client(address = address, port = 8082, timeout = timeout, timeUnit = timeUnit) + Logger.i("Created PatrolAppServiceClient: ${client.serverUrl}") + } + + @Throws(PatrolAppServiceClientException::class) + fun listDartTests(): Contracts.DartGroupEntry { + Logger.i("PatrolAppServiceClient.listDartTests()") + val result = client.listDartTests() + return result.group + } + + @Throws(PatrolAppServiceClientException::class) + fun runDartTest(name: String): Contracts.RunDartTestResponse { + Logger.i("PatrolAppServiceClient.runDartTest($name)") + return client.runDartTest(Contracts.RunDartTestRequest(name)) + } +} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java index fffe13014..03c969a7e 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolJUnitRunner.java @@ -10,12 +10,16 @@ import android.os.Bundle; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.runner.AndroidJUnitRunner; -import io.grpc.StatusRuntimeException; -import pl.leancode.patrol.contracts.Contracts.DartTestGroup; +import pl.leancode.patrol.contracts.Contracts; +import pl.leancode.patrol.contracts.PatrolAppServiceClientException; + +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.concurrent.ExecutionException; +import static pl.leancode.patrol.contracts.Contracts.DartGroupEntry; import static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse; /** @@ -53,7 +57,8 @@ public void onCreate(Bundle arguments) { * This default behavior doesn't work with Flutter apps. That's because in Flutter * apps, the tests are in the app itself, so running only the instrumentation * during the initial run is not enough. - * The app must also be run, and queried for Dart tests That's what this method does. + * The app must also be run, and queried for Dart tests. + * That's what this method does. *

*/ public void setUp(Class activityClass) { @@ -91,13 +96,8 @@ public PatrolAppServiceClient createAppServiceClient() { public void waitForPatrolAppService() { final String TAG = "PatrolJUnitRunner.setUp(): "; - try { - Logger.INSTANCE.i(TAG + "Waiting for PatrolAppService to report its readiness..."); - PatrolServer.Companion.getAppReadyFuture().get(); - } catch (InterruptedException | ExecutionException e) { - Logger.INSTANCE.e(TAG + "Exception was thrown when waiting for appReady: ", e); - throw new RuntimeException(e); - } + Logger.INSTANCE.i(TAG + "Waiting for PatrolAppService to report its readiness..."); + PatrolServer.Companion.getAppReady().block(); Logger.INSTANCE.i(TAG + "PatrolAppService is ready to report Dart tests"); } @@ -106,13 +106,18 @@ public Object[] listDartTests() { final String TAG = "PatrolJUnitRunner.listDartTests(): "; try { - final DartTestGroup dartTestGroup = patrolAppServiceClient.listDartTests(); - Object[] dartTestFiles = ContractsExtensionsKt.listFlatDartFiles(dartTestGroup).toArray(); - Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestFiles)); - return dartTestFiles; - } catch (StatusRuntimeException e) { + final DartGroupEntry dartTestGroup = patrolAppServiceClient.listDartTests(); + List dartTestCases = ContractsExtensionsKt.listTestsFlat(dartTestGroup, ""); + List dartTestCaseNamesList = new ArrayList<>(); + for (DartGroupEntry dartTestCase : dartTestCases) { + dartTestCaseNamesList.add(dartTestCase.getName()); + } + Object[] dartTestCaseNames = dartTestCaseNamesList.toArray(); + Logger.INSTANCE.i(TAG + "Got Dart tests: " + Arrays.toString(dartTestCaseNames)); + return dartTestCaseNames; + } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + "Failed to list Dart tests: ", e); - throw e; + throw new RuntimeException(e); } } @@ -126,13 +131,13 @@ public RunDartTestResponse runDartTest(String name) { try { Logger.INSTANCE.i(TAG + "Requested execution"); RunDartTestResponse response = patrolAppServiceClient.runDartTest(name); - if (response.getResult() == RunDartTestResponse.Result.FAILURE) { + if (response.getResult() == Contracts.RunDartTestResponseResult.failure) { throw new AssertionError("Dart test failed: " + name + "\n" + response.getDetails()); } return response; - } catch (StatusRuntimeException e) { + } catch (PatrolAppServiceClientException e) { Logger.INSTANCE.e(TAG + e.getMessage(), e.getCause()); - throw e; + throw new RuntimeException(e); } } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt index c09d48a1b..fc82c0870 100644 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt @@ -1,49 +1,49 @@ package pl.leancode.patrol +import android.os.ConditionVariable import androidx.test.platform.app.InstrumentationRegistry -import com.google.common.util.concurrent.SettableFuture -import io.grpc.InsecureServerCredentials -import io.grpc.Server -import io.grpc.okhttp.OkHttpServerBuilder -import java.util.concurrent.Future +import org.http4k.core.ContentType +import org.http4k.filter.ServerFilters +import org.http4k.server.Http4kServer +import org.http4k.server.KtorCIO +import org.http4k.server.asServer class PatrolServer { private val envPortKey = "PATROL_PORT" private val port: Int - private var server: Server? = null + private var server: Http4kServer? = null + private var automatorServer: AutomatorServer? = null init { port = arguments.getString(envPortKey)?.toInt() ?: 8081 - server = OkHttpServerBuilder - .forPort(port, InsecureServerCredentials.create()) - .intercept(LoggerInterceptor()) - .addService(AutomatorServer(automation = Automator.instance)) - .build() } private val arguments get() = InstrumentationRegistry.getArguments() fun start() { - server?.start() + Logger.i("Starting server...") + + automatorServer = AutomatorServer(Automator.instance) + server = automatorServer!!.router + .withFilter(catcher) + .withFilter(printer) + .withFilter(ServerFilters.SetContentType(ContentType.TEXT_PLAIN)) + .asServer(KtorCIO(port)) + .start() + Logger.i("Created and started PatrolServer, port: $port") Runtime.getRuntime().addShutdownHook( Thread { Logger.i("Stopping server...") - server?.shutdown() + server?.close() Logger.i("Server stopped") } ) } - fun blockUntilShutdown() { - server?.awaitTermination() - } - companion object { - val appReady: SettableFuture = SettableFuture.create() - val appReadyFuture: Future - get() = appReady + val appReady: ConditionVariable = ConditionVariable() } } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt new file mode 100644 index 000000000..55d71f44e --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServerFilters.kt @@ -0,0 +1,42 @@ +package pl.leancode.patrol + +import androidx.test.uiautomator.UiObjectNotFoundException +import kotlinx.serialization.json.Json +import org.http4k.core.Filter +import org.http4k.core.Response +import org.http4k.core.Status.Companion.INTERNAL_SERVER_ERROR +import org.http4k.core.Status.Companion.NOT_FOUND +import org.http4k.core.Status.Companion.NOT_IMPLEMENTED + +private val json = Json { ignoreUnknownKeys = true } + +val printer = + Filter { next -> + { request -> + val requestName = "${request.method} ${request.uri}" + Logger.i("$requestName started") + val startTime = System.currentTimeMillis() + val response = next(request) + val latency = System.currentTimeMillis() - startTime + Logger.i("$requestName took $latency ms") + response + } + } + +val catcher = + Filter { next -> + { request -> + try { + next(request) + } catch (err: UiObjectNotFoundException) { + Logger.e("caught UiObjectNotFoundException", err) + val msg = "selector ${err.message} found nothing" + Response(NOT_FOUND).body(msg) + } catch (err: NotImplementedError) { + Response(NOT_IMPLEMENTED).body("method ${err.message}() is not implemented on Android") + } catch (err: Exception) { + Logger.e("caught Exception", err) + Response(INTERNAL_SERVER_ERROR).body(err.stackTraceToString()) + } + } + } diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt deleted file mode 100644 index 3273b9781..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ConfigureRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeconfigureRequest") -public inline fun configureRequest(block: pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ConfigureRequest = - pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.ConfigureRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.ConfigureRequest` - */ -public object ConfigureRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.ConfigureRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.ConfigureRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.ConfigureRequest = _builder.build() - - /** - * uint64 findTimeoutMillis = 1; - */ - public var findTimeoutMillis: kotlin.Long - @JvmName("getFindTimeoutMillis") - get() = _builder.getFindTimeoutMillis() - @JvmName("setFindTimeoutMillis") - set(value) { - _builder.setFindTimeoutMillis(value) - } - /** - * `uint64 findTimeoutMillis = 1;` - */ - public fun clearFindTimeoutMillis() { - _builder.clearFindTimeoutMillis() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.ConfigureRequest.copy(block: pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ConfigureRequest = - pl.leancode.patrol.contracts.ConfigureRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java deleted file mode 100644 index 22199865b..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.java +++ /dev/null @@ -1,12512 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -package pl.leancode.patrol.contracts; - -public final class Contracts { - private Contracts() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - public interface ListDartTestsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.ListDartTestsResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.DartTestGroup group = 1; - * @return Whether the group field is set. - */ - boolean hasGroup(); - /** - * .patrol.DartTestGroup group = 1; - * @return The group. - */ - pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup(); - } - /** - * Protobuf type {@code patrol.ListDartTestsResponse} - */ - public static final class ListDartTestsResponse extends - com.google.protobuf.GeneratedMessageLite< - ListDartTestsResponse, ListDartTestsResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.ListDartTestsResponse) - ListDartTestsResponseOrBuilder { - private ListDartTestsResponse() { - } - public static final int GROUP_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.DartTestGroup group_; - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public boolean hasGroup() { - return group_ != null; - } - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup() { - return group_ == null ? pl.leancode.patrol.contracts.Contracts.DartTestGroup.getDefaultInstance() : group_; - } - /** - * .patrol.DartTestGroup group = 1; - */ - private void setGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - group_ = value; - - } - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - if (group_ != null && - group_ != pl.leancode.patrol.contracts.Contracts.DartTestGroup.getDefaultInstance()) { - group_ = - pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder(group_).mergeFrom(value).buildPartial(); - } else { - group_ = value; - } - - } - /** - * .patrol.DartTestGroup group = 1; - */ - private void clearGroup() { group_ = null; - - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.ListDartTestsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.ListDartTestsResponse) - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public boolean hasGroup() { - return instance.hasGroup(); - } - /** - * .patrol.DartTestGroup group = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroup() { - return instance.getGroup(); - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder setGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.setGroup(value); - return this; - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder setGroup( - pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.setGroup(builderForValue.build()); - return this; - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder mergeGroup(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.mergeGroup(value); - return this; - } - /** - * .patrol.DartTestGroup group = 1; - */ - public Builder clearGroup() { copyOnWrite(); - instance.clearGroup(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.ListDartTestsResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "group_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\t"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.ListDartTestsResponse) - private static final pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse DEFAULT_INSTANCE; - static { - ListDartTestsResponse defaultInstance = new ListDartTestsResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ListDartTestsResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DartTestGroupOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DartTestGroup) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated .patrol.DartTestCase tests = 2; - */ - java.util.List - getTestsList(); - /** - * repeated .patrol.DartTestCase tests = 2; - */ - pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index); - /** - * repeated .patrol.DartTestCase tests = 2; - */ - int getTestsCount(); - - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - java.util.List - getGroupsList(); - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index); - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - int getGroupsCount(); - } - /** - * Protobuf type {@code patrol.DartTestGroup} - */ - public static final class DartTestGroup extends - com.google.protobuf.GeneratedMessageLite< - DartTestGroup, DartTestGroup.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DartTestGroup) - DartTestGroupOrBuilder { - private DartTestGroup() { - name_ = ""; - tests_ = emptyProtobufList(); - groups_ = emptyProtobufList(); - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static final int TESTS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList tests_; - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public java.util.List getTestsList() { - return tests_; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public java.util.List - getTestsOrBuilderList() { - return tests_; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public int getTestsCount() { - return tests_.size(); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index) { - return tests_.get(index); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public pl.leancode.patrol.contracts.Contracts.DartTestCaseOrBuilder getTestsOrBuilder( - int index) { - return tests_.get(index); - } - private void ensureTestsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = tests_; - if (!tmp.isModifiable()) { - tests_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.set(index, value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addTests(pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.add(value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - value.getClass(); - ensureTestsIsMutable(); - tests_.add(index, value); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void addAllTests( - java.lang.Iterable values) { - ensureTestsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, tests_); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void clearTests() { - tests_ = emptyProtobufList(); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - private void removeTests(int index) { - ensureTestsIsMutable(); - tests_.remove(index); - } - - public static final int GROUPS_FIELD_NUMBER = 3; - private com.google.protobuf.Internal.ProtobufList groups_; - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public java.util.List getGroupsList() { - return groups_; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public java.util.List - getGroupsOrBuilderList() { - return groups_; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public int getGroupsCount() { - return groups_.size(); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index) { - return groups_.get(index); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public pl.leancode.patrol.contracts.Contracts.DartTestGroupOrBuilder getGroupsOrBuilder( - int index) { - return groups_.get(index); - } - private void ensureGroupsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = groups_; - if (!tmp.isModifiable()) { - groups_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - ensureGroupsIsMutable(); - groups_.set(index, value); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void addGroups(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - ensureGroupsIsMutable(); - groups_.add(value); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - value.getClass(); - ensureGroupsIsMutable(); - groups_.add(index, value); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void addAllGroups( - java.lang.Iterable values) { - ensureGroupsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, groups_); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void clearGroups() { - groups_ = emptyProtobufList(); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - private void removeGroups(int index) { - ensureGroupsIsMutable(); - groups_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartTestGroup prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DartTestGroup} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DartTestGroup, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DartTestGroup) - pl.leancode.patrol.contracts.Contracts.DartTestGroupOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public java.util.List getTestsList() { - return java.util.Collections.unmodifiableList( - instance.getTestsList()); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public int getTestsCount() { - return instance.getTestsCount(); - }/** - * repeated .patrol.DartTestCase tests = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestCase getTests(int index) { - return instance.getTests(index); - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.setTests(index, value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder setTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.setTests(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests(pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.addTests(value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase value) { - copyOnWrite(); - instance.addTests(index, value); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.addTests(builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addTests( - int index, pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder builderForValue) { - copyOnWrite(); - instance.addTests(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder addAllTests( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllTests(values); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder clearTests() { - copyOnWrite(); - instance.clearTests(); - return this; - } - /** - * repeated .patrol.DartTestCase tests = 2; - */ - public Builder removeTests(int index) { - copyOnWrite(); - instance.removeTests(index); - return this; - } - - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public java.util.List getGroupsList() { - return java.util.Collections.unmodifiableList( - instance.getGroupsList()); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public int getGroupsCount() { - return instance.getGroupsCount(); - }/** - * repeated .patrol.DartTestGroup groups = 3; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.DartTestGroup getGroups(int index) { - return instance.getGroups(index); - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.setGroups(index, value); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder setGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.setGroups(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups(pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.addGroups(value); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup value) { - copyOnWrite(); - instance.addGroups(index, value); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups( - pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.addGroups(builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addGroups( - int index, pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder builderForValue) { - copyOnWrite(); - instance.addGroups(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder addAllGroups( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllGroups(values); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder clearGroups() { - copyOnWrite(); - instance.clearGroups(); - return this; - } - /** - * repeated .patrol.DartTestGroup groups = 3; - */ - public Builder removeGroups(int index) { - copyOnWrite(); - instance.removeGroups(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DartTestGroup) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DartTestGroup(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - "tests_", - pl.leancode.patrol.contracts.Contracts.DartTestCase.class, - "groups_", - pl.leancode.patrol.contracts.Contracts.DartTestGroup.class, - }; - java.lang.String info = - "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0002\u0000\u0001\u0208\u0002\u001b" + - "\u0003\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DartTestGroup.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DartTestGroup) - private static final pl.leancode.patrol.contracts.Contracts.DartTestGroup DEFAULT_INSTANCE; - static { - DartTestGroup defaultInstance = new DartTestGroup(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DartTestGroup.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestGroup getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DartTestCaseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DartTestCase) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - * Protobuf type {@code patrol.DartTestCase} - */ - public static final class DartTestCase extends - com.google.protobuf.GeneratedMessageLite< - DartTestCase, DartTestCase.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DartTestCase) - DartTestCaseOrBuilder { - private DartTestCase() { - name_ = ""; - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DartTestCase parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DartTestCase prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DartTestCase} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DartTestCase, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DartTestCase) - pl.leancode.patrol.contracts.Contracts.DartTestCaseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DartTestCase.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DartTestCase) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DartTestCase(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DartTestCase.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DartTestCase) - private static final pl.leancode.patrol.contracts.Contracts.DartTestCase DEFAULT_INSTANCE; - static { - DartTestCase defaultInstance = new DartTestCase(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DartTestCase.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DartTestCase getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface RunDartTestRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.RunDartTestRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - } - /** - * Protobuf type {@code patrol.RunDartTestRequest} - */ - public static final class RunDartTestRequest extends - com.google.protobuf.GeneratedMessageLite< - RunDartTestRequest, RunDartTestRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.RunDartTestRequest) - RunDartTestRequestOrBuilder { - private RunDartTestRequest() { - name_ = ""; - } - public static final int NAME_FIELD_NUMBER = 1; - private java.lang.String name_; - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return name_; - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(name_); - } - /** - * string name = 1; - * @param value The name to set. - */ - private void setName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - name_ = value; - } - /** - * string name = 1; - */ - private void clearName() { - - name_ = getDefaultInstance().getName(); - } - /** - * string name = 1; - * @param value The bytes for name to set. - */ - private void setNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - name_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.RunDartTestRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.RunDartTestRequest) - pl.leancode.patrol.contracts.Contracts.RunDartTestRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - return instance.getName(); - } - /** - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - return instance.getNameBytes(); - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - copyOnWrite(); - instance.setName(value); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - copyOnWrite(); - instance.clearName(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setNameBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.RunDartTestRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.RunDartTestRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "name_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.RunDartTestRequest) - private static final pl.leancode.patrol.contracts.Contracts.RunDartTestRequest DEFAULT_INSTANCE; - static { - RunDartTestRequest defaultInstance = new RunDartTestRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - RunDartTestRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface RunDartTestResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.RunDartTestResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - int getResultValue(); - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The result. - */ - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result getResult(); - - /** - * optional string details = 2; - * @return Whether the details field is set. - */ - boolean hasDetails(); - /** - * optional string details = 2; - * @return The details. - */ - java.lang.String getDetails(); - /** - * optional string details = 2; - * @return The bytes for details. - */ - com.google.protobuf.ByteString - getDetailsBytes(); - } - /** - * Protobuf type {@code patrol.RunDartTestResponse} - */ - public static final class RunDartTestResponse extends - com.google.protobuf.GeneratedMessageLite< - RunDartTestResponse, RunDartTestResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.RunDartTestResponse) - RunDartTestResponseOrBuilder { - private RunDartTestResponse() { - details_ = ""; - } - /** - * Protobuf enum {@code patrol.RunDartTestResponse.Result} - */ - public enum Result - implements com.google.protobuf.Internal.EnumLite { - /** - * SUCCESS = 0; - */ - SUCCESS(0), - /** - * SKIPPED = 1; - */ - SKIPPED(1), - /** - * FAILURE = 2; - */ - FAILURE(2), - UNRECOGNIZED(-1), - ; - - /** - * SUCCESS = 0; - */ - public static final int SUCCESS_VALUE = 0; - /** - * SKIPPED = 1; - */ - public static final int SKIPPED_VALUE = 1; - /** - * FAILURE = 2; - */ - public static final int FAILURE_VALUE = 2; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Result valueOf(int value) { - return forNumber(value); - } - - public static Result forNumber(int value) { - switch (value) { - case 0: return SUCCESS; - case 1: return SKIPPED; - case 2: return FAILURE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Result> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public Result findValueByNumber(int number) { - return Result.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return ResultVerifier.INSTANCE; - } - - private static final class ResultVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new ResultVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return Result.forNumber(number) != null; - } - }; - - private final int value; - - private Result(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.RunDartTestResponse.Result) - } - - private int bitField0_; - public static final int RESULT_FIELD_NUMBER = 1; - private int result_; - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override - public int getResultValue() { - return result_; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The result. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result getResult() { - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result result = pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result.forNumber(result_); - return result == null ? pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result.UNRECOGNIZED : result; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The enum numeric value on the wire for result to set. - */ - private void setResultValue(int value) { - result_ = value; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The result to set. - */ - private void setResult(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result value) { - result_ = value.getNumber(); - - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - */ - private void clearResult() { - - result_ = 0; - } - - public static final int DETAILS_FIELD_NUMBER = 2; - private java.lang.String details_; - /** - * optional string details = 2; - * @return Whether the details field is set. - */ - @java.lang.Override - public boolean hasDetails() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string details = 2; - * @return The details. - */ - @java.lang.Override - public java.lang.String getDetails() { - return details_; - } - /** - * optional string details = 2; - * @return The bytes for details. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDetailsBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(details_); - } - /** - * optional string details = 2; - * @param value The details to set. - */ - private void setDetails( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000001; - details_ = value; - } - /** - * optional string details = 2; - */ - private void clearDetails() { - bitField0_ = (bitField0_ & ~0x00000001); - details_ = getDefaultInstance().getDetails(); - } - /** - * optional string details = 2; - * @param value The bytes for details to set. - */ - private void setDetailsBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - details_ = value.toStringUtf8(); - bitField0_ |= 0x00000001; - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.RunDartTestResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.RunDartTestResponse) - pl.leancode.patrol.contracts.Contracts.RunDartTestResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override - public int getResultValue() { - return instance.getResultValue(); - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The result to set. - * @return This builder for chaining. - */ - public Builder setResultValue(int value) { - copyOnWrite(); - instance.setResultValue(value); - return this; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return The result. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result getResult() { - return instance.getResult(); - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @param value The enum numeric value on the wire for result to set. - * @return This builder for chaining. - */ - public Builder setResult(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result value) { - copyOnWrite(); - instance.setResult(value); - return this; - } - /** - * .patrol.RunDartTestResponse.Result result = 1; - * @return This builder for chaining. - */ - public Builder clearResult() { - copyOnWrite(); - instance.clearResult(); - return this; - } - - /** - * optional string details = 2; - * @return Whether the details field is set. - */ - @java.lang.Override - public boolean hasDetails() { - return instance.hasDetails(); - } - /** - * optional string details = 2; - * @return The details. - */ - @java.lang.Override - public java.lang.String getDetails() { - return instance.getDetails(); - } - /** - * optional string details = 2; - * @return The bytes for details. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDetailsBytes() { - return instance.getDetailsBytes(); - } - /** - * optional string details = 2; - * @param value The details to set. - * @return This builder for chaining. - */ - public Builder setDetails( - java.lang.String value) { - copyOnWrite(); - instance.setDetails(value); - return this; - } - /** - * optional string details = 2; - * @return This builder for chaining. - */ - public Builder clearDetails() { - copyOnWrite(); - instance.clearDetails(); - return this; - } - /** - * optional string details = 2; - * @param value The bytes for details to set. - * @return This builder for chaining. - */ - public Builder setDetailsBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setDetailsBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.RunDartTestResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.RunDartTestResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "bitField0_", - "result_", - "details_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0001\u0001\u0002\u0002\u0000\u0000\u0000\u0001\f\u0002\u1208" + - "\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.RunDartTestResponse) - private static final pl.leancode.patrol.contracts.Contracts.RunDartTestResponse DEFAULT_INSTANCE; - static { - RunDartTestResponse defaultInstance = new RunDartTestResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - RunDartTestResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.RunDartTestResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface ConfigureRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.ConfigureRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint64 findTimeoutMillis = 1; - * @return The findTimeoutMillis. - */ - long getFindTimeoutMillis(); - } - /** - * Protobuf type {@code patrol.ConfigureRequest} - */ - public static final class ConfigureRequest extends - com.google.protobuf.GeneratedMessageLite< - ConfigureRequest, ConfigureRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.ConfigureRequest) - ConfigureRequestOrBuilder { - private ConfigureRequest() { - } - public static final int FINDTIMEOUTMILLIS_FIELD_NUMBER = 1; - private long findTimeoutMillis_; - /** - * uint64 findTimeoutMillis = 1; - * @return The findTimeoutMillis. - */ - @java.lang.Override - public long getFindTimeoutMillis() { - return findTimeoutMillis_; - } - /** - * uint64 findTimeoutMillis = 1; - * @param value The findTimeoutMillis to set. - */ - private void setFindTimeoutMillis(long value) { - - findTimeoutMillis_ = value; - } - /** - * uint64 findTimeoutMillis = 1; - */ - private void clearFindTimeoutMillis() { - - findTimeoutMillis_ = 0L; - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.ConfigureRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.ConfigureRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.ConfigureRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.ConfigureRequest) - pl.leancode.patrol.contracts.Contracts.ConfigureRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.ConfigureRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint64 findTimeoutMillis = 1; - * @return The findTimeoutMillis. - */ - @java.lang.Override - public long getFindTimeoutMillis() { - return instance.getFindTimeoutMillis(); - } - /** - * uint64 findTimeoutMillis = 1; - * @param value The findTimeoutMillis to set. - * @return This builder for chaining. - */ - public Builder setFindTimeoutMillis(long value) { - copyOnWrite(); - instance.setFindTimeoutMillis(value); - return this; - } - /** - * uint64 findTimeoutMillis = 1; - * @return This builder for chaining. - */ - public Builder clearFindTimeoutMillis() { - copyOnWrite(); - instance.clearFindTimeoutMillis(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.ConfigureRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.ConfigureRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "findTimeoutMillis_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0003"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.ConfigureRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.ConfigureRequest) - private static final pl.leancode.patrol.contracts.Contracts.ConfigureRequest DEFAULT_INSTANCE; - static { - ConfigureRequest defaultInstance = new ConfigureRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - ConfigureRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.ConfigureRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface OpenAppRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.OpenAppRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string appId = 1; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 1; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.OpenAppRequest} - */ - public static final class OpenAppRequest extends - com.google.protobuf.GeneratedMessageLite< - OpenAppRequest, OpenAppRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.OpenAppRequest) - OpenAppRequestOrBuilder { - private OpenAppRequest() { - appId_ = ""; - } - public static final int APPID_FIELD_NUMBER = 1; - private java.lang.String appId_; - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 1; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 1; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.OpenAppRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.OpenAppRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.OpenAppRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.OpenAppRequest) - pl.leancode.patrol.contracts.Contracts.OpenAppRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.OpenAppRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 1; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 1; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.OpenAppRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.OpenAppRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "appId_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.OpenAppRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.OpenAppRequest) - private static final pl.leancode.patrol.contracts.Contracts.OpenAppRequest DEFAULT_INSTANCE; - static { - OpenAppRequest defaultInstance = new OpenAppRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - OpenAppRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenAppRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TapOnNotificationRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.TapOnNotificationRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint32 index = 1; - * @return Whether the index field is set. - */ - boolean hasIndex(); - /** - * uint32 index = 1; - * @return The index. - */ - int getIndex(); - - /** - * .patrol.Selector selector = 2; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 2; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - public pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.FindByCase getFindByCase(); - } - /** - * Protobuf type {@code patrol.TapOnNotificationRequest} - */ - public static final class TapOnNotificationRequest extends - com.google.protobuf.GeneratedMessageLite< - TapOnNotificationRequest, TapOnNotificationRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.TapOnNotificationRequest) - TapOnNotificationRequestOrBuilder { - private TapOnNotificationRequest() { - } - private int findByCase_ = 0; - private java.lang.Object findBy_; - public enum FindByCase { - INDEX(1), - SELECTOR(2), - FINDBY_NOT_SET(0); - private final int value; - private FindByCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static FindByCase valueOf(int value) { - return forNumber(value); - } - - public static FindByCase forNumber(int value) { - switch (value) { - case 1: return INDEX; - case 2: return SELECTOR; - case 0: return FINDBY_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - @java.lang.Override - public FindByCase - getFindByCase() { - return FindByCase.forNumber( - findByCase_); - } - - private void clearFindBy() { - findByCase_ = 0; - findBy_ = null; - } - - public static final int INDEX_FIELD_NUMBER = 1; - /** - * uint32 index = 1; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return findByCase_ == 1; - } - /** - * uint32 index = 1; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - if (findByCase_ == 1) { - return (java.lang.Integer) findBy_; - } - return 0; - } - /** - * uint32 index = 1; - * @param value The index to set. - */ - private void setIndex(int value) { - findByCase_ = 1; - findBy_ = value; - } - /** - * uint32 index = 1; - */ - private void clearIndex() { - if (findByCase_ == 1) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static final int SELECTOR_FIELD_NUMBER = 2; - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public boolean hasSelector() { - return findByCase_ == 2; - } - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - if (findByCase_ == 2) { - return (pl.leancode.patrol.contracts.Contracts.Selector) findBy_; - } - return pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance(); - } - /** - * .patrol.Selector selector = 2; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - findBy_ = value; - findByCase_ = 2; - } - /** - * .patrol.Selector selector = 2; - */ - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (findByCase_ == 2 && - findBy_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - findBy_ = pl.leancode.patrol.contracts.Contracts.Selector.newBuilder((pl.leancode.patrol.contracts.Contracts.Selector) findBy_) - .mergeFrom(value).buildPartial(); - } else { - findBy_ = value; - } - findByCase_ = 2; - } - /** - * .patrol.Selector selector = 2; - */ - private void clearSelector() { - if (findByCase_ == 2) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.TapOnNotificationRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.TapOnNotificationRequest) - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - @java.lang.Override - public FindByCase - getFindByCase() { - return instance.getFindByCase(); - } - - public Builder clearFindBy() { - copyOnWrite(); - instance.clearFindBy(); - return this; - } - - - /** - * uint32 index = 1; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return instance.hasIndex(); - } - /** - * uint32 index = 1; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - return instance.getIndex(); - } - /** - * uint32 index = 1; - * @param value The index to set. - * @return This builder for chaining. - */ - public Builder setIndex(int value) { - copyOnWrite(); - instance.setIndex(value); - return this; - } - /** - * uint32 index = 1; - * @return This builder for chaining. - */ - public Builder clearIndex() { - copyOnWrite(); - instance.clearIndex(); - return this; - } - - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 2; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 2; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 2; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 2; - */ - public Builder clearSelector() { - copyOnWrite(); - instance.clearSelector(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.TapOnNotificationRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "findBy_", - "findByCase_", - pl.leancode.patrol.contracts.Contracts.Selector.class, - }; - java.lang.String info = - "\u0000\u0002\u0001\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001>\u0000\u0002<" + - "\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.TapOnNotificationRequest) - private static final pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest DEFAULT_INSTANCE; - static { - TapOnNotificationRequest defaultInstance = new TapOnNotificationRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - TapOnNotificationRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface EmptyOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.Empty) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - *
-   * We're defining our own Empty instead of using google.protobuf.Empty because
-   * the Dart plugin can't easily generate it.
-   *
-   * See:
-   *  * https://github.com/google/protobuf.dart/issues/170
-   * 
- * - * Protobuf type {@code patrol.Empty} - */ - public static final class Empty extends - com.google.protobuf.GeneratedMessageLite< - Empty, Empty.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.Empty) - EmptyOrBuilder { - private Empty() { - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.Empty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.Empty parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Empty parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Empty prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * We're defining our own Empty instead of using google.protobuf.Empty because
-     * the Dart plugin can't easily generate it.
-     *
-     * See:
-     *  * https://github.com/google/protobuf.dart/issues/170
-     * 
- * - * Protobuf type {@code patrol.Empty} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.Empty, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.Empty) - pl.leancode.patrol.contracts.Contracts.EmptyOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.Empty.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:patrol.Empty) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.Empty(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = null;java.lang.String info = - "\u0000\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.Empty.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.Empty) - private static final pl.leancode.patrol.contracts.Contracts.Empty DEFAULT_INSTANCE; - static { - Empty defaultInstance = new Empty(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Empty.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.Empty getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface OpenQuickSettingsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.OpenQuickSettingsRequest) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - * Protobuf type {@code patrol.OpenQuickSettingsRequest} - */ - public static final class OpenQuickSettingsRequest extends - com.google.protobuf.GeneratedMessageLite< - OpenQuickSettingsRequest, OpenQuickSettingsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.OpenQuickSettingsRequest) - OpenQuickSettingsRequestOrBuilder { - private OpenQuickSettingsRequest() { - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.OpenQuickSettingsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.OpenQuickSettingsRequest) - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:patrol.OpenQuickSettingsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = null;java.lang.String info = - "\u0000\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.OpenQuickSettingsRequest) - private static final pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest DEFAULT_INSTANCE; - static { - OpenQuickSettingsRequest defaultInstance = new OpenQuickSettingsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - OpenQuickSettingsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface DarkModeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.DarkModeRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string appId = 1; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 1; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.DarkModeRequest} - */ - public static final class DarkModeRequest extends - com.google.protobuf.GeneratedMessageLite< - DarkModeRequest, DarkModeRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.DarkModeRequest) - DarkModeRequestOrBuilder { - private DarkModeRequest() { - appId_ = ""; - } - public static final int APPID_FIELD_NUMBER = 1; - private java.lang.String appId_; - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 1; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 1; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.DarkModeRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.DarkModeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.DarkModeRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.DarkModeRequest) - pl.leancode.patrol.contracts.Contracts.DarkModeRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.DarkModeRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string appId = 1; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 1; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 1; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 1; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 1; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.DarkModeRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.DarkModeRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "appId_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.DarkModeRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.DarkModeRequest) - private static final pl.leancode.patrol.contracts.Contracts.DarkModeRequest DEFAULT_INSTANCE; - static { - DarkModeRequest defaultInstance = new DarkModeRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - DarkModeRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.DarkModeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNativeViewsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNativeViewsRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.Selector selector = 1; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 1; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.GetNativeViewsRequest} - */ - public static final class GetNativeViewsRequest extends - com.google.protobuf.GeneratedMessageLite< - GetNativeViewsRequest, GetNativeViewsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNativeViewsRequest) - GetNativeViewsRequestOrBuilder { - private GetNativeViewsRequest() { - appId_ = ""; - } - public static final int SELECTOR_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.Selector selector_; - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return selector_ != null; - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return selector_ == null ? pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance() : selector_; - } - /** - * .patrol.Selector selector = 1; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - selector_ = value; - - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (selector_ != null && - selector_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - selector_ = - pl.leancode.patrol.contracts.Contracts.Selector.newBuilder(selector_).mergeFrom(value).buildPartial(); - } else { - selector_ = value; - } - - } - /** - * .patrol.Selector selector = 1; - */ - private void clearSelector() { selector_ = null; - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNativeViewsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNativeViewsRequest) - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder clearSelector() { copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.GetNativeViewsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "selector_", - "appId_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNativeViewsRequest) - private static final pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest DEFAULT_INSTANCE; - static { - GetNativeViewsRequest defaultInstance = new GetNativeViewsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNativeViewsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNativeViewsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNativeViewsResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - java.util.List - getNativeViewsList(); - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - pl.leancode.patrol.contracts.Contracts.NativeView getNativeViews(int index); - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - int getNativeViewsCount(); - } - /** - * Protobuf type {@code patrol.GetNativeViewsResponse} - */ - public static final class GetNativeViewsResponse extends - com.google.protobuf.GeneratedMessageLite< - GetNativeViewsResponse, GetNativeViewsResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNativeViewsResponse) - GetNativeViewsResponseOrBuilder { - private GetNativeViewsResponse() { - nativeViews_ = emptyProtobufList(); - } - public static final int NATIVEVIEWS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList nativeViews_; - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public java.util.List getNativeViewsList() { - return nativeViews_; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public java.util.List - getNativeViewsOrBuilderList() { - return nativeViews_; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public int getNativeViewsCount() { - return nativeViews_.size(); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getNativeViews(int index) { - return nativeViews_.get(index); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public pl.leancode.patrol.contracts.Contracts.NativeViewOrBuilder getNativeViewsOrBuilder( - int index) { - return nativeViews_.get(index); - } - private void ensureNativeViewsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = nativeViews_; - if (!tmp.isModifiable()) { - nativeViews_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void setNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureNativeViewsIsMutable(); - nativeViews_.set(index, value); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void addNativeViews(pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureNativeViewsIsMutable(); - nativeViews_.add(value); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void addNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureNativeViewsIsMutable(); - nativeViews_.add(index, value); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void addAllNativeViews( - java.lang.Iterable values) { - ensureNativeViewsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, nativeViews_); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void clearNativeViews() { - nativeViews_ = emptyProtobufList(); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - private void removeNativeViews(int index) { - ensureNativeViewsIsMutable(); - nativeViews_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNativeViewsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNativeViewsResponse) - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public java.util.List getNativeViewsList() { - return java.util.Collections.unmodifiableList( - instance.getNativeViewsList()); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public int getNativeViewsCount() { - return instance.getNativeViewsCount(); - }/** - * repeated .patrol.NativeView nativeViews = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getNativeViews(int index) { - return instance.getNativeViews(index); - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder setNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.setNativeViews(index, value); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder setNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.setNativeViews(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews(pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addNativeViews(value); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addNativeViews(index, value); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews( - pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addNativeViews(builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addNativeViews( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addNativeViews(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder addAllNativeViews( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllNativeViews(values); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder clearNativeViews() { - copyOnWrite(); - instance.clearNativeViews(); - return this; - } - /** - * repeated .patrol.NativeView nativeViews = 2; - */ - public Builder removeNativeViews(int index) { - copyOnWrite(); - instance.removeNativeViews(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.GetNativeViewsResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "nativeViews_", - pl.leancode.patrol.contracts.Contracts.NativeView.class, - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0002\u0002\u0001\u0000\u0001\u0000\u0002\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNativeViewsResponse) - private static final pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse DEFAULT_INSTANCE; - static { - GetNativeViewsResponse defaultInstance = new GetNativeViewsResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNativeViewsResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNotificationsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNotificationsRequest) - com.google.protobuf.MessageLiteOrBuilder { - } - /** - * Protobuf type {@code patrol.GetNotificationsRequest} - */ - public static final class GetNotificationsRequest extends - com.google.protobuf.GeneratedMessageLite< - GetNotificationsRequest, GetNotificationsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNotificationsRequest) - GetNotificationsRequestOrBuilder { - private GetNotificationsRequest() { - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNotificationsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNotificationsRequest) - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - // @@protoc_insertion_point(builder_scope:patrol.GetNotificationsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = null;java.lang.String info = - "\u0000\u0000"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNotificationsRequest) - private static final pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest DEFAULT_INSTANCE; - static { - GetNotificationsRequest defaultInstance = new GetNotificationsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNotificationsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface GetNotificationsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.GetNotificationsResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * repeated .patrol.Notification notifications = 2; - */ - java.util.List - getNotificationsList(); - /** - * repeated .patrol.Notification notifications = 2; - */ - pl.leancode.patrol.contracts.Contracts.Notification getNotifications(int index); - /** - * repeated .patrol.Notification notifications = 2; - */ - int getNotificationsCount(); - } - /** - * Protobuf type {@code patrol.GetNotificationsResponse} - */ - public static final class GetNotificationsResponse extends - com.google.protobuf.GeneratedMessageLite< - GetNotificationsResponse, GetNotificationsResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.GetNotificationsResponse) - GetNotificationsResponseOrBuilder { - private GetNotificationsResponse() { - notifications_ = emptyProtobufList(); - } - public static final int NOTIFICATIONS_FIELD_NUMBER = 2; - private com.google.protobuf.Internal.ProtobufList notifications_; - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public java.util.List getNotificationsList() { - return notifications_; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public java.util.List - getNotificationsOrBuilderList() { - return notifications_; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public int getNotificationsCount() { - return notifications_.size(); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Notification getNotifications(int index) { - return notifications_.get(index); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public pl.leancode.patrol.contracts.Contracts.NotificationOrBuilder getNotificationsOrBuilder( - int index) { - return notifications_.get(index); - } - private void ensureNotificationsIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = notifications_; - if (!tmp.isModifiable()) { - notifications_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.Notification notifications = 2; - */ - private void setNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - value.getClass(); - ensureNotificationsIsMutable(); - notifications_.set(index, value); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void addNotifications(pl.leancode.patrol.contracts.Contracts.Notification value) { - value.getClass(); - ensureNotificationsIsMutable(); - notifications_.add(value); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void addNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - value.getClass(); - ensureNotificationsIsMutable(); - notifications_.add(index, value); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void addAllNotifications( - java.lang.Iterable values) { - ensureNotificationsIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, notifications_); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void clearNotifications() { - notifications_ = emptyProtobufList(); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - private void removeNotifications(int index) { - ensureNotificationsIsMutable(); - notifications_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.GetNotificationsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.GetNotificationsResponse) - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public java.util.List getNotificationsList() { - return java.util.Collections.unmodifiableList( - instance.getNotificationsList()); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public int getNotificationsCount() { - return instance.getNotificationsCount(); - }/** - * repeated .patrol.Notification notifications = 2; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Notification getNotifications(int index) { - return instance.getNotifications(index); - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder setNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - copyOnWrite(); - instance.setNotifications(index, value); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder setNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification.Builder builderForValue) { - copyOnWrite(); - instance.setNotifications(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications(pl.leancode.patrol.contracts.Contracts.Notification value) { - copyOnWrite(); - instance.addNotifications(value); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification value) { - copyOnWrite(); - instance.addNotifications(index, value); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications( - pl.leancode.patrol.contracts.Contracts.Notification.Builder builderForValue) { - copyOnWrite(); - instance.addNotifications(builderForValue.build()); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addNotifications( - int index, pl.leancode.patrol.contracts.Contracts.Notification.Builder builderForValue) { - copyOnWrite(); - instance.addNotifications(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder addAllNotifications( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllNotifications(values); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder clearNotifications() { - copyOnWrite(); - instance.clearNotifications(); - return this; - } - /** - * repeated .patrol.Notification notifications = 2; - */ - public Builder removeNotifications(int index) { - copyOnWrite(); - instance.removeNotifications(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.GetNotificationsResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "notifications_", - pl.leancode.patrol.contracts.Contracts.Notification.class, - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0002\u0002\u0001\u0000\u0001\u0000\u0002\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.GetNotificationsResponse) - private static final pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse DEFAULT_INSTANCE; - static { - GetNotificationsResponse defaultInstance = new GetNotificationsResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - GetNotificationsResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface TapRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.TapRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.Selector selector = 1; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 1; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.TapRequest} - */ - public static final class TapRequest extends - com.google.protobuf.GeneratedMessageLite< - TapRequest, TapRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.TapRequest) - TapRequestOrBuilder { - private TapRequest() { - appId_ = ""; - } - public static final int SELECTOR_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.Selector selector_; - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return selector_ != null; - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return selector_ == null ? pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance() : selector_; - } - /** - * .patrol.Selector selector = 1; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - selector_ = value; - - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (selector_ != null && - selector_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - selector_ = - pl.leancode.patrol.contracts.Contracts.Selector.newBuilder(selector_).mergeFrom(value).buildPartial(); - } else { - selector_ = value; - } - - } - /** - * .patrol.Selector selector = 1; - */ - private void clearSelector() { selector_ = null; - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.TapRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.TapRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.TapRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.TapRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.TapRequest) - pl.leancode.patrol.contracts.Contracts.TapRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.TapRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder clearSelector() { copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.TapRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.TapRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "selector_", - "appId_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.TapRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.TapRequest) - private static final pl.leancode.patrol.contracts.Contracts.TapRequest DEFAULT_INSTANCE; - static { - TapRequest defaultInstance = new TapRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - TapRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.TapRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface EnterTextRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.EnterTextRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string data = 1; - * @return The data. - */ - java.lang.String getData(); - /** - * string data = 1; - * @return The bytes for data. - */ - com.google.protobuf.ByteString - getDataBytes(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - - /** - * uint32 index = 3; - * @return Whether the index field is set. - */ - boolean hasIndex(); - /** - * uint32 index = 3; - * @return The index. - */ - int getIndex(); - - /** - * .patrol.Selector selector = 4; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 4; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return The enum numeric value on the wire for keyboardBehavior. - */ - int getKeyboardBehaviorValue(); - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return The keyboardBehavior. - */ - pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior getKeyboardBehavior(); - - public pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase getFindByCase(); - } - /** - * Protobuf type {@code patrol.EnterTextRequest} - */ - public static final class EnterTextRequest extends - com.google.protobuf.GeneratedMessageLite< - EnterTextRequest, EnterTextRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.EnterTextRequest) - EnterTextRequestOrBuilder { - private EnterTextRequest() { - data_ = ""; - appId_ = ""; - } - /** - * Protobuf enum {@code patrol.EnterTextRequest.KeyboardBehavior} - */ - public enum KeyboardBehavior - implements com.google.protobuf.Internal.EnumLite { - /** - *
-       * The default keyboard behavior.
-       *
-       * Keyboard will be shown when entering text starts, and will be
-       * automatically dismissed afterwards.
-       * 
- * - * SHOW_AND_DISMISS = 0; - */ - SHOW_AND_DISMISS(0), - /** - *
-       * The alternative keyboard behavior.
-       *
-       * On Android, no keyboard will be shown at all. The text will simply appear
-       * inside the TextField.
-       *
-       * On iOS, the keyboard will not be dismissed after entering text.
-       * 
- * - * ALTERNATIVE = 1; - */ - ALTERNATIVE(1), - UNRECOGNIZED(-1), - ; - - /** - *
-       * The default keyboard behavior.
-       *
-       * Keyboard will be shown when entering text starts, and will be
-       * automatically dismissed afterwards.
-       * 
- * - * SHOW_AND_DISMISS = 0; - */ - public static final int SHOW_AND_DISMISS_VALUE = 0; - /** - *
-       * The alternative keyboard behavior.
-       *
-       * On Android, no keyboard will be shown at all. The text will simply appear
-       * inside the TextField.
-       *
-       * On iOS, the keyboard will not be dismissed after entering text.
-       * 
- * - * ALTERNATIVE = 1; - */ - public static final int ALTERNATIVE_VALUE = 1; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KeyboardBehavior valueOf(int value) { - return forNumber(value); - } - - public static KeyboardBehavior forNumber(int value) { - switch (value) { - case 0: return SHOW_AND_DISMISS; - case 1: return ALTERNATIVE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - KeyboardBehavior> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public KeyboardBehavior findValueByNumber(int number) { - return KeyboardBehavior.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return KeyboardBehaviorVerifier.INSTANCE; - } - - private static final class KeyboardBehaviorVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new KeyboardBehaviorVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return KeyboardBehavior.forNumber(number) != null; - } - }; - - private final int value; - - private KeyboardBehavior(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.EnterTextRequest.KeyboardBehavior) - } - - private int findByCase_ = 0; - private java.lang.Object findBy_; - public enum FindByCase { - INDEX(3), - SELECTOR(4), - FINDBY_NOT_SET(0); - private final int value; - private FindByCase(int value) { - this.value = value; - } - /** - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static FindByCase valueOf(int value) { - return forNumber(value); - } - - public static FindByCase forNumber(int value) { - switch (value) { - case 3: return INDEX; - case 4: return SELECTOR; - case 0: return FINDBY_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - @java.lang.Override - public FindByCase - getFindByCase() { - return FindByCase.forNumber( - findByCase_); - } - - private void clearFindBy() { - findByCase_ = 0; - findBy_ = null; - } - - public static final int DATA_FIELD_NUMBER = 1; - private java.lang.String data_; - /** - * string data = 1; - * @return The data. - */ - @java.lang.Override - public java.lang.String getData() { - return data_; - } - /** - * string data = 1; - * @return The bytes for data. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDataBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(data_); - } - /** - * string data = 1; - * @param value The data to set. - */ - private void setData( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - data_ = value; - } - /** - * string data = 1; - */ - private void clearData() { - - data_ = getDefaultInstance().getData(); - } - /** - * string data = 1; - * @param value The bytes for data to set. - */ - private void setDataBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - data_ = value.toStringUtf8(); - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static final int INDEX_FIELD_NUMBER = 3; - /** - * uint32 index = 3; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return findByCase_ == 3; - } - /** - * uint32 index = 3; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - if (findByCase_ == 3) { - return (java.lang.Integer) findBy_; - } - return 0; - } - /** - * uint32 index = 3; - * @param value The index to set. - */ - private void setIndex(int value) { - findByCase_ = 3; - findBy_ = value; - } - /** - * uint32 index = 3; - */ - private void clearIndex() { - if (findByCase_ == 3) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static final int SELECTOR_FIELD_NUMBER = 4; - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public boolean hasSelector() { - return findByCase_ == 4; - } - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - if (findByCase_ == 4) { - return (pl.leancode.patrol.contracts.Contracts.Selector) findBy_; - } - return pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance(); - } - /** - * .patrol.Selector selector = 4; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - findBy_ = value; - findByCase_ = 4; - } - /** - * .patrol.Selector selector = 4; - */ - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (findByCase_ == 4 && - findBy_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - findBy_ = pl.leancode.patrol.contracts.Contracts.Selector.newBuilder((pl.leancode.patrol.contracts.Contracts.Selector) findBy_) - .mergeFrom(value).buildPartial(); - } else { - findBy_ = value; - } - findByCase_ = 4; - } - /** - * .patrol.Selector selector = 4; - */ - private void clearSelector() { - if (findByCase_ == 4) { - findByCase_ = 0; - findBy_ = null; - } - } - - public static final int KEYBOARDBEHAVIOR_FIELD_NUMBER = 5; - private int keyboardBehavior_; - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return The enum numeric value on the wire for keyboardBehavior. - */ - @java.lang.Override - public int getKeyboardBehaviorValue() { - return keyboardBehavior_; - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return The keyboardBehavior. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior getKeyboardBehavior() { - pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior result = pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior.forNumber(keyboardBehavior_); - return result == null ? pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior.UNRECOGNIZED : result; - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @param value The enum numeric value on the wire for keyboardBehavior to set. - */ - private void setKeyboardBehaviorValue(int value) { - keyboardBehavior_ = value; - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @param value The keyboardBehavior to set. - */ - private void setKeyboardBehavior(pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior value) { - keyboardBehavior_ = value.getNumber(); - - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - */ - private void clearKeyboardBehavior() { - - keyboardBehavior_ = 0; - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.EnterTextRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.EnterTextRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.EnterTextRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.EnterTextRequest) - pl.leancode.patrol.contracts.Contracts.EnterTextRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.EnterTextRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - @java.lang.Override - public FindByCase - getFindByCase() { - return instance.getFindByCase(); - } - - public Builder clearFindBy() { - copyOnWrite(); - instance.clearFindBy(); - return this; - } - - - /** - * string data = 1; - * @return The data. - */ - @java.lang.Override - public java.lang.String getData() { - return instance.getData(); - } - /** - * string data = 1; - * @return The bytes for data. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDataBytes() { - return instance.getDataBytes(); - } - /** - * string data = 1; - * @param value The data to set. - * @return This builder for chaining. - */ - public Builder setData( - java.lang.String value) { - copyOnWrite(); - instance.setData(value); - return this; - } - /** - * string data = 1; - * @return This builder for chaining. - */ - public Builder clearData() { - copyOnWrite(); - instance.clearData(); - return this; - } - /** - * string data = 1; - * @param value The bytes for data to set. - * @return This builder for chaining. - */ - public Builder setDataBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setDataBytes(value); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - /** - * uint32 index = 3; - * @return Whether the index field is set. - */ - @java.lang.Override - public boolean hasIndex() { - return instance.hasIndex(); - } - /** - * uint32 index = 3; - * @return The index. - */ - @java.lang.Override - public int getIndex() { - return instance.getIndex(); - } - /** - * uint32 index = 3; - * @param value The index to set. - * @return This builder for chaining. - */ - public Builder setIndex(int value) { - copyOnWrite(); - instance.setIndex(value); - return this; - } - /** - * uint32 index = 3; - * @return This builder for chaining. - */ - public Builder clearIndex() { - copyOnWrite(); - instance.clearIndex(); - return this; - } - - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 4; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 4; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 4; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 4; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 4; - */ - public Builder clearSelector() { - copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return The enum numeric value on the wire for keyboardBehavior. - */ - @java.lang.Override - public int getKeyboardBehaviorValue() { - return instance.getKeyboardBehaviorValue(); - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @param value The keyboardBehavior to set. - * @return This builder for chaining. - */ - public Builder setKeyboardBehaviorValue(int value) { - copyOnWrite(); - instance.setKeyboardBehaviorValue(value); - return this; - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return The keyboardBehavior. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior getKeyboardBehavior() { - return instance.getKeyboardBehavior(); - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @param value The enum numeric value on the wire for keyboardBehavior to set. - * @return This builder for chaining. - */ - public Builder setKeyboardBehavior(pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior value) { - copyOnWrite(); - instance.setKeyboardBehavior(value); - return this; - } - /** - * .patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5; - * @return This builder for chaining. - */ - public Builder clearKeyboardBehavior() { - copyOnWrite(); - instance.clearKeyboardBehavior(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.EnterTextRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.EnterTextRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "findBy_", - "findByCase_", - "data_", - "appId_", - pl.leancode.patrol.contracts.Contracts.Selector.class, - "keyboardBehavior_", - }; - java.lang.String info = - "\u0000\u0005\u0001\u0000\u0001\u0005\u0005\u0000\u0000\u0000\u0001\u0208\u0002\u0208" + - "\u0003>\u0000\u0004<\u0000\u0005\f"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.EnterTextRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.EnterTextRequest) - private static final pl.leancode.patrol.contracts.Contracts.EnterTextRequest DEFAULT_INSTANCE; - static { - EnterTextRequest defaultInstance = new EnterTextRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - EnterTextRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.EnterTextRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SwipeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.SwipeRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * float startX = 1; - * @return The startX. - */ - float getStartX(); - - /** - * float startY = 2; - * @return The startY. - */ - float getStartY(); - - /** - * float endX = 3; - * @return The endX. - */ - float getEndX(); - - /** - * float endY = 4; - * @return The endY. - */ - float getEndY(); - - /** - * uint32 steps = 5; - * @return The steps. - */ - int getSteps(); - - /** - * string appId = 6; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 6; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.SwipeRequest} - */ - public static final class SwipeRequest extends - com.google.protobuf.GeneratedMessageLite< - SwipeRequest, SwipeRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.SwipeRequest) - SwipeRequestOrBuilder { - private SwipeRequest() { - appId_ = ""; - } - public static final int STARTX_FIELD_NUMBER = 1; - private float startX_; - /** - * float startX = 1; - * @return The startX. - */ - @java.lang.Override - public float getStartX() { - return startX_; - } - /** - * float startX = 1; - * @param value The startX to set. - */ - private void setStartX(float value) { - - startX_ = value; - } - /** - * float startX = 1; - */ - private void clearStartX() { - - startX_ = 0F; - } - - public static final int STARTY_FIELD_NUMBER = 2; - private float startY_; - /** - * float startY = 2; - * @return The startY. - */ - @java.lang.Override - public float getStartY() { - return startY_; - } - /** - * float startY = 2; - * @param value The startY to set. - */ - private void setStartY(float value) { - - startY_ = value; - } - /** - * float startY = 2; - */ - private void clearStartY() { - - startY_ = 0F; - } - - public static final int ENDX_FIELD_NUMBER = 3; - private float endX_; - /** - * float endX = 3; - * @return The endX. - */ - @java.lang.Override - public float getEndX() { - return endX_; - } - /** - * float endX = 3; - * @param value The endX to set. - */ - private void setEndX(float value) { - - endX_ = value; - } - /** - * float endX = 3; - */ - private void clearEndX() { - - endX_ = 0F; - } - - public static final int ENDY_FIELD_NUMBER = 4; - private float endY_; - /** - * float endY = 4; - * @return The endY. - */ - @java.lang.Override - public float getEndY() { - return endY_; - } - /** - * float endY = 4; - * @param value The endY to set. - */ - private void setEndY(float value) { - - endY_ = value; - } - /** - * float endY = 4; - */ - private void clearEndY() { - - endY_ = 0F; - } - - public static final int STEPS_FIELD_NUMBER = 5; - private int steps_; - /** - * uint32 steps = 5; - * @return The steps. - */ - @java.lang.Override - public int getSteps() { - return steps_; - } - /** - * uint32 steps = 5; - * @param value The steps to set. - */ - private void setSteps(int value) { - - steps_ = value; - } - /** - * uint32 steps = 5; - */ - private void clearSteps() { - - steps_ = 0; - } - - public static final int APPID_FIELD_NUMBER = 6; - private java.lang.String appId_; - /** - * string appId = 6; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 6; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 6; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 6; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 6; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SwipeRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.SwipeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.SwipeRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.SwipeRequest) - pl.leancode.patrol.contracts.Contracts.SwipeRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.SwipeRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * float startX = 1; - * @return The startX. - */ - @java.lang.Override - public float getStartX() { - return instance.getStartX(); - } - /** - * float startX = 1; - * @param value The startX to set. - * @return This builder for chaining. - */ - public Builder setStartX(float value) { - copyOnWrite(); - instance.setStartX(value); - return this; - } - /** - * float startX = 1; - * @return This builder for chaining. - */ - public Builder clearStartX() { - copyOnWrite(); - instance.clearStartX(); - return this; - } - - /** - * float startY = 2; - * @return The startY. - */ - @java.lang.Override - public float getStartY() { - return instance.getStartY(); - } - /** - * float startY = 2; - * @param value The startY to set. - * @return This builder for chaining. - */ - public Builder setStartY(float value) { - copyOnWrite(); - instance.setStartY(value); - return this; - } - /** - * float startY = 2; - * @return This builder for chaining. - */ - public Builder clearStartY() { - copyOnWrite(); - instance.clearStartY(); - return this; - } - - /** - * float endX = 3; - * @return The endX. - */ - @java.lang.Override - public float getEndX() { - return instance.getEndX(); - } - /** - * float endX = 3; - * @param value The endX to set. - * @return This builder for chaining. - */ - public Builder setEndX(float value) { - copyOnWrite(); - instance.setEndX(value); - return this; - } - /** - * float endX = 3; - * @return This builder for chaining. - */ - public Builder clearEndX() { - copyOnWrite(); - instance.clearEndX(); - return this; - } - - /** - * float endY = 4; - * @return The endY. - */ - @java.lang.Override - public float getEndY() { - return instance.getEndY(); - } - /** - * float endY = 4; - * @param value The endY to set. - * @return This builder for chaining. - */ - public Builder setEndY(float value) { - copyOnWrite(); - instance.setEndY(value); - return this; - } - /** - * float endY = 4; - * @return This builder for chaining. - */ - public Builder clearEndY() { - copyOnWrite(); - instance.clearEndY(); - return this; - } - - /** - * uint32 steps = 5; - * @return The steps. - */ - @java.lang.Override - public int getSteps() { - return instance.getSteps(); - } - /** - * uint32 steps = 5; - * @param value The steps to set. - * @return This builder for chaining. - */ - public Builder setSteps(int value) { - copyOnWrite(); - instance.setSteps(value); - return this; - } - /** - * uint32 steps = 5; - * @return This builder for chaining. - */ - public Builder clearSteps() { - copyOnWrite(); - instance.clearSteps(); - return this; - } - - /** - * string appId = 6; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 6; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 6; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 6; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 6; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.SwipeRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.SwipeRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "startX_", - "startY_", - "endX_", - "endY_", - "steps_", - "appId_", - }; - java.lang.String info = - "\u0000\u0006\u0000\u0000\u0001\u0006\u0006\u0000\u0000\u0000\u0001\u0001\u0002\u0001" + - "\u0003\u0001\u0004\u0001\u0005\u000b\u0006\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.SwipeRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.SwipeRequest) - private static final pl.leancode.patrol.contracts.Contracts.SwipeRequest DEFAULT_INSTANCE; - static { - SwipeRequest defaultInstance = new SwipeRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SwipeRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.SwipeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface WaitUntilVisibleRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.WaitUntilVisibleRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.Selector selector = 1; - * @return Whether the selector field is set. - */ - boolean hasSelector(); - /** - * .patrol.Selector selector = 1; - * @return The selector. - */ - pl.leancode.patrol.contracts.Contracts.Selector getSelector(); - - /** - * string appId = 2; - * @return The appId. - */ - java.lang.String getAppId(); - /** - * string appId = 2; - * @return The bytes for appId. - */ - com.google.protobuf.ByteString - getAppIdBytes(); - } - /** - * Protobuf type {@code patrol.WaitUntilVisibleRequest} - */ - public static final class WaitUntilVisibleRequest extends - com.google.protobuf.GeneratedMessageLite< - WaitUntilVisibleRequest, WaitUntilVisibleRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.WaitUntilVisibleRequest) - WaitUntilVisibleRequestOrBuilder { - private WaitUntilVisibleRequest() { - appId_ = ""; - } - public static final int SELECTOR_FIELD_NUMBER = 1; - private pl.leancode.patrol.contracts.Contracts.Selector selector_; - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return selector_ != null; - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return selector_ == null ? pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance() : selector_; - } - /** - * .patrol.Selector selector = 1; - */ - private void setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - selector_ = value; - - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.SuppressWarnings({"ReferenceEquality"}) - private void mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - value.getClass(); - if (selector_ != null && - selector_ != pl.leancode.patrol.contracts.Contracts.Selector.getDefaultInstance()) { - selector_ = - pl.leancode.patrol.contracts.Contracts.Selector.newBuilder(selector_).mergeFrom(value).buildPartial(); - } else { - selector_ = value; - } - - } - /** - * .patrol.Selector selector = 1; - */ - private void clearSelector() { selector_ = null; - - } - - public static final int APPID_FIELD_NUMBER = 2; - private java.lang.String appId_; - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return appId_; - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appId_); - } - /** - * string appId = 2; - * @param value The appId to set. - */ - private void setAppId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - appId_ = value; - } - /** - * string appId = 2; - */ - private void clearAppId() { - - appId_ = getDefaultInstance().getAppId(); - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - */ - private void setAppIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appId_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.WaitUntilVisibleRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.WaitUntilVisibleRequest) - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public boolean hasSelector() { - return instance.hasSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.Selector getSelector() { - return instance.getSelector(); - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.setSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder setSelector( - pl.leancode.patrol.contracts.Contracts.Selector.Builder builderForValue) { - copyOnWrite(); - instance.setSelector(builderForValue.build()); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder mergeSelector(pl.leancode.patrol.contracts.Contracts.Selector value) { - copyOnWrite(); - instance.mergeSelector(value); - return this; - } - /** - * .patrol.Selector selector = 1; - */ - public Builder clearSelector() { copyOnWrite(); - instance.clearSelector(); - return this; - } - - /** - * string appId = 2; - * @return The appId. - */ - @java.lang.Override - public java.lang.String getAppId() { - return instance.getAppId(); - } - /** - * string appId = 2; - * @return The bytes for appId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppIdBytes() { - return instance.getAppIdBytes(); - } - /** - * string appId = 2; - * @param value The appId to set. - * @return This builder for chaining. - */ - public Builder setAppId( - java.lang.String value) { - copyOnWrite(); - instance.setAppId(value); - return this; - } - /** - * string appId = 2; - * @return This builder for chaining. - */ - public Builder clearAppId() { - copyOnWrite(); - instance.clearAppId(); - return this; - } - /** - * string appId = 2; - * @param value The bytes for appId to set. - * @return This builder for chaining. - */ - public Builder setAppIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppIdBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.WaitUntilVisibleRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "selector_", - "appId_", - }; - java.lang.String info = - "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0000\u0000\u0001\t\u0002\u0208" + - ""; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.WaitUntilVisibleRequest) - private static final pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest DEFAULT_INSTANCE; - static { - WaitUntilVisibleRequest defaultInstance = new WaitUntilVisibleRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - WaitUntilVisibleRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface HandlePermissionRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.HandlePermissionRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The enum numeric value on the wire for code. - */ - int getCodeValue(); - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The code. - */ - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code getCode(); - } - /** - * Protobuf type {@code patrol.HandlePermissionRequest} - */ - public static final class HandlePermissionRequest extends - com.google.protobuf.GeneratedMessageLite< - HandlePermissionRequest, HandlePermissionRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.HandlePermissionRequest) - HandlePermissionRequestOrBuilder { - private HandlePermissionRequest() { - } - /** - * Protobuf enum {@code patrol.HandlePermissionRequest.Code} - */ - public enum Code - implements com.google.protobuf.Internal.EnumLite { - /** - * WHILE_USING = 0; - */ - WHILE_USING(0), - /** - * ONLY_THIS_TIME = 1; - */ - ONLY_THIS_TIME(1), - /** - * DENIED = 2; - */ - DENIED(2), - UNRECOGNIZED(-1), - ; - - /** - * WHILE_USING = 0; - */ - public static final int WHILE_USING_VALUE = 0; - /** - * ONLY_THIS_TIME = 1; - */ - public static final int ONLY_THIS_TIME_VALUE = 1; - /** - * DENIED = 2; - */ - public static final int DENIED_VALUE = 2; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Code valueOf(int value) { - return forNumber(value); - } - - public static Code forNumber(int value) { - switch (value) { - case 0: return WHILE_USING; - case 1: return ONLY_THIS_TIME; - case 2: return DENIED; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Code> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public Code findValueByNumber(int number) { - return Code.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return CodeVerifier.INSTANCE; - } - - private static final class CodeVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new CodeVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return Code.forNumber(number) != null; - } - }; - - private final int value; - - private Code(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.HandlePermissionRequest.Code) - } - - public static final int CODE_FIELD_NUMBER = 1; - private int code_; - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The enum numeric value on the wire for code. - */ - @java.lang.Override - public int getCodeValue() { - return code_; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The code. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code getCode() { - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code result = pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.forNumber(code_); - return result == null ? pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code.UNRECOGNIZED : result; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The enum numeric value on the wire for code to set. - */ - private void setCodeValue(int value) { - code_ = value; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The code to set. - */ - private void setCode(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code value) { - code_ = value.getNumber(); - - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - */ - private void clearCode() { - - code_ = 0; - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.HandlePermissionRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.HandlePermissionRequest) - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The enum numeric value on the wire for code. - */ - @java.lang.Override - public int getCodeValue() { - return instance.getCodeValue(); - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The code to set. - * @return This builder for chaining. - */ - public Builder setCodeValue(int value) { - copyOnWrite(); - instance.setCodeValue(value); - return this; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return The code. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code getCode() { - return instance.getCode(); - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @param value The enum numeric value on the wire for code to set. - * @return This builder for chaining. - */ - public Builder setCode(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code value) { - copyOnWrite(); - instance.setCode(value); - return this; - } - /** - * .patrol.HandlePermissionRequest.Code code = 1; - * @return This builder for chaining. - */ - public Builder clearCode() { - copyOnWrite(); - instance.clearCode(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.HandlePermissionRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "code_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.HandlePermissionRequest) - private static final pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest DEFAULT_INSTANCE; - static { - HandlePermissionRequest defaultInstance = new HandlePermissionRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - HandlePermissionRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SetLocationAccuracyRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.SetLocationAccuracyRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The enum numeric value on the wire for locationAccuracy. - */ - int getLocationAccuracyValue(); - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The locationAccuracy. - */ - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy getLocationAccuracy(); - } - /** - * Protobuf type {@code patrol.SetLocationAccuracyRequest} - */ - public static final class SetLocationAccuracyRequest extends - com.google.protobuf.GeneratedMessageLite< - SetLocationAccuracyRequest, SetLocationAccuracyRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.SetLocationAccuracyRequest) - SetLocationAccuracyRequestOrBuilder { - private SetLocationAccuracyRequest() { - } - /** - * Protobuf enum {@code patrol.SetLocationAccuracyRequest.LocationAccuracy} - */ - public enum LocationAccuracy - implements com.google.protobuf.Internal.EnumLite { - /** - * COARSE = 0; - */ - COARSE(0), - /** - * FINE = 1; - */ - FINE(1), - UNRECOGNIZED(-1), - ; - - /** - * COARSE = 0; - */ - public static final int COARSE_VALUE = 0; - /** - * FINE = 1; - */ - public static final int FINE_VALUE = 1; - - - @java.lang.Override - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static LocationAccuracy valueOf(int value) { - return forNumber(value); - } - - public static LocationAccuracy forNumber(int value) { - switch (value) { - case 0: return COARSE; - case 1: return FINE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - LocationAccuracy> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - @java.lang.Override - public LocationAccuracy findValueByNumber(int number) { - return LocationAccuracy.forNumber(number); - } - }; - - public static com.google.protobuf.Internal.EnumVerifier - internalGetVerifier() { - return LocationAccuracyVerifier.INSTANCE; - } - - private static final class LocationAccuracyVerifier implements - com.google.protobuf.Internal.EnumVerifier { - static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new LocationAccuracyVerifier(); - @java.lang.Override - public boolean isInRange(int number) { - return LocationAccuracy.forNumber(number) != null; - } - }; - - private final int value; - - private LocationAccuracy(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:patrol.SetLocationAccuracyRequest.LocationAccuracy) - } - - public static final int LOCATIONACCURACY_FIELD_NUMBER = 1; - private int locationAccuracy_; - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The enum numeric value on the wire for locationAccuracy. - */ - @java.lang.Override - public int getLocationAccuracyValue() { - return locationAccuracy_; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The locationAccuracy. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy getLocationAccuracy() { - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy result = pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.forNumber(locationAccuracy_); - return result == null ? pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy.UNRECOGNIZED : result; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The enum numeric value on the wire for locationAccuracy to set. - */ - private void setLocationAccuracyValue(int value) { - locationAccuracy_ = value; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The locationAccuracy to set. - */ - private void setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy value) { - locationAccuracy_ = value.getNumber(); - - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - */ - private void clearLocationAccuracy() { - - locationAccuracy_ = 0; - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.SetLocationAccuracyRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.SetLocationAccuracyRequest) - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The enum numeric value on the wire for locationAccuracy. - */ - @java.lang.Override - public int getLocationAccuracyValue() { - return instance.getLocationAccuracyValue(); - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The locationAccuracy to set. - * @return This builder for chaining. - */ - public Builder setLocationAccuracyValue(int value) { - copyOnWrite(); - instance.setLocationAccuracyValue(value); - return this; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return The locationAccuracy. - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy getLocationAccuracy() { - return instance.getLocationAccuracy(); - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @param value The enum numeric value on the wire for locationAccuracy to set. - * @return This builder for chaining. - */ - public Builder setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy value) { - copyOnWrite(); - instance.setLocationAccuracy(value); - return this; - } - /** - * .patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1; - * @return This builder for chaining. - */ - public Builder clearLocationAccuracy() { - copyOnWrite(); - instance.clearLocationAccuracy(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.SetLocationAccuracyRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "locationAccuracy_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\f"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.SetLocationAccuracyRequest) - private static final pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest DEFAULT_INSTANCE; - static { - SetLocationAccuracyRequest defaultInstance = new SetLocationAccuracyRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SetLocationAccuracyRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface PermissionDialogVisibleRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.PermissionDialogVisibleRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * uint64 timeoutMillis = 1; - * @return The timeoutMillis. - */ - long getTimeoutMillis(); - } - /** - * Protobuf type {@code patrol.PermissionDialogVisibleRequest} - */ - public static final class PermissionDialogVisibleRequest extends - com.google.protobuf.GeneratedMessageLite< - PermissionDialogVisibleRequest, PermissionDialogVisibleRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.PermissionDialogVisibleRequest) - PermissionDialogVisibleRequestOrBuilder { - private PermissionDialogVisibleRequest() { - } - public static final int TIMEOUTMILLIS_FIELD_NUMBER = 1; - private long timeoutMillis_; - /** - * uint64 timeoutMillis = 1; - * @return The timeoutMillis. - */ - @java.lang.Override - public long getTimeoutMillis() { - return timeoutMillis_; - } - /** - * uint64 timeoutMillis = 1; - * @param value The timeoutMillis to set. - */ - private void setTimeoutMillis(long value) { - - timeoutMillis_ = value; - } - /** - * uint64 timeoutMillis = 1; - */ - private void clearTimeoutMillis() { - - timeoutMillis_ = 0L; - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.PermissionDialogVisibleRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.PermissionDialogVisibleRequest) - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * uint64 timeoutMillis = 1; - * @return The timeoutMillis. - */ - @java.lang.Override - public long getTimeoutMillis() { - return instance.getTimeoutMillis(); - } - /** - * uint64 timeoutMillis = 1; - * @param value The timeoutMillis to set. - * @return This builder for chaining. - */ - public Builder setTimeoutMillis(long value) { - copyOnWrite(); - instance.setTimeoutMillis(value); - return this; - } - /** - * uint64 timeoutMillis = 1; - * @return This builder for chaining. - */ - public Builder clearTimeoutMillis() { - copyOnWrite(); - instance.clearTimeoutMillis(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.PermissionDialogVisibleRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "timeoutMillis_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0003"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.PermissionDialogVisibleRequest) - private static final pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest DEFAULT_INSTANCE; - static { - PermissionDialogVisibleRequest defaultInstance = new PermissionDialogVisibleRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - PermissionDialogVisibleRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface PermissionDialogVisibleResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.PermissionDialogVisibleResponse) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * bool visible = 1; - * @return The visible. - */ - boolean getVisible(); - } - /** - * Protobuf type {@code patrol.PermissionDialogVisibleResponse} - */ - public static final class PermissionDialogVisibleResponse extends - com.google.protobuf.GeneratedMessageLite< - PermissionDialogVisibleResponse, PermissionDialogVisibleResponse.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.PermissionDialogVisibleResponse) - PermissionDialogVisibleResponseOrBuilder { - private PermissionDialogVisibleResponse() { - } - public static final int VISIBLE_FIELD_NUMBER = 1; - private boolean visible_; - /** - * bool visible = 1; - * @return The visible. - */ - @java.lang.Override - public boolean getVisible() { - return visible_; - } - /** - * bool visible = 1; - * @param value The visible to set. - */ - private void setVisible(boolean value) { - - visible_ = value; - } - /** - * bool visible = 1; - */ - private void clearVisible() { - - visible_ = false; - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.PermissionDialogVisibleResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.PermissionDialogVisibleResponse) - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponseOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * bool visible = 1; - * @return The visible. - */ - @java.lang.Override - public boolean getVisible() { - return instance.getVisible(); - } - /** - * bool visible = 1; - * @param value The visible to set. - * @return This builder for chaining. - */ - public Builder setVisible(boolean value) { - copyOnWrite(); - instance.setVisible(value); - return this; - } - /** - * bool visible = 1; - * @return This builder for chaining. - */ - public Builder clearVisible() { - copyOnWrite(); - instance.clearVisible(); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.PermissionDialogVisibleResponse) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "visible_", - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0007"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.PermissionDialogVisibleResponse) - private static final pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse DEFAULT_INSTANCE; - static { - PermissionDialogVisibleResponse defaultInstance = new PermissionDialogVisibleResponse(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - PermissionDialogVisibleResponse.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SelectorOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.Selector) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional string text = 1; - * @return Whether the text field is set. - */ - boolean hasText(); - /** - * optional string text = 1; - * @return The text. - */ - java.lang.String getText(); - /** - * optional string text = 1; - * @return The bytes for text. - */ - com.google.protobuf.ByteString - getTextBytes(); - - /** - * optional string textStartsWith = 2; - * @return Whether the textStartsWith field is set. - */ - boolean hasTextStartsWith(); - /** - * optional string textStartsWith = 2; - * @return The textStartsWith. - */ - java.lang.String getTextStartsWith(); - /** - * optional string textStartsWith = 2; - * @return The bytes for textStartsWith. - */ - com.google.protobuf.ByteString - getTextStartsWithBytes(); - - /** - * optional string textContains = 3; - * @return Whether the textContains field is set. - */ - boolean hasTextContains(); - /** - * optional string textContains = 3; - * @return The textContains. - */ - java.lang.String getTextContains(); - /** - * optional string textContains = 3; - * @return The bytes for textContains. - */ - com.google.protobuf.ByteString - getTextContainsBytes(); - - /** - * optional string className = 4; - * @return Whether the className field is set. - */ - boolean hasClassName(); - /** - * optional string className = 4; - * @return The className. - */ - java.lang.String getClassName(); - /** - * optional string className = 4; - * @return The bytes for className. - */ - com.google.protobuf.ByteString - getClassNameBytes(); - - /** - * optional string contentDescription = 5; - * @return Whether the contentDescription field is set. - */ - boolean hasContentDescription(); - /** - * optional string contentDescription = 5; - * @return The contentDescription. - */ - java.lang.String getContentDescription(); - /** - * optional string contentDescription = 5; - * @return The bytes for contentDescription. - */ - com.google.protobuf.ByteString - getContentDescriptionBytes(); - - /** - * optional string contentDescriptionStartsWith = 6; - * @return Whether the contentDescriptionStartsWith field is set. - */ - boolean hasContentDescriptionStartsWith(); - /** - * optional string contentDescriptionStartsWith = 6; - * @return The contentDescriptionStartsWith. - */ - java.lang.String getContentDescriptionStartsWith(); - /** - * optional string contentDescriptionStartsWith = 6; - * @return The bytes for contentDescriptionStartsWith. - */ - com.google.protobuf.ByteString - getContentDescriptionStartsWithBytes(); - - /** - * optional string contentDescriptionContains = 7; - * @return Whether the contentDescriptionContains field is set. - */ - boolean hasContentDescriptionContains(); - /** - * optional string contentDescriptionContains = 7; - * @return The contentDescriptionContains. - */ - java.lang.String getContentDescriptionContains(); - /** - * optional string contentDescriptionContains = 7; - * @return The bytes for contentDescriptionContains. - */ - com.google.protobuf.ByteString - getContentDescriptionContainsBytes(); - - /** - * optional string resourceId = 8; - * @return Whether the resourceId field is set. - */ - boolean hasResourceId(); - /** - * optional string resourceId = 8; - * @return The resourceId. - */ - java.lang.String getResourceId(); - /** - * optional string resourceId = 8; - * @return The bytes for resourceId. - */ - com.google.protobuf.ByteString - getResourceIdBytes(); - - /** - * optional uint32 instance = 9; - * @return Whether the instance field is set. - */ - boolean hasInstance(); - /** - * optional uint32 instance = 9; - * @return The instance. - */ - int getInstance(); - - /** - * optional bool enabled = 10; - * @return Whether the enabled field is set. - */ - boolean hasEnabled(); - /** - * optional bool enabled = 10; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * optional bool focused = 11; - * @return Whether the focused field is set. - */ - boolean hasFocused(); - /** - * optional bool focused = 11; - * @return The focused. - */ - boolean getFocused(); - - /** - * optional string pkg = 12; - * @return Whether the pkg field is set. - */ - boolean hasPkg(); - /** - * optional string pkg = 12; - * @return The pkg. - */ - java.lang.String getPkg(); - /** - * optional string pkg = 12; - * @return The bytes for pkg. - */ - com.google.protobuf.ByteString - getPkgBytes(); - } - /** - * Protobuf type {@code patrol.Selector} - */ - public static final class Selector extends - com.google.protobuf.GeneratedMessageLite< - Selector, Selector.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.Selector) - SelectorOrBuilder { - private Selector() { - text_ = ""; - textStartsWith_ = ""; - textContains_ = ""; - className_ = ""; - contentDescription_ = ""; - contentDescriptionStartsWith_ = ""; - contentDescriptionContains_ = ""; - resourceId_ = ""; - pkg_ = ""; - } - private int bitField0_; - public static final int TEXT_FIELD_NUMBER = 1; - private java.lang.String text_; - /** - * optional string text = 1; - * @return Whether the text field is set. - */ - @java.lang.Override - public boolean hasText() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string text = 1; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return text_; - } - /** - * optional string text = 1; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(text_); - } - /** - * optional string text = 1; - * @param value The text to set. - */ - private void setText( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000001; - text_ = value; - } - /** - * optional string text = 1; - */ - private void clearText() { - bitField0_ = (bitField0_ & ~0x00000001); - text_ = getDefaultInstance().getText(); - } - /** - * optional string text = 1; - * @param value The bytes for text to set. - */ - private void setTextBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - text_ = value.toStringUtf8(); - bitField0_ |= 0x00000001; - } - - public static final int TEXTSTARTSWITH_FIELD_NUMBER = 2; - private java.lang.String textStartsWith_; - /** - * optional string textStartsWith = 2; - * @return Whether the textStartsWith field is set. - */ - @java.lang.Override - public boolean hasTextStartsWith() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional string textStartsWith = 2; - * @return The textStartsWith. - */ - @java.lang.Override - public java.lang.String getTextStartsWith() { - return textStartsWith_; - } - /** - * optional string textStartsWith = 2; - * @return The bytes for textStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextStartsWithBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(textStartsWith_); - } - /** - * optional string textStartsWith = 2; - * @param value The textStartsWith to set. - */ - private void setTextStartsWith( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000002; - textStartsWith_ = value; - } - /** - * optional string textStartsWith = 2; - */ - private void clearTextStartsWith() { - bitField0_ = (bitField0_ & ~0x00000002); - textStartsWith_ = getDefaultInstance().getTextStartsWith(); - } - /** - * optional string textStartsWith = 2; - * @param value The bytes for textStartsWith to set. - */ - private void setTextStartsWithBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - textStartsWith_ = value.toStringUtf8(); - bitField0_ |= 0x00000002; - } - - public static final int TEXTCONTAINS_FIELD_NUMBER = 3; - private java.lang.String textContains_; - /** - * optional string textContains = 3; - * @return Whether the textContains field is set. - */ - @java.lang.Override - public boolean hasTextContains() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional string textContains = 3; - * @return The textContains. - */ - @java.lang.Override - public java.lang.String getTextContains() { - return textContains_; - } - /** - * optional string textContains = 3; - * @return The bytes for textContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextContainsBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(textContains_); - } - /** - * optional string textContains = 3; - * @param value The textContains to set. - */ - private void setTextContains( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000004; - textContains_ = value; - } - /** - * optional string textContains = 3; - */ - private void clearTextContains() { - bitField0_ = (bitField0_ & ~0x00000004); - textContains_ = getDefaultInstance().getTextContains(); - } - /** - * optional string textContains = 3; - * @param value The bytes for textContains to set. - */ - private void setTextContainsBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - textContains_ = value.toStringUtf8(); - bitField0_ |= 0x00000004; - } - - public static final int CLASSNAME_FIELD_NUMBER = 4; - private java.lang.String className_; - /** - * optional string className = 4; - * @return Whether the className field is set. - */ - @java.lang.Override - public boolean hasClassName() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional string className = 4; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return className_; - } - /** - * optional string className = 4; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(className_); - } - /** - * optional string className = 4; - * @param value The className to set. - */ - private void setClassName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000008; - className_ = value; - } - /** - * optional string className = 4; - */ - private void clearClassName() { - bitField0_ = (bitField0_ & ~0x00000008); - className_ = getDefaultInstance().getClassName(); - } - /** - * optional string className = 4; - * @param value The bytes for className to set. - */ - private void setClassNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - className_ = value.toStringUtf8(); - bitField0_ |= 0x00000008; - } - - public static final int CONTENTDESCRIPTION_FIELD_NUMBER = 5; - private java.lang.String contentDescription_; - /** - * optional string contentDescription = 5; - * @return Whether the contentDescription field is set. - */ - @java.lang.Override - public boolean hasContentDescription() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional string contentDescription = 5; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return contentDescription_; - } - /** - * optional string contentDescription = 5; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescription_); - } - /** - * optional string contentDescription = 5; - * @param value The contentDescription to set. - */ - private void setContentDescription( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000010; - contentDescription_ = value; - } - /** - * optional string contentDescription = 5; - */ - private void clearContentDescription() { - bitField0_ = (bitField0_ & ~0x00000010); - contentDescription_ = getDefaultInstance().getContentDescription(); - } - /** - * optional string contentDescription = 5; - * @param value The bytes for contentDescription to set. - */ - private void setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescription_ = value.toStringUtf8(); - bitField0_ |= 0x00000010; - } - - public static final int CONTENTDESCRIPTIONSTARTSWITH_FIELD_NUMBER = 6; - private java.lang.String contentDescriptionStartsWith_; - /** - * optional string contentDescriptionStartsWith = 6; - * @return Whether the contentDescriptionStartsWith field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionStartsWith() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The contentDescriptionStartsWith. - */ - @java.lang.Override - public java.lang.String getContentDescriptionStartsWith() { - return contentDescriptionStartsWith_; - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The bytes for contentDescriptionStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionStartsWithBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescriptionStartsWith_); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The contentDescriptionStartsWith to set. - */ - private void setContentDescriptionStartsWith( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000020; - contentDescriptionStartsWith_ = value; - } - /** - * optional string contentDescriptionStartsWith = 6; - */ - private void clearContentDescriptionStartsWith() { - bitField0_ = (bitField0_ & ~0x00000020); - contentDescriptionStartsWith_ = getDefaultInstance().getContentDescriptionStartsWith(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The bytes for contentDescriptionStartsWith to set. - */ - private void setContentDescriptionStartsWithBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescriptionStartsWith_ = value.toStringUtf8(); - bitField0_ |= 0x00000020; - } - - public static final int CONTENTDESCRIPTIONCONTAINS_FIELD_NUMBER = 7; - private java.lang.String contentDescriptionContains_; - /** - * optional string contentDescriptionContains = 7; - * @return Whether the contentDescriptionContains field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionContains() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * optional string contentDescriptionContains = 7; - * @return The contentDescriptionContains. - */ - @java.lang.Override - public java.lang.String getContentDescriptionContains() { - return contentDescriptionContains_; - } - /** - * optional string contentDescriptionContains = 7; - * @return The bytes for contentDescriptionContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionContainsBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescriptionContains_); - } - /** - * optional string contentDescriptionContains = 7; - * @param value The contentDescriptionContains to set. - */ - private void setContentDescriptionContains( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000040; - contentDescriptionContains_ = value; - } - /** - * optional string contentDescriptionContains = 7; - */ - private void clearContentDescriptionContains() { - bitField0_ = (bitField0_ & ~0x00000040); - contentDescriptionContains_ = getDefaultInstance().getContentDescriptionContains(); - } - /** - * optional string contentDescriptionContains = 7; - * @param value The bytes for contentDescriptionContains to set. - */ - private void setContentDescriptionContainsBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescriptionContains_ = value.toStringUtf8(); - bitField0_ |= 0x00000040; - } - - public static final int RESOURCEID_FIELD_NUMBER = 8; - private java.lang.String resourceId_; - /** - * optional string resourceId = 8; - * @return Whether the resourceId field is set. - */ - @java.lang.Override - public boolean hasResourceId() { - return ((bitField0_ & 0x00000080) != 0); - } - /** - * optional string resourceId = 8; - * @return The resourceId. - */ - @java.lang.Override - public java.lang.String getResourceId() { - return resourceId_; - } - /** - * optional string resourceId = 8; - * @return The bytes for resourceId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceIdBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(resourceId_); - } - /** - * optional string resourceId = 8; - * @param value The resourceId to set. - */ - private void setResourceId( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000080; - resourceId_ = value; - } - /** - * optional string resourceId = 8; - */ - private void clearResourceId() { - bitField0_ = (bitField0_ & ~0x00000080); - resourceId_ = getDefaultInstance().getResourceId(); - } - /** - * optional string resourceId = 8; - * @param value The bytes for resourceId to set. - */ - private void setResourceIdBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - resourceId_ = value.toStringUtf8(); - bitField0_ |= 0x00000080; - } - - public static final int INSTANCE_FIELD_NUMBER = 9; - private int instance_; - /** - * optional uint32 instance = 9; - * @return Whether the instance field is set. - */ - @java.lang.Override - public boolean hasInstance() { - return ((bitField0_ & 0x00000100) != 0); - } - /** - * optional uint32 instance = 9; - * @return The instance. - */ - @java.lang.Override - public int getInstance() { - return instance_; - } - /** - * optional uint32 instance = 9; - * @param value The instance to set. - */ - private void setInstance(int value) { - bitField0_ |= 0x00000100; - instance_ = value; - } - /** - * optional uint32 instance = 9; - */ - private void clearInstance() { - bitField0_ = (bitField0_ & ~0x00000100); - instance_ = 0; - } - - public static final int ENABLED_FIELD_NUMBER = 10; - private boolean enabled_; - /** - * optional bool enabled = 10; - * @return Whether the enabled field is set. - */ - @java.lang.Override - public boolean hasEnabled() { - return ((bitField0_ & 0x00000200) != 0); - } - /** - * optional bool enabled = 10; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * optional bool enabled = 10; - * @param value The enabled to set. - */ - private void setEnabled(boolean value) { - bitField0_ |= 0x00000200; - enabled_ = value; - } - /** - * optional bool enabled = 10; - */ - private void clearEnabled() { - bitField0_ = (bitField0_ & ~0x00000200); - enabled_ = false; - } - - public static final int FOCUSED_FIELD_NUMBER = 11; - private boolean focused_; - /** - * optional bool focused = 11; - * @return Whether the focused field is set. - */ - @java.lang.Override - public boolean hasFocused() { - return ((bitField0_ & 0x00000400) != 0); - } - /** - * optional bool focused = 11; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return focused_; - } - /** - * optional bool focused = 11; - * @param value The focused to set. - */ - private void setFocused(boolean value) { - bitField0_ |= 0x00000400; - focused_ = value; - } - /** - * optional bool focused = 11; - */ - private void clearFocused() { - bitField0_ = (bitField0_ & ~0x00000400); - focused_ = false; - } - - public static final int PKG_FIELD_NUMBER = 12; - private java.lang.String pkg_; - /** - * optional string pkg = 12; - * @return Whether the pkg field is set. - */ - @java.lang.Override - public boolean hasPkg() { - return ((bitField0_ & 0x00000800) != 0); - } - /** - * optional string pkg = 12; - * @return The pkg. - */ - @java.lang.Override - public java.lang.String getPkg() { - return pkg_; - } - /** - * optional string pkg = 12; - * @return The bytes for pkg. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPkgBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(pkg_); - } - /** - * optional string pkg = 12; - * @param value The pkg to set. - */ - private void setPkg( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000800; - pkg_ = value; - } - /** - * optional string pkg = 12; - */ - private void clearPkg() { - bitField0_ = (bitField0_ & ~0x00000800); - pkg_ = getDefaultInstance().getPkg(); - } - /** - * optional string pkg = 12; - * @param value The bytes for pkg to set. - */ - private void setPkgBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - pkg_ = value.toStringUtf8(); - bitField0_ |= 0x00000800; - } - - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.Selector parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.Selector parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Selector parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Selector prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.Selector} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.Selector, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.Selector) - pl.leancode.patrol.contracts.Contracts.SelectorOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.Selector.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional string text = 1; - * @return Whether the text field is set. - */ - @java.lang.Override - public boolean hasText() { - return instance.hasText(); - } - /** - * optional string text = 1; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return instance.getText(); - } - /** - * optional string text = 1; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return instance.getTextBytes(); - } - /** - * optional string text = 1; - * @param value The text to set. - * @return This builder for chaining. - */ - public Builder setText( - java.lang.String value) { - copyOnWrite(); - instance.setText(value); - return this; - } - /** - * optional string text = 1; - * @return This builder for chaining. - */ - public Builder clearText() { - copyOnWrite(); - instance.clearText(); - return this; - } - /** - * optional string text = 1; - * @param value The bytes for text to set. - * @return This builder for chaining. - */ - public Builder setTextBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextBytes(value); - return this; - } - - /** - * optional string textStartsWith = 2; - * @return Whether the textStartsWith field is set. - */ - @java.lang.Override - public boolean hasTextStartsWith() { - return instance.hasTextStartsWith(); - } - /** - * optional string textStartsWith = 2; - * @return The textStartsWith. - */ - @java.lang.Override - public java.lang.String getTextStartsWith() { - return instance.getTextStartsWith(); - } - /** - * optional string textStartsWith = 2; - * @return The bytes for textStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextStartsWithBytes() { - return instance.getTextStartsWithBytes(); - } - /** - * optional string textStartsWith = 2; - * @param value The textStartsWith to set. - * @return This builder for chaining. - */ - public Builder setTextStartsWith( - java.lang.String value) { - copyOnWrite(); - instance.setTextStartsWith(value); - return this; - } - /** - * optional string textStartsWith = 2; - * @return This builder for chaining. - */ - public Builder clearTextStartsWith() { - copyOnWrite(); - instance.clearTextStartsWith(); - return this; - } - /** - * optional string textStartsWith = 2; - * @param value The bytes for textStartsWith to set. - * @return This builder for chaining. - */ - public Builder setTextStartsWithBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextStartsWithBytes(value); - return this; - } - - /** - * optional string textContains = 3; - * @return Whether the textContains field is set. - */ - @java.lang.Override - public boolean hasTextContains() { - return instance.hasTextContains(); - } - /** - * optional string textContains = 3; - * @return The textContains. - */ - @java.lang.Override - public java.lang.String getTextContains() { - return instance.getTextContains(); - } - /** - * optional string textContains = 3; - * @return The bytes for textContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextContainsBytes() { - return instance.getTextContainsBytes(); - } - /** - * optional string textContains = 3; - * @param value The textContains to set. - * @return This builder for chaining. - */ - public Builder setTextContains( - java.lang.String value) { - copyOnWrite(); - instance.setTextContains(value); - return this; - } - /** - * optional string textContains = 3; - * @return This builder for chaining. - */ - public Builder clearTextContains() { - copyOnWrite(); - instance.clearTextContains(); - return this; - } - /** - * optional string textContains = 3; - * @param value The bytes for textContains to set. - * @return This builder for chaining. - */ - public Builder setTextContainsBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextContainsBytes(value); - return this; - } - - /** - * optional string className = 4; - * @return Whether the className field is set. - */ - @java.lang.Override - public boolean hasClassName() { - return instance.hasClassName(); - } - /** - * optional string className = 4; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return instance.getClassName(); - } - /** - * optional string className = 4; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return instance.getClassNameBytes(); - } - /** - * optional string className = 4; - * @param value The className to set. - * @return This builder for chaining. - */ - public Builder setClassName( - java.lang.String value) { - copyOnWrite(); - instance.setClassName(value); - return this; - } - /** - * optional string className = 4; - * @return This builder for chaining. - */ - public Builder clearClassName() { - copyOnWrite(); - instance.clearClassName(); - return this; - } - /** - * optional string className = 4; - * @param value The bytes for className to set. - * @return This builder for chaining. - */ - public Builder setClassNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setClassNameBytes(value); - return this; - } - - /** - * optional string contentDescription = 5; - * @return Whether the contentDescription field is set. - */ - @java.lang.Override - public boolean hasContentDescription() { - return instance.hasContentDescription(); - } - /** - * optional string contentDescription = 5; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return instance.getContentDescription(); - } - /** - * optional string contentDescription = 5; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return instance.getContentDescriptionBytes(); - } - /** - * optional string contentDescription = 5; - * @param value The contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescription( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescription(value); - return this; - } - /** - * optional string contentDescription = 5; - * @return This builder for chaining. - */ - public Builder clearContentDescription() { - copyOnWrite(); - instance.clearContentDescription(); - return this; - } - /** - * optional string contentDescription = 5; - * @param value The bytes for contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionBytes(value); - return this; - } - - /** - * optional string contentDescriptionStartsWith = 6; - * @return Whether the contentDescriptionStartsWith field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionStartsWith() { - return instance.hasContentDescriptionStartsWith(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The contentDescriptionStartsWith. - */ - @java.lang.Override - public java.lang.String getContentDescriptionStartsWith() { - return instance.getContentDescriptionStartsWith(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return The bytes for contentDescriptionStartsWith. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionStartsWithBytes() { - return instance.getContentDescriptionStartsWithBytes(); - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The contentDescriptionStartsWith to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionStartsWith( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescriptionStartsWith(value); - return this; - } - /** - * optional string contentDescriptionStartsWith = 6; - * @return This builder for chaining. - */ - public Builder clearContentDescriptionStartsWith() { - copyOnWrite(); - instance.clearContentDescriptionStartsWith(); - return this; - } - /** - * optional string contentDescriptionStartsWith = 6; - * @param value The bytes for contentDescriptionStartsWith to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionStartsWithBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionStartsWithBytes(value); - return this; - } - - /** - * optional string contentDescriptionContains = 7; - * @return Whether the contentDescriptionContains field is set. - */ - @java.lang.Override - public boolean hasContentDescriptionContains() { - return instance.hasContentDescriptionContains(); - } - /** - * optional string contentDescriptionContains = 7; - * @return The contentDescriptionContains. - */ - @java.lang.Override - public java.lang.String getContentDescriptionContains() { - return instance.getContentDescriptionContains(); - } - /** - * optional string contentDescriptionContains = 7; - * @return The bytes for contentDescriptionContains. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionContainsBytes() { - return instance.getContentDescriptionContainsBytes(); - } - /** - * optional string contentDescriptionContains = 7; - * @param value The contentDescriptionContains to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionContains( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescriptionContains(value); - return this; - } - /** - * optional string contentDescriptionContains = 7; - * @return This builder for chaining. - */ - public Builder clearContentDescriptionContains() { - copyOnWrite(); - instance.clearContentDescriptionContains(); - return this; - } - /** - * optional string contentDescriptionContains = 7; - * @param value The bytes for contentDescriptionContains to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionContainsBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionContainsBytes(value); - return this; - } - - /** - * optional string resourceId = 8; - * @return Whether the resourceId field is set. - */ - @java.lang.Override - public boolean hasResourceId() { - return instance.hasResourceId(); - } - /** - * optional string resourceId = 8; - * @return The resourceId. - */ - @java.lang.Override - public java.lang.String getResourceId() { - return instance.getResourceId(); - } - /** - * optional string resourceId = 8; - * @return The bytes for resourceId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceIdBytes() { - return instance.getResourceIdBytes(); - } - /** - * optional string resourceId = 8; - * @param value The resourceId to set. - * @return This builder for chaining. - */ - public Builder setResourceId( - java.lang.String value) { - copyOnWrite(); - instance.setResourceId(value); - return this; - } - /** - * optional string resourceId = 8; - * @return This builder for chaining. - */ - public Builder clearResourceId() { - copyOnWrite(); - instance.clearResourceId(); - return this; - } - /** - * optional string resourceId = 8; - * @param value The bytes for resourceId to set. - * @return This builder for chaining. - */ - public Builder setResourceIdBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setResourceIdBytes(value); - return this; - } - - /** - * optional uint32 instance = 9; - * @return Whether the instance field is set. - */ - @java.lang.Override - public boolean hasInstance() { - return instance.hasInstance(); - } - /** - * optional uint32 instance = 9; - * @return The instance. - */ - @java.lang.Override - public int getInstance() { - return instance.getInstance(); - } - /** - * optional uint32 instance = 9; - * @param value The instance to set. - * @return This builder for chaining. - */ - public Builder setInstance(int value) { - copyOnWrite(); - instance.setInstance(value); - return this; - } - /** - * optional uint32 instance = 9; - * @return This builder for chaining. - */ - public Builder clearInstance() { - copyOnWrite(); - instance.clearInstance(); - return this; - } - - /** - * optional bool enabled = 10; - * @return Whether the enabled field is set. - */ - @java.lang.Override - public boolean hasEnabled() { - return instance.hasEnabled(); - } - /** - * optional bool enabled = 10; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return instance.getEnabled(); - } - /** - * optional bool enabled = 10; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - copyOnWrite(); - instance.setEnabled(value); - return this; - } - /** - * optional bool enabled = 10; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - copyOnWrite(); - instance.clearEnabled(); - return this; - } - - /** - * optional bool focused = 11; - * @return Whether the focused field is set. - */ - @java.lang.Override - public boolean hasFocused() { - return instance.hasFocused(); - } - /** - * optional bool focused = 11; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return instance.getFocused(); - } - /** - * optional bool focused = 11; - * @param value The focused to set. - * @return This builder for chaining. - */ - public Builder setFocused(boolean value) { - copyOnWrite(); - instance.setFocused(value); - return this; - } - /** - * optional bool focused = 11; - * @return This builder for chaining. - */ - public Builder clearFocused() { - copyOnWrite(); - instance.clearFocused(); - return this; - } - - /** - * optional string pkg = 12; - * @return Whether the pkg field is set. - */ - @java.lang.Override - public boolean hasPkg() { - return instance.hasPkg(); - } - /** - * optional string pkg = 12; - * @return The pkg. - */ - @java.lang.Override - public java.lang.String getPkg() { - return instance.getPkg(); - } - /** - * optional string pkg = 12; - * @return The bytes for pkg. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPkgBytes() { - return instance.getPkgBytes(); - } - /** - * optional string pkg = 12; - * @param value The pkg to set. - * @return This builder for chaining. - */ - public Builder setPkg( - java.lang.String value) { - copyOnWrite(); - instance.setPkg(value); - return this; - } - /** - * optional string pkg = 12; - * @return This builder for chaining. - */ - public Builder clearPkg() { - copyOnWrite(); - instance.clearPkg(); - return this; - } - /** - * optional string pkg = 12; - * @param value The bytes for pkg to set. - * @return This builder for chaining. - */ - public Builder setPkgBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setPkgBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.Selector) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.Selector(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "bitField0_", - "text_", - "textStartsWith_", - "textContains_", - "className_", - "contentDescription_", - "contentDescriptionStartsWith_", - "contentDescriptionContains_", - "resourceId_", - "instance_", - "enabled_", - "focused_", - "pkg_", - }; - java.lang.String info = - "\u0000\f\u0000\u0001\u0001\f\f\u0000\u0000\u0000\u0001\u1208\u0000\u0002\u1208\u0001" + - "\u0003\u1208\u0002\u0004\u1208\u0003\u0005\u1208\u0004\u0006\u1208\u0005\u0007\u1208" + - "\u0006\b\u1208\u0007\t\u100b\b\n\u1007\t\u000b\u1007\n\f\u1208\u000b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.Selector.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.Selector) - private static final pl.leancode.patrol.contracts.Contracts.Selector DEFAULT_INSTANCE; - static { - Selector defaultInstance = new Selector(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Selector.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.Selector getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface NativeViewOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.NativeView) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * string className = 1; - * @return The className. - */ - java.lang.String getClassName(); - /** - * string className = 1; - * @return The bytes for className. - */ - com.google.protobuf.ByteString - getClassNameBytes(); - - /** - * string text = 2; - * @return The text. - */ - java.lang.String getText(); - /** - * string text = 2; - * @return The bytes for text. - */ - com.google.protobuf.ByteString - getTextBytes(); - - /** - * string contentDescription = 3; - * @return The contentDescription. - */ - java.lang.String getContentDescription(); - /** - * string contentDescription = 3; - * @return The bytes for contentDescription. - */ - com.google.protobuf.ByteString - getContentDescriptionBytes(); - - /** - * bool focused = 4; - * @return The focused. - */ - boolean getFocused(); - - /** - * bool enabled = 5; - * @return The enabled. - */ - boolean getEnabled(); - - /** - * int32 childCount = 6; - * @return The childCount. - */ - int getChildCount(); - - /** - * string resourceName = 7; - * @return The resourceName. - */ - java.lang.String getResourceName(); - /** - * string resourceName = 7; - * @return The bytes for resourceName. - */ - com.google.protobuf.ByteString - getResourceNameBytes(); - - /** - * string applicationPackage = 8; - * @return The applicationPackage. - */ - java.lang.String getApplicationPackage(); - /** - * string applicationPackage = 8; - * @return The bytes for applicationPackage. - */ - com.google.protobuf.ByteString - getApplicationPackageBytes(); - - /** - * repeated .patrol.NativeView children = 9; - */ - java.util.List - getChildrenList(); - /** - * repeated .patrol.NativeView children = 9; - */ - pl.leancode.patrol.contracts.Contracts.NativeView getChildren(int index); - /** - * repeated .patrol.NativeView children = 9; - */ - int getChildrenCount(); - } - /** - *
-   * Represents a native UI control.
-   *
-   * On Android, this is `android.view.View`.
-   * 
- * - * Protobuf type {@code patrol.NativeView} - */ - public static final class NativeView extends - com.google.protobuf.GeneratedMessageLite< - NativeView, NativeView.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.NativeView) - NativeViewOrBuilder { - private NativeView() { - className_ = ""; - text_ = ""; - contentDescription_ = ""; - resourceName_ = ""; - applicationPackage_ = ""; - children_ = emptyProtobufList(); - } - public static final int CLASSNAME_FIELD_NUMBER = 1; - private java.lang.String className_; - /** - * string className = 1; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return className_; - } - /** - * string className = 1; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(className_); - } - /** - * string className = 1; - * @param value The className to set. - */ - private void setClassName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - className_ = value; - } - /** - * string className = 1; - */ - private void clearClassName() { - - className_ = getDefaultInstance().getClassName(); - } - /** - * string className = 1; - * @param value The bytes for className to set. - */ - private void setClassNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - className_ = value.toStringUtf8(); - - } - - public static final int TEXT_FIELD_NUMBER = 2; - private java.lang.String text_; - /** - * string text = 2; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return text_; - } - /** - * string text = 2; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(text_); - } - /** - * string text = 2; - * @param value The text to set. - */ - private void setText( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - text_ = value; - } - /** - * string text = 2; - */ - private void clearText() { - - text_ = getDefaultInstance().getText(); - } - /** - * string text = 2; - * @param value The bytes for text to set. - */ - private void setTextBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - text_ = value.toStringUtf8(); - - } - - public static final int CONTENTDESCRIPTION_FIELD_NUMBER = 3; - private java.lang.String contentDescription_; - /** - * string contentDescription = 3; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return contentDescription_; - } - /** - * string contentDescription = 3; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(contentDescription_); - } - /** - * string contentDescription = 3; - * @param value The contentDescription to set. - */ - private void setContentDescription( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - contentDescription_ = value; - } - /** - * string contentDescription = 3; - */ - private void clearContentDescription() { - - contentDescription_ = getDefaultInstance().getContentDescription(); - } - /** - * string contentDescription = 3; - * @param value The bytes for contentDescription to set. - */ - private void setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - contentDescription_ = value.toStringUtf8(); - - } - - public static final int FOCUSED_FIELD_NUMBER = 4; - private boolean focused_; - /** - * bool focused = 4; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return focused_; - } - /** - * bool focused = 4; - * @param value The focused to set. - */ - private void setFocused(boolean value) { - - focused_ = value; - } - /** - * bool focused = 4; - */ - private void clearFocused() { - - focused_ = false; - } - - public static final int ENABLED_FIELD_NUMBER = 5; - private boolean enabled_; - /** - * bool enabled = 5; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return enabled_; - } - /** - * bool enabled = 5; - * @param value The enabled to set. - */ - private void setEnabled(boolean value) { - - enabled_ = value; - } - /** - * bool enabled = 5; - */ - private void clearEnabled() { - - enabled_ = false; - } - - public static final int CHILDCOUNT_FIELD_NUMBER = 6; - private int childCount_; - /** - * int32 childCount = 6; - * @return The childCount. - */ - @java.lang.Override - public int getChildCount() { - return childCount_; - } - /** - * int32 childCount = 6; - * @param value The childCount to set. - */ - private void setChildCount(int value) { - - childCount_ = value; - } - /** - * int32 childCount = 6; - */ - private void clearChildCount() { - - childCount_ = 0; - } - - public static final int RESOURCENAME_FIELD_NUMBER = 7; - private java.lang.String resourceName_; - /** - * string resourceName = 7; - * @return The resourceName. - */ - @java.lang.Override - public java.lang.String getResourceName() { - return resourceName_; - } - /** - * string resourceName = 7; - * @return The bytes for resourceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(resourceName_); - } - /** - * string resourceName = 7; - * @param value The resourceName to set. - */ - private void setResourceName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - resourceName_ = value; - } - /** - * string resourceName = 7; - */ - private void clearResourceName() { - - resourceName_ = getDefaultInstance().getResourceName(); - } - /** - * string resourceName = 7; - * @param value The bytes for resourceName to set. - */ - private void setResourceNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - resourceName_ = value.toStringUtf8(); - - } - - public static final int APPLICATIONPACKAGE_FIELD_NUMBER = 8; - private java.lang.String applicationPackage_; - /** - * string applicationPackage = 8; - * @return The applicationPackage. - */ - @java.lang.Override - public java.lang.String getApplicationPackage() { - return applicationPackage_; - } - /** - * string applicationPackage = 8; - * @return The bytes for applicationPackage. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationPackageBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(applicationPackage_); - } - /** - * string applicationPackage = 8; - * @param value The applicationPackage to set. - */ - private void setApplicationPackage( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - applicationPackage_ = value; - } - /** - * string applicationPackage = 8; - */ - private void clearApplicationPackage() { - - applicationPackage_ = getDefaultInstance().getApplicationPackage(); - } - /** - * string applicationPackage = 8; - * @param value The bytes for applicationPackage to set. - */ - private void setApplicationPackageBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - applicationPackage_ = value.toStringUtf8(); - - } - - public static final int CHILDREN_FIELD_NUMBER = 9; - private com.google.protobuf.Internal.ProtobufList children_; - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public java.util.List getChildrenList() { - return children_; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public java.util.List - getChildrenOrBuilderList() { - return children_; - } - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public int getChildrenCount() { - return children_.size(); - } - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getChildren(int index) { - return children_.get(index); - } - /** - * repeated .patrol.NativeView children = 9; - */ - public pl.leancode.patrol.contracts.Contracts.NativeViewOrBuilder getChildrenOrBuilder( - int index) { - return children_.get(index); - } - private void ensureChildrenIsMutable() { - com.google.protobuf.Internal.ProtobufList tmp = children_; - if (!tmp.isModifiable()) { - children_ = - com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp); - } - } - - /** - * repeated .patrol.NativeView children = 9; - */ - private void setChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureChildrenIsMutable(); - children_.set(index, value); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void addChildren(pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureChildrenIsMutable(); - children_.add(value); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void addChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - value.getClass(); - ensureChildrenIsMutable(); - children_.add(index, value); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void addAllChildren( - java.lang.Iterable values) { - ensureChildrenIsMutable(); - com.google.protobuf.AbstractMessageLite.addAll( - values, children_); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void clearChildren() { - children_ = emptyProtobufList(); - } - /** - * repeated .patrol.NativeView children = 9; - */ - private void removeChildren(int index) { - ensureChildrenIsMutable(); - children_.remove(index); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.NativeView parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.NativeView prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * Represents a native UI control.
-     *
-     * On Android, this is `android.view.View`.
-     * 
- * - * Protobuf type {@code patrol.NativeView} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.NativeView, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.NativeView) - pl.leancode.patrol.contracts.Contracts.NativeViewOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.NativeView.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * string className = 1; - * @return The className. - */ - @java.lang.Override - public java.lang.String getClassName() { - return instance.getClassName(); - } - /** - * string className = 1; - * @return The bytes for className. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getClassNameBytes() { - return instance.getClassNameBytes(); - } - /** - * string className = 1; - * @param value The className to set. - * @return This builder for chaining. - */ - public Builder setClassName( - java.lang.String value) { - copyOnWrite(); - instance.setClassName(value); - return this; - } - /** - * string className = 1; - * @return This builder for chaining. - */ - public Builder clearClassName() { - copyOnWrite(); - instance.clearClassName(); - return this; - } - /** - * string className = 1; - * @param value The bytes for className to set. - * @return This builder for chaining. - */ - public Builder setClassNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setClassNameBytes(value); - return this; - } - - /** - * string text = 2; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - return instance.getText(); - } - /** - * string text = 2; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - return instance.getTextBytes(); - } - /** - * string text = 2; - * @param value The text to set. - * @return This builder for chaining. - */ - public Builder setText( - java.lang.String value) { - copyOnWrite(); - instance.setText(value); - return this; - } - /** - * string text = 2; - * @return This builder for chaining. - */ - public Builder clearText() { - copyOnWrite(); - instance.clearText(); - return this; - } - /** - * string text = 2; - * @param value The bytes for text to set. - * @return This builder for chaining. - */ - public Builder setTextBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTextBytes(value); - return this; - } - - /** - * string contentDescription = 3; - * @return The contentDescription. - */ - @java.lang.Override - public java.lang.String getContentDescription() { - return instance.getContentDescription(); - } - /** - * string contentDescription = 3; - * @return The bytes for contentDescription. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentDescriptionBytes() { - return instance.getContentDescriptionBytes(); - } - /** - * string contentDescription = 3; - * @param value The contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescription( - java.lang.String value) { - copyOnWrite(); - instance.setContentDescription(value); - return this; - } - /** - * string contentDescription = 3; - * @return This builder for chaining. - */ - public Builder clearContentDescription() { - copyOnWrite(); - instance.clearContentDescription(); - return this; - } - /** - * string contentDescription = 3; - * @param value The bytes for contentDescription to set. - * @return This builder for chaining. - */ - public Builder setContentDescriptionBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentDescriptionBytes(value); - return this; - } - - /** - * bool focused = 4; - * @return The focused. - */ - @java.lang.Override - public boolean getFocused() { - return instance.getFocused(); - } - /** - * bool focused = 4; - * @param value The focused to set. - * @return This builder for chaining. - */ - public Builder setFocused(boolean value) { - copyOnWrite(); - instance.setFocused(value); - return this; - } - /** - * bool focused = 4; - * @return This builder for chaining. - */ - public Builder clearFocused() { - copyOnWrite(); - instance.clearFocused(); - return this; - } - - /** - * bool enabled = 5; - * @return The enabled. - */ - @java.lang.Override - public boolean getEnabled() { - return instance.getEnabled(); - } - /** - * bool enabled = 5; - * @param value The enabled to set. - * @return This builder for chaining. - */ - public Builder setEnabled(boolean value) { - copyOnWrite(); - instance.setEnabled(value); - return this; - } - /** - * bool enabled = 5; - * @return This builder for chaining. - */ - public Builder clearEnabled() { - copyOnWrite(); - instance.clearEnabled(); - return this; - } - - /** - * int32 childCount = 6; - * @return The childCount. - */ - @java.lang.Override - public int getChildCount() { - return instance.getChildCount(); - } - /** - * int32 childCount = 6; - * @param value The childCount to set. - * @return This builder for chaining. - */ - public Builder setChildCount(int value) { - copyOnWrite(); - instance.setChildCount(value); - return this; - } - /** - * int32 childCount = 6; - * @return This builder for chaining. - */ - public Builder clearChildCount() { - copyOnWrite(); - instance.clearChildCount(); - return this; - } - - /** - * string resourceName = 7; - * @return The resourceName. - */ - @java.lang.Override - public java.lang.String getResourceName() { - return instance.getResourceName(); - } - /** - * string resourceName = 7; - * @return The bytes for resourceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceNameBytes() { - return instance.getResourceNameBytes(); - } - /** - * string resourceName = 7; - * @param value The resourceName to set. - * @return This builder for chaining. - */ - public Builder setResourceName( - java.lang.String value) { - copyOnWrite(); - instance.setResourceName(value); - return this; - } - /** - * string resourceName = 7; - * @return This builder for chaining. - */ - public Builder clearResourceName() { - copyOnWrite(); - instance.clearResourceName(); - return this; - } - /** - * string resourceName = 7; - * @param value The bytes for resourceName to set. - * @return This builder for chaining. - */ - public Builder setResourceNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setResourceNameBytes(value); - return this; - } - - /** - * string applicationPackage = 8; - * @return The applicationPackage. - */ - @java.lang.Override - public java.lang.String getApplicationPackage() { - return instance.getApplicationPackage(); - } - /** - * string applicationPackage = 8; - * @return The bytes for applicationPackage. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationPackageBytes() { - return instance.getApplicationPackageBytes(); - } - /** - * string applicationPackage = 8; - * @param value The applicationPackage to set. - * @return This builder for chaining. - */ - public Builder setApplicationPackage( - java.lang.String value) { - copyOnWrite(); - instance.setApplicationPackage(value); - return this; - } - /** - * string applicationPackage = 8; - * @return This builder for chaining. - */ - public Builder clearApplicationPackage() { - copyOnWrite(); - instance.clearApplicationPackage(); - return this; - } - /** - * string applicationPackage = 8; - * @param value The bytes for applicationPackage to set. - * @return This builder for chaining. - */ - public Builder setApplicationPackageBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setApplicationPackageBytes(value); - return this; - } - - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public java.util.List getChildrenList() { - return java.util.Collections.unmodifiableList( - instance.getChildrenList()); - } - /** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public int getChildrenCount() { - return instance.getChildrenCount(); - }/** - * repeated .patrol.NativeView children = 9; - */ - @java.lang.Override - public pl.leancode.patrol.contracts.Contracts.NativeView getChildren(int index) { - return instance.getChildren(index); - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder setChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.setChildren(index, value); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder setChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.setChildren(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren(pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addChildren(value); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView value) { - copyOnWrite(); - instance.addChildren(index, value); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren( - pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addChildren(builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addChildren( - int index, pl.leancode.patrol.contracts.Contracts.NativeView.Builder builderForValue) { - copyOnWrite(); - instance.addChildren(index, - builderForValue.build()); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder addAllChildren( - java.lang.Iterable values) { - copyOnWrite(); - instance.addAllChildren(values); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder clearChildren() { - copyOnWrite(); - instance.clearChildren(); - return this; - } - /** - * repeated .patrol.NativeView children = 9; - */ - public Builder removeChildren(int index) { - copyOnWrite(); - instance.removeChildren(index); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.NativeView) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.NativeView(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "className_", - "text_", - "contentDescription_", - "focused_", - "enabled_", - "childCount_", - "resourceName_", - "applicationPackage_", - "children_", - pl.leancode.patrol.contracts.Contracts.NativeView.class, - }; - java.lang.String info = - "\u0000\t\u0000\u0000\u0001\t\t\u0000\u0001\u0000\u0001\u0208\u0002\u0208\u0003\u0208" + - "\u0004\u0007\u0005\u0007\u0006\u0004\u0007\u0208\b\u0208\t\u001b"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.NativeView.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.NativeView) - private static final pl.leancode.patrol.contracts.Contracts.NativeView DEFAULT_INSTANCE; - static { - NativeView defaultInstance = new NativeView(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - NativeView.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.NativeView getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface NotificationOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.Notification) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * optional string appName = 1; - * @return Whether the appName field is set. - */ - boolean hasAppName(); - /** - * optional string appName = 1; - * @return The appName. - */ - java.lang.String getAppName(); - /** - * optional string appName = 1; - * @return The bytes for appName. - */ - com.google.protobuf.ByteString - getAppNameBytes(); - - /** - * string title = 2; - * @return The title. - */ - java.lang.String getTitle(); - /** - * string title = 2; - * @return The bytes for title. - */ - com.google.protobuf.ByteString - getTitleBytes(); - - /** - * string content = 3; - * @return The content. - */ - java.lang.String getContent(); - /** - * string content = 3; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - * string raw = 4; - * @return The raw. - */ - java.lang.String getRaw(); - /** - * string raw = 4; - * @return The bytes for raw. - */ - com.google.protobuf.ByteString - getRawBytes(); - } - /** - *
-   * Represents a notification visible in the notification shade.
-   * 
- * - * Protobuf type {@code patrol.Notification} - */ - public static final class Notification extends - com.google.protobuf.GeneratedMessageLite< - Notification, Notification.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.Notification) - NotificationOrBuilder { - private Notification() { - appName_ = ""; - title_ = ""; - content_ = ""; - raw_ = ""; - } - private int bitField0_; - public static final int APPNAME_FIELD_NUMBER = 1; - private java.lang.String appName_; - /** - * optional string appName = 1; - * @return Whether the appName field is set. - */ - @java.lang.Override - public boolean hasAppName() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string appName = 1; - * @return The appName. - */ - @java.lang.Override - public java.lang.String getAppName() { - return appName_; - } - /** - * optional string appName = 1; - * @return The bytes for appName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppNameBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(appName_); - } - /** - * optional string appName = 1; - * @param value The appName to set. - */ - private void setAppName( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - bitField0_ |= 0x00000001; - appName_ = value; - } - /** - * optional string appName = 1; - */ - private void clearAppName() { - bitField0_ = (bitField0_ & ~0x00000001); - appName_ = getDefaultInstance().getAppName(); - } - /** - * optional string appName = 1; - * @param value The bytes for appName to set. - */ - private void setAppNameBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - appName_ = value.toStringUtf8(); - bitField0_ |= 0x00000001; - } - - public static final int TITLE_FIELD_NUMBER = 2; - private java.lang.String title_; - /** - * string title = 2; - * @return The title. - */ - @java.lang.Override - public java.lang.String getTitle() { - return title_; - } - /** - * string title = 2; - * @return The bytes for title. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTitleBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(title_); - } - /** - * string title = 2; - * @param value The title to set. - */ - private void setTitle( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - title_ = value; - } - /** - * string title = 2; - */ - private void clearTitle() { - - title_ = getDefaultInstance().getTitle(); - } - /** - * string title = 2; - * @param value The bytes for title to set. - */ - private void setTitleBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - title_ = value.toStringUtf8(); - - } - - public static final int CONTENT_FIELD_NUMBER = 3; - private java.lang.String content_; - /** - * string content = 3; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - return content_; - } - /** - * string content = 3; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(content_); - } - /** - * string content = 3; - * @param value The content to set. - */ - private void setContent( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - content_ = value; - } - /** - * string content = 3; - */ - private void clearContent() { - - content_ = getDefaultInstance().getContent(); - } - /** - * string content = 3; - * @param value The bytes for content to set. - */ - private void setContentBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - content_ = value.toStringUtf8(); - - } - - public static final int RAW_FIELD_NUMBER = 4; - private java.lang.String raw_; - /** - * string raw = 4; - * @return The raw. - */ - @java.lang.Override - public java.lang.String getRaw() { - return raw_; - } - /** - * string raw = 4; - * @return The bytes for raw. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRawBytes() { - return com.google.protobuf.ByteString.copyFromUtf8(raw_); - } - /** - * string raw = 4; - * @param value The raw to set. - */ - private void setRaw( - java.lang.String value) { - java.lang.Class valueClass = value.getClass(); - - raw_ = value; - } - /** - * string raw = 4; - */ - private void clearRaw() { - - raw_ = getDefaultInstance().getRaw(); - } - /** - * string raw = 4; - * @param value The bytes for raw to set. - */ - private void setRawBytes( - com.google.protobuf.ByteString value) { - checkByteStringIsUtf8(value); - raw_ = value.toStringUtf8(); - - } - - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.Notification parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.Notification parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.Notification parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.Notification prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - *
-     * Represents a notification visible in the notification shade.
-     * 
- * - * Protobuf type {@code patrol.Notification} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.Notification, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.Notification) - pl.leancode.patrol.contracts.Contracts.NotificationOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.Notification.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - /** - * optional string appName = 1; - * @return Whether the appName field is set. - */ - @java.lang.Override - public boolean hasAppName() { - return instance.hasAppName(); - } - /** - * optional string appName = 1; - * @return The appName. - */ - @java.lang.Override - public java.lang.String getAppName() { - return instance.getAppName(); - } - /** - * optional string appName = 1; - * @return The bytes for appName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAppNameBytes() { - return instance.getAppNameBytes(); - } - /** - * optional string appName = 1; - * @param value The appName to set. - * @return This builder for chaining. - */ - public Builder setAppName( - java.lang.String value) { - copyOnWrite(); - instance.setAppName(value); - return this; - } - /** - * optional string appName = 1; - * @return This builder for chaining. - */ - public Builder clearAppName() { - copyOnWrite(); - instance.clearAppName(); - return this; - } - /** - * optional string appName = 1; - * @param value The bytes for appName to set. - * @return This builder for chaining. - */ - public Builder setAppNameBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setAppNameBytes(value); - return this; - } - - /** - * string title = 2; - * @return The title. - */ - @java.lang.Override - public java.lang.String getTitle() { - return instance.getTitle(); - } - /** - * string title = 2; - * @return The bytes for title. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTitleBytes() { - return instance.getTitleBytes(); - } - /** - * string title = 2; - * @param value The title to set. - * @return This builder for chaining. - */ - public Builder setTitle( - java.lang.String value) { - copyOnWrite(); - instance.setTitle(value); - return this; - } - /** - * string title = 2; - * @return This builder for chaining. - */ - public Builder clearTitle() { - copyOnWrite(); - instance.clearTitle(); - return this; - } - /** - * string title = 2; - * @param value The bytes for title to set. - * @return This builder for chaining. - */ - public Builder setTitleBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setTitleBytes(value); - return this; - } - - /** - * string content = 3; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - return instance.getContent(); - } - /** - * string content = 3; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - return instance.getContentBytes(); - } - /** - * string content = 3; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - copyOnWrite(); - instance.setContent(value); - return this; - } - /** - * string content = 3; - * @return This builder for chaining. - */ - public Builder clearContent() { - copyOnWrite(); - instance.clearContent(); - return this; - } - /** - * string content = 3; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setContentBytes(value); - return this; - } - - /** - * string raw = 4; - * @return The raw. - */ - @java.lang.Override - public java.lang.String getRaw() { - return instance.getRaw(); - } - /** - * string raw = 4; - * @return The bytes for raw. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRawBytes() { - return instance.getRawBytes(); - } - /** - * string raw = 4; - * @param value The raw to set. - * @return This builder for chaining. - */ - public Builder setRaw( - java.lang.String value) { - copyOnWrite(); - instance.setRaw(value); - return this; - } - /** - * string raw = 4; - * @return This builder for chaining. - */ - public Builder clearRaw() { - copyOnWrite(); - instance.clearRaw(); - return this; - } - /** - * string raw = 4; - * @param value The bytes for raw to set. - * @return This builder for chaining. - */ - public Builder setRawBytes( - com.google.protobuf.ByteString value) { - copyOnWrite(); - instance.setRawBytes(value); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.Notification) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.Notification(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "bitField0_", - "appName_", - "title_", - "content_", - "raw_", - }; - java.lang.String info = - "\u0000\u0004\u0000\u0001\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u1208\u0000\u0002" + - "\u0208\u0003\u0208\u0004\u0208"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.Notification.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.Notification) - private static final pl.leancode.patrol.contracts.Contracts.Notification DEFAULT_INSTANCE; - static { - Notification defaultInstance = new Notification(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - Notification.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.Notification getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - public interface SubmitTestResultsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:patrol.SubmitTestResultsRequest) - com.google.protobuf.MessageLiteOrBuilder { - - /** - * map<string, string> results = 1; - */ - int getResultsCount(); - /** - * map<string, string> results = 1; - */ - boolean containsResults( - java.lang.String key); - /** - * Use {@link #getResultsMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getResults(); - /** - * map<string, string> results = 1; - */ - java.util.Map - getResultsMap(); - /** - * map<string, string> results = 1; - */ - - /* nullable */ -java.lang.String getResultsOrDefault( - java.lang.String key, - /* nullable */ -java.lang.String defaultValue); - /** - * map<string, string> results = 1; - */ - - java.lang.String getResultsOrThrow( - java.lang.String key); - } - /** - * Protobuf type {@code patrol.SubmitTestResultsRequest} - */ - public static final class SubmitTestResultsRequest extends - com.google.protobuf.GeneratedMessageLite< - SubmitTestResultsRequest, SubmitTestResultsRequest.Builder> implements - // @@protoc_insertion_point(message_implements:patrol.SubmitTestResultsRequest) - SubmitTestResultsRequestOrBuilder { - private SubmitTestResultsRequest() { - } - public static final int RESULTS_FIELD_NUMBER = 1; - private static final class ResultsDefaultEntryHolder { - static final com.google.protobuf.MapEntryLite< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntryLite - .newDefaultInstance( - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapFieldLite< - java.lang.String, java.lang.String> results_ = - com.google.protobuf.MapFieldLite.emptyMapField(); - private com.google.protobuf.MapFieldLite - internalGetResults() { - return results_; - } - private com.google.protobuf.MapFieldLite - internalGetMutableResults() { - if (!results_.isMutable()) { - results_ = results_.mutableCopy(); - } - return results_; - } - @java.lang.Override - - public int getResultsCount() { - return internalGetResults().size(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public boolean containsResults( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - return internalGetResults().containsKey(key); - } - /** - * Use {@link #getResultsMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getResults() { - return getResultsMap(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public java.util.Map getResultsMap() { - return java.util.Collections.unmodifiableMap( - internalGetResults()); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public /* nullable */ -java.lang.String getResultsOrDefault( - java.lang.String key, - /* nullable */ -java.lang.String defaultValue) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - internalGetResults(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public java.lang.String getResultsOrThrow( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - internalGetResults(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - /** - * map<string, string> results = 1; - */ - private java.util.Map - getMutableResultsMap() { - return internalGetMutableResults(); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, data, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input); - } - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageLite.parseFrom( - DEFAULT_INSTANCE, input, extensionRegistry); - } - - public static Builder newBuilder() { - return (Builder) DEFAULT_INSTANCE.createBuilder(); - } - public static Builder newBuilder(pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest prototype) { - return (Builder) DEFAULT_INSTANCE.createBuilder(prototype); - } - - /** - * Protobuf type {@code patrol.SubmitTestResultsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageLite.Builder< - pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest, Builder> implements - // @@protoc_insertion_point(builder_implements:patrol.SubmitTestResultsRequest) - pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequestOrBuilder { - // Construct using pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.newBuilder() - private Builder() { - super(DEFAULT_INSTANCE); - } - - - @java.lang.Override - - public int getResultsCount() { - return instance.getResultsMap().size(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public boolean containsResults( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - return instance.getResultsMap().containsKey(key); - } - - public Builder clearResults() { - copyOnWrite(); - instance.getMutableResultsMap().clear(); - return this; - } - /** - * map<string, string> results = 1; - */ - - public Builder removeResults( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - copyOnWrite(); - instance.getMutableResultsMap().remove(key); - return this; - } - /** - * Use {@link #getResultsMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getResults() { - return getResultsMap(); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - public java.util.Map getResultsMap() { - return java.util.Collections.unmodifiableMap( - instance.getResultsMap()); - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public /* nullable */ -java.lang.String getResultsOrDefault( - java.lang.String key, - /* nullable */ -java.lang.String defaultValue) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - instance.getResultsMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> results = 1; - */ - @java.lang.Override - - public java.lang.String getResultsOrThrow( - java.lang.String key) { - java.lang.Class keyClass = key.getClass(); - java.util.Map map = - instance.getResultsMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - /** - * map<string, string> results = 1; - */ - public Builder putResults( - java.lang.String key, - java.lang.String value) { - java.lang.Class keyClass = key.getClass(); - java.lang.Class valueClass = value.getClass(); - copyOnWrite(); - instance.getMutableResultsMap().put(key, value); - return this; - } - /** - * map<string, string> results = 1; - */ - public Builder putAllResults( - java.util.Map values) { - copyOnWrite(); - instance.getMutableResultsMap().putAll(values); - return this; - } - - // @@protoc_insertion_point(builder_scope:patrol.SubmitTestResultsRequest) - } - @java.lang.Override - @java.lang.SuppressWarnings({"unchecked", "fallthrough"}) - protected final java.lang.Object dynamicMethod( - com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, - java.lang.Object arg0, java.lang.Object arg1) { - switch (method) { - case NEW_MUTABLE_INSTANCE: { - return new pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest(); - } - case NEW_BUILDER: { - return new Builder(); - } - case BUILD_MESSAGE_INFO: { - java.lang.Object[] objects = new java.lang.Object[] { - "results_", - ResultsDefaultEntryHolder.defaultEntry, - }; - java.lang.String info = - "\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u00012"; - return newMessageInfo(DEFAULT_INSTANCE, info, objects); - } - // fall through - case GET_DEFAULT_INSTANCE: { - return DEFAULT_INSTANCE; - } - case GET_PARSER: { - com.google.protobuf.Parser parser = PARSER; - if (parser == null) { - synchronized (pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.class) { - parser = PARSER; - if (parser == null) { - parser = - new DefaultInstanceBasedParser( - DEFAULT_INSTANCE); - PARSER = parser; - } - } - } - return parser; - } - case GET_MEMOIZED_IS_INITIALIZED: { - return (byte) 1; - } - case SET_MEMOIZED_IS_INITIALIZED: { - return null; - } - } - throw new UnsupportedOperationException(); - } - - - // @@protoc_insertion_point(class_scope:patrol.SubmitTestResultsRequest) - private static final pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest DEFAULT_INSTANCE; - static { - SubmitTestResultsRequest defaultInstance = new SubmitTestResultsRequest(); - // New instances are implicitly immutable so no need to make - // immutable. - DEFAULT_INSTANCE = defaultInstance; - com.google.protobuf.GeneratedMessageLite.registerDefaultInstance( - SubmitTestResultsRequest.class, defaultInstance); - } - - public static pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static volatile com.google.protobuf.Parser PARSER; - - public static com.google.protobuf.Parser parser() { - return DEFAULT_INSTANCE.getParserForType(); - } - } - - - static { - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt new file mode 100644 index 000000000..cf0ac5b2d --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt @@ -0,0 +1,281 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package pl.leancode.patrol.contracts; + +import kotlinx.serialization.Serializable + +class Contracts { + @Serializable + enum class GroupEntryType { + group, + test, + } + + @Serializable + enum class RunDartTestResponseResult { + success, + skipped, + failure, + } + + @Serializable + enum class KeyboardBehavior { + showAndDismiss, + alternative, + } + + @Serializable + enum class HandlePermissionRequestCode { + whileUsing, + onlyThisTime, + denied, + } + + @Serializable + enum class SetLocationAccuracyRequestLocationAccuracy { + coarse, + fine, + } + + @Serializable + data class DartGroupEntry ( + val name: String, + val type: GroupEntryType, + val entries: List + ) + + @Serializable + data class ListDartTestsResponse ( + val group: DartGroupEntry + ) + + @Serializable + data class RunDartTestRequest ( + val name: String + ) + + @Serializable + data class RunDartTestResponse ( + val result: RunDartTestResponseResult, + val details: String? = null + ){ + fun hasDetails(): Boolean { + return details != null + } + } + + @Serializable + data class ConfigureRequest ( + val findTimeoutMillis: Long + ) + + @Serializable + data class OpenAppRequest ( + val appId: String + ) + + @Serializable + class OpenQuickSettingsRequest ( + + ) + + @Serializable + data class Selector ( + val text: String? = null, + val textStartsWith: String? = null, + val textContains: String? = null, + val className: String? = null, + val contentDescription: String? = null, + val contentDescriptionStartsWith: String? = null, + val contentDescriptionContains: String? = null, + val resourceId: String? = null, + val instance: Long? = null, + val enabled: Boolean? = null, + val focused: Boolean? = null, + val pkg: String? = null + ){ + fun hasText(): Boolean { + return text != null + } + fun hasTextStartsWith(): Boolean { + return textStartsWith != null + } + fun hasTextContains(): Boolean { + return textContains != null + } + fun hasClassName(): Boolean { + return className != null + } + fun hasContentDescription(): Boolean { + return contentDescription != null + } + fun hasContentDescriptionStartsWith(): Boolean { + return contentDescriptionStartsWith != null + } + fun hasContentDescriptionContains(): Boolean { + return contentDescriptionContains != null + } + fun hasResourceId(): Boolean { + return resourceId != null + } + fun hasInstance(): Boolean { + return instance != null + } + fun hasEnabled(): Boolean { + return enabled != null + } + fun hasFocused(): Boolean { + return focused != null + } + fun hasPkg(): Boolean { + return pkg != null + } + } + + @Serializable + data class GetNativeViewsRequest ( + val selector: Selector, + val appId: String + ) + + @Serializable + data class NativeView ( + val className: String? = null, + val text: String? = null, + val contentDescription: String? = null, + val focused: Boolean, + val enabled: Boolean, + val childCount: Long? = null, + val resourceName: String? = null, + val applicationPackage: String? = null, + val children: List + ){ + fun hasClassName(): Boolean { + return className != null + } + fun hasText(): Boolean { + return text != null + } + fun hasContentDescription(): Boolean { + return contentDescription != null + } + fun hasChildCount(): Boolean { + return childCount != null + } + fun hasResourceName(): Boolean { + return resourceName != null + } + fun hasApplicationPackage(): Boolean { + return applicationPackage != null + } + } + + @Serializable + data class GetNativeViewsResponse ( + val nativeViews: List + ) + + @Serializable + data class TapRequest ( + val selector: Selector, + val appId: String + ) + + @Serializable + data class EnterTextRequest ( + val data: String, + val appId: String, + val index: Long? = null, + val selector: Selector? = null, + val keyboardBehavior: KeyboardBehavior + ){ + fun hasIndex(): Boolean { + return index != null + } + fun hasSelector(): Boolean { + return selector != null + } + } + + @Serializable + data class SwipeRequest ( + val startX: Double, + val startY: Double, + val endX: Double, + val endY: Double, + val steps: Long + ) + + @Serializable + data class WaitUntilVisibleRequest ( + val selector: Selector, + val appId: String + ) + + @Serializable + data class DarkModeRequest ( + val appId: String + ) + + @Serializable + data class Notification ( + val appName: String? = null, + val title: String, + val content: String, + val raw: String? = null + ){ + fun hasAppName(): Boolean { + return appName != null + } + fun hasRaw(): Boolean { + return raw != null + } + } + + @Serializable + data class GetNotificationsResponse ( + val notifications: List + ) + + @Serializable + class GetNotificationsRequest ( + + ) + + @Serializable + data class TapOnNotificationRequest ( + val index: Long? = null, + val selector: Selector? = null + ){ + fun hasIndex(): Boolean { + return index != null + } + fun hasSelector(): Boolean { + return selector != null + } + } + + @Serializable + data class PermissionDialogVisibleResponse ( + val visible: Boolean + ) + + @Serializable + data class PermissionDialogVisibleRequest ( + val timeoutMillis: Long + ) + + @Serializable + data class HandlePermissionRequest ( + val code: HandlePermissionRequestCode + ) + + @Serializable + data class SetLocationAccuracyRequest ( + val locationAccuracy: SetLocationAccuracyRequestLocationAccuracy + ) + +} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt deleted file mode 100644 index ad00b8870..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsGrpcKt.kt +++ /dev/null @@ -1,1700 +0,0 @@ -package pl.leancode.patrol.contracts - -import io.grpc.CallOptions -import io.grpc.CallOptions.DEFAULT -import io.grpc.Channel -import io.grpc.Metadata -import io.grpc.MethodDescriptor -import io.grpc.ServerServiceDefinition -import io.grpc.ServerServiceDefinition.builder -import io.grpc.ServiceDescriptor -import io.grpc.Status -import io.grpc.Status.UNIMPLEMENTED -import io.grpc.StatusException -import io.grpc.kotlin.AbstractCoroutineServerImpl -import io.grpc.kotlin.AbstractCoroutineStub -import io.grpc.kotlin.ClientCalls -import io.grpc.kotlin.ClientCalls.unaryRpc -import io.grpc.kotlin.ServerCalls -import io.grpc.kotlin.ServerCalls.unaryServerMethodDefinition -import io.grpc.kotlin.StubFor -import kotlin.String -import kotlin.coroutines.CoroutineContext -import kotlin.coroutines.EmptyCoroutineContext -import kotlin.jvm.JvmOverloads -import kotlin.jvm.JvmStatic -import pl.leancode.patrol.contracts.PatrolAppServiceGrpc.getServiceDescriptor - -/** - * Holder for Kotlin coroutine-based client and server APIs for patrol.PatrolAppService. - */ -public object PatrolAppServiceGrpcKt { - public const val SERVICE_NAME: String = PatrolAppServiceGrpc.SERVICE_NAME - - @JvmStatic - public val serviceDescriptor: ServiceDescriptor - get() = PatrolAppServiceGrpc.getServiceDescriptor() - - public val listDartTestsMethod: MethodDescriptor - @JvmStatic - get() = PatrolAppServiceGrpc.getListDartTestsMethod() - - public val runDartTestMethod: - MethodDescriptor - @JvmStatic - get() = PatrolAppServiceGrpc.getRunDartTestMethod() - - /** - * A stub for issuing RPCs to a(n) patrol.PatrolAppService service as suspending coroutines. - */ - @StubFor(PatrolAppServiceGrpc::class) - public class PatrolAppServiceCoroutineStub @JvmOverloads constructor( - channel: Channel, - callOptions: CallOptions = DEFAULT, - ) : AbstractCoroutineStub(channel, callOptions) { - public override fun build(channel: Channel, callOptions: CallOptions): - PatrolAppServiceCoroutineStub = PatrolAppServiceCoroutineStub(channel, callOptions) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun listDartTests(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.ListDartTestsResponse = unaryRpc( - channel, - PatrolAppServiceGrpc.getListDartTestsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun runDartTest(request: Contracts.RunDartTestRequest, headers: Metadata = - Metadata()): Contracts.RunDartTestResponse = unaryRpc( - channel, - PatrolAppServiceGrpc.getRunDartTestMethod(), - request, - callOptions, - headers - ) - } - - /** - * Skeletal implementation of the patrol.PatrolAppService service based on Kotlin coroutines. - */ - public abstract class PatrolAppServiceCoroutineImplBase( - coroutineContext: CoroutineContext = EmptyCoroutineContext, - ) : AbstractCoroutineServerImpl(coroutineContext) { - /** - * Returns the response to an RPC for patrol.PatrolAppService.listDartTests. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun listDartTests(request: Contracts.Empty): Contracts.ListDartTestsResponse - = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.PatrolAppService.listDartTests is unimplemented")) - - /** - * Returns the response to an RPC for patrol.PatrolAppService.runDartTest. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun runDartTest(request: Contracts.RunDartTestRequest): - Contracts.RunDartTestResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.PatrolAppService.runDartTest is unimplemented")) - - public final override fun bindService(): ServerServiceDefinition = - builder(getServiceDescriptor()) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = PatrolAppServiceGrpc.getListDartTestsMethod(), - implementation = ::listDartTests - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = PatrolAppServiceGrpc.getRunDartTestMethod(), - implementation = ::runDartTest - )).build() - } -} - -/** - * Holder for Kotlin coroutine-based client and server APIs for patrol.NativeAutomator. - */ -public object NativeAutomatorGrpcKt { - public const val SERVICE_NAME: String = NativeAutomatorGrpc.SERVICE_NAME - - @JvmStatic - public val serviceDescriptor: ServiceDescriptor - get() = NativeAutomatorGrpc.getServiceDescriptor() - - public val initializeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getInitializeMethod() - - public val configureMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getConfigureMethod() - - public val pressHomeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getPressHomeMethod() - - public val pressBackMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getPressBackMethod() - - public val pressRecentAppsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getPressRecentAppsMethod() - - public val doublePressRecentAppsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDoublePressRecentAppsMethod() - - public val openAppMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getOpenAppMethod() - - public val openQuickSettingsMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getOpenQuickSettingsMethod() - - public val getNativeViewsMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getGetNativeViewsMethod() - - public val tapMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getTapMethod() - - public val doubleTapMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDoubleTapMethod() - - public val enterTextMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnterTextMethod() - - public val swipeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getSwipeMethod() - - public val waitUntilVisibleMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getWaitUntilVisibleMethod() - - public val enableAirplaneModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableAirplaneModeMethod() - - public val disableAirplaneModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableAirplaneModeMethod() - - public val enableWiFiMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableWiFiMethod() - - public val disableWiFiMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableWiFiMethod() - - public val enableCellularMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableCellularMethod() - - public val disableCellularMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableCellularMethod() - - public val enableBluetoothMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableBluetoothMethod() - - public val disableBluetoothMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableBluetoothMethod() - - public val enableDarkModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getEnableDarkModeMethod() - - public val disableDarkModeMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDisableDarkModeMethod() - - public val openNotificationsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getOpenNotificationsMethod() - - public val closeNotificationsMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getCloseNotificationsMethod() - - public val closeHeadsUpNotificationMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod() - - public val getNotificationsMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getGetNotificationsMethod() - - public val tapOnNotificationMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getTapOnNotificationMethod() - - public val isPermissionDialogVisibleMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod() - - public val handlePermissionDialogMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getHandlePermissionDialogMethod() - - public val setLocationAccuracyMethod: - MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getSetLocationAccuracyMethod() - - public val debugMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getDebugMethod() - - public val markPatrolAppServiceReadyMethod: MethodDescriptor - @JvmStatic - get() = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod() - - /** - * A stub for issuing RPCs to a(n) patrol.NativeAutomator service as suspending coroutines. - */ - @StubFor(NativeAutomatorGrpc::class) - public class NativeAutomatorCoroutineStub @JvmOverloads constructor( - channel: Channel, - callOptions: CallOptions = DEFAULT, - ) : AbstractCoroutineStub(channel, callOptions) { - public override fun build(channel: Channel, callOptions: CallOptions): - NativeAutomatorCoroutineStub = NativeAutomatorCoroutineStub(channel, callOptions) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun initialize(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getInitializeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun configure(request: Contracts.ConfigureRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getConfigureMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun pressHome(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getPressHomeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun pressBack(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getPressBackMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun pressRecentApps(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getPressRecentAppsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun doublePressRecentApps(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDoublePressRecentAppsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun openApp(request: Contracts.OpenAppRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getOpenAppMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getOpenQuickSettingsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun getNativeViews(request: Contracts.GetNativeViewsRequest, headers: Metadata = - Metadata()): Contracts.GetNativeViewsResponse = unaryRpc( - channel, - NativeAutomatorGrpc.getGetNativeViewsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun tap(request: Contracts.TapRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getTapMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun doubleTap(request: Contracts.TapRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDoubleTapMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enterText(request: Contracts.EnterTextRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnterTextMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun swipe(request: Contracts.SwipeRequest, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getSwipeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getWaitUntilVisibleMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableAirplaneMode(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableAirplaneModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableAirplaneMode(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableAirplaneModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableWiFi(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableWiFiMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableWiFi(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableWiFiMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableCellular(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableCellularMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableCellular(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableCellularMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableBluetooth(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableBluetoothMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableBluetooth(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableBluetoothMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun enableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getEnableDarkModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun disableDarkMode(request: Contracts.DarkModeRequest, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDisableDarkModeMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun openNotifications(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getOpenNotificationsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun closeNotifications(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getCloseNotificationsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun closeHeadsUpNotification(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun getNotifications(request: Contracts.GetNotificationsRequest, - headers: Metadata = Metadata()): Contracts.GetNotificationsResponse = unaryRpc( - channel, - NativeAutomatorGrpc.getGetNotificationsMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun tapOnNotification(request: Contracts.TapOnNotificationRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getTapOnNotificationMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest, - headers: Metadata = Metadata()): Contracts.PermissionDialogVisibleResponse = unaryRpc( - channel, - NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun handlePermissionDialog(request: Contracts.HandlePermissionRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getHandlePermissionDialogMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest, - headers: Metadata = Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getSetLocationAccuracyMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun debug(request: Contracts.Empty, headers: Metadata = Metadata()): - Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getDebugMethod(), - request, - callOptions, - headers - ) - - /** - * Executes this RPC and returns the response message, suspending until the RPC completes - * with [`Status.OK`][Status]. If the RPC completes with another status, a corresponding - * [StatusException] is thrown. If this coroutine is cancelled, the RPC is also cancelled - * with the corresponding exception as a cause. - * - * @param request The request message to send to the server. - * - * @param headers Metadata to attach to the request. Most users will not need this. - * - * @return The single response from the server. - */ - public suspend fun markPatrolAppServiceReady(request: Contracts.Empty, headers: Metadata = - Metadata()): Contracts.Empty = unaryRpc( - channel, - NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod(), - request, - callOptions, - headers - ) - } - - /** - * Skeletal implementation of the patrol.NativeAutomator service based on Kotlin coroutines. - */ - public abstract class NativeAutomatorCoroutineImplBase( - coroutineContext: CoroutineContext = EmptyCoroutineContext, - ) : AbstractCoroutineServerImpl(coroutineContext) { - /** - * Returns the response to an RPC for patrol.NativeAutomator.initialize. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun initialize(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.initialize is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.configure. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun configure(request: Contracts.ConfigureRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.configure is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.pressHome. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun pressHome(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.pressHome is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.pressBack. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun pressBack(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.pressBack is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.pressRecentApps. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun pressRecentApps(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.pressRecentApps is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.doublePressRecentApps. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun doublePressRecentApps(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.doublePressRecentApps is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.openApp. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun openApp(request: Contracts.OpenAppRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openApp is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.openQuickSettings. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openQuickSettings is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.getNativeViews. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun getNativeViews(request: Contracts.GetNativeViewsRequest): - Contracts.GetNativeViewsResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.getNativeViews is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.tap. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun tap(request: Contracts.TapRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.tap is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.doubleTap. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun doubleTap(request: Contracts.TapRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.doubleTap is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enterText. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enterText(request: Contracts.EnterTextRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enterText is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.swipe. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun swipe(request: Contracts.SwipeRequest): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.swipe is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.waitUntilVisible. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.waitUntilVisible is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableAirplaneMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableAirplaneMode(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableAirplaneMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableAirplaneMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableAirplaneMode(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableAirplaneMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableWiFi. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableWiFi(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableWiFi is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableWiFi. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableWiFi(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableWiFi is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableCellular. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableCellular(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableCellular is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableCellular. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableCellular(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableCellular is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableBluetooth. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableBluetooth(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableBluetooth is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableBluetooth. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableBluetooth(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableBluetooth is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.enableDarkMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun enableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.enableDarkMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.disableDarkMode. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun disableDarkMode(request: Contracts.DarkModeRequest): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.disableDarkMode is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.openNotifications. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun openNotifications(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.openNotifications is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.closeNotifications. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun closeNotifications(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.closeNotifications is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.closeHeadsUpNotification. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun closeHeadsUpNotification(request: Contracts.Empty): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.closeHeadsUpNotification is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.getNotifications. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun getNotifications(request: Contracts.GetNotificationsRequest): - Contracts.GetNotificationsResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.getNotifications is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.tapOnNotification. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun tapOnNotification(request: Contracts.TapOnNotificationRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.tapOnNotification is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.isPermissionDialogVisible. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend - fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): - Contracts.PermissionDialogVisibleResponse = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.isPermissionDialogVisible is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.handlePermissionDialog. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun handlePermissionDialog(request: Contracts.HandlePermissionRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.handlePermissionDialog is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.setLocationAccuracy. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest): - Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.setLocationAccuracy is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.debug. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun debug(request: Contracts.Empty): Contracts.Empty = throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.debug is unimplemented")) - - /** - * Returns the response to an RPC for patrol.NativeAutomator.markPatrolAppServiceReady. - * - * If this method fails with a [StatusException], the RPC will fail with the corresponding - * [Status]. If this method fails with a [java.util.concurrent.CancellationException], the RPC - * will fail - * with status `Status.CANCELLED`. If this method fails for any other reason, the RPC will - * fail with `Status.UNKNOWN` with the exception as a cause. - * - * @param request The request from the client. - */ - public open suspend fun markPatrolAppServiceReady(request: Contracts.Empty): Contracts.Empty = - throw - StatusException(UNIMPLEMENTED.withDescription("Method patrol.NativeAutomator.markPatrolAppServiceReady is unimplemented")) - - public final override fun bindService(): ServerServiceDefinition = - builder(NativeAutomatorGrpc.getServiceDescriptor()) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getInitializeMethod(), - implementation = ::initialize - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getConfigureMethod(), - implementation = ::configure - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getPressHomeMethod(), - implementation = ::pressHome - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getPressBackMethod(), - implementation = ::pressBack - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getPressRecentAppsMethod(), - implementation = ::pressRecentApps - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDoublePressRecentAppsMethod(), - implementation = ::doublePressRecentApps - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getOpenAppMethod(), - implementation = ::openApp - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getOpenQuickSettingsMethod(), - implementation = ::openQuickSettings - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getGetNativeViewsMethod(), - implementation = ::getNativeViews - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getTapMethod(), - implementation = ::tap - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDoubleTapMethod(), - implementation = ::doubleTap - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnterTextMethod(), - implementation = ::enterText - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getSwipeMethod(), - implementation = ::swipe - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getWaitUntilVisibleMethod(), - implementation = ::waitUntilVisible - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableAirplaneModeMethod(), - implementation = ::enableAirplaneMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableAirplaneModeMethod(), - implementation = ::disableAirplaneMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableWiFiMethod(), - implementation = ::enableWiFi - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableWiFiMethod(), - implementation = ::disableWiFi - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableCellularMethod(), - implementation = ::enableCellular - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableCellularMethod(), - implementation = ::disableCellular - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableBluetoothMethod(), - implementation = ::enableBluetooth - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableBluetoothMethod(), - implementation = ::disableBluetooth - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getEnableDarkModeMethod(), - implementation = ::enableDarkMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDisableDarkModeMethod(), - implementation = ::disableDarkMode - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getOpenNotificationsMethod(), - implementation = ::openNotifications - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getCloseNotificationsMethod(), - implementation = ::closeNotifications - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod(), - implementation = ::closeHeadsUpNotification - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getGetNotificationsMethod(), - implementation = ::getNotifications - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getTapOnNotificationMethod(), - implementation = ::tapOnNotification - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod(), - implementation = ::isPermissionDialogVisible - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getHandlePermissionDialogMethod(), - implementation = ::handlePermissionDialog - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getSetLocationAccuracyMethod(), - implementation = ::setLocationAccuracy - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getDebugMethod(), - implementation = ::debug - )) - .addMethod(unaryServerMethodDefinition( - context = this.context, - descriptor = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod(), - implementation = ::markPatrolAppServiceReady - )).build() - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt deleted file mode 100644 index 10cc09af0..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ContractsKt.kt +++ /dev/null @@ -1,7 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt deleted file mode 100644 index 7dbc07e61..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DarkModeRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedarkModeRequest") -public inline fun darkModeRequest(block: pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DarkModeRequest = - pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DarkModeRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DarkModeRequest` - */ -public object DarkModeRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DarkModeRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DarkModeRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DarkModeRequest = _builder.build() - - /** - * `string appId = 1;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 1;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DarkModeRequest.copy(block: pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DarkModeRequest = - pl.leancode.patrol.contracts.DarkModeRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt deleted file mode 100644 index d9213b71c..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestCaseKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartTestCase") -public inline fun dartTestCase(block: pl.leancode.patrol.contracts.DartTestCaseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestCase = - pl.leancode.patrol.contracts.DartTestCaseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartTestCase.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartTestCase` - */ -public object DartTestCaseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartTestCase.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartTestCase = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartTestCase.copy(block: pl.leancode.patrol.contracts.DartTestCaseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestCase = - pl.leancode.patrol.contracts.DartTestCaseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt deleted file mode 100644 index 2bf1e489c..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/DartTestGroupKt.kt +++ /dev/null @@ -1,192 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializedartTestGroup") -public inline fun dartTestGroup(block: pl.leancode.patrol.contracts.DartTestGroupKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestGroup = - pl.leancode.patrol.contracts.DartTestGroupKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.DartTestGroup.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.DartTestGroup` - */ -public object DartTestGroupKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.DartTestGroup.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.DartTestGroup = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class TestsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartTestCase tests = 2;` - */ - public val tests: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getTestsList() - ) - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param value The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addTests") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - _builder.addTests(value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param value The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignTests") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - add(value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param values The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllTests") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllTests(values) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param values The tests to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllTests") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - * @param index The index to set the value at. - * @param value The tests to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setTests") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartTestCase) { - _builder.setTests(index, value) - } - /** - * `repeated .patrol.DartTestCase tests = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearTests") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearTests() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class GroupsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.DartTestGroup groups = 3;` - */ - public val groups: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getGroupsList() - ) - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param value The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addGroups") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - _builder.addGroups(value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param value The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignGroups") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - add(value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param values The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllGroups") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllGroups(values) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param values The groups to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllGroups") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - * @param index The index to set the value at. - * @param value The groups to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setGroups") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.DartTestGroup) { - _builder.setGroups(index, value) - } - /** - * `repeated .patrol.DartTestGroup groups = 3;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearGroups") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearGroups() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.DartTestGroup.copy(block: pl.leancode.patrol.contracts.DartTestGroupKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.DartTestGroup = - pl.leancode.patrol.contracts.DartTestGroupKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt deleted file mode 100644 index c32da0a83..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EmptyKt.kt +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeempty") -public inline fun empty(block: pl.leancode.patrol.contracts.EmptyKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Empty = - pl.leancode.patrol.contracts.EmptyKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.Empty.newBuilder()).apply { block() }._build() -/** - * ``` - * We're defining our own Empty instead of using google.protobuf.Empty because - * the Dart plugin can't easily generate it. - * - * See: - * * https://github.com/google/protobuf.dart/issues/170 - * ``` - * - * Protobuf type `patrol.Empty` - */ -public object EmptyKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.Empty.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.Empty.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.Empty = _builder.build() - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.Empty.copy(block: pl.leancode.patrol.contracts.EmptyKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Empty = - pl.leancode.patrol.contracts.EmptyKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt deleted file mode 100644 index 8bf9729be..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/EnterTextRequestKt.kt +++ /dev/null @@ -1,149 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeenterTextRequest") -public inline fun enterTextRequest(block: pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.EnterTextRequest = - pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.EnterTextRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.EnterTextRequest` - */ -public object EnterTextRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.EnterTextRequest = _builder.build() - - /** - * `string data = 1;` - */ - public var data: kotlin.String - @JvmName("getData") - get() = _builder.getData() - @JvmName("setData") - set(value) { - _builder.setData(value) - } - /** - * `string data = 1;` - */ - public fun clearData() { - _builder.clearData() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - - /** - * uint32 index = 3; - */ - public var index: kotlin.Int - @JvmName("getIndex") - get() = _builder.getIndex() - @JvmName("setIndex") - set(value) { - _builder.setIndex(value) - } - /** - * `uint32 index = 3;` - */ - public fun clearIndex() { - _builder.clearIndex() - } - /** - * `uint32 index = 3;` - * @return Whether the index field is set. - */ - public fun hasIndex(): kotlin.Boolean { - return _builder.hasIndex() - } - - /** - * `.patrol.Selector selector = 4;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 4;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 4;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `.patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5;` - */ - public var keyboardBehavior: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.KeyboardBehavior - @JvmName("getKeyboardBehavior") - get() = _builder.getKeyboardBehavior() - @JvmName("setKeyboardBehavior") - set(value) { - _builder.setKeyboardBehavior(value) - } - public var keyboardBehaviorValue: kotlin.Int - @JvmName("getKeyboardBehaviorValue") - get() = _builder.getKeyboardBehaviorValue() - @JvmName("setKeyboardBehaviorValue") - set(value) { - _builder.setKeyboardBehaviorValue(value) - } - /** - * `.patrol.EnterTextRequest.KeyboardBehavior keyboardBehavior = 5;` - */ - public fun clearKeyboardBehavior() { - _builder.clearKeyboardBehavior() - } - public val findByCase: pl.leancode.patrol.contracts.Contracts.EnterTextRequest.FindByCase - @JvmName("getFindByCase") - get() = _builder.getFindByCase() - - public fun clearFindBy() { - _builder.clearFindBy() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.EnterTextRequest.copy(block: pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.EnterTextRequest = - pl.leancode.patrol.contracts.EnterTextRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.EnterTextRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt deleted file mode 100644 index d3afacc60..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsRequestKt.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNativeViewsRequest") -public inline fun getNativeViewsRequest(block: pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest = - pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNativeViewsRequest` - */ -public object GetNativeViewsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest = _builder.build() - - /** - * `.patrol.Selector selector = 1;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 1;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 1;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.copy(block: pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest = - pl.leancode.patrol.contracts.GetNativeViewsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt deleted file mode 100644 index 541907f43..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNativeViewsResponseKt.kt +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNativeViewsResponse") -public inline fun getNativeViewsResponse(block: pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse = - pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNativeViewsResponse` - */ -public object GetNativeViewsResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class NativeViewsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.NativeView nativeViews = 2;` - */ - public val nativeViews: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getNativeViewsList() - ) - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param value The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addNativeViews") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.addNativeViews(value) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param value The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignNativeViews") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - add(value) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param values The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllNativeViews") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllNativeViews(values) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param values The nativeViews to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllNativeViews") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - * @param index The index to set the value at. - * @param value The nativeViews to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setNativeViews") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.setNativeViews(index, value) - } - /** - * `repeated .patrol.NativeView nativeViews = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearNativeViews") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearNativeViews() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.copy(block: pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse = - pl.leancode.patrol.contracts.GetNativeViewsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt deleted file mode 100644 index 59cc82208..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsRequestKt.kt +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNotificationsRequest") -public inline fun getNotificationsRequest(block: pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest = - pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNotificationsRequest` - */ -public object GetNotificationsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest = _builder.build() - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.copy(block: pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest = - pl.leancode.patrol.contracts.GetNotificationsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt deleted file mode 100644 index 0283e2ca9..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/GetNotificationsResponseKt.kt +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializegetNotificationsResponse") -public inline fun getNotificationsResponse(block: pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse = - pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.GetNotificationsResponse` - */ -public object GetNotificationsResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class NotificationsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.Notification notifications = 2;` - */ - public val notifications: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getNotificationsList() - ) - /** - * `repeated .patrol.Notification notifications = 2;` - * @param value The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addNotifications") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.Notification) { - _builder.addNotifications(value) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param value The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignNotifications") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.Notification) { - add(value) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param values The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllNotifications") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllNotifications(values) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param values The notifications to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllNotifications") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.Notification notifications = 2;` - * @param index The index to set the value at. - * @param value The notifications to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setNotifications") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.Notification) { - _builder.setNotifications(index, value) - } - /** - * `repeated .patrol.Notification notifications = 2;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearNotifications") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearNotifications() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.copy(block: pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse = - pl.leancode.patrol.contracts.GetNotificationsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt deleted file mode 100644 index da7b66092..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/HandlePermissionRequestKt.kt +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializehandlePermissionRequest") -public inline fun handlePermissionRequest(block: pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest = - pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.HandlePermissionRequest` - */ -public object HandlePermissionRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest = _builder.build() - - /** - * `.patrol.HandlePermissionRequest.Code code = 1;` - */ - public var code: pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.Code - @JvmName("getCode") - get() = _builder.getCode() - @JvmName("setCode") - set(value) { - _builder.setCode(value) - } - public var codeValue: kotlin.Int - @JvmName("getCodeValue") - get() = _builder.getCodeValue() - @JvmName("setCodeValue") - set(value) { - _builder.setCodeValue(value) - } - /** - * `.patrol.HandlePermissionRequest.Code code = 1;` - */ - public fun clearCode() { - _builder.clearCode() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.copy(block: pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest = - pl.leancode.patrol.contracts.HandlePermissionRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt deleted file mode 100644 index b40a14ecc..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/ListDartTestsResponseKt.kt +++ /dev/null @@ -1,60 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializelistDartTestsResponse") -public inline fun listDartTestsResponse(block: pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = - pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.ListDartTestsResponse` - */ -public object ListDartTestsResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = _builder.build() - - /** - * `.patrol.DartTestGroup group = 1;` - */ - public var group: pl.leancode.patrol.contracts.Contracts.DartTestGroup - @JvmName("getGroup") - get() = _builder.getGroup() - @JvmName("setGroup") - set(value) { - _builder.setGroup(value) - } - /** - * `.patrol.DartTestGroup group = 1;` - */ - public fun clearGroup() { - _builder.clearGroup() - } - /** - * `.patrol.DartTestGroup group = 1;` - * @return Whether the group field is set. - */ - public fun hasGroup(): kotlin.Boolean { - return _builder.hasGroup() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.copy(block: pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse = - pl.leancode.patrol.contracts.ListDartTestsResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.ListDartTestsResponseOrBuilder.groupOrNull: pl.leancode.patrol.contracts.Contracts.DartTestGroup? - get() = if (hasGroup()) getGroup() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java deleted file mode 100644 index 0c299eb82..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorGrpc.java +++ /dev/null @@ -1,2732 +0,0 @@ -package pl.leancode.patrol.contracts; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.49.1)", - comments = "Source: contracts.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class NativeAutomatorGrpc { - - private NativeAutomatorGrpc() {} - - public static final String SERVICE_NAME = "patrol.NativeAutomator"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getInitializeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "initialize", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getInitializeMethod() { - io.grpc.MethodDescriptor getInitializeMethod; - if ((getInitializeMethod = NativeAutomatorGrpc.getInitializeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getInitializeMethod = NativeAutomatorGrpc.getInitializeMethod) == null) { - NativeAutomatorGrpc.getInitializeMethod = getInitializeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "initialize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getInitializeMethod; - } - - private static volatile io.grpc.MethodDescriptor getConfigureMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "configure", - requestType = pl.leancode.patrol.contracts.Contracts.ConfigureRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getConfigureMethod() { - io.grpc.MethodDescriptor getConfigureMethod; - if ((getConfigureMethod = NativeAutomatorGrpc.getConfigureMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getConfigureMethod = NativeAutomatorGrpc.getConfigureMethod) == null) { - NativeAutomatorGrpc.getConfigureMethod = getConfigureMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "configure")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.ConfigureRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getConfigureMethod; - } - - private static volatile io.grpc.MethodDescriptor getPressHomeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "pressHome", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPressHomeMethod() { - io.grpc.MethodDescriptor getPressHomeMethod; - if ((getPressHomeMethod = NativeAutomatorGrpc.getPressHomeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getPressHomeMethod = NativeAutomatorGrpc.getPressHomeMethod) == null) { - NativeAutomatorGrpc.getPressHomeMethod = getPressHomeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "pressHome")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getPressHomeMethod; - } - - private static volatile io.grpc.MethodDescriptor getPressBackMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "pressBack", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPressBackMethod() { - io.grpc.MethodDescriptor getPressBackMethod; - if ((getPressBackMethod = NativeAutomatorGrpc.getPressBackMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getPressBackMethod = NativeAutomatorGrpc.getPressBackMethod) == null) { - NativeAutomatorGrpc.getPressBackMethod = getPressBackMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "pressBack")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getPressBackMethod; - } - - private static volatile io.grpc.MethodDescriptor getPressRecentAppsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "pressRecentApps", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPressRecentAppsMethod() { - io.grpc.MethodDescriptor getPressRecentAppsMethod; - if ((getPressRecentAppsMethod = NativeAutomatorGrpc.getPressRecentAppsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getPressRecentAppsMethod = NativeAutomatorGrpc.getPressRecentAppsMethod) == null) { - NativeAutomatorGrpc.getPressRecentAppsMethod = getPressRecentAppsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "pressRecentApps")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getPressRecentAppsMethod; - } - - private static volatile io.grpc.MethodDescriptor getDoublePressRecentAppsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "doublePressRecentApps", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDoublePressRecentAppsMethod() { - io.grpc.MethodDescriptor getDoublePressRecentAppsMethod; - if ((getDoublePressRecentAppsMethod = NativeAutomatorGrpc.getDoublePressRecentAppsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDoublePressRecentAppsMethod = NativeAutomatorGrpc.getDoublePressRecentAppsMethod) == null) { - NativeAutomatorGrpc.getDoublePressRecentAppsMethod = getDoublePressRecentAppsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "doublePressRecentApps")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDoublePressRecentAppsMethod; - } - - private static volatile io.grpc.MethodDescriptor getOpenAppMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "openApp", - requestType = pl.leancode.patrol.contracts.Contracts.OpenAppRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getOpenAppMethod() { - io.grpc.MethodDescriptor getOpenAppMethod; - if ((getOpenAppMethod = NativeAutomatorGrpc.getOpenAppMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getOpenAppMethod = NativeAutomatorGrpc.getOpenAppMethod) == null) { - NativeAutomatorGrpc.getOpenAppMethod = getOpenAppMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "openApp")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.OpenAppRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getOpenAppMethod; - } - - private static volatile io.grpc.MethodDescriptor getOpenQuickSettingsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "openQuickSettings", - requestType = pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getOpenQuickSettingsMethod() { - io.grpc.MethodDescriptor getOpenQuickSettingsMethod; - if ((getOpenQuickSettingsMethod = NativeAutomatorGrpc.getOpenQuickSettingsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getOpenQuickSettingsMethod = NativeAutomatorGrpc.getOpenQuickSettingsMethod) == null) { - NativeAutomatorGrpc.getOpenQuickSettingsMethod = getOpenQuickSettingsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "openQuickSettings")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getOpenQuickSettingsMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetNativeViewsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "getNativeViews", - requestType = pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetNativeViewsMethod() { - io.grpc.MethodDescriptor getGetNativeViewsMethod; - if ((getGetNativeViewsMethod = NativeAutomatorGrpc.getGetNativeViewsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getGetNativeViewsMethod = NativeAutomatorGrpc.getGetNativeViewsMethod) == null) { - NativeAutomatorGrpc.getGetNativeViewsMethod = getGetNativeViewsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getNativeViews")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse.getDefaultInstance())) - .build(); - } - } - } - return getGetNativeViewsMethod; - } - - private static volatile io.grpc.MethodDescriptor getTapMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "tap", - requestType = pl.leancode.patrol.contracts.Contracts.TapRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getTapMethod() { - io.grpc.MethodDescriptor getTapMethod; - if ((getTapMethod = NativeAutomatorGrpc.getTapMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getTapMethod = NativeAutomatorGrpc.getTapMethod) == null) { - NativeAutomatorGrpc.getTapMethod = getTapMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "tap")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.TapRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getTapMethod; - } - - private static volatile io.grpc.MethodDescriptor getDoubleTapMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "doubleTap", - requestType = pl.leancode.patrol.contracts.Contracts.TapRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDoubleTapMethod() { - io.grpc.MethodDescriptor getDoubleTapMethod; - if ((getDoubleTapMethod = NativeAutomatorGrpc.getDoubleTapMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDoubleTapMethod = NativeAutomatorGrpc.getDoubleTapMethod) == null) { - NativeAutomatorGrpc.getDoubleTapMethod = getDoubleTapMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "doubleTap")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.TapRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDoubleTapMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnterTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enterText", - requestType = pl.leancode.patrol.contracts.Contracts.EnterTextRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnterTextMethod() { - io.grpc.MethodDescriptor getEnterTextMethod; - if ((getEnterTextMethod = NativeAutomatorGrpc.getEnterTextMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnterTextMethod = NativeAutomatorGrpc.getEnterTextMethod) == null) { - NativeAutomatorGrpc.getEnterTextMethod = getEnterTextMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enterText")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.EnterTextRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnterTextMethod; - } - - private static volatile io.grpc.MethodDescriptor getSwipeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "swipe", - requestType = pl.leancode.patrol.contracts.Contracts.SwipeRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getSwipeMethod() { - io.grpc.MethodDescriptor getSwipeMethod; - if ((getSwipeMethod = NativeAutomatorGrpc.getSwipeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getSwipeMethod = NativeAutomatorGrpc.getSwipeMethod) == null) { - NativeAutomatorGrpc.getSwipeMethod = getSwipeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "swipe")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.SwipeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getSwipeMethod; - } - - private static volatile io.grpc.MethodDescriptor getWaitUntilVisibleMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "waitUntilVisible", - requestType = pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getWaitUntilVisibleMethod() { - io.grpc.MethodDescriptor getWaitUntilVisibleMethod; - if ((getWaitUntilVisibleMethod = NativeAutomatorGrpc.getWaitUntilVisibleMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getWaitUntilVisibleMethod = NativeAutomatorGrpc.getWaitUntilVisibleMethod) == null) { - NativeAutomatorGrpc.getWaitUntilVisibleMethod = getWaitUntilVisibleMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "waitUntilVisible")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getWaitUntilVisibleMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableAirplaneModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableAirplaneMode", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableAirplaneModeMethod() { - io.grpc.MethodDescriptor getEnableAirplaneModeMethod; - if ((getEnableAirplaneModeMethod = NativeAutomatorGrpc.getEnableAirplaneModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableAirplaneModeMethod = NativeAutomatorGrpc.getEnableAirplaneModeMethod) == null) { - NativeAutomatorGrpc.getEnableAirplaneModeMethod = getEnableAirplaneModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableAirplaneMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableAirplaneModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableAirplaneModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableAirplaneMode", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableAirplaneModeMethod() { - io.grpc.MethodDescriptor getDisableAirplaneModeMethod; - if ((getDisableAirplaneModeMethod = NativeAutomatorGrpc.getDisableAirplaneModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableAirplaneModeMethod = NativeAutomatorGrpc.getDisableAirplaneModeMethod) == null) { - NativeAutomatorGrpc.getDisableAirplaneModeMethod = getDisableAirplaneModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableAirplaneMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableAirplaneModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableWiFiMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableWiFi", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableWiFiMethod() { - io.grpc.MethodDescriptor getEnableWiFiMethod; - if ((getEnableWiFiMethod = NativeAutomatorGrpc.getEnableWiFiMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableWiFiMethod = NativeAutomatorGrpc.getEnableWiFiMethod) == null) { - NativeAutomatorGrpc.getEnableWiFiMethod = getEnableWiFiMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableWiFi")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableWiFiMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableWiFiMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableWiFi", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableWiFiMethod() { - io.grpc.MethodDescriptor getDisableWiFiMethod; - if ((getDisableWiFiMethod = NativeAutomatorGrpc.getDisableWiFiMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableWiFiMethod = NativeAutomatorGrpc.getDisableWiFiMethod) == null) { - NativeAutomatorGrpc.getDisableWiFiMethod = getDisableWiFiMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableWiFi")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableWiFiMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableCellularMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableCellular", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableCellularMethod() { - io.grpc.MethodDescriptor getEnableCellularMethod; - if ((getEnableCellularMethod = NativeAutomatorGrpc.getEnableCellularMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableCellularMethod = NativeAutomatorGrpc.getEnableCellularMethod) == null) { - NativeAutomatorGrpc.getEnableCellularMethod = getEnableCellularMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableCellular")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableCellularMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableCellularMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableCellular", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableCellularMethod() { - io.grpc.MethodDescriptor getDisableCellularMethod; - if ((getDisableCellularMethod = NativeAutomatorGrpc.getDisableCellularMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableCellularMethod = NativeAutomatorGrpc.getDisableCellularMethod) == null) { - NativeAutomatorGrpc.getDisableCellularMethod = getDisableCellularMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableCellular")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableCellularMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableBluetoothMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableBluetooth", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableBluetoothMethod() { - io.grpc.MethodDescriptor getEnableBluetoothMethod; - if ((getEnableBluetoothMethod = NativeAutomatorGrpc.getEnableBluetoothMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableBluetoothMethod = NativeAutomatorGrpc.getEnableBluetoothMethod) == null) { - NativeAutomatorGrpc.getEnableBluetoothMethod = getEnableBluetoothMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableBluetooth")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableBluetoothMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableBluetoothMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableBluetooth", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableBluetoothMethod() { - io.grpc.MethodDescriptor getDisableBluetoothMethod; - if ((getDisableBluetoothMethod = NativeAutomatorGrpc.getDisableBluetoothMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableBluetoothMethod = NativeAutomatorGrpc.getDisableBluetoothMethod) == null) { - NativeAutomatorGrpc.getDisableBluetoothMethod = getDisableBluetoothMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableBluetooth")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableBluetoothMethod; - } - - private static volatile io.grpc.MethodDescriptor getEnableDarkModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "enableDarkMode", - requestType = pl.leancode.patrol.contracts.Contracts.DarkModeRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEnableDarkModeMethod() { - io.grpc.MethodDescriptor getEnableDarkModeMethod; - if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getEnableDarkModeMethod = NativeAutomatorGrpc.getEnableDarkModeMethod) == null) { - NativeAutomatorGrpc.getEnableDarkModeMethod = getEnableDarkModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "enableDarkMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getEnableDarkModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getDisableDarkModeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "disableDarkMode", - requestType = pl.leancode.patrol.contracts.Contracts.DarkModeRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDisableDarkModeMethod() { - io.grpc.MethodDescriptor getDisableDarkModeMethod; - if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDisableDarkModeMethod = NativeAutomatorGrpc.getDisableDarkModeMethod) == null) { - NativeAutomatorGrpc.getDisableDarkModeMethod = getDisableDarkModeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "disableDarkMode")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDisableDarkModeMethod; - } - - private static volatile io.grpc.MethodDescriptor getOpenNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "openNotifications", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getOpenNotificationsMethod() { - io.grpc.MethodDescriptor getOpenNotificationsMethod; - if ((getOpenNotificationsMethod = NativeAutomatorGrpc.getOpenNotificationsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getOpenNotificationsMethod = NativeAutomatorGrpc.getOpenNotificationsMethod) == null) { - NativeAutomatorGrpc.getOpenNotificationsMethod = getOpenNotificationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "openNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getOpenNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor getCloseNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "closeNotifications", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCloseNotificationsMethod() { - io.grpc.MethodDescriptor getCloseNotificationsMethod; - if ((getCloseNotificationsMethod = NativeAutomatorGrpc.getCloseNotificationsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getCloseNotificationsMethod = NativeAutomatorGrpc.getCloseNotificationsMethod) == null) { - NativeAutomatorGrpc.getCloseNotificationsMethod = getCloseNotificationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "closeNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getCloseNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor getCloseHeadsUpNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "closeHeadsUpNotification", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCloseHeadsUpNotificationMethod() { - io.grpc.MethodDescriptor getCloseHeadsUpNotificationMethod; - if ((getCloseHeadsUpNotificationMethod = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getCloseHeadsUpNotificationMethod = NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod) == null) { - NativeAutomatorGrpc.getCloseHeadsUpNotificationMethod = getCloseHeadsUpNotificationMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "closeHeadsUpNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getCloseHeadsUpNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetNotificationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "getNotifications", - requestType = pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetNotificationsMethod() { - io.grpc.MethodDescriptor getGetNotificationsMethod; - if ((getGetNotificationsMethod = NativeAutomatorGrpc.getGetNotificationsMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getGetNotificationsMethod = NativeAutomatorGrpc.getGetNotificationsMethod) == null) { - NativeAutomatorGrpc.getGetNotificationsMethod = getGetNotificationsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getNotifications")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse.getDefaultInstance())) - .build(); - } - } - } - return getGetNotificationsMethod; - } - - private static volatile io.grpc.MethodDescriptor getTapOnNotificationMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "tapOnNotification", - requestType = pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getTapOnNotificationMethod() { - io.grpc.MethodDescriptor getTapOnNotificationMethod; - if ((getTapOnNotificationMethod = NativeAutomatorGrpc.getTapOnNotificationMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getTapOnNotificationMethod = NativeAutomatorGrpc.getTapOnNotificationMethod) == null) { - NativeAutomatorGrpc.getTapOnNotificationMethod = getTapOnNotificationMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "tapOnNotification")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getTapOnNotificationMethod; - } - - private static volatile io.grpc.MethodDescriptor getIsPermissionDialogVisibleMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "isPermissionDialogVisible", - requestType = pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getIsPermissionDialogVisibleMethod() { - io.grpc.MethodDescriptor getIsPermissionDialogVisibleMethod; - if ((getIsPermissionDialogVisibleMethod = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getIsPermissionDialogVisibleMethod = NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod) == null) { - NativeAutomatorGrpc.getIsPermissionDialogVisibleMethod = getIsPermissionDialogVisibleMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "isPermissionDialogVisible")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.getDefaultInstance())) - .build(); - } - } - } - return getIsPermissionDialogVisibleMethod; - } - - private static volatile io.grpc.MethodDescriptor getHandlePermissionDialogMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "handlePermissionDialog", - requestType = pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getHandlePermissionDialogMethod() { - io.grpc.MethodDescriptor getHandlePermissionDialogMethod; - if ((getHandlePermissionDialogMethod = NativeAutomatorGrpc.getHandlePermissionDialogMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getHandlePermissionDialogMethod = NativeAutomatorGrpc.getHandlePermissionDialogMethod) == null) { - NativeAutomatorGrpc.getHandlePermissionDialogMethod = getHandlePermissionDialogMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "handlePermissionDialog")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getHandlePermissionDialogMethod; - } - - private static volatile io.grpc.MethodDescriptor getSetLocationAccuracyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "setLocationAccuracy", - requestType = pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getSetLocationAccuracyMethod() { - io.grpc.MethodDescriptor getSetLocationAccuracyMethod; - if ((getSetLocationAccuracyMethod = NativeAutomatorGrpc.getSetLocationAccuracyMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getSetLocationAccuracyMethod = NativeAutomatorGrpc.getSetLocationAccuracyMethod) == null) { - NativeAutomatorGrpc.getSetLocationAccuracyMethod = getSetLocationAccuracyMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "setLocationAccuracy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getSetLocationAccuracyMethod; - } - - private static volatile io.grpc.MethodDescriptor getDebugMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "debug", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDebugMethod() { - io.grpc.MethodDescriptor getDebugMethod; - if ((getDebugMethod = NativeAutomatorGrpc.getDebugMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getDebugMethod = NativeAutomatorGrpc.getDebugMethod) == null) { - NativeAutomatorGrpc.getDebugMethod = getDebugMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "debug")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getDebugMethod; - } - - private static volatile io.grpc.MethodDescriptor getMarkPatrolAppServiceReadyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "markPatrolAppServiceReady", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getMarkPatrolAppServiceReadyMethod() { - io.grpc.MethodDescriptor getMarkPatrolAppServiceReadyMethod; - if ((getMarkPatrolAppServiceReadyMethod = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod) == null) { - synchronized (NativeAutomatorGrpc.class) { - if ((getMarkPatrolAppServiceReadyMethod = NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod) == null) { - NativeAutomatorGrpc.getMarkPatrolAppServiceReadyMethod = getMarkPatrolAppServiceReadyMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "markPatrolAppServiceReady")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .build(); - } - } - } - return getMarkPatrolAppServiceReadyMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static NativeAutomatorStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public NativeAutomatorStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorStub(channel, callOptions); - } - }; - return NativeAutomatorStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static NativeAutomatorBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public NativeAutomatorBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorBlockingStub(channel, callOptions); - } - }; - return NativeAutomatorBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static NativeAutomatorFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public NativeAutomatorFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorFutureStub(channel, callOptions); - } - }; - return NativeAutomatorFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class NativeAutomatorImplBase implements io.grpc.BindableService { - - /** - */ - public void initialize(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getInitializeMethod(), responseObserver); - } - - /** - */ - public void configure(pl.leancode.patrol.contracts.Contracts.ConfigureRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getConfigureMethod(), responseObserver); - } - - /** - *
-     * general
-     * 
- */ - public void pressHome(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPressHomeMethod(), responseObserver); - } - - /** - */ - public void pressBack(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPressBackMethod(), responseObserver); - } - - /** - */ - public void pressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPressRecentAppsMethod(), responseObserver); - } - - /** - */ - public void doublePressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDoublePressRecentAppsMethod(), responseObserver); - } - - /** - */ - public void openApp(pl.leancode.patrol.contracts.Contracts.OpenAppRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenAppMethod(), responseObserver); - } - - /** - */ - public void openQuickSettings(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenQuickSettingsMethod(), responseObserver); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public void getNativeViews(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNativeViewsMethod(), responseObserver); - } - - /** - */ - public void tap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTapMethod(), responseObserver); - } - - /** - */ - public void doubleTap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDoubleTapMethod(), responseObserver); - } - - /** - */ - public void enterText(pl.leancode.patrol.contracts.Contracts.EnterTextRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnterTextMethod(), responseObserver); - } - - /** - */ - public void swipe(pl.leancode.patrol.contracts.Contracts.SwipeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSwipeMethod(), responseObserver); - } - - /** - */ - public void waitUntilVisible(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitUntilVisibleMethod(), responseObserver); - } - - /** - *
-     * services
-     * 
- */ - public void enableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableAirplaneModeMethod(), responseObserver); - } - - /** - */ - public void disableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableAirplaneModeMethod(), responseObserver); - } - - /** - */ - public void enableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableWiFiMethod(), responseObserver); - } - - /** - */ - public void disableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableWiFiMethod(), responseObserver); - } - - /** - */ - public void enableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableCellularMethod(), responseObserver); - } - - /** - */ - public void disableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableCellularMethod(), responseObserver); - } - - /** - */ - public void enableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableBluetoothMethod(), responseObserver); - } - - /** - */ - public void disableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableBluetoothMethod(), responseObserver); - } - - /** - */ - public void enableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEnableDarkModeMethod(), responseObserver); - } - - /** - */ - public void disableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDisableDarkModeMethod(), responseObserver); - } - - /** - *
-     * notifications
-     * 
- */ - public void openNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenNotificationsMethod(), responseObserver); - } - - /** - */ - public void closeNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloseNotificationsMethod(), responseObserver); - } - - /** - */ - public void closeHeadsUpNotification(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloseHeadsUpNotificationMethod(), responseObserver); - } - - /** - */ - public void getNotifications(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetNotificationsMethod(), responseObserver); - } - - /** - */ - public void tapOnNotification(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTapOnNotificationMethod(), responseObserver); - } - - /** - *
-     * permissions
-     * 
- */ - public void isPermissionDialogVisible(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIsPermissionDialogVisibleMethod(), responseObserver); - } - - /** - */ - public void handlePermissionDialog(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getHandlePermissionDialogMethod(), responseObserver); - } - - /** - */ - public void setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetLocationAccuracyMethod(), responseObserver); - } - - /** - *
-     * other
-     * 
- */ - public void debug(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDebugMethod(), responseObserver); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public void markPatrolAppServiceReady(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMarkPatrolAppServiceReadyMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getInitializeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_INITIALIZE))) - .addMethod( - getConfigureMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.ConfigureRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_CONFIGURE))) - .addMethod( - getPressHomeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_PRESS_HOME))) - .addMethod( - getPressBackMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_PRESS_BACK))) - .addMethod( - getPressRecentAppsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_PRESS_RECENT_APPS))) - .addMethod( - getDoublePressRecentAppsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DOUBLE_PRESS_RECENT_APPS))) - .addMethod( - getOpenAppMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.OpenAppRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_OPEN_APP))) - .addMethod( - getOpenQuickSettingsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_OPEN_QUICK_SETTINGS))) - .addMethod( - getGetNativeViewsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest, - pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse>( - this, METHODID_GET_NATIVE_VIEWS))) - .addMethod( - getTapMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.TapRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_TAP))) - .addMethod( - getDoubleTapMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.TapRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DOUBLE_TAP))) - .addMethod( - getEnterTextMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.EnterTextRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENTER_TEXT))) - .addMethod( - getSwipeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.SwipeRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_SWIPE))) - .addMethod( - getWaitUntilVisibleMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_WAIT_UNTIL_VISIBLE))) - .addMethod( - getEnableAirplaneModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_AIRPLANE_MODE))) - .addMethod( - getDisableAirplaneModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_AIRPLANE_MODE))) - .addMethod( - getEnableWiFiMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_WI_FI))) - .addMethod( - getDisableWiFiMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_WI_FI))) - .addMethod( - getEnableCellularMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_CELLULAR))) - .addMethod( - getDisableCellularMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_CELLULAR))) - .addMethod( - getEnableBluetoothMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_BLUETOOTH))) - .addMethod( - getDisableBluetoothMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_BLUETOOTH))) - .addMethod( - getEnableDarkModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.DarkModeRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_ENABLE_DARK_MODE))) - .addMethod( - getDisableDarkModeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.DarkModeRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DISABLE_DARK_MODE))) - .addMethod( - getOpenNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_OPEN_NOTIFICATIONS))) - .addMethod( - getCloseNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_CLOSE_NOTIFICATIONS))) - .addMethod( - getCloseHeadsUpNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_CLOSE_HEADS_UP_NOTIFICATION))) - .addMethod( - getGetNotificationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest, - pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse>( - this, METHODID_GET_NOTIFICATIONS))) - .addMethod( - getTapOnNotificationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_TAP_ON_NOTIFICATION))) - .addMethod( - getIsPermissionDialogVisibleMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest, - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse>( - this, METHODID_IS_PERMISSION_DIALOG_VISIBLE))) - .addMethod( - getHandlePermissionDialogMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_HANDLE_PERMISSION_DIALOG))) - .addMethod( - getSetLocationAccuracyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_SET_LOCATION_ACCURACY))) - .addMethod( - getDebugMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_DEBUG))) - .addMethod( - getMarkPatrolAppServiceReadyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.Empty>( - this, METHODID_MARK_PATROL_APP_SERVICE_READY))) - .build(); - } - } - - /** - */ - public static final class NativeAutomatorStub extends io.grpc.stub.AbstractAsyncStub { - private NativeAutomatorStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected NativeAutomatorStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorStub(channel, callOptions); - } - - /** - */ - public void initialize(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getInitializeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void configure(pl.leancode.patrol.contracts.Contracts.ConfigureRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getConfigureMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * general
-     * 
- */ - public void pressHome(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPressHomeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void pressBack(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPressBackMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void pressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPressRecentAppsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void doublePressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDoublePressRecentAppsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void openApp(pl.leancode.patrol.contracts.Contracts.OpenAppRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getOpenAppMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void openQuickSettings(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getOpenQuickSettingsMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public void getNativeViews(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetNativeViewsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void tap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getTapMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void doubleTap(pl.leancode.patrol.contracts.Contracts.TapRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDoubleTapMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enterText(pl.leancode.patrol.contracts.Contracts.EnterTextRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnterTextMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void swipe(pl.leancode.patrol.contracts.Contracts.SwipeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSwipeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void waitUntilVisible(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getWaitUntilVisibleMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * services
-     * 
- */ - public void enableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableAirplaneModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableAirplaneModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableWiFiMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableWiFiMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableCellularMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableCellular(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableCellularMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableBluetoothMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableBluetoothMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void enableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void disableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * notifications
-     * 
- */ - public void openNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getOpenNotificationsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void closeNotifications(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCloseNotificationsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void closeHeadsUpNotification(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCloseHeadsUpNotificationMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getNotifications(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetNotificationsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void tapOnNotification(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getTapOnNotificationMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * permissions
-     * 
- */ - public void isPermissionDialogVisible(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getIsPermissionDialogVisibleMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void handlePermissionDialog(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getHandlePermissionDialogMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSetLocationAccuracyMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * other
-     * 
- */ - public void debug(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDebugMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public void markPatrolAppServiceReady(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getMarkPatrolAppServiceReadyMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class NativeAutomatorBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private NativeAutomatorBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected NativeAutomatorBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorBlockingStub(channel, callOptions); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty initialize(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getInitializeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty configure(pl.leancode.patrol.contracts.Contracts.ConfigureRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getConfigureMethod(), getCallOptions(), request); - } - - /** - *
-     * general
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty pressHome(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPressHomeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty pressBack(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPressBackMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty pressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPressRecentAppsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty doublePressRecentApps(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDoublePressRecentAppsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty openApp(pl.leancode.patrol.contracts.Contracts.OpenAppRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getOpenAppMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty openQuickSettings(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getOpenQuickSettingsMethod(), getCallOptions(), request); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.GetNativeViewsResponse getNativeViews(pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetNativeViewsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty tap(pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTapMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty doubleTap(pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDoubleTapMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enterText(pl.leancode.patrol.contracts.Contracts.EnterTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnterTextMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty swipe(pl.leancode.patrol.contracts.Contracts.SwipeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSwipeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty waitUntilVisible(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getWaitUntilVisibleMethod(), getCallOptions(), request); - } - - /** - *
-     * services
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty enableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableAirplaneModeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableAirplaneMode(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableAirplaneModeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableWiFiMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableWiFi(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableWiFiMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableCellular(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableCellularMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableCellular(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableCellularMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableBluetoothMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableBluetooth(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableBluetoothMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty enableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEnableDarkModeMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty disableDarkMode(pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDisableDarkModeMethod(), getCallOptions(), request); - } - - /** - *
-     * notifications
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty openNotifications(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getOpenNotificationsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty closeNotifications(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCloseNotificationsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty closeHeadsUpNotification(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCloseHeadsUpNotificationMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.GetNotificationsResponse getNotifications(pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetNotificationsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty tapOnNotification(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTapOnNotificationMethod(), getCallOptions(), request); - } - - /** - *
-     * permissions
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse isPermissionDialogVisible(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getIsPermissionDialogVisibleMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty handlePermissionDialog(pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getHandlePermissionDialogMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.Empty setLocationAccuracy(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSetLocationAccuracyMethod(), getCallOptions(), request); - } - - /** - *
-     * other
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty debug(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDebugMethod(), getCallOptions(), request); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public pl.leancode.patrol.contracts.Contracts.Empty markPatrolAppServiceReady(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getMarkPatrolAppServiceReadyMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class NativeAutomatorFutureStub extends io.grpc.stub.AbstractFutureStub { - private NativeAutomatorFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected NativeAutomatorFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new NativeAutomatorFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture initialize( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getInitializeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture configure( - pl.leancode.patrol.contracts.Contracts.ConfigureRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getConfigureMethod(), getCallOptions()), request); - } - - /** - *
-     * general
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture pressHome( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPressHomeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pressBack( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPressBackMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pressRecentApps( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPressRecentAppsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture doublePressRecentApps( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDoublePressRecentAppsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture openApp( - pl.leancode.patrol.contracts.Contracts.OpenAppRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getOpenAppMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture openQuickSettings( - pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getOpenQuickSettingsMethod(), getCallOptions()), request); - } - - /** - *
-     * general UI interaction
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getNativeViews( - pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetNativeViewsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture tap( - pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTapMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture doubleTap( - pl.leancode.patrol.contracts.Contracts.TapRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDoubleTapMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enterText( - pl.leancode.patrol.contracts.Contracts.EnterTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnterTextMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture swipe( - pl.leancode.patrol.contracts.Contracts.SwipeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSwipeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture waitUntilVisible( - pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getWaitUntilVisibleMethod(), getCallOptions()), request); - } - - /** - *
-     * services
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture enableAirplaneMode( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableAirplaneModeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableAirplaneMode( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableAirplaneModeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableWiFi( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableWiFiMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableWiFi( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableWiFiMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableCellular( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableCellularMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableCellular( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableCellularMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableBluetooth( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableBluetoothMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableBluetooth( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableBluetoothMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture enableDarkMode( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEnableDarkModeMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture disableDarkMode( - pl.leancode.patrol.contracts.Contracts.DarkModeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDisableDarkModeMethod(), getCallOptions()), request); - } - - /** - *
-     * notifications
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture openNotifications( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getOpenNotificationsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture closeNotifications( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCloseNotificationsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture closeHeadsUpNotification( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCloseHeadsUpNotificationMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getNotifications( - pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetNotificationsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture tapOnNotification( - pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTapOnNotificationMethod(), getCallOptions()), request); - } - - /** - *
-     * permissions
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture isPermissionDialogVisible( - pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getIsPermissionDialogVisibleMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture handlePermissionDialog( - pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getHandlePermissionDialogMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture setLocationAccuracy( - pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSetLocationAccuracyMethod(), getCallOptions()), request); - } - - /** - *
-     * other
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture debug( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDebugMethod(), getCallOptions()), request); - } - - /** - *
-     * TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture markPatrolAppServiceReady( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getMarkPatrolAppServiceReadyMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_INITIALIZE = 0; - private static final int METHODID_CONFIGURE = 1; - private static final int METHODID_PRESS_HOME = 2; - private static final int METHODID_PRESS_BACK = 3; - private static final int METHODID_PRESS_RECENT_APPS = 4; - private static final int METHODID_DOUBLE_PRESS_RECENT_APPS = 5; - private static final int METHODID_OPEN_APP = 6; - private static final int METHODID_OPEN_QUICK_SETTINGS = 7; - private static final int METHODID_GET_NATIVE_VIEWS = 8; - private static final int METHODID_TAP = 9; - private static final int METHODID_DOUBLE_TAP = 10; - private static final int METHODID_ENTER_TEXT = 11; - private static final int METHODID_SWIPE = 12; - private static final int METHODID_WAIT_UNTIL_VISIBLE = 13; - private static final int METHODID_ENABLE_AIRPLANE_MODE = 14; - private static final int METHODID_DISABLE_AIRPLANE_MODE = 15; - private static final int METHODID_ENABLE_WI_FI = 16; - private static final int METHODID_DISABLE_WI_FI = 17; - private static final int METHODID_ENABLE_CELLULAR = 18; - private static final int METHODID_DISABLE_CELLULAR = 19; - private static final int METHODID_ENABLE_BLUETOOTH = 20; - private static final int METHODID_DISABLE_BLUETOOTH = 21; - private static final int METHODID_ENABLE_DARK_MODE = 22; - private static final int METHODID_DISABLE_DARK_MODE = 23; - private static final int METHODID_OPEN_NOTIFICATIONS = 24; - private static final int METHODID_CLOSE_NOTIFICATIONS = 25; - private static final int METHODID_CLOSE_HEADS_UP_NOTIFICATION = 26; - private static final int METHODID_GET_NOTIFICATIONS = 27; - private static final int METHODID_TAP_ON_NOTIFICATION = 28; - private static final int METHODID_IS_PERMISSION_DIALOG_VISIBLE = 29; - private static final int METHODID_HANDLE_PERMISSION_DIALOG = 30; - private static final int METHODID_SET_LOCATION_ACCURACY = 31; - private static final int METHODID_DEBUG = 32; - private static final int METHODID_MARK_PATROL_APP_SERVICE_READY = 33; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final NativeAutomatorImplBase serviceImpl; - private final int methodId; - - MethodHandlers(NativeAutomatorImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_INITIALIZE: - serviceImpl.initialize((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CONFIGURE: - serviceImpl.configure((pl.leancode.patrol.contracts.Contracts.ConfigureRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PRESS_HOME: - serviceImpl.pressHome((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PRESS_BACK: - serviceImpl.pressBack((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PRESS_RECENT_APPS: - serviceImpl.pressRecentApps((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DOUBLE_PRESS_RECENT_APPS: - serviceImpl.doublePressRecentApps((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_OPEN_APP: - serviceImpl.openApp((pl.leancode.patrol.contracts.Contracts.OpenAppRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_OPEN_QUICK_SETTINGS: - serviceImpl.openQuickSettings((pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_NATIVE_VIEWS: - serviceImpl.getNativeViews((pl.leancode.patrol.contracts.Contracts.GetNativeViewsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_TAP: - serviceImpl.tap((pl.leancode.patrol.contracts.Contracts.TapRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DOUBLE_TAP: - serviceImpl.doubleTap((pl.leancode.patrol.contracts.Contracts.TapRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENTER_TEXT: - serviceImpl.enterText((pl.leancode.patrol.contracts.Contracts.EnterTextRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SWIPE: - serviceImpl.swipe((pl.leancode.patrol.contracts.Contracts.SwipeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_WAIT_UNTIL_VISIBLE: - serviceImpl.waitUntilVisible((pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_AIRPLANE_MODE: - serviceImpl.enableAirplaneMode((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_AIRPLANE_MODE: - serviceImpl.disableAirplaneMode((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_WI_FI: - serviceImpl.enableWiFi((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_WI_FI: - serviceImpl.disableWiFi((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_CELLULAR: - serviceImpl.enableCellular((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_CELLULAR: - serviceImpl.disableCellular((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_BLUETOOTH: - serviceImpl.enableBluetooth((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_BLUETOOTH: - serviceImpl.disableBluetooth((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ENABLE_DARK_MODE: - serviceImpl.enableDarkMode((pl.leancode.patrol.contracts.Contracts.DarkModeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DISABLE_DARK_MODE: - serviceImpl.disableDarkMode((pl.leancode.patrol.contracts.Contracts.DarkModeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_OPEN_NOTIFICATIONS: - serviceImpl.openNotifications((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CLOSE_NOTIFICATIONS: - serviceImpl.closeNotifications((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CLOSE_HEADS_UP_NOTIFICATION: - serviceImpl.closeHeadsUpNotification((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_NOTIFICATIONS: - serviceImpl.getNotifications((pl.leancode.patrol.contracts.Contracts.GetNotificationsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_TAP_ON_NOTIFICATION: - serviceImpl.tapOnNotification((pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_IS_PERMISSION_DIALOG_VISIBLE: - serviceImpl.isPermissionDialogVisible((pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_HANDLE_PERMISSION_DIALOG: - serviceImpl.handlePermissionDialog((pl.leancode.patrol.contracts.Contracts.HandlePermissionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SET_LOCATION_ACCURACY: - serviceImpl.setLocationAccuracy((pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DEBUG: - serviceImpl.debug((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_MARK_PATROL_APP_SERVICE_READY: - serviceImpl.markPatrolAppServiceReady((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (NativeAutomatorGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .addMethod(getInitializeMethod()) - .addMethod(getConfigureMethod()) - .addMethod(getPressHomeMethod()) - .addMethod(getPressBackMethod()) - .addMethod(getPressRecentAppsMethod()) - .addMethod(getDoublePressRecentAppsMethod()) - .addMethod(getOpenAppMethod()) - .addMethod(getOpenQuickSettingsMethod()) - .addMethod(getGetNativeViewsMethod()) - .addMethod(getTapMethod()) - .addMethod(getDoubleTapMethod()) - .addMethod(getEnterTextMethod()) - .addMethod(getSwipeMethod()) - .addMethod(getWaitUntilVisibleMethod()) - .addMethod(getEnableAirplaneModeMethod()) - .addMethod(getDisableAirplaneModeMethod()) - .addMethod(getEnableWiFiMethod()) - .addMethod(getDisableWiFiMethod()) - .addMethod(getEnableCellularMethod()) - .addMethod(getDisableCellularMethod()) - .addMethod(getEnableBluetoothMethod()) - .addMethod(getDisableBluetoothMethod()) - .addMethod(getEnableDarkModeMethod()) - .addMethod(getDisableDarkModeMethod()) - .addMethod(getOpenNotificationsMethod()) - .addMethod(getCloseNotificationsMethod()) - .addMethod(getCloseHeadsUpNotificationMethod()) - .addMethod(getGetNotificationsMethod()) - .addMethod(getTapOnNotificationMethod()) - .addMethod(getIsPermissionDialogVisibleMethod()) - .addMethod(getHandlePermissionDialogMethod()) - .addMethod(getSetLocationAccuracyMethod()) - .addMethod(getDebugMethod()) - .addMethod(getMarkPatrolAppServiceReadyMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt new file mode 100644 index 000000000..a61c499a9 --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt @@ -0,0 +1,209 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package pl.leancode.patrol.contracts; + +import org.http4k.core.Response +import org.http4k.core.Method.POST +import org.http4k.routing.bind +import org.http4k.core.Status.Companion.OK +import org.http4k.routing.routes +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +abstract class NativeAutomatorServer { + abstract fun initialize() + abstract fun configure(request: Contracts.ConfigureRequest) + abstract fun pressHome() + abstract fun pressBack() + abstract fun pressRecentApps() + abstract fun doublePressRecentApps() + abstract fun openApp(request: Contracts.OpenAppRequest) + abstract fun openQuickSettings(request: Contracts.OpenQuickSettingsRequest) + abstract fun getNativeViews(request: Contracts.GetNativeViewsRequest): Contracts.GetNativeViewsResponse + abstract fun tap(request: Contracts.TapRequest) + abstract fun doubleTap(request: Contracts.TapRequest) + abstract fun enterText(request: Contracts.EnterTextRequest) + abstract fun swipe(request: Contracts.SwipeRequest) + abstract fun waitUntilVisible(request: Contracts.WaitUntilVisibleRequest) + abstract fun enableAirplaneMode() + abstract fun disableAirplaneMode() + abstract fun enableWiFi() + abstract fun disableWiFi() + abstract fun enableCellular() + abstract fun disableCellular() + abstract fun enableBluetooth() + abstract fun disableBluetooth() + abstract fun enableDarkMode(request: Contracts.DarkModeRequest) + abstract fun disableDarkMode(request: Contracts.DarkModeRequest) + abstract fun openNotifications() + abstract fun closeNotifications() + abstract fun closeHeadsUpNotification() + abstract fun getNotifications(request: Contracts.GetNotificationsRequest): Contracts.GetNotificationsResponse + abstract fun tapOnNotification(request: Contracts.TapOnNotificationRequest) + abstract fun isPermissionDialogVisible(request: Contracts.PermissionDialogVisibleRequest): Contracts.PermissionDialogVisibleResponse + abstract fun handlePermissionDialog(request: Contracts.HandlePermissionRequest) + abstract fun setLocationAccuracy(request: Contracts.SetLocationAccuracyRequest) + abstract fun debug() + abstract fun markPatrolAppServiceReady() + + val router = routes( + "initialize" bind POST to { + initialize() + Response(OK) + }, + "configure" bind POST to { + val body = json.decodeFromString(it.bodyString()) + configure(body) + Response(OK) + }, + "pressHome" bind POST to { + pressHome() + Response(OK) + }, + "pressBack" bind POST to { + pressBack() + Response(OK) + }, + "pressRecentApps" bind POST to { + pressRecentApps() + Response(OK) + }, + "doublePressRecentApps" bind POST to { + doublePressRecentApps() + Response(OK) + }, + "openApp" bind POST to { + val body = json.decodeFromString(it.bodyString()) + openApp(body) + Response(OK) + }, + "openQuickSettings" bind POST to { + val body = json.decodeFromString(it.bodyString()) + openQuickSettings(body) + Response(OK) + }, + "getNativeViews" bind POST to { + val body = json.decodeFromString(it.bodyString()) + val response = getNativeViews(body) + Response(OK).body(json.encodeToString(response)) + }, + "tap" bind POST to { + val body = json.decodeFromString(it.bodyString()) + tap(body) + Response(OK) + }, + "doubleTap" bind POST to { + val body = json.decodeFromString(it.bodyString()) + doubleTap(body) + Response(OK) + }, + "enterText" bind POST to { + val body = json.decodeFromString(it.bodyString()) + enterText(body) + Response(OK) + }, + "swipe" bind POST to { + val body = json.decodeFromString(it.bodyString()) + swipe(body) + Response(OK) + }, + "waitUntilVisible" bind POST to { + val body = json.decodeFromString(it.bodyString()) + waitUntilVisible(body) + Response(OK) + }, + "enableAirplaneMode" bind POST to { + enableAirplaneMode() + Response(OK) + }, + "disableAirplaneMode" bind POST to { + disableAirplaneMode() + Response(OK) + }, + "enableWiFi" bind POST to { + enableWiFi() + Response(OK) + }, + "disableWiFi" bind POST to { + disableWiFi() + Response(OK) + }, + "enableCellular" bind POST to { + enableCellular() + Response(OK) + }, + "disableCellular" bind POST to { + disableCellular() + Response(OK) + }, + "enableBluetooth" bind POST to { + enableBluetooth() + Response(OK) + }, + "disableBluetooth" bind POST to { + disableBluetooth() + Response(OK) + }, + "enableDarkMode" bind POST to { + val body = json.decodeFromString(it.bodyString()) + enableDarkMode(body) + Response(OK) + }, + "disableDarkMode" bind POST to { + val body = json.decodeFromString(it.bodyString()) + disableDarkMode(body) + Response(OK) + }, + "openNotifications" bind POST to { + openNotifications() + Response(OK) + }, + "closeNotifications" bind POST to { + closeNotifications() + Response(OK) + }, + "closeHeadsUpNotification" bind POST to { + closeHeadsUpNotification() + Response(OK) + }, + "getNotifications" bind POST to { + val body = json.decodeFromString(it.bodyString()) + val response = getNotifications(body) + Response(OK).body(json.encodeToString(response)) + }, + "tapOnNotification" bind POST to { + val body = json.decodeFromString(it.bodyString()) + tapOnNotification(body) + Response(OK) + }, + "isPermissionDialogVisible" bind POST to { + val body = json.decodeFromString(it.bodyString()) + val response = isPermissionDialogVisible(body) + Response(OK).body(json.encodeToString(response)) + }, + "handlePermissionDialog" bind POST to { + val body = json.decodeFromString(it.bodyString()) + handlePermissionDialog(body) + Response(OK) + }, + "setLocationAccuracy" bind POST to { + val body = json.decodeFromString(it.bodyString()) + setLocationAccuracy(body) + Response(OK) + }, + "debug" bind POST to { + debug() + Response(OK) + }, + "markPatrolAppServiceReady" bind POST to { + markPatrolAppServiceReady() + Response(OK) + } + ) + + private val json = Json { ignoreUnknownKeys = true } +} + diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt deleted file mode 100644 index 504ff26c8..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeViewKt.kt +++ /dev/null @@ -1,246 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializenativeView") -public inline fun nativeView(block: pl.leancode.patrol.contracts.NativeViewKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.NativeView = - pl.leancode.patrol.contracts.NativeViewKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.NativeView.newBuilder()).apply { block() }._build() -/** - * ``` - * Represents a native UI control. - * - * On Android, this is `android.view.View`. - * ``` - * - * Protobuf type `patrol.NativeView` - */ -public object NativeViewKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.NativeView.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.NativeView.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.NativeView = _builder.build() - - /** - * `string className = 1;` - */ - public var className: kotlin.String - @JvmName("getClassName") - get() = _builder.getClassName() - @JvmName("setClassName") - set(value) { - _builder.setClassName(value) - } - /** - * `string className = 1;` - */ - public fun clearClassName() { - _builder.clearClassName() - } - - /** - * `string text = 2;` - */ - public var text: kotlin.String - @JvmName("getText") - get() = _builder.getText() - @JvmName("setText") - set(value) { - _builder.setText(value) - } - /** - * `string text = 2;` - */ - public fun clearText() { - _builder.clearText() - } - - /** - * `string contentDescription = 3;` - */ - public var contentDescription: kotlin.String - @JvmName("getContentDescription") - get() = _builder.getContentDescription() - @JvmName("setContentDescription") - set(value) { - _builder.setContentDescription(value) - } - /** - * `string contentDescription = 3;` - */ - public fun clearContentDescription() { - _builder.clearContentDescription() - } - - /** - * bool focused = 4; - */ - public var focused: kotlin.Boolean - @JvmName("getFocused") - get() = _builder.getFocused() - @JvmName("setFocused") - set(value) { - _builder.setFocused(value) - } - /** - * `bool focused = 4;` - */ - public fun clearFocused() { - _builder.clearFocused() - } - - /** - * bool enabled = 5; - */ - public var enabled: kotlin.Boolean - @JvmName("getEnabled") - get() = _builder.getEnabled() - @JvmName("setEnabled") - set(value) { - _builder.setEnabled(value) - } - /** - * `bool enabled = 5;` - */ - public fun clearEnabled() { - _builder.clearEnabled() - } - - /** - * int32 childCount = 6; - */ - public var childCount: kotlin.Int - @JvmName("getChildCount") - get() = _builder.getChildCount() - @JvmName("setChildCount") - set(value) { - _builder.setChildCount(value) - } - /** - * `int32 childCount = 6;` - */ - public fun clearChildCount() { - _builder.clearChildCount() - } - - /** - * `string resourceName = 7;` - */ - public var resourceName: kotlin.String - @JvmName("getResourceName") - get() = _builder.getResourceName() - @JvmName("setResourceName") - set(value) { - _builder.setResourceName(value) - } - /** - * `string resourceName = 7;` - */ - public fun clearResourceName() { - _builder.clearResourceName() - } - - /** - * `string applicationPackage = 8;` - */ - public var applicationPackage: kotlin.String - @JvmName("getApplicationPackage") - get() = _builder.getApplicationPackage() - @JvmName("setApplicationPackage") - set(value) { - _builder.setApplicationPackage(value) - } - /** - * `string applicationPackage = 8;` - */ - public fun clearApplicationPackage() { - _builder.clearApplicationPackage() - } - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class ChildrenProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `repeated .patrol.NativeView children = 9;` - */ - public val children: com.google.protobuf.kotlin.DslList - @kotlin.jvm.JvmSynthetic - get() = com.google.protobuf.kotlin.DslList( - _builder.getChildrenList() - ) - /** - * `repeated .patrol.NativeView children = 9;` - * @param value The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addChildren") - public fun com.google.protobuf.kotlin.DslList.add(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.addChildren(value) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param value The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignChildren") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: pl.leancode.patrol.contracts.Contracts.NativeView) { - add(value) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param values The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("addAllChildren") - public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) { - _builder.addAllChildren(values) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param values The children to add. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("plusAssignAllChildren") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) { - addAll(values) - } - /** - * `repeated .patrol.NativeView children = 9;` - * @param index The index to set the value at. - * @param value The children to set. - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("setChildren") - public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: pl.leancode.patrol.contracts.Contracts.NativeView) { - _builder.setChildren(index, value) - } - /** - * `repeated .patrol.NativeView children = 9;` - */ - @kotlin.jvm.JvmSynthetic - @kotlin.jvm.JvmName("clearChildren") - public fun com.google.protobuf.kotlin.DslList.clear() { - _builder.clearChildren() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.NativeView.copy(block: pl.leancode.patrol.contracts.NativeViewKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.NativeView = - pl.leancode.patrol.contracts.NativeViewKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt deleted file mode 100644 index 774b6401f..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NotificationKt.kt +++ /dev/null @@ -1,112 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializenotification") -public inline fun notification(block: pl.leancode.patrol.contracts.NotificationKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Notification = - pl.leancode.patrol.contracts.NotificationKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.Notification.newBuilder()).apply { block() }._build() -/** - * ``` - * Represents a notification visible in the notification shade. - * ``` - * - * Protobuf type `patrol.Notification` - */ -public object NotificationKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.Notification.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.Notification.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.Notification = _builder.build() - - /** - * `optional string appName = 1;` - */ - public var appName: kotlin.String - @JvmName("getAppName") - get() = _builder.getAppName() - @JvmName("setAppName") - set(value) { - _builder.setAppName(value) - } - /** - * `optional string appName = 1;` - */ - public fun clearAppName() { - _builder.clearAppName() - } - /** - * `optional string appName = 1;` - * @return Whether the appName field is set. - */ - public fun hasAppName(): kotlin.Boolean { - return _builder.hasAppName() - } - - /** - * `string title = 2;` - */ - public var title: kotlin.String - @JvmName("getTitle") - get() = _builder.getTitle() - @JvmName("setTitle") - set(value) { - _builder.setTitle(value) - } - /** - * `string title = 2;` - */ - public fun clearTitle() { - _builder.clearTitle() - } - - /** - * `string content = 3;` - */ - public var content: kotlin.String - @JvmName("getContent") - get() = _builder.getContent() - @JvmName("setContent") - set(value) { - _builder.setContent(value) - } - /** - * `string content = 3;` - */ - public fun clearContent() { - _builder.clearContent() - } - - /** - * `string raw = 4;` - */ - public var raw: kotlin.String - @JvmName("getRaw") - get() = _builder.getRaw() - @JvmName("setRaw") - set(value) { - _builder.setRaw(value) - } - /** - * `string raw = 4;` - */ - public fun clearRaw() { - _builder.clearRaw() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.Notification.copy(block: pl.leancode.patrol.contracts.NotificationKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Notification = - pl.leancode.patrol.contracts.NotificationKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt deleted file mode 100644 index 07edbbe77..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenAppRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeopenAppRequest") -public inline fun openAppRequest(block: pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenAppRequest = - pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.OpenAppRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.OpenAppRequest` - */ -public object OpenAppRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.OpenAppRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.OpenAppRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.OpenAppRequest = _builder.build() - - /** - * `string appId = 1;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 1;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.OpenAppRequest.copy(block: pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenAppRequest = - pl.leancode.patrol.contracts.OpenAppRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt deleted file mode 100644 index d53d15034..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/OpenQuickSettingsRequestKt.kt +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeopenQuickSettingsRequest") -public inline fun openQuickSettingsRequest(block: pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest = - pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.OpenQuickSettingsRequest` - */ -public object OpenQuickSettingsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest = _builder.build() - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest.copy(block: pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.OpenQuickSettingsRequest = - pl.leancode.patrol.contracts.OpenQuickSettingsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt new file mode 100644 index 000000000..5f39bd12e --- /dev/null +++ b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceClient.kt @@ -0,0 +1,61 @@ +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package pl.leancode.patrol.contracts; + +import com.squareup.okhttp.MediaType +import com.squareup.okhttp.OkHttpClient +import com.squareup.okhttp.Request +import com.squareup.okhttp.RequestBody +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import java.util.concurrent.TimeUnit + +class PatrolAppServiceClient(address: String, port: Int, private val timeout: Long, private val timeUnit: TimeUnit) { + + fun listDartTests(): Contracts.ListDartTestsResponse { + val response = performRequest("listDartTests") + return json.decodeFromString(response) + } + + fun runDartTest(request: Contracts.RunDartTestRequest): Contracts.RunDartTestResponse { + val response = performRequest("runDartTest", json.encodeToString(request)) + return json.decodeFromString(response) + } + + private fun performRequest(path: String, requestBody: String? = null): String { + val endpoint = "$serverUrl$path" + + val client = OkHttpClient().apply { + setConnectTimeout(timeout, timeUnit) + setReadTimeout(timeout, timeUnit) + setWriteTimeout(timeout, timeUnit) + } + + val request = Request.Builder() + .url(endpoint) + .also { + if (requestBody != null) { + it.post(RequestBody.create(jsonMediaType, requestBody)) + } + } + .build() + + val response = client.newCall(request).execute() + if (response.code() != 200) { + throw PatrolAppServiceClientException("Invalid response ${response.code()}, ${response?.body()?.string()}") + } + + return response.body().string() + } + + val serverUrl = "http://$address:$port/" + + private val json = Json { ignoreUnknownKeys = true } + + private val jsonMediaType = MediaType.parse("application/json; charset=utf-8") +} + +class PatrolAppServiceClientException(message: String) : Exception(message) diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java deleted file mode 100644 index a9cfa643a..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PatrolAppServiceGrpc.java +++ /dev/null @@ -1,312 +0,0 @@ -package pl.leancode.patrol.contracts; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.49.1)", - comments = "Source: contracts.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class PatrolAppServiceGrpc { - - private PatrolAppServiceGrpc() {} - - public static final String SERVICE_NAME = "patrol.PatrolAppService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getListDartTestsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "listDartTests", - requestType = pl.leancode.patrol.contracts.Contracts.Empty.class, - responseType = pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListDartTestsMethod() { - io.grpc.MethodDescriptor getListDartTestsMethod; - if ((getListDartTestsMethod = PatrolAppServiceGrpc.getListDartTestsMethod) == null) { - synchronized (PatrolAppServiceGrpc.class) { - if ((getListDartTestsMethod = PatrolAppServiceGrpc.getListDartTestsMethod) == null) { - PatrolAppServiceGrpc.getListDartTestsMethod = getListDartTestsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "listDartTests")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse.getDefaultInstance())) - .build(); - } - } - } - return getListDartTestsMethod; - } - - private static volatile io.grpc.MethodDescriptor getRunDartTestMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "runDartTest", - requestType = pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.class, - responseType = pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRunDartTestMethod() { - io.grpc.MethodDescriptor getRunDartTestMethod; - if ((getRunDartTestMethod = PatrolAppServiceGrpc.getRunDartTestMethod) == null) { - synchronized (PatrolAppServiceGrpc.class) { - if ((getRunDartTestMethod = PatrolAppServiceGrpc.getRunDartTestMethod) == null) { - PatrolAppServiceGrpc.getRunDartTestMethod = getRunDartTestMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "runDartTest")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller( - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.getDefaultInstance())) - .build(); - } - } - } - return getRunDartTestMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static PatrolAppServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PatrolAppServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceStub(channel, callOptions); - } - }; - return PatrolAppServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static PatrolAppServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PatrolAppServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceBlockingStub(channel, callOptions); - } - }; - return PatrolAppServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static PatrolAppServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PatrolAppServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceFutureStub(channel, callOptions); - } - }; - return PatrolAppServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class PatrolAppServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void listDartTests(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListDartTestsMethod(), responseObserver); - } - - /** - */ - public void runDartTest(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRunDartTestMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListDartTestsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.Empty, - pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse>( - this, METHODID_LIST_DART_TESTS))) - .addMethod( - getRunDartTestMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest, - pl.leancode.patrol.contracts.Contracts.RunDartTestResponse>( - this, METHODID_RUN_DART_TEST))) - .build(); - } - } - - /** - */ - public static final class PatrolAppServiceStub extends io.grpc.stub.AbstractAsyncStub { - private PatrolAppServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PatrolAppServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceStub(channel, callOptions); - } - - /** - */ - public void listDartTests(pl.leancode.patrol.contracts.Contracts.Empty request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListDartTestsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void runDartTest(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRunDartTestMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class PatrolAppServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private PatrolAppServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PatrolAppServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceBlockingStub(channel, callOptions); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.ListDartTestsResponse listDartTests(pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListDartTestsMethod(), getCallOptions(), request); - } - - /** - */ - public pl.leancode.patrol.contracts.Contracts.RunDartTestResponse runDartTest(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRunDartTestMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class PatrolAppServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private PatrolAppServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PatrolAppServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PatrolAppServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listDartTests( - pl.leancode.patrol.contracts.Contracts.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListDartTestsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture runDartTest( - pl.leancode.patrol.contracts.Contracts.RunDartTestRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRunDartTestMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_LIST_DART_TESTS = 0; - private static final int METHODID_RUN_DART_TEST = 1; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final PatrolAppServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(PatrolAppServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_LIST_DART_TESTS: - serviceImpl.listDartTests((pl.leancode.patrol.contracts.Contracts.Empty) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_RUN_DART_TEST: - serviceImpl.runDartTest((pl.leancode.patrol.contracts.Contracts.RunDartTestRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (PatrolAppServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .addMethod(getListDartTestsMethod()) - .addMethod(getRunDartTestMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt deleted file mode 100644 index 835a01708..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializepermissionDialogVisibleRequest") -public inline fun permissionDialogVisibleRequest(block: pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest = - pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.PermissionDialogVisibleRequest` - */ -public object PermissionDialogVisibleRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest = _builder.build() - - /** - * uint64 timeoutMillis = 1; - */ - public var timeoutMillis: kotlin.Long - @JvmName("getTimeoutMillis") - get() = _builder.getTimeoutMillis() - @JvmName("setTimeoutMillis") - set(value) { - _builder.setTimeoutMillis(value) - } - /** - * `uint64 timeoutMillis = 1;` - */ - public fun clearTimeoutMillis() { - _builder.clearTimeoutMillis() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest.copy(block: pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleRequest = - pl.leancode.patrol.contracts.PermissionDialogVisibleRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt deleted file mode 100644 index 905f21ce2..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/PermissionDialogVisibleResponseKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializepermissionDialogVisibleResponse") -public inline fun permissionDialogVisibleResponse(block: pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse = - pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.PermissionDialogVisibleResponse` - */ -public object PermissionDialogVisibleResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse = _builder.build() - - /** - * bool visible = 1; - */ - public var visible: kotlin.Boolean - @JvmName("getVisible") - get() = _builder.getVisible() - @JvmName("setVisible") - set(value) { - _builder.setVisible(value) - } - /** - * `bool visible = 1;` - */ - public fun clearVisible() { - _builder.clearVisible() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse.copy(block: pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.PermissionDialogVisibleResponse = - pl.leancode.patrol.contracts.PermissionDialogVisibleResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt deleted file mode 100644 index 27d883142..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestRequestKt.kt +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializerunDartTestRequest") -public inline fun runDartTestRequest(block: pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestRequest = - pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.RunDartTestRequest` - */ -public object RunDartTestRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.RunDartTestRequest = _builder.build() - - /** - * `string name = 1;` - */ - public var name: kotlin.String - @JvmName("getName") - get() = _builder.getName() - @JvmName("setName") - set(value) { - _builder.setName(value) - } - /** - * `string name = 1;` - */ - public fun clearName() { - _builder.clearName() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.RunDartTestRequest.copy(block: pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestRequest = - pl.leancode.patrol.contracts.RunDartTestRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt deleted file mode 100644 index 8ff168f8d..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/RunDartTestResponseKt.kt +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializerunDartTestResponse") -public inline fun runDartTestResponse(block: pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestResponse = - pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.RunDartTestResponse` - */ -public object RunDartTestResponseKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.RunDartTestResponse = _builder.build() - - /** - * `.patrol.RunDartTestResponse.Result result = 1;` - */ - public var result: pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.Result - @JvmName("getResult") - get() = _builder.getResult() - @JvmName("setResult") - set(value) { - _builder.setResult(value) - } - public var resultValue: kotlin.Int - @JvmName("getResultValue") - get() = _builder.getResultValue() - @JvmName("setResultValue") - set(value) { - _builder.setResultValue(value) - } - /** - * `.patrol.RunDartTestResponse.Result result = 1;` - */ - public fun clearResult() { - _builder.clearResult() - } - - /** - * `optional string details = 2;` - */ - public var details: kotlin.String - @JvmName("getDetails") - get() = _builder.getDetails() - @JvmName("setDetails") - set(value) { - _builder.setDetails(value) - } - /** - * `optional string details = 2;` - */ - public fun clearDetails() { - _builder.clearDetails() - } - /** - * `optional string details = 2;` - * @return Whether the details field is set. - */ - public fun hasDetails(): kotlin.Boolean { - return _builder.hasDetails() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.RunDartTestResponse.copy(block: pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.RunDartTestResponse = - pl.leancode.patrol.contracts.RunDartTestResponseKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt deleted file mode 100644 index 6929f62f5..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SelectorKt.kt +++ /dev/null @@ -1,321 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeselector") -public inline fun selector(block: pl.leancode.patrol.contracts.SelectorKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Selector = - pl.leancode.patrol.contracts.SelectorKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.Selector.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.Selector` - */ -public object SelectorKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.Selector.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.Selector.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.Selector = _builder.build() - - /** - * `optional string text = 1;` - */ - public var text: kotlin.String - @JvmName("getText") - get() = _builder.getText() - @JvmName("setText") - set(value) { - _builder.setText(value) - } - /** - * `optional string text = 1;` - */ - public fun clearText() { - _builder.clearText() - } - /** - * `optional string text = 1;` - * @return Whether the text field is set. - */ - public fun hasText(): kotlin.Boolean { - return _builder.hasText() - } - - /** - * `optional string textStartsWith = 2;` - */ - public var textStartsWith: kotlin.String - @JvmName("getTextStartsWith") - get() = _builder.getTextStartsWith() - @JvmName("setTextStartsWith") - set(value) { - _builder.setTextStartsWith(value) - } - /** - * `optional string textStartsWith = 2;` - */ - public fun clearTextStartsWith() { - _builder.clearTextStartsWith() - } - /** - * `optional string textStartsWith = 2;` - * @return Whether the textStartsWith field is set. - */ - public fun hasTextStartsWith(): kotlin.Boolean { - return _builder.hasTextStartsWith() - } - - /** - * `optional string textContains = 3;` - */ - public var textContains: kotlin.String - @JvmName("getTextContains") - get() = _builder.getTextContains() - @JvmName("setTextContains") - set(value) { - _builder.setTextContains(value) - } - /** - * `optional string textContains = 3;` - */ - public fun clearTextContains() { - _builder.clearTextContains() - } - /** - * `optional string textContains = 3;` - * @return Whether the textContains field is set. - */ - public fun hasTextContains(): kotlin.Boolean { - return _builder.hasTextContains() - } - - /** - * `optional string className = 4;` - */ - public var className: kotlin.String - @JvmName("getClassName") - get() = _builder.getClassName() - @JvmName("setClassName") - set(value) { - _builder.setClassName(value) - } - /** - * `optional string className = 4;` - */ - public fun clearClassName() { - _builder.clearClassName() - } - /** - * `optional string className = 4;` - * @return Whether the className field is set. - */ - public fun hasClassName(): kotlin.Boolean { - return _builder.hasClassName() - } - - /** - * `optional string contentDescription = 5;` - */ - public var contentDescription: kotlin.String - @JvmName("getContentDescription") - get() = _builder.getContentDescription() - @JvmName("setContentDescription") - set(value) { - _builder.setContentDescription(value) - } - /** - * `optional string contentDescription = 5;` - */ - public fun clearContentDescription() { - _builder.clearContentDescription() - } - /** - * `optional string contentDescription = 5;` - * @return Whether the contentDescription field is set. - */ - public fun hasContentDescription(): kotlin.Boolean { - return _builder.hasContentDescription() - } - - /** - * `optional string contentDescriptionStartsWith = 6;` - */ - public var contentDescriptionStartsWith: kotlin.String - @JvmName("getContentDescriptionStartsWith") - get() = _builder.getContentDescriptionStartsWith() - @JvmName("setContentDescriptionStartsWith") - set(value) { - _builder.setContentDescriptionStartsWith(value) - } - /** - * `optional string contentDescriptionStartsWith = 6;` - */ - public fun clearContentDescriptionStartsWith() { - _builder.clearContentDescriptionStartsWith() - } - /** - * `optional string contentDescriptionStartsWith = 6;` - * @return Whether the contentDescriptionStartsWith field is set. - */ - public fun hasContentDescriptionStartsWith(): kotlin.Boolean { - return _builder.hasContentDescriptionStartsWith() - } - - /** - * `optional string contentDescriptionContains = 7;` - */ - public var contentDescriptionContains: kotlin.String - @JvmName("getContentDescriptionContains") - get() = _builder.getContentDescriptionContains() - @JvmName("setContentDescriptionContains") - set(value) { - _builder.setContentDescriptionContains(value) - } - /** - * `optional string contentDescriptionContains = 7;` - */ - public fun clearContentDescriptionContains() { - _builder.clearContentDescriptionContains() - } - /** - * `optional string contentDescriptionContains = 7;` - * @return Whether the contentDescriptionContains field is set. - */ - public fun hasContentDescriptionContains(): kotlin.Boolean { - return _builder.hasContentDescriptionContains() - } - - /** - * `optional string resourceId = 8;` - */ - public var resourceId: kotlin.String - @JvmName("getResourceId") - get() = _builder.getResourceId() - @JvmName("setResourceId") - set(value) { - _builder.setResourceId(value) - } - /** - * `optional string resourceId = 8;` - */ - public fun clearResourceId() { - _builder.clearResourceId() - } - /** - * `optional string resourceId = 8;` - * @return Whether the resourceId field is set. - */ - public fun hasResourceId(): kotlin.Boolean { - return _builder.hasResourceId() - } - - /** - * optional uint32 instance = 9; - */ - public var instance: kotlin.Int - @JvmName("getInstance") - get() = _builder.getInstance() - @JvmName("setInstance") - set(value) { - _builder.setInstance(value) - } - /** - * `optional uint32 instance = 9;` - */ - public fun clearInstance() { - _builder.clearInstance() - } - /** - * `optional uint32 instance = 9;` - * @return Whether the instance field is set. - */ - public fun hasInstance(): kotlin.Boolean { - return _builder.hasInstance() - } - - /** - * optional bool enabled = 10; - */ - public var enabled: kotlin.Boolean - @JvmName("getEnabled") - get() = _builder.getEnabled() - @JvmName("setEnabled") - set(value) { - _builder.setEnabled(value) - } - /** - * `optional bool enabled = 10;` - */ - public fun clearEnabled() { - _builder.clearEnabled() - } - /** - * `optional bool enabled = 10;` - * @return Whether the enabled field is set. - */ - public fun hasEnabled(): kotlin.Boolean { - return _builder.hasEnabled() - } - - /** - * optional bool focused = 11; - */ - public var focused: kotlin.Boolean - @JvmName("getFocused") - get() = _builder.getFocused() - @JvmName("setFocused") - set(value) { - _builder.setFocused(value) - } - /** - * `optional bool focused = 11;` - */ - public fun clearFocused() { - _builder.clearFocused() - } - /** - * `optional bool focused = 11;` - * @return Whether the focused field is set. - */ - public fun hasFocused(): kotlin.Boolean { - return _builder.hasFocused() - } - - /** - * `optional string pkg = 12;` - */ - public var pkg: kotlin.String - @JvmName("getPkg") - get() = _builder.getPkg() - @JvmName("setPkg") - set(value) { - _builder.setPkg(value) - } - /** - * `optional string pkg = 12;` - */ - public fun clearPkg() { - _builder.clearPkg() - } - /** - * `optional string pkg = 12;` - * @return Whether the pkg field is set. - */ - public fun hasPkg(): kotlin.Boolean { - return _builder.hasPkg() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.Selector.copy(block: pl.leancode.patrol.contracts.SelectorKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.Selector = - pl.leancode.patrol.contracts.SelectorKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt deleted file mode 100644 index 9fdff5df0..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SetLocationAccuracyRequestKt.kt +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializesetLocationAccuracyRequest") -public inline fun setLocationAccuracyRequest(block: pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest = - pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.SetLocationAccuracyRequest` - */ -public object SetLocationAccuracyRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest = _builder.build() - - /** - * `.patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1;` - */ - public var locationAccuracy: pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.LocationAccuracy - @JvmName("getLocationAccuracy") - get() = _builder.getLocationAccuracy() - @JvmName("setLocationAccuracy") - set(value) { - _builder.setLocationAccuracy(value) - } - public var locationAccuracyValue: kotlin.Int - @JvmName("getLocationAccuracyValue") - get() = _builder.getLocationAccuracyValue() - @JvmName("setLocationAccuracyValue") - set(value) { - _builder.setLocationAccuracyValue(value) - } - /** - * `.patrol.SetLocationAccuracyRequest.LocationAccuracy locationAccuracy = 1;` - */ - public fun clearLocationAccuracy() { - _builder.clearLocationAccuracy() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest.copy(block: pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SetLocationAccuracyRequest = - pl.leancode.patrol.contracts.SetLocationAccuracyRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt deleted file mode 100644 index 426068eb9..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SubmitTestResultsRequestKt.kt +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializesubmitTestResultsRequest") -public inline fun submitTestResultsRequest(block: pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest = - pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.SubmitTestResultsRequest` - */ -public object SubmitTestResultsRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest = _builder.build() - - /** - * An uninstantiable, behaviorless type to represent the field in - * generics. - */ - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - public class ResultsProxy private constructor() : com.google.protobuf.kotlin.DslProxy() - /** - * `map results = 1;` - */ - public val results: com.google.protobuf.kotlin.DslMap - @kotlin.jvm.JvmSynthetic - @JvmName("getResultsMap") - get() = com.google.protobuf.kotlin.DslMap( - _builder.getResultsMap() - ) - /** - * `map results = 1;` - */ - @JvmName("putResults") - public fun com.google.protobuf.kotlin.DslMap - .put(key: kotlin.String, value: kotlin.String) { - _builder.putResults(key, value) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("setResults") - @Suppress("NOTHING_TO_INLINE") - public inline operator fun com.google.protobuf.kotlin.DslMap - .set(key: kotlin.String, value: kotlin.String) { - put(key, value) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("removeResults") - public fun com.google.protobuf.kotlin.DslMap - .remove(key: kotlin.String) { - _builder.removeResults(key) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("putAllResults") - public fun com.google.protobuf.kotlin.DslMap - .putAll(map: kotlin.collections.Map) { - _builder.putAllResults(map) - } - /** - * `map results = 1;` - */ - @kotlin.jvm.JvmSynthetic - @JvmName("clearResults") - public fun com.google.protobuf.kotlin.DslMap - .clear() { - _builder.clearResults() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest.copy(block: pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SubmitTestResultsRequest = - pl.leancode.patrol.contracts.SubmitTestResultsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt deleted file mode 100644 index 9a27c6879..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/SwipeRequestKt.kt +++ /dev/null @@ -1,135 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializeswipeRequest") -public inline fun swipeRequest(block: pl.leancode.patrol.contracts.SwipeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SwipeRequest = - pl.leancode.patrol.contracts.SwipeRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.SwipeRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.SwipeRequest` - */ -public object SwipeRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.SwipeRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.SwipeRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.SwipeRequest = _builder.build() - - /** - * float startX = 1; - */ - public var startX: kotlin.Float - @JvmName("getStartX") - get() = _builder.getStartX() - @JvmName("setStartX") - set(value) { - _builder.setStartX(value) - } - /** - * `float startX = 1;` - */ - public fun clearStartX() { - _builder.clearStartX() - } - - /** - * float startY = 2; - */ - public var startY: kotlin.Float - @JvmName("getStartY") - get() = _builder.getStartY() - @JvmName("setStartY") - set(value) { - _builder.setStartY(value) - } - /** - * `float startY = 2;` - */ - public fun clearStartY() { - _builder.clearStartY() - } - - /** - * float endX = 3; - */ - public var endX: kotlin.Float - @JvmName("getEndX") - get() = _builder.getEndX() - @JvmName("setEndX") - set(value) { - _builder.setEndX(value) - } - /** - * `float endX = 3;` - */ - public fun clearEndX() { - _builder.clearEndX() - } - - /** - * float endY = 4; - */ - public var endY: kotlin.Float - @JvmName("getEndY") - get() = _builder.getEndY() - @JvmName("setEndY") - set(value) { - _builder.setEndY(value) - } - /** - * `float endY = 4;` - */ - public fun clearEndY() { - _builder.clearEndY() - } - - /** - * uint32 steps = 5; - */ - public var steps: kotlin.Int - @JvmName("getSteps") - get() = _builder.getSteps() - @JvmName("setSteps") - set(value) { - _builder.setSteps(value) - } - /** - * `uint32 steps = 5;` - */ - public fun clearSteps() { - _builder.clearSteps() - } - - /** - * `string appId = 6;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 6;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.SwipeRequest.copy(block: pl.leancode.patrol.contracts.SwipeRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.SwipeRequest = - pl.leancode.patrol.contracts.SwipeRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt deleted file mode 100644 index 6ce546637..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapOnNotificationRequestKt.kt +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializetapOnNotificationRequest") -public inline fun tapOnNotificationRequest(block: pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest = - pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.TapOnNotificationRequest` - */ -public object TapOnNotificationRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest = _builder.build() - - /** - * uint32 index = 1; - */ - public var index: kotlin.Int - @JvmName("getIndex") - get() = _builder.getIndex() - @JvmName("setIndex") - set(value) { - _builder.setIndex(value) - } - /** - * `uint32 index = 1;` - */ - public fun clearIndex() { - _builder.clearIndex() - } - /** - * `uint32 index = 1;` - * @return Whether the index field is set. - */ - public fun hasIndex(): kotlin.Boolean { - return _builder.hasIndex() - } - - /** - * `.patrol.Selector selector = 2;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 2;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 2;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - public val findByCase: pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.FindByCase - @JvmName("getFindByCase") - get() = _builder.getFindByCase() - - public fun clearFindBy() { - _builder.clearFindBy() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest.copy(block: pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequest = - pl.leancode.patrol.contracts.TapOnNotificationRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.TapOnNotificationRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt deleted file mode 100644 index be945fdbf..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/TapRequestKt.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializetapRequest") -public inline fun tapRequest(block: pl.leancode.patrol.contracts.TapRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapRequest = - pl.leancode.patrol.contracts.TapRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.TapRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.TapRequest` - */ -public object TapRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.TapRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.TapRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.TapRequest = _builder.build() - - /** - * `.patrol.Selector selector = 1;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 1;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 1;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.TapRequest.copy(block: pl.leancode.patrol.contracts.TapRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.TapRequest = - pl.leancode.patrol.contracts.TapRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.TapRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt b/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt deleted file mode 100644 index 0b0e2be9a..000000000 --- a/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/WaitUntilVisibleRequestKt.kt +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: contracts.proto - -// Generated files should ignore deprecation warnings -@file:Suppress("DEPRECATION") -package pl.leancode.patrol.contracts; - -@kotlin.jvm.JvmName("-initializewaitUntilVisibleRequest") -public inline fun waitUntilVisibleRequest(block: pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest = - pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl._create(pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.newBuilder()).apply { block() }._build() -/** - * Protobuf type `patrol.WaitUntilVisibleRequest` - */ -public object WaitUntilVisibleRequestKt { - @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class) - @com.google.protobuf.kotlin.ProtoDslMarker - public class Dsl private constructor( - private val _builder: pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.Builder - ) { - public companion object { - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _create(builder: pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.Builder): Dsl = Dsl(builder) - } - - @kotlin.jvm.JvmSynthetic - @kotlin.PublishedApi - internal fun _build(): pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest = _builder.build() - - /** - * `.patrol.Selector selector = 1;` - */ - public var selector: pl.leancode.patrol.contracts.Contracts.Selector - @JvmName("getSelector") - get() = _builder.getSelector() - @JvmName("setSelector") - set(value) { - _builder.setSelector(value) - } - /** - * `.patrol.Selector selector = 1;` - */ - public fun clearSelector() { - _builder.clearSelector() - } - /** - * `.patrol.Selector selector = 1;` - * @return Whether the selector field is set. - */ - public fun hasSelector(): kotlin.Boolean { - return _builder.hasSelector() - } - - /** - * `string appId = 2;` - */ - public var appId: kotlin.String - @JvmName("getAppId") - get() = _builder.getAppId() - @JvmName("setAppId") - set(value) { - _builder.setAppId(value) - } - /** - * `string appId = 2;` - */ - public fun clearAppId() { - _builder.clearAppId() - } - } -} -public inline fun pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest.copy(block: pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl.() -> kotlin.Unit): pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequest = - pl.leancode.patrol.contracts.WaitUntilVisibleRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build() - -public val pl.leancode.patrol.contracts.Contracts.WaitUntilVisibleRequestOrBuilder.selectorOrNull: pl.leancode.patrol.contracts.Contracts.Selector? - get() = if (hasSelector()) getSelector() else null - diff --git a/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt b/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt index c8c553380..c556b5d3e 100644 --- a/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt +++ b/packages/patrol/android/src/test/kotlin/pl/leancode/patrol/ContractsExtensionsTest.kt @@ -1,37 +1,115 @@ package pl.leancode.patrol import org.junit.Test -import pl.leancode.patrol.contracts.dartTestGroup +import pl.leancode.patrol.contracts.Contracts.DartGroupEntry +import pl.leancode.patrol.contracts.Contracts.GroupEntryType import kotlin.test.assertContentEquals -// TODO: Make sure these tests are run on CI +fun dartTestGroup( + name: String, + entries: List, +): DartGroupEntry { + return DartGroupEntry(name, GroupEntryType.group, entries) +} + +fun dartTestCase(name: String): DartGroupEntry { + return DartGroupEntry(name, GroupEntryType.test, listOf()) +} class DartTestGroupExtensionsTest { @Test - fun `listDartFilesFlat() litmus test`() { + fun `listTestsFlat() handles simple hierarchy`() { // given - val dartTestGroup = dartTestGroup { - name = "root" - groups += listOf( - dartTestGroup { - name = "example_test" - }, - dartTestGroup { - name = "example.example_test" - }, + val dartTestGroup = dartTestGroup( + "", + listOf( + dartTestGroup( + "example_test", + listOf(dartTestCase("increments counter, exits the app, and comes back")), + ), + dartTestGroup( + "open_app_test", + listOf(dartTestCase("open maps")), + ), + dartTestGroup( + "webview_test", + listOf(dartTestCase("interacts with the LeanCode website in a webview")), + ), + ), + ) + + // when + val dartTests = dartTestGroup.listTestsFlat() + + // then + assertContentEquals( + listOf( + dartTestCase("example_test increments counter, exits the app, and comes back"), + dartTestCase("open_app_test open maps"), + dartTestCase("webview_test interacts with the LeanCode website in a webview"), + ), + dartTests, + ) + } + + @Test + fun `listTestsFlat() handles nested hierarchy`() { + // given + val exampleTest = dartTestGroup( + "example_test", + listOf( + dartTestCase("the first test"), + dartTestGroup( + "top level group in file", + listOf( + dartTestGroup( + "alpha", + listOf( + dartTestCase("first"), + dartTestCase("second"), + ), + ), + dartTestCase("test between groups"), + dartTestGroup( + "bravo", + listOf( + dartTestCase("first"), + dartTestCase("second"), + ), + ), + ), + ), + ), + ) + + val openAppTest = dartTestGroup( + "open_app_test", + listOf( + dartTestCase("open maps"), + dartTestCase("open browser"), + ), ) - } + + val rootDartTestGroup = dartTestGroup("", listOf(exampleTest, openAppTest)) // when - val dartTestFiles = dartTestGroup.listFlatDartFiles() + val dartTests = rootDartTestGroup.listTestsFlat() // then assertContentEquals( - dartTestFiles, listOf( - "example_test", - "example.example_test", + // example_test + dartTestCase("example_test the first test"), + dartTestCase("example_test top level group in file alpha first"), + dartTestCase("example_test top level group in file alpha second"), + dartTestCase("example_test top level group in file test between groups"), + dartTestCase("example_test top level group in file bravo first"), + dartTestCase("example_test top level group in file bravo second"), + // open_app_test + dartTestCase("open_app_test open maps"), + dartTestCase("open_app_test open browser"), ), + dartTests, ) } } diff --git a/packages/patrol/example/integration_test/internal/README b/packages/patrol/example/integration_test/internal/README new file mode 100644 index 000000000..b708d68e8 --- /dev/null +++ b/packages/patrol/example/integration_test/internal/README @@ -0,0 +1,2 @@ +Tests in this directory are used for developing & testing Patrol itself, not for +demonstrating the API. diff --git a/packages/patrol/example/integration_test/internal/group_test.dart b/packages/patrol/example/integration_test/internal/group_test.dart new file mode 100644 index 000000000..b938c20ba --- /dev/null +++ b/packages/patrol/example/integration_test/internal/group_test.dart @@ -0,0 +1,43 @@ +import 'package:patrol/src/global_state.dart' as global_state; + +import '../common.dart'; + +void main() { + patrol('at the beginning', ($) async { + await _testBody($); + }); + + group('top level group in file', () { + group('alpha', () { + patrol('first', ($) async { + await _testBody($); + }); + patrol('second', ($) async { + await _testBody($); + }); + }); + + patrol('in the middle', ($) async { + await _testBody($); + }); + + group('bravo', () { + patrol('first', ($) async { + await _testBody($); + }); + patrol('second', ($) async { + await _testBody($); + }); + }); + }); +} + +Future _testBody(PatrolTester $) async { + await createApp($); + + final testName = global_state.currentTestFullName; + await $(#textField).enterText(testName); + + await $.native.pressHome(); + await $.native.openApp(); +} diff --git a/packages/patrol/example/integration_test/internal/long_name_test.dart b/packages/patrol/example/integration_test/internal/long_name_test.dart new file mode 100644 index 000000000..913b21d56 --- /dev/null +++ b/packages/patrol/example/integration_test/internal/long_name_test.dart @@ -0,0 +1,52 @@ +import 'package:flutter/material.dart'; + +import '../common.dart'; + +String _generateString(int length) { + return 'a' * length; +} + +void main() { + patrol( + // way too long for ATO because of https://github.com/android/android-test/issues/1935 + _generateString(200), + ($) async { + await createApp($); + + await $(FloatingActionButton).tap(); + expect($(#counterText).text, '1'); + + await $(#textField).enterText('Hello, Flutter!'); + expect($('Hello, Flutter!'), findsOneWidget); + + await $.native.pressHome(); + await $.native.openApp(); + + expect($(#counterText).text, '1'); + await $(FloatingActionButton).tap(); + + expect($(#counterText).text, '2'); + expect($('Hello, Flutter!'), findsOneWidget); + }, + ); + + patrol( + '${"alpha" * 36}A', // 194 - max allowed value + ($) async { + await createApp($); + + await $(FloatingActionButton).tap(); + expect($(#counterText).text, '1'); + }, + ); + + patrol( + '${"kocyk" * 36}AA', // 195 - 1 too many + ($) async { + await createApp($); + + await $(FloatingActionButton).tap(); + expect($(#counterText).text, '1'); + }, + ); +} diff --git a/packages/patrol/example/integration_test/open_app_test.dart b/packages/patrol/example/integration_test/open_app_test.dart index be33a8011..c52a7a13c 100644 --- a/packages/patrol/example/integration_test/open_app_test.dart +++ b/packages/patrol/example/integration_test/open_app_test.dart @@ -5,14 +5,16 @@ import 'package:flutter/material.dart'; import 'common.dart'; void main() { - late String mapsId; - if (Platform.isIOS) { - mapsId = 'com.apple.Maps'; - } else if (Platform.isAndroid) { - mapsId = 'com.google.android.apps.maps'; - } - - patrol('counter state is the same after switching apps', ($) async { + patrol('open maps', ($) async { + final String mapsId; + if (Platform.isIOS) { + mapsId = 'com.apple.Maps'; + } else if (Platform.isAndroid) { + mapsId = 'com.google.android.apps.maps'; + } else { + throw UnsupportedError('Unsupported platform'); + } + await createApp($); expect($(#counterText).text, '0'); @@ -26,4 +28,28 @@ void main() { expect($(#counterText).text, '1'); }); + + patrol('open browser', ($) async { + final String browserId; + if (Platform.isIOS) { + browserId = 'com.apple.mobilesafari'; + } else if (Platform.isAndroid) { + browserId = 'com.android.chrome'; + } else { + throw UnsupportedError('Unsupported platform'); + } + + await createApp($); + + expect($(#counterText).text, '0'); + + await $(FloatingActionButton).tap(); + + await $.native.pressHome(); + await $.native.openApp(appId: browserId); + await $.native.pressHome(); + await $.native.openApp(); + + expect($(#counterText).text, '1'); + }); } diff --git a/packages/patrol/example/integration_test/notifications_test.dart b/packages/patrol/example/integration_test/permissions/notifications_test.dart similarity index 96% rename from packages/patrol/example/integration_test/notifications_test.dart rename to packages/patrol/example/integration_test/permissions/notifications_test.dart index c51ad1099..27758ce71 100644 --- a/packages/patrol/example/integration_test/notifications_test.dart +++ b/packages/patrol/example/integration_test/permissions/notifications_test.dart @@ -1,4 +1,4 @@ -import 'common.dart'; +import '../common.dart'; void main() { patrol( diff --git a/packages/patrol/example/integration_test/permissions_location_test.dart b/packages/patrol/example/integration_test/permissions/permissions_location_test.dart similarity index 98% rename from packages/patrol/example/integration_test/permissions_location_test.dart rename to packages/patrol/example/integration_test/permissions/permissions_location_test.dart index 1e92094dd..d47f1b917 100644 --- a/packages/patrol/example/integration_test/permissions_location_test.dart +++ b/packages/patrol/example/integration_test/permissions/permissions_location_test.dart @@ -3,7 +3,7 @@ import 'dart:io' as io; import 'package:permission_handler/permission_handler.dart'; -import 'common.dart'; +import '../common.dart'; const _timeout = Duration(seconds: 5); // to avoid timeouts on CI diff --git a/packages/patrol/example/integration_test/permissions_many_test.dart b/packages/patrol/example/integration_test/permissions/permissions_many_test.dart similarity index 98% rename from packages/patrol/example/integration_test/permissions_many_test.dart rename to packages/patrol/example/integration_test/permissions/permissions_many_test.dart index f1e5941b2..e9d1c97b5 100644 --- a/packages/patrol/example/integration_test/permissions_many_test.dart +++ b/packages/patrol/example/integration_test/permissions/permissions_many_test.dart @@ -1,6 +1,6 @@ import 'package:permission_handler/permission_handler.dart'; -import 'common.dart'; +import '../common.dart'; const _timeout = Duration(seconds: 5); // to avoid timeouts on CI diff --git a/packages/patrol/example/integration_test/swipe_test.dart b/packages/patrol/example/integration_test/swipe_test.dart index ef959d108..370223659 100644 --- a/packages/patrol/example/integration_test/swipe_test.dart +++ b/packages/patrol/example/integration_test/swipe_test.dart @@ -3,11 +3,13 @@ import 'dart:io' show Platform; import 'common.dart'; void main() { - late String appId; + final String appId; if (Platform.isIOS) { appId = 'com.apple.Preferences'; } else if (Platform.isAndroid) { appId = 'com.android.settings'; + } else { + throw UnsupportedError('Unsupported platform'); } patrol('scrolls the Settings app', ($) async { diff --git a/packages/patrol/example/ios/Podfile.lock b/packages/patrol/example/ios/Podfile.lock index cc9cbd509..79b1ff61b 100644 --- a/packages/patrol/example/ios/Podfile.lock +++ b/packages/patrol/example/ios/Podfile.lock @@ -1,14 +1,5 @@ PODS: - - _NIODataStructures (2.40.0) - - CGRPCZlib (1.8.0) - - CNIOAtomics (2.40.0) - - CNIOBoringSSL (2.19.0) - - CNIOBoringSSLShims (2.19.0): - - CNIOBoringSSL (= 2.19.0) - - CNIODarwin (2.40.0) - - CNIOHTTPParser (2.40.0) - - CNIOLinux (2.40.0) - - CNIOWindows (2.40.0) + - CocoaAsyncSocket (7.6.5) - Flutter (1.0.0) - flutter_local_notifications (0.0.1): - Flutter @@ -16,154 +7,17 @@ PODS: - Flutter - geolocator_apple (1.2.0): - Flutter - - gRPC-Swift (1.8.0): - - CGRPCZlib (= 1.8.0) - - Logging (< 2.0.0, >= 1.4.0) - - SwiftNIO (< 3.0.0, >= 2.32.0) - - SwiftNIOExtras (< 2.0.0, >= 1.4.0) - - SwiftNIOHTTP2 (< 2.0.0, >= 1.22.0) - - SwiftNIOSSL (< 3.0.0, >= 2.14.0) - - SwiftNIOTransportServices (< 2.0.0, >= 1.11.1) - - SwiftProtobuf (< 2.0.0, >= 1.19.0) + - HTTPParserC (2.9.4) - integration_test (0.0.1): - Flutter - - Logging (1.4.0) - patrol (0.0.1): - Flutter - - gRPC-Swift (~> 1.8.0) + - Telegraph (~> 0.30.0) - permission_handler_apple (9.1.1): - Flutter - - SwiftNIO (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOConcurrencyHelpers (2.40.0): - - CNIOAtomics (= 2.40.0) - - SwiftNIOCore (2.40.0): - - CNIOAtomics (= 2.40.0) - - CNIOLinux (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOEmbedded (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIOLinux (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOExtras (1.11.0): - - _NIODataStructures (< 3, >= 2.32.0) - - CNIOAtomics (< 3, >= 2.32.0) - - CNIODarwin (< 3, >= 2.32.0) - - CNIOLinux (< 3, >= 2.32.0) - - CNIOWindows (< 3, >= 2.32.0) - - SwiftNIO (< 3, >= 2.32.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) - - SwiftNIOCore (< 3, >= 2.32.0) - - SwiftNIOEmbedded (< 3, >= 2.32.0) - - SwiftNIOPosix (< 3, >= 2.32.0) - - SwiftNIOFoundationCompat (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIO (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOHPACK (1.22.0): - - _NIODataStructures (< 3, >= 2.35.0) - - CNIOAtomics (< 3, >= 2.35.0) - - CNIODarwin (< 3, >= 2.35.0) - - CNIOHTTPParser (< 3, >= 2.35.0) - - CNIOLinux (< 3, >= 2.35.0) - - CNIOWindows (< 3, >= 2.35.0) - - SwiftNIO (< 3, >= 2.35.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.35.0) - - SwiftNIOCore (< 3, >= 2.35.0) - - SwiftNIOEmbedded (< 3, >= 2.35.0) - - SwiftNIOHTTP1 (< 3, >= 2.35.0) - - SwiftNIOPosix (< 3, >= 2.35.0) - - SwiftNIOHTTP1 (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOHTTPParser (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIO (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOHTTP2 (1.22.0): - - _NIODataStructures (< 3, >= 2.35.0) - - CNIOAtomics (< 3, >= 2.35.0) - - CNIODarwin (< 3, >= 2.35.0) - - CNIOHTTPParser (< 3, >= 2.35.0) - - CNIOLinux (< 3, >= 2.35.0) - - CNIOWindows (< 3, >= 2.35.0) - - SwiftNIO (< 3, >= 2.35.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.35.0) - - SwiftNIOCore (< 3, >= 2.35.0) - - SwiftNIOEmbedded (< 3, >= 2.35.0) - - SwiftNIOHPACK (= 1.22.0) - - SwiftNIOHTTP1 (< 3, >= 2.35.0) - - SwiftNIOPosix (< 3, >= 2.35.0) - - SwiftNIOTLS (< 3, >= 2.35.0) - - SwiftNIOPosix (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOSSL (2.19.0): - - _NIODataStructures (< 3, >= 2.32.0) - - CNIOAtomics (< 3, >= 2.32.0) - - CNIOBoringSSL (= 2.19.0) - - CNIOBoringSSLShims (= 2.19.0) - - CNIODarwin (< 3, >= 2.32.0) - - CNIOLinux (< 3, >= 2.32.0) - - CNIOWindows (< 3, >= 2.32.0) - - SwiftNIO (< 3, >= 2.32.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) - - SwiftNIOCore (< 3, >= 2.32.0) - - SwiftNIOEmbedded (< 3, >= 2.32.0) - - SwiftNIOPosix (< 3, >= 2.32.0) - - SwiftNIOTLS (< 3, >= 2.32.0) - - SwiftNIOTLS (2.40.0): - - _NIODataStructures (= 2.40.0) - - CNIOAtomics (= 2.40.0) - - CNIODarwin (= 2.40.0) - - CNIOLinux (= 2.40.0) - - CNIOWindows (= 2.40.0) - - SwiftNIO (= 2.40.0) - - SwiftNIOConcurrencyHelpers (= 2.40.0) - - SwiftNIOCore (= 2.40.0) - - SwiftNIOEmbedded (= 2.40.0) - - SwiftNIOPosix (= 2.40.0) - - SwiftNIOTransportServices (1.12.0): - - _NIODataStructures (< 3, >= 2.32.0) - - CNIOAtomics (< 3, >= 2.32.0) - - CNIODarwin (< 3, >= 2.32.0) - - CNIOLinux (< 3, >= 2.32.0) - - CNIOWindows (< 3, >= 2.32.0) - - SwiftNIO (< 3, >= 2.32.0) - - SwiftNIOConcurrencyHelpers (< 3, >= 2.32.0) - - SwiftNIOCore (< 3, >= 2.32.0) - - SwiftNIOEmbedded (< 3, >= 2.32.0) - - SwiftNIOFoundationCompat (< 3, >= 2.32.0) - - SwiftNIOPosix (< 3, >= 2.32.0) - - SwiftNIOTLS (< 3, >= 2.32.0) - - SwiftProtobuf (1.20.3) + - Telegraph (0.30.0): + - CocoaAsyncSocket (~> 7.6) + - HTTPParserC (~> 2.9) - webview_flutter_wkwebview (0.0.1): - Flutter @@ -179,31 +33,9 @@ DEPENDENCIES: SPEC REPOS: trunk: - - _NIODataStructures - - CGRPCZlib - - CNIOAtomics - - CNIOBoringSSL - - CNIOBoringSSLShims - - CNIODarwin - - CNIOHTTPParser - - CNIOLinux - - CNIOWindows - - gRPC-Swift - - Logging - - SwiftNIO - - SwiftNIOConcurrencyHelpers - - SwiftNIOCore - - SwiftNIOEmbedded - - SwiftNIOExtras - - SwiftNIOFoundationCompat - - SwiftNIOHPACK - - SwiftNIOHTTP1 - - SwiftNIOHTTP2 - - SwiftNIOPosix - - SwiftNIOSSL - - SwiftNIOTLS - - SwiftNIOTransportServices - - SwiftProtobuf + - CocoaAsyncSocket + - HTTPParserC + - Telegraph EXTERNAL SOURCES: Flutter: @@ -224,38 +56,16 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: - _NIODataStructures: 3d45d8e70a1d17a15b1dc59d102c63dbc0525ffd - CGRPCZlib: 298dd3237ba4bd7b3eed109e7080ff3324b7d9c9 - CNIOAtomics: 8edf08644e5e6fa0f021c239be9e8beb1cd9ef18 - CNIOBoringSSL: 2c9c96c2e95f15e83fb8d26b9738d939cc39ae33 - CNIOBoringSSLShims: c5c9346e7bbd1040f4f8793a35441dda7487539a - CNIODarwin: 93850990d29f2626b05306c6c9309f9be0d74c2f - CNIOHTTPParser: 8ce395236fa1d09ac3b4f4bcfba79b849b2ac684 - CNIOLinux: 62e3505f50de558c393dc2f273dde71dcce518da - CNIOWindows: 3047f2d8165848a3936a0a755fee27c6b5ee479b + CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 - gRPC-Swift: 74adcaaa62ac5e0a018938840328cb1fdfb09e7b + HTTPParserC: aea14c3d2d4ac5beb3988781daa36dfa62e0d9ef integration_test: 13825b8a9334a850581300559b8839134b124670 - Logging: beeb016c9c80cf77042d62e83495816847ef108b - patrol: a7622350c42b3a944962fbfe052d07e3691789e5 + patrol: 0966206ac7e717e0ee4d9b6b4e86c8aab62acbfc permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 - SwiftNIO: 829958aab300642625091f82fc2f49cb7cf4ef24 - SwiftNIOConcurrencyHelpers: 697370136789b1074e4535eaae75cbd7f900370e - SwiftNIOCore: 473fdfe746534d7aa25766916459eeaf6f92ef49 - SwiftNIOEmbedded: ffcb5147db67d9686c8366b7f8427b36132f2c8a - SwiftNIOExtras: 481f74d6bf0b0ef699905ed66439cb019c4975c9 - SwiftNIOFoundationCompat: b9cdbea4806e4a12e9f66d9696fa3b98c4c3232b - SwiftNIOHPACK: e7d3ff5bd671528adfb11cd4e0c84ddfdc3c4453 - SwiftNIOHTTP1: ef56706550a1dc135ea69d65215b9941e643c23b - SwiftNIOHTTP2: cc81d7a6ba70d2ddc5376f471904b27ef5d2b7b8 - SwiftNIOPosix: b49af4bdbecaadfadd5c93dfe28594d6722b75e4 - SwiftNIOSSL: d153c5a6fc5b2301b0519b4c4d037a9414212da6 - SwiftNIOTLS: 598af547490133e9aac52aed0c23c4a90c31dcfc - SwiftNIOTransportServices: 0b2b407819d82eb63af558c5396e33c945759503 - SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1 + Telegraph: 12576b119324138e4929792af9e5a1085c2ecbc1 webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a PODFILE CHECKSUM: 0976da911d4a3d1a369deaf59f82a1c7d01a40d5 diff --git a/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj b/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj index 13a049c99..db11d1e62 100644 --- a/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/patrol/example/ios/Runner.xcodeproj/project.pbxproj @@ -265,7 +265,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 327fff847..05552f28c 100644 --- a/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/patrol/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ \n" - printf "\tfor example:\n" - printf "\t\$ ./run_ios_local integration_test/app_test.dart --simulator\n" -} - -target="${1:-}" -simulator="${2:-}" - -if [ -z "$target" ]; then - _usage - exit 1 -fi - -target_path="$(realpath "$target")" -dev_target="16.2" - -run_mode="Release" -flag="--debug" -sdk="iphoneos" -if [ -n "$simulator" ]; then - echo "Running tests in debug mode on iOS Simulator" - run_mode="Debug" - sdk="iphonesimulator" - flag="--simulator" -else - echo "Running tests in release mode on iOS device" -fi - -flutter build ios "$target_path" "$flag" - -pushd ios -xcodebuild build-for-testing \ - -workspace Runner.xcworkspace \ - -scheme Runner \ - -xcconfig Flutter/"$run_mode.xcconfig" \ - -configuration "$run_mode" \ - -derivedDataPath ../build/ios_integ \ - -sdk "$sdk" -popd - -exec xcodebuild test-without-building \ - -xctestrun "build/ios_integ/Build/Products/Runner_iphoneos$dev_target-arm64.xctestrun" \ - -destination id="$(idevice_id -l)" diff --git a/packages/patrol/example/run_ios_testlab b/packages/patrol/example/run_ios_testlab index 62d7e1b26..2ff350da1 100755 --- a/packages/patrol/example/run_ios_testlab +++ b/packages/patrol/example/run_ios_testlab @@ -5,7 +5,14 @@ set -euo pipefail # * DEVICE_MODEL (for example: "iphone11pro") # * DEVICE_VERSION (for example: "16.3") -# And ios_tests.zip containing the iOS app and XCTest files +# patrol build ios must be called before this script + +cd build/ios_integ/Build/Products + +rm -f ios_tests.zip +zip -r ios_tests.zip Release-iphoneos/*.app *.xctestrun + +cd - gcloud firebase test ios run \ --type xctest \ diff --git a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift index 2f8d15f3f..6d01e2fc0 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Automator.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Automator.swift @@ -219,8 +219,8 @@ self.preferences.descendants(matching: .any)["Developer"].firstMatch.tap() let value = - self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value! - as! String + self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value + as? String? if value == "0" { self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.tap() } @@ -237,8 +237,8 @@ self.preferences.descendants(matching: .any)["Developer"].firstMatch.tap() let value = - self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value! - as! String + self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.value + as? String? if value == "1" { self.preferences.descendants(matching: .any)["Dark Appearance"].firstMatch.tap() } @@ -372,7 +372,7 @@ func getNativeViews( byText text: String, inApp bundleId: String - ) async throws -> [Patrol_NativeView] { + ) async throws -> [NativeView] { try await runAction("getting native views matching \(text)") { let app = try self.getApp(withBundleId: bundleId) @@ -388,7 +388,7 @@ let elements = query.allElementsBoundByIndex let views = elements.map { xcuielement in - return Patrol_NativeView.fromXCUIElement(xcuielement, bundleId) + return NativeView.fromXCUIElement(xcuielement, bundleId) } return views @@ -433,16 +433,14 @@ try await Task.sleep(nanoseconds: UInt64(1 * Double(NSEC_PER_SEC))) } - func getNotifications() async throws -> [Patrol_Notification] { - var notifications = [Patrol_Notification]() + func getNotifications() async throws -> [Notification] { + var notifications = [Notification]() await runAction("getting notifications") { let cells = self.springboard.buttons.matching(identifier: "NotificationCell") .allElementsBoundByIndex for (i, cell) in cells.enumerated() { - let notification = Patrol_Notification.with { - Logger.shared.i("found notification at index \(i) with label \(format: cell.label)") - $0.raw = cell.label - } + Logger.shared.i("found notification at index \(i) with label \(format: cell.label)") + let notification = Notification(title: String(), content: String(), raw: cell.label) notifications.append(notification) } } @@ -804,23 +802,19 @@ } } - extension Patrol_NativeView { - static func fromXCUIElement(_ xcuielement: XCUIElement, _ bundleId: String) -> Patrol_NativeView - { - return Patrol_NativeView.with { - $0.text = xcuielement.label - if xcuielement.accessibilityLabel != nil { - $0.contentDescription = xcuielement.accessibilityLabel! - } - $0.resourceName = xcuielement.identifier - $0.enabled = xcuielement.isEnabled - $0.focused = xcuielement.hasFocus - $0.className = String(xcuielement.elementType.rawValue) // TODO: Provide mapping for names - $0.applicationPackage = bundleId - $0.children = xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in - return Patrol_NativeView.fromXCUIElement(child, bundleId) - } - } + extension NativeView { + static func fromXCUIElement(_ xcuielement: XCUIElement, _ bundleId: String) -> NativeView { + return NativeView( + className: String(xcuielement.elementType.rawValue), // TODO: Provide mapping for names + text: xcuielement.label, + contentDescription: xcuielement.accessibilityLabel, + focused: xcuielement.hasFocus, + enabled: xcuielement.isEnabled, + resourceName: xcuielement.identifier, + applicationPackage: bundleId, + children: xcuielement.children(matching: .any).allElementsBoundByIndex.map { child in + return NativeView.fromXCUIElement(child, bundleId) + }) } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift index d5a3ec317..5e800f85d 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/AutomatorServer.swift @@ -1,12 +1,8 @@ #if PATROL_ENABLED import Foundation - import GRPC - typealias Empty = Patrol_Empty - typealias DefaultResponse = Patrol_Empty - - final class AutomatorServer: Patrol_NativeAutomatorAsyncProvider { + final class AutomatorServer: NativeAutomatorServer { private let automator: Automator private let onAppReady: (Bool) -> Void @@ -16,365 +12,245 @@ self.onAppReady = onAppReady } - func initialize( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Empty { - return DefaultResponse() - } + func initialize() async throws {} - func configure( - request: Patrol_ConfigureRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Empty { + func configure(request: ConfigureRequest) async throws { automator.configure(timeout: TimeInterval(request.findTimeoutMillis / 1000)) - return DefaultResponse() } // MARK: General - func pressHome( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func pressHome() async throws { return try await runCatching { try await automator.pressHome() - return DefaultResponse() } } - func pressBack( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func pressBack() async throws { return try await runCatching { throw PatrolError.methodNotImplemented("pressBack") } } - func pressRecentApps( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + + func pressRecentApps() async throws { return try await runCatching { try await automator.openAppSwitcher() - return DefaultResponse() } } - func doublePressRecentApps( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func doublePressRecentApps() async throws { return try await runCatching { throw PatrolError.methodNotImplemented("doublePressRecentApps") } } - func openApp( - request: Patrol_OpenAppRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func openApp(request: OpenAppRequest) async throws { return try await runCatching { - try await automator.openApp(request.appID) - return DefaultResponse() + try await automator.openApp(request.appId) } } - func openQuickSettings( - request: Patrol_OpenQuickSettingsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func openQuickSettings(request: OpenQuickSettingsRequest) async throws { return try await runCatching { try await automator.openControlCenter() - return DefaultResponse() } } // MARK: General UI interaction func getNativeViews( - request: Patrol_GetNativeViewsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNativeViewsResponse { + request: GetNativeViewsRequest + ) async throws -> GetNativeViewsResponse { return try await runCatching { let nativeViews = try await automator.getNativeViews( - byText: request.selector.text, - inApp: request.appID + byText: request.selector.text ?? String(), + inApp: request.appId ) - return Patrol_GetNativeViewsResponse.with { - $0.nativeViews = nativeViews - } + return GetNativeViewsResponse(nativeViews: nativeViews) } } - func tap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func tap(request: TapRequest) async throws { return try await runCatching { try await automator.tap( - onText: request.selector.text, - inApp: request.appID, - atIndex: Int(request.selector.instance) + onText: request.selector.text ?? String(), + inApp: request.appId, + atIndex: request.selector.instance ?? 0 ) - return DefaultResponse() } } - func doubleTap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func doubleTap(request: TapRequest) async throws { return try await runCatching { try await automator.doubleTap( - onText: request.selector.text, - inApp: request.appID + onText: request.selector.text ?? String(), + inApp: request.appId ) - return DefaultResponse() } } - func enterText( - request: Patrol_EnterTextRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func enterText(request: EnterTextRequest) async throws { return try await runCatching { - switch request.findBy { - case .index(let index): + if let index = request.index { try await automator.enterText( request.data, byIndex: Int(index), - inApp: request.appID, + inApp: request.appId, dismissKeyboard: request.keyboardBehavior == .showAndDismiss ) - case .selector(let selector): + } else if let selector = request.selector { try await automator.enterText( request.data, - byText: selector.text, - atIndex: Int(selector.instance), - inApp: request.appID, + byText: selector.text ?? String(), + atIndex: selector.instance ?? 0, + inApp: request.appId, dismissKeyboard: request.keyboardBehavior == .showAndDismiss ) - default: + } else { throw PatrolError.internal("enterText(): neither index nor selector are set") } - - return DefaultResponse() } } - func swipe( - request: Patrol_SwipeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func swipe(request: SwipeRequest) async throws { return try await runCatching { throw PatrolError.methodNotImplemented("swipe") } } - func waitUntilVisible( - request: Patrol_WaitUntilVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func waitUntilVisible(request: WaitUntilVisibleRequest) async throws { return try await runCatching { try await automator.waitUntilVisible( - onText: request.selector.text, - inApp: request.appID + onText: request.selector.text ?? String(), + inApp: request.appId ) - return DefaultResponse() } } // MARK: Services - func enableAirplaneMode( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func enableAirplaneMode() async throws { return try await runCatching { try await automator.enableAirplaneMode() - return DefaultResponse() } } - func disableAirplaneMode( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func disableAirplaneMode() async throws { return try await runCatching { try await automator.disableAirplaneMode() - return DefaultResponse() } } - func enableWiFi( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func enableWiFi() async throws { return try await runCatching { try await automator.enableWiFi() - return DefaultResponse() } } - func disableWiFi( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func disableWiFi() async throws { return try await runCatching { try await automator.disableWiFi() - return DefaultResponse() } } - func enableCellular( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func enableCellular() async throws { return try await runCatching { try await automator.enableCellular() - return DefaultResponse() } } - func disableCellular( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func disableCellular() async throws { return try await runCatching { try await automator.disableCellular() - return DefaultResponse() } } - func enableBluetooth( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func enableBluetooth() async throws { return try await runCatching { try await automator.enableBluetooth() - return DefaultResponse() } } - func disableBluetooth( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func disableBluetooth() async throws { return try await runCatching { try await automator.disableBluetooth() - return DefaultResponse() } } - func enableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func enableDarkMode(request: DarkModeRequest) async throws { return try await runCatching { - try await automator.enableDarkMode(request.appID) - return DefaultResponse() + try await automator.enableDarkMode(request.appId) } } - func disableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func disableDarkMode(request: DarkModeRequest) async throws { return try await runCatching { - try await automator.disableDarkMode(request.appID) - return DefaultResponse() + try await automator.disableDarkMode(request.appId) } } // MARK: Notifications - func openNotifications( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func openNotifications() async throws { return try await runCatching { try await automator.openNotifications() - return DefaultResponse() } } - func closeNotifications( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func closeNotifications() async throws { return try await runCatching { try await automator.closeNotifications() - return DefaultResponse() } } - func closeHeadsUpNotification( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func closeHeadsUpNotification() async throws { return try await runCatching { try await automator.closeHeadsUpNotification() - return DefaultResponse() } } func getNotifications( - request: Patrol_GetNotificationsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNotificationsResponse { + request: GetNotificationsRequest + ) async throws -> GetNotificationsResponse { return try await runCatching { let notifications = try await automator.getNotifications() - return Patrol_GetNotificationsResponse.with { - $0.notifications = notifications - } + return GetNotificationsResponse(notifications: notifications) } } - func tapOnNotification( - request: Patrol_TapOnNotificationRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func tapOnNotification(request: TapOnNotificationRequest) async throws { return try await runCatching { - switch request.findBy { - case .index(let index): + if let index = request.index { try await automator.tapOnNotification( - byIndex: Int(index) + byIndex: index ) - case .selector(let selector): + } else if let selector = request.selector { try await automator.tapOnNotification( - bySubstring: selector.textContains + bySubstring: selector.textContains ?? String() ) - default: + } else { throw PatrolError.internal("tapOnNotification(): neither index nor selector are set") } - - return DefaultResponse() } } // MARK: Permissions func isPermissionDialogVisible( - request: Patrol_PermissionDialogVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_PermissionDialogVisibleResponse { + request: PermissionDialogVisibleRequest + ) async throws -> PermissionDialogVisibleResponse { return try await runCatching { let visible = await automator.isPermissionDialogVisible( timeout: TimeInterval(request.timeoutMillis / 1000) ) - return Patrol_PermissionDialogVisibleResponse.with { - $0.visible = visible - } + return PermissionDialogVisibleResponse(visible: visible) + } } - func handlePermissionDialog( - request: Patrol_HandlePermissionRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func handlePermissionDialog(request: HandlePermissionRequest) async throws { return try await runCatching { switch request.code { case .whileUsing: @@ -383,39 +259,24 @@ try await automator.allowPermissionOnce() case .denied: try await automator.denyPermission() - case .UNRECOGNIZED: - throw PatrolError.internal("handlePermissionDialog(): bad permission code") } - - return DefaultResponse() } } - func setLocationAccuracy( - request: Patrol_SetLocationAccuracyRequest, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func setLocationAccuracy(request: SetLocationAccuracyRequest) async throws { return try await runCatching { switch request.locationAccuracy { case .coarse: try await automator.selectCoarseLocation() case .fine: try await automator.selectFineLocation() - case .UNRECOGNIZED: - throw PatrolError.internal("unrecognized location accuracy") } - - return DefaultResponse() } } - func debug( - request: Empty, - context: GRPCAsyncServerCallContext - ) async throws -> DefaultResponse { + func debug() async throws { return try await runCatching { try await automator.debug() - return DefaultResponse() } } @@ -432,12 +293,8 @@ } } - func markPatrolAppServiceReady( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty { + func markPatrolAppServiceReady() async throws { onAppReady(true) - return Empty() } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift new file mode 100644 index 000000000..7a7e4ac5c --- /dev/null +++ b/packages/patrol/ios/Classes/AutomatorServer/Contracts.swift @@ -0,0 +1,167 @@ +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +enum GroupEntryType: String, Codable { + case group + case test +} + +enum RunDartTestResponseResult: String, Codable { + case success + case skipped + case failure +} + +enum KeyboardBehavior: String, Codable { + case showAndDismiss + case alternative +} + +enum HandlePermissionRequestCode: String, Codable { + case whileUsing + case onlyThisTime + case denied +} + +enum SetLocationAccuracyRequestLocationAccuracy: String, Codable { + case coarse + case fine +} + +struct DartGroupEntry: Codable { + var name: String + var type: GroupEntryType + var entries: [DartGroupEntry] +} + +struct ListDartTestsResponse: Codable { + var group: DartGroupEntry +} + +struct RunDartTestRequest: Codable { + var name: String +} + +struct RunDartTestResponse: Codable { + var result: RunDartTestResponseResult + var details: String? +} + +struct ConfigureRequest: Codable { + var findTimeoutMillis: Int +} + +struct OpenAppRequest: Codable { + var appId: String +} + +struct OpenQuickSettingsRequest: Codable { + +} + +struct Selector: Codable { + var text: String? + var textStartsWith: String? + var textContains: String? + var className: String? + var contentDescription: String? + var contentDescriptionStartsWith: String? + var contentDescriptionContains: String? + var resourceId: String? + var instance: Int? + var enabled: Bool? + var focused: Bool? + var pkg: String? +} + +struct GetNativeViewsRequest: Codable { + var selector: Selector + var appId: String +} + +struct NativeView: Codable { + var className: String? + var text: String? + var contentDescription: String? + var focused: Bool + var enabled: Bool + var childCount: Int? + var resourceName: String? + var applicationPackage: String? + var children: [NativeView] +} + +struct GetNativeViewsResponse: Codable { + var nativeViews: [NativeView] +} + +struct TapRequest: Codable { + var selector: Selector + var appId: String +} + +struct EnterTextRequest: Codable { + var data: String + var appId: String + var index: Int? + var selector: Selector? + var keyboardBehavior: KeyboardBehavior +} + +struct SwipeRequest: Codable { + var startX: Double + var startY: Double + var endX: Double + var endY: Double + var steps: Int +} + +struct WaitUntilVisibleRequest: Codable { + var selector: Selector + var appId: String +} + +struct DarkModeRequest: Codable { + var appId: String +} + +struct Notification: Codable { + var appName: String? + var title: String + var content: String + var raw: String? +} + +struct GetNotificationsResponse: Codable { + var notifications: [Notification] +} + +struct GetNotificationsRequest: Codable { + +} + +struct TapOnNotificationRequest: Codable { + var index: Int? + var selector: Selector? +} + +struct PermissionDialogVisibleResponse: Codable { + var visible: Bool +} + +struct PermissionDialogVisibleRequest: Codable { + var timeoutMillis: Int +} + +struct HandlePermissionRequest: Codable { + var code: HandlePermissionRequestCode +} + +struct SetLocationAccuracyRequest: Codable { + var locationAccuracy: SetLocationAccuracyRequestLocationAccuracy +} + diff --git a/packages/patrol/ios/Classes/AutomatorServer/Errors.swift b/packages/patrol/ios/Classes/AutomatorServer/Errors.swift index e4b2ef7e7..e75ac9978 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/Errors.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/Errors.swift @@ -1,5 +1,3 @@ -import GRPC - enum PatrolError: Error { case viewNotExists(_ elementDescription: String) case appNotInstalled(_ bundleId: String) @@ -8,7 +6,7 @@ enum PatrolError: Error { case unknown(_ error: Error) } -extension PatrolError: CustomStringConvertible, GRPCStatusTransformable { +extension PatrolError: CustomStringConvertible { var description: String { switch self { case .viewNotExists(let elementDescription): @@ -23,19 +21,6 @@ extension PatrolError: CustomStringConvertible, GRPCStatusTransformable { return "\(err)" } } - - func makeGRPCStatus() -> GRPC.GRPCStatus { - switch self { - case .viewNotExists, .appNotInstalled: - return GRPCStatus(code: .notFound, message: self.description) - case .methodNotImplemented: - return GRPCStatus(code: .unimplemented, message: self.description) - case .internal: - return GRPCStatus(code: .internalError, message: self.description) - case .unknown(let err): - return GRPCStatus(code: .unknown, message: "unknown error: \(err)") - } - } } extension String.StringInterpolation { diff --git a/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift new file mode 100644 index 000000000..0342b5275 --- /dev/null +++ b/packages/patrol/ios/Classes/AutomatorServer/NativeAutomatorServer.swift @@ -0,0 +1,443 @@ +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +import Telegraph + +protocol NativeAutomatorServer { + func initialize() async throws + func configure(request: ConfigureRequest) async throws + func pressHome() async throws + func pressBack() async throws + func pressRecentApps() async throws + func doublePressRecentApps() async throws + func openApp(request: OpenAppRequest) async throws + func openQuickSettings(request: OpenQuickSettingsRequest) async throws + func getNativeViews(request: GetNativeViewsRequest) async throws -> GetNativeViewsResponse + func tap(request: TapRequest) async throws + func doubleTap(request: TapRequest) async throws + func enterText(request: EnterTextRequest) async throws + func swipe(request: SwipeRequest) async throws + func waitUntilVisible(request: WaitUntilVisibleRequest) async throws + func enableAirplaneMode() async throws + func disableAirplaneMode() async throws + func enableWiFi() async throws + func disableWiFi() async throws + func enableCellular() async throws + func disableCellular() async throws + func enableBluetooth() async throws + func disableBluetooth() async throws + func enableDarkMode(request: DarkModeRequest) async throws + func disableDarkMode(request: DarkModeRequest) async throws + func openNotifications() async throws + func closeNotifications() async throws + func closeHeadsUpNotification() async throws + func getNotifications(request: GetNotificationsRequest) async throws -> GetNotificationsResponse + func tapOnNotification(request: TapOnNotificationRequest) async throws + func isPermissionDialogVisible(request: PermissionDialogVisibleRequest) async throws -> PermissionDialogVisibleResponse + func handlePermissionDialog(request: HandlePermissionRequest) async throws + func setLocationAccuracy(request: SetLocationAccuracyRequest) async throws + func debug() async throws + func markPatrolAppServiceReady() async throws +} + +extension NativeAutomatorServer { + private func initializeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await initialize() + return HTTPResponse(.ok) + } + + private func configureHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(ConfigureRequest.self, from: request.body) + try await configure(request: requestArg) + return HTTPResponse(.ok) + } + + private func pressHomeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await pressHome() + return HTTPResponse(.ok) + } + + private func pressBackHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await pressBack() + return HTTPResponse(.ok) + } + + private func pressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await pressRecentApps() + return HTTPResponse(.ok) + } + + private func doublePressRecentAppsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await doublePressRecentApps() + return HTTPResponse(.ok) + } + + private func openAppHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(OpenAppRequest.self, from: request.body) + try await openApp(request: requestArg) + return HTTPResponse(.ok) + } + + private func openQuickSettingsHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(OpenQuickSettingsRequest.self, from: request.body) + try await openQuickSettings(request: requestArg) + return HTTPResponse(.ok) + } + + private func getNativeViewsHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(GetNativeViewsRequest.self, from: request.body) + let response = try await getNativeViews(request: requestArg) + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body) + } + + private func tapHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) + try await tap(request: requestArg) + return HTTPResponse(.ok) + } + + private func doubleTapHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(TapRequest.self, from: request.body) + try await doubleTap(request: requestArg) + return HTTPResponse(.ok) + } + + private func enterTextHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(EnterTextRequest.self, from: request.body) + try await enterText(request: requestArg) + return HTTPResponse(.ok) + } + + private func swipeHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(SwipeRequest.self, from: request.body) + try await swipe(request: requestArg) + return HTTPResponse(.ok) + } + + private func waitUntilVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(WaitUntilVisibleRequest.self, from: request.body) + try await waitUntilVisible(request: requestArg) + return HTTPResponse(.ok) + } + + private func enableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableAirplaneMode() + return HTTPResponse(.ok) + } + + private func disableAirplaneModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableAirplaneMode() + return HTTPResponse(.ok) + } + + private func enableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableWiFi() + return HTTPResponse(.ok) + } + + private func disableWiFiHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableWiFi() + return HTTPResponse(.ok) + } + + private func enableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableCellular() + return HTTPResponse(.ok) + } + + private func disableCellularHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableCellular() + return HTTPResponse(.ok) + } + + private func enableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await enableBluetooth() + return HTTPResponse(.ok) + } + + private func disableBluetoothHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await disableBluetooth() + return HTTPResponse(.ok) + } + + private func enableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) + try await enableDarkMode(request: requestArg) + return HTTPResponse(.ok) + } + + private func disableDarkModeHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(DarkModeRequest.self, from: request.body) + try await disableDarkMode(request: requestArg) + return HTTPResponse(.ok) + } + + private func openNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await openNotifications() + return HTTPResponse(.ok) + } + + private func closeNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await closeNotifications() + return HTTPResponse(.ok) + } + + private func closeHeadsUpNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await closeHeadsUpNotification() + return HTTPResponse(.ok) + } + + private func getNotificationsHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(GetNotificationsRequest.self, from: request.body) + let response = try await getNotifications(request: requestArg) + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body) + } + + private func tapOnNotificationHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(TapOnNotificationRequest.self, from: request.body) + try await tapOnNotification(request: requestArg) + return HTTPResponse(.ok) + } + + private func isPermissionDialogVisibleHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(PermissionDialogVisibleRequest.self, from: request.body) + let response = try await isPermissionDialogVisible(request: requestArg) + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body) + } + + private func handlePermissionDialogHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(HandlePermissionRequest.self, from: request.body) + try await handlePermissionDialog(request: requestArg) + return HTTPResponse(.ok) + } + + private func setLocationAccuracyHandler(request: HTTPRequest) async throws -> HTTPResponse { + let requestArg = try JSONDecoder().decode(SetLocationAccuracyRequest.self, from: request.body) + try await setLocationAccuracy(request: requestArg) + return HTTPResponse(.ok) + } + + private func debugHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await debug() + return HTTPResponse(.ok) + } + + private func markPatrolAppServiceReadyHandler(request: HTTPRequest) async throws -> HTTPResponse { + try await markPatrolAppServiceReady() + return HTTPResponse(.ok) + } +} + +extension NativeAutomatorServer { + func setupRoutes(server: Server) { + server.route(.POST, "initialize") { + request in handleRequest( + request: request, + handler: initializeHandler) + } + server.route(.POST, "configure") { + request in handleRequest( + request: request, + handler: configureHandler) + } + server.route(.POST, "pressHome") { + request in handleRequest( + request: request, + handler: pressHomeHandler) + } + server.route(.POST, "pressBack") { + request in handleRequest( + request: request, + handler: pressBackHandler) + } + server.route(.POST, "pressRecentApps") { + request in handleRequest( + request: request, + handler: pressRecentAppsHandler) + } + server.route(.POST, "doublePressRecentApps") { + request in handleRequest( + request: request, + handler: doublePressRecentAppsHandler) + } + server.route(.POST, "openApp") { + request in handleRequest( + request: request, + handler: openAppHandler) + } + server.route(.POST, "openQuickSettings") { + request in handleRequest( + request: request, + handler: openQuickSettingsHandler) + } + server.route(.POST, "getNativeViews") { + request in handleRequest( + request: request, + handler: getNativeViewsHandler) + } + server.route(.POST, "tap") { + request in handleRequest( + request: request, + handler: tapHandler) + } + server.route(.POST, "doubleTap") { + request in handleRequest( + request: request, + handler: doubleTapHandler) + } + server.route(.POST, "enterText") { + request in handleRequest( + request: request, + handler: enterTextHandler) + } + server.route(.POST, "swipe") { + request in handleRequest( + request: request, + handler: swipeHandler) + } + server.route(.POST, "waitUntilVisible") { + request in handleRequest( + request: request, + handler: waitUntilVisibleHandler) + } + server.route(.POST, "enableAirplaneMode") { + request in handleRequest( + request: request, + handler: enableAirplaneModeHandler) + } + server.route(.POST, "disableAirplaneMode") { + request in handleRequest( + request: request, + handler: disableAirplaneModeHandler) + } + server.route(.POST, "enableWiFi") { + request in handleRequest( + request: request, + handler: enableWiFiHandler) + } + server.route(.POST, "disableWiFi") { + request in handleRequest( + request: request, + handler: disableWiFiHandler) + } + server.route(.POST, "enableCellular") { + request in handleRequest( + request: request, + handler: enableCellularHandler) + } + server.route(.POST, "disableCellular") { + request in handleRequest( + request: request, + handler: disableCellularHandler) + } + server.route(.POST, "enableBluetooth") { + request in handleRequest( + request: request, + handler: enableBluetoothHandler) + } + server.route(.POST, "disableBluetooth") { + request in handleRequest( + request: request, + handler: disableBluetoothHandler) + } + server.route(.POST, "enableDarkMode") { + request in handleRequest( + request: request, + handler: enableDarkModeHandler) + } + server.route(.POST, "disableDarkMode") { + request in handleRequest( + request: request, + handler: disableDarkModeHandler) + } + server.route(.POST, "openNotifications") { + request in handleRequest( + request: request, + handler: openNotificationsHandler) + } + server.route(.POST, "closeNotifications") { + request in handleRequest( + request: request, + handler: closeNotificationsHandler) + } + server.route(.POST, "closeHeadsUpNotification") { + request in handleRequest( + request: request, + handler: closeHeadsUpNotificationHandler) + } + server.route(.POST, "getNotifications") { + request in handleRequest( + request: request, + handler: getNotificationsHandler) + } + server.route(.POST, "tapOnNotification") { + request in handleRequest( + request: request, + handler: tapOnNotificationHandler) + } + server.route(.POST, "isPermissionDialogVisible") { + request in handleRequest( + request: request, + handler: isPermissionDialogVisibleHandler) + } + server.route(.POST, "handlePermissionDialog") { + request in handleRequest( + request: request, + handler: handlePermissionDialogHandler) + } + server.route(.POST, "setLocationAccuracy") { + request in handleRequest( + request: request, + handler: setLocationAccuracyHandler) + } + server.route(.POST, "debug") { + request in handleRequest( + request: request, + handler: debugHandler) + } + server.route(.POST, "markPatrolAppServiceReady") { + request in handleRequest( + request: request, + handler: markPatrolAppServiceReadyHandler) + } + } +} + +fileprivate class Box { + var result: Result? = nil +} + +extension NativeAutomatorServer { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) -> HTTPResponse { + do { + return try unsafeWait { + return try await handler(request) + } + } catch let err { + return HTTPResponse(.badRequest, headers: [:], error: err) + } + } + + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { + let box = Box() + let sema = DispatchSemaphore(value: 0) + Task { + do { + let val = try await f() + box.result = .success(val) + } catch { + box.result = .failure(error) + } + sema.signal() + } + sema.wait() + return try box.result!.get() + } +} diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift new file mode 100644 index 000000000..b3ed8d553 --- /dev/null +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolAppServiceClient.swift @@ -0,0 +1,47 @@ +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +class PatrolAppServiceClient { + private let port: Int + private let address: String + private let timeout: TimeInterval + + init(port: Int, address: String, timeout: TimeInterval) { + self.port = port + self.address = address + self.timeout = timeout + } + + func listDartTests() async throws -> ListDartTestsResponse { + return try await performRequest(requestName: "listDartTests") + } + + func runDartTest(request: RunDartTestRequest) async throws -> RunDartTestResponse { + let body = try JSONEncoder().encode(request) + return try await performRequest(requestName: "runDartTest", body: body) + } + + private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { + let url = URL(string: "http://\(address):\(port)/\(requestName)")! + + let urlconfig = URLSessionConfiguration.default + urlconfig.timeoutIntervalForRequest = timeout + urlconfig.timeoutIntervalForResource = timeout + + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.httpBody = body + request.timeoutInterval = timeout + + let (data, response) = try await URLSession(configuration: urlconfig).data(for: request) + guard (response as? HTTPURLResponse)?.statusCode == 200 else { + throw PatrolError.internal("Invalid response: \(response) \(data)") + } + + return try JSONDecoder().decode(TResult.self, from: data) + } +} diff --git a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift index c4696d5b6..ef2575e5a 100644 --- a/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift +++ b/packages/patrol/ios/Classes/AutomatorServer/PatrolServer.swift @@ -1,7 +1,5 @@ import Foundation -import GRPC -import NIOCore -import NIOPosix +import Telegraph @objc public class PatrolServer: NSObject { private static let envPortKey = "PATROL_PORT" @@ -11,6 +9,7 @@ import NIOPosix #if PATROL_ENABLED private let port: Int private let automator: Automator + private let server: Server #endif @objc @@ -39,6 +38,7 @@ import NIOPosix Logger.shared.i("PATROL_ENABLED flag is defined") self.port = passedPort self.automator = Automator() + self.server = Server() #else Logger.shared.i("Fatal error: PATROL_ENABLED flag is not defined") #endif @@ -46,20 +46,18 @@ import NIOPosix @objc public func start() async throws { #if PATROL_ENABLED - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) + Logger.shared.i("Starting server...") + let provider = AutomatorServer(automator: automator) { appReady in Logger.shared.i("App reported that it is ready") self.appReady = appReady } - let server = try await Server.insecure(group: group).withServiceProviders([provider]).bind( - host: "0.0.0.0", port: port - ).get() + provider.setupRoutes(server: server) - Logger.shared.i("Server started on http://localhost:\(port)") + try server.start(port: port) - try await server.onClose.get() - Logger.shared.i("Server stopped") + Logger.shared.i("Server started on http://0.0.0.0:\(port)") #endif } } diff --git a/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift b/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift deleted file mode 100644 index 615148cc5..000000000 --- a/packages/patrol/ios/Classes/AutomatorServer/contracts.grpc.swift +++ /dev/null @@ -1,3931 +0,0 @@ -// -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the protocol buffer compiler. -// Source: contracts.proto -// -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -/// Usage: instantiate `Patrol_PatrolAppServiceClient`, then call methods of this protocol to make API calls. -internal protocol Patrol_PatrolAppServiceClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { get } - - func listDartTests( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func runDartTest( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Patrol_PatrolAppServiceClientProtocol { - internal var serviceName: String { - return "patrol.PatrolAppService" - } - - /// Unary call to listDartTests - /// - /// - Parameters: - /// - request: Request to send to listDartTests. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func listDartTests( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [] - ) - } - - /// Unary call to runDartTest - /// - /// - Parameters: - /// - request: Request to send to runDartTest. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func runDartTest( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Patrol_PatrolAppServiceClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Patrol_PatrolAppServiceNIOClient") -internal final class Patrol_PatrolAppServiceClient: Patrol_PatrolAppServiceClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the patrol.PatrolAppService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Patrol_PatrolAppServiceNIOClient: Patrol_PatrolAppServiceClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? - - /// Creates a client for the patrol.PatrolAppService service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_PatrolAppServiceAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { get } - - func makeListDartTestsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeRunDartTestCall( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_PatrolAppServiceAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_PatrolAppServiceClientMetadata.serviceDescriptor - } - - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeListDartTestsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [] - ) - } - - internal func makeRunDartTestCall( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_PatrolAppServiceAsyncClientProtocol { - internal func listDartTests( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_ListDartTestsResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [] - ) - } - - internal func runDartTest( - _ request: Patrol_RunDartTestRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_RunDartTestResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Patrol_PatrolAppServiceAsyncClient: Patrol_PatrolAppServiceAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_PatrolAppServiceClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Patrol_PatrolAppServiceClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'listDartTests'. - func makelistDartTestsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'runDartTest'. - func makerunDartTestInterceptors() -> [ClientInterceptor] -} - -internal enum Patrol_PatrolAppServiceClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "PatrolAppService", - fullName: "patrol.PatrolAppService", - methods: [ - Patrol_PatrolAppServiceClientMetadata.Methods.listDartTests, - Patrol_PatrolAppServiceClientMetadata.Methods.runDartTest, - ] - ) - - internal enum Methods { - internal static let listDartTests = GRPCMethodDescriptor( - name: "listDartTests", - path: "/patrol.PatrolAppService/listDartTests", - type: GRPCCallType.unary - ) - - internal static let runDartTest = GRPCMethodDescriptor( - name: "runDartTest", - path: "/patrol.PatrolAppService/runDartTest", - type: GRPCCallType.unary - ) - } -} - -/// Usage: instantiate `Patrol_NativeAutomatorClient`, then call methods of this protocol to make API calls. -internal protocol Patrol_NativeAutomatorClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { get } - - func initialize( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func configure( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func pressHome( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func pressBack( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func pressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func doublePressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func openApp( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func openQuickSettings( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func getNativeViews( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func tap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func doubleTap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func enterText( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func swipe( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func waitUntilVisible( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func enableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func disableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func enableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func disableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func openNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func closeNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func closeHeadsUpNotification( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func getNotifications( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func tapOnNotification( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func isPermissionDialogVisible( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func handlePermissionDialog( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func setLocationAccuracy( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func debug( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall - - func markPatrolAppServiceReady( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Patrol_NativeAutomatorClientProtocol { - internal var serviceName: String { - return "patrol.NativeAutomator" - } - - /// Unary call to initialize - /// - /// - Parameters: - /// - request: Request to send to initialize. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func initialize( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.initialize.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [] - ) - } - - /// Unary call to configure - /// - /// - Parameters: - /// - request: Request to send to configure. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func configure( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.configure.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [] - ) - } - - /// general - /// - /// - Parameters: - /// - request: Request to send to pressHome. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pressHome( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressHome.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [] - ) - } - - /// Unary call to pressBack - /// - /// - Parameters: - /// - request: Request to send to pressBack. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pressBack( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressBack.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressBackInterceptors() ?? [] - ) - } - - /// Unary call to pressRecentApps - /// - /// - Parameters: - /// - request: Request to send to pressRecentApps. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [] - ) - } - - /// Unary call to doublePressRecentApps - /// - /// - Parameters: - /// - request: Request to send to doublePressRecentApps. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func doublePressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [] - ) - } - - /// Unary call to openApp - /// - /// - Parameters: - /// - request: Request to send to openApp. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func openApp( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openApp.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [] - ) - } - - /// Unary call to openQuickSettings - /// - /// - Parameters: - /// - request: Request to send to openQuickSettings. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func openQuickSettings( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [] - ) - } - - /// general UI interaction - /// - /// - Parameters: - /// - request: Request to send to getNativeViews. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func getNativeViews( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [] - ) - } - - /// Unary call to tap - /// - /// - Parameters: - /// - request: Request to send to tap. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func tap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapInterceptors() ?? [] - ) - } - - /// Unary call to doubleTap - /// - /// - Parameters: - /// - request: Request to send to doubleTap. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func doubleTap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doubleTap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [] - ) - } - - /// Unary call to enterText - /// - /// - Parameters: - /// - request: Request to send to enterText. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enterText( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enterText.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [] - ) - } - - /// Unary call to swipe - /// - /// - Parameters: - /// - request: Request to send to swipe. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func swipe( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.swipe.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeswipeInterceptors() ?? [] - ) - } - - /// Unary call to waitUntilVisible - /// - /// - Parameters: - /// - request: Request to send to waitUntilVisible. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func waitUntilVisible( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [] - ) - } - - /// services - /// - /// - Parameters: - /// - request: Request to send to enableAirplaneMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] - ) - } - - /// Unary call to disableAirplaneMode - /// - /// - Parameters: - /// - request: Request to send to disableAirplaneMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] - ) - } - - /// Unary call to enableWiFi - /// - /// - Parameters: - /// - request: Request to send to enableWiFi. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [] - ) - } - - /// Unary call to disableWiFi - /// - /// - Parameters: - /// - request: Request to send to disableWiFi. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [] - ) - } - - /// Unary call to enableCellular - /// - /// - Parameters: - /// - request: Request to send to enableCellular. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [] - ) - } - - /// Unary call to disableCellular - /// - /// - Parameters: - /// - request: Request to send to disableCellular. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [] - ) - } - - /// Unary call to enableBluetooth - /// - /// - Parameters: - /// - request: Request to send to enableBluetooth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] - ) - } - - /// Unary call to disableBluetooth - /// - /// - Parameters: - /// - request: Request to send to disableBluetooth. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] - ) - } - - /// Unary call to enableDarkMode - /// - /// - Parameters: - /// - request: Request to send to enableDarkMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func enableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] - ) - } - - /// Unary call to disableDarkMode - /// - /// - Parameters: - /// - request: Request to send to disableDarkMode. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func disableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] - ) - } - - /// notifications - /// - /// - Parameters: - /// - request: Request to send to openNotifications. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func openNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [] - ) - } - - /// Unary call to closeNotifications - /// - /// - Parameters: - /// - request: Request to send to closeNotifications. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func closeNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [] - ) - } - - /// Unary call to closeHeadsUpNotification - /// - /// - Parameters: - /// - request: Request to send to closeHeadsUpNotification. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func closeHeadsUpNotification( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [] - ) - } - - /// Unary call to getNotifications - /// - /// - Parameters: - /// - request: Request to send to getNotifications. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func getNotifications( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [] - ) - } - - /// Unary call to tapOnNotification - /// - /// - Parameters: - /// - request: Request to send to tapOnNotification. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func tapOnNotification( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [] - ) - } - - /// permissions - /// - /// - Parameters: - /// - request: Request to send to isPermissionDialogVisible. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func isPermissionDialogVisible( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [] - ) - } - - /// Unary call to handlePermissionDialog - /// - /// - Parameters: - /// - request: Request to send to handlePermissionDialog. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func handlePermissionDialog( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [] - ) - } - - /// Unary call to setLocationAccuracy - /// - /// - Parameters: - /// - request: Request to send to setLocationAccuracy. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func setLocationAccuracy( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [] - ) - } - - /// other - /// - /// - Parameters: - /// - request: Request to send to debug. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func debug( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.debug.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedebugInterceptors() ?? [] - ) - } - - /// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - /// - /// - Parameters: - /// - request: Request to send to markPatrolAppServiceReady. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func markPatrolAppServiceReady( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Patrol_NativeAutomatorClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Patrol_NativeAutomatorNIOClient") -internal final class Patrol_NativeAutomatorClient: Patrol_NativeAutomatorClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the patrol.NativeAutomator service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Patrol_NativeAutomatorNIOClient: Patrol_NativeAutomatorClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? - - /// Creates a client for the patrol.NativeAutomator service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_NativeAutomatorAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { get } - - func makeInitializeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeConfigureCall( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePressHomeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePressBackCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDoublePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeOpenAppCall( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeOpenQuickSettingsCall( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetNativeViewsCall( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDoubleTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnterTextCall( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSwipeCall( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeWaitUntilVisibleCall( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeEnableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDisableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeOpenNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCloseNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeCloseHeadsUpNotificationCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeGetNotificationsCall( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeTapOnNotificationCall( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeIsPermissionDialogVisibleCall( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeHandlePermissionDialogCall( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeSetLocationAccuracyCall( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeDebugCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeMarkPatrolAppServiceReadyCall( - _ request: Patrol_Empty, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_NativeAutomatorAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_NativeAutomatorClientMetadata.serviceDescriptor - } - - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeInitializeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.initialize.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [] - ) - } - - internal func makeConfigureCall( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.configure.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [] - ) - } - - internal func makePressHomeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressHome.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [] - ) - } - - internal func makePressBackCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressBack.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressBackInterceptors() ?? [] - ) - } - - internal func makePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [] - ) - } - - internal func makeDoublePressRecentAppsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [] - ) - } - - internal func makeOpenAppCall( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openApp.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [] - ) - } - - internal func makeOpenQuickSettingsCall( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [] - ) - } - - internal func makeGetNativeViewsCall( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [] - ) - } - - internal func makeTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapInterceptors() ?? [] - ) - } - - internal func makeDoubleTapCall( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doubleTap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [] - ) - } - - internal func makeEnterTextCall( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enterText.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [] - ) - } - - internal func makeSwipeCall( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.swipe.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeswipeInterceptors() ?? [] - ) - } - - internal func makeWaitUntilVisibleCall( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [] - ) - } - - internal func makeEnableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] - ) - } - - internal func makeDisableAirplaneModeCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] - ) - } - - internal func makeEnableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [] - ) - } - - internal func makeDisableWiFiCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [] - ) - } - - internal func makeEnableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [] - ) - } - - internal func makeDisableCellularCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [] - ) - } - - internal func makeEnableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] - ) - } - - internal func makeDisableBluetoothCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] - ) - } - - internal func makeEnableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] - ) - } - - internal func makeDisableDarkModeCall( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] - ) - } - - internal func makeOpenNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [] - ) - } - - internal func makeCloseNotificationsCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [] - ) - } - - internal func makeCloseHeadsUpNotificationCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [] - ) - } - - internal func makeGetNotificationsCall( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [] - ) - } - - internal func makeTapOnNotificationCall( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [] - ) - } - - internal func makeIsPermissionDialogVisibleCall( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [] - ) - } - - internal func makeHandlePermissionDialogCall( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [] - ) - } - - internal func makeSetLocationAccuracyCall( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [] - ) - } - - internal func makeDebugCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.debug.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedebugInterceptors() ?? [] - ) - } - - internal func makeMarkPatrolAppServiceReadyCall( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_NativeAutomatorAsyncClientProtocol { - internal func initialize( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.initialize.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [] - ) - } - - internal func configure( - _ request: Patrol_ConfigureRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.configure.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [] - ) - } - - internal func pressHome( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressHome.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [] - ) - } - - internal func pressBack( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressBack.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressBackInterceptors() ?? [] - ) - } - - internal func pressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [] - ) - } - - internal func doublePressRecentApps( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [] - ) - } - - internal func openApp( - _ request: Patrol_OpenAppRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openApp.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [] - ) - } - - internal func openQuickSettings( - _ request: Patrol_OpenQuickSettingsRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [] - ) - } - - internal func getNativeViews( - _ request: Patrol_GetNativeViewsRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_GetNativeViewsResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [] - ) - } - - internal func tap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapInterceptors() ?? [] - ) - } - - internal func doubleTap( - _ request: Patrol_TapRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.doubleTap.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [] - ) - } - - internal func enterText( - _ request: Patrol_EnterTextRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enterText.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [] - ) - } - - internal func swipe( - _ request: Patrol_SwipeRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.swipe.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeswipeInterceptors() ?? [] - ) - } - - internal func waitUntilVisible( - _ request: Patrol_WaitUntilVisibleRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [] - ) - } - - internal func enableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [] - ) - } - - internal func disableAirplaneMode( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [] - ) - } - - internal func enableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [] - ) - } - - internal func disableWiFi( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [] - ) - } - - internal func enableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [] - ) - } - - internal func disableCellular( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableCellular.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [] - ) - } - - internal func enableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [] - ) - } - - internal func disableBluetooth( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [] - ) - } - - internal func enableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [] - ) - } - - internal func disableDarkMode( - _ request: Patrol_DarkModeRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [] - ) - } - - internal func openNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.openNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [] - ) - } - - internal func closeNotifications( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [] - ) - } - - internal func closeHeadsUpNotification( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [] - ) - } - - internal func getNotifications( - _ request: Patrol_GetNotificationsRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_GetNotificationsResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.getNotifications.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [] - ) - } - - internal func tapOnNotification( - _ request: Patrol_TapOnNotificationRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [] - ) - } - - internal func isPermissionDialogVisible( - _ request: Patrol_PermissionDialogVisibleRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_PermissionDialogVisibleResponse { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [] - ) - } - - internal func handlePermissionDialog( - _ request: Patrol_HandlePermissionRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [] - ) - } - - internal func setLocationAccuracy( - _ request: Patrol_SetLocationAccuracyRequest, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [] - ) - } - - internal func debug( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.debug.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makedebugInterceptors() ?? [] - ) - } - - internal func markPatrolAppServiceReady( - _ request: Patrol_Empty, - callOptions: CallOptions? = nil - ) async throws -> Patrol_Empty { - return try await self.performAsyncUnaryCall( - path: Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Patrol_NativeAutomatorAsyncClient: Patrol_NativeAutomatorAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Patrol_NativeAutomatorClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Patrol_NativeAutomatorClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'initialize'. - func makeinitializeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'configure'. - func makeconfigureInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pressHome'. - func makepressHomeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pressBack'. - func makepressBackInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pressRecentApps'. - func makepressRecentAppsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'doublePressRecentApps'. - func makedoublePressRecentAppsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'openApp'. - func makeopenAppInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'openQuickSettings'. - func makeopenQuickSettingsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'getNativeViews'. - func makegetNativeViewsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'tap'. - func maketapInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'doubleTap'. - func makedoubleTapInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enterText'. - func makeenterTextInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'swipe'. - func makeswipeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'waitUntilVisible'. - func makewaitUntilVisibleInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableAirplaneMode'. - func makeenableAirplaneModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableAirplaneMode'. - func makedisableAirplaneModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableWiFi'. - func makeenableWiFiInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableWiFi'. - func makedisableWiFiInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableCellular'. - func makeenableCellularInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableCellular'. - func makedisableCellularInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableBluetooth'. - func makeenableBluetoothInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableBluetooth'. - func makedisableBluetoothInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'enableDarkMode'. - func makeenableDarkModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'disableDarkMode'. - func makedisableDarkModeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'openNotifications'. - func makeopenNotificationsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'closeNotifications'. - func makecloseNotificationsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'closeHeadsUpNotification'. - func makecloseHeadsUpNotificationInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'getNotifications'. - func makegetNotificationsInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'tapOnNotification'. - func maketapOnNotificationInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'isPermissionDialogVisible'. - func makeisPermissionDialogVisibleInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'handlePermissionDialog'. - func makehandlePermissionDialogInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'setLocationAccuracy'. - func makesetLocationAccuracyInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'debug'. - func makedebugInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'markPatrolAppServiceReady'. - func makemarkPatrolAppServiceReadyInterceptors() -> [ClientInterceptor] -} - -internal enum Patrol_NativeAutomatorClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "NativeAutomator", - fullName: "patrol.NativeAutomator", - methods: [ - Patrol_NativeAutomatorClientMetadata.Methods.initialize, - Patrol_NativeAutomatorClientMetadata.Methods.configure, - Patrol_NativeAutomatorClientMetadata.Methods.pressHome, - Patrol_NativeAutomatorClientMetadata.Methods.pressBack, - Patrol_NativeAutomatorClientMetadata.Methods.pressRecentApps, - Patrol_NativeAutomatorClientMetadata.Methods.doublePressRecentApps, - Patrol_NativeAutomatorClientMetadata.Methods.openApp, - Patrol_NativeAutomatorClientMetadata.Methods.openQuickSettings, - Patrol_NativeAutomatorClientMetadata.Methods.getNativeViews, - Patrol_NativeAutomatorClientMetadata.Methods.tap, - Patrol_NativeAutomatorClientMetadata.Methods.doubleTap, - Patrol_NativeAutomatorClientMetadata.Methods.enterText, - Patrol_NativeAutomatorClientMetadata.Methods.swipe, - Patrol_NativeAutomatorClientMetadata.Methods.waitUntilVisible, - Patrol_NativeAutomatorClientMetadata.Methods.enableAirplaneMode, - Patrol_NativeAutomatorClientMetadata.Methods.disableAirplaneMode, - Patrol_NativeAutomatorClientMetadata.Methods.enableWiFi, - Patrol_NativeAutomatorClientMetadata.Methods.disableWiFi, - Patrol_NativeAutomatorClientMetadata.Methods.enableCellular, - Patrol_NativeAutomatorClientMetadata.Methods.disableCellular, - Patrol_NativeAutomatorClientMetadata.Methods.enableBluetooth, - Patrol_NativeAutomatorClientMetadata.Methods.disableBluetooth, - Patrol_NativeAutomatorClientMetadata.Methods.enableDarkMode, - Patrol_NativeAutomatorClientMetadata.Methods.disableDarkMode, - Patrol_NativeAutomatorClientMetadata.Methods.openNotifications, - Patrol_NativeAutomatorClientMetadata.Methods.closeNotifications, - Patrol_NativeAutomatorClientMetadata.Methods.closeHeadsUpNotification, - Patrol_NativeAutomatorClientMetadata.Methods.getNotifications, - Patrol_NativeAutomatorClientMetadata.Methods.tapOnNotification, - Patrol_NativeAutomatorClientMetadata.Methods.isPermissionDialogVisible, - Patrol_NativeAutomatorClientMetadata.Methods.handlePermissionDialog, - Patrol_NativeAutomatorClientMetadata.Methods.setLocationAccuracy, - Patrol_NativeAutomatorClientMetadata.Methods.debug, - Patrol_NativeAutomatorClientMetadata.Methods.markPatrolAppServiceReady, - ] - ) - - internal enum Methods { - internal static let initialize = GRPCMethodDescriptor( - name: "initialize", - path: "/patrol.NativeAutomator/initialize", - type: GRPCCallType.unary - ) - - internal static let configure = GRPCMethodDescriptor( - name: "configure", - path: "/patrol.NativeAutomator/configure", - type: GRPCCallType.unary - ) - - internal static let pressHome = GRPCMethodDescriptor( - name: "pressHome", - path: "/patrol.NativeAutomator/pressHome", - type: GRPCCallType.unary - ) - - internal static let pressBack = GRPCMethodDescriptor( - name: "pressBack", - path: "/patrol.NativeAutomator/pressBack", - type: GRPCCallType.unary - ) - - internal static let pressRecentApps = GRPCMethodDescriptor( - name: "pressRecentApps", - path: "/patrol.NativeAutomator/pressRecentApps", - type: GRPCCallType.unary - ) - - internal static let doublePressRecentApps = GRPCMethodDescriptor( - name: "doublePressRecentApps", - path: "/patrol.NativeAutomator/doublePressRecentApps", - type: GRPCCallType.unary - ) - - internal static let openApp = GRPCMethodDescriptor( - name: "openApp", - path: "/patrol.NativeAutomator/openApp", - type: GRPCCallType.unary - ) - - internal static let openQuickSettings = GRPCMethodDescriptor( - name: "openQuickSettings", - path: "/patrol.NativeAutomator/openQuickSettings", - type: GRPCCallType.unary - ) - - internal static let getNativeViews = GRPCMethodDescriptor( - name: "getNativeViews", - path: "/patrol.NativeAutomator/getNativeViews", - type: GRPCCallType.unary - ) - - internal static let tap = GRPCMethodDescriptor( - name: "tap", - path: "/patrol.NativeAutomator/tap", - type: GRPCCallType.unary - ) - - internal static let doubleTap = GRPCMethodDescriptor( - name: "doubleTap", - path: "/patrol.NativeAutomator/doubleTap", - type: GRPCCallType.unary - ) - - internal static let enterText = GRPCMethodDescriptor( - name: "enterText", - path: "/patrol.NativeAutomator/enterText", - type: GRPCCallType.unary - ) - - internal static let swipe = GRPCMethodDescriptor( - name: "swipe", - path: "/patrol.NativeAutomator/swipe", - type: GRPCCallType.unary - ) - - internal static let waitUntilVisible = GRPCMethodDescriptor( - name: "waitUntilVisible", - path: "/patrol.NativeAutomator/waitUntilVisible", - type: GRPCCallType.unary - ) - - internal static let enableAirplaneMode = GRPCMethodDescriptor( - name: "enableAirplaneMode", - path: "/patrol.NativeAutomator/enableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let disableAirplaneMode = GRPCMethodDescriptor( - name: "disableAirplaneMode", - path: "/patrol.NativeAutomator/disableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let enableWiFi = GRPCMethodDescriptor( - name: "enableWiFi", - path: "/patrol.NativeAutomator/enableWiFi", - type: GRPCCallType.unary - ) - - internal static let disableWiFi = GRPCMethodDescriptor( - name: "disableWiFi", - path: "/patrol.NativeAutomator/disableWiFi", - type: GRPCCallType.unary - ) - - internal static let enableCellular = GRPCMethodDescriptor( - name: "enableCellular", - path: "/patrol.NativeAutomator/enableCellular", - type: GRPCCallType.unary - ) - - internal static let disableCellular = GRPCMethodDescriptor( - name: "disableCellular", - path: "/patrol.NativeAutomator/disableCellular", - type: GRPCCallType.unary - ) - - internal static let enableBluetooth = GRPCMethodDescriptor( - name: "enableBluetooth", - path: "/patrol.NativeAutomator/enableBluetooth", - type: GRPCCallType.unary - ) - - internal static let disableBluetooth = GRPCMethodDescriptor( - name: "disableBluetooth", - path: "/patrol.NativeAutomator/disableBluetooth", - type: GRPCCallType.unary - ) - - internal static let enableDarkMode = GRPCMethodDescriptor( - name: "enableDarkMode", - path: "/patrol.NativeAutomator/enableDarkMode", - type: GRPCCallType.unary - ) - - internal static let disableDarkMode = GRPCMethodDescriptor( - name: "disableDarkMode", - path: "/patrol.NativeAutomator/disableDarkMode", - type: GRPCCallType.unary - ) - - internal static let openNotifications = GRPCMethodDescriptor( - name: "openNotifications", - path: "/patrol.NativeAutomator/openNotifications", - type: GRPCCallType.unary - ) - - internal static let closeNotifications = GRPCMethodDescriptor( - name: "closeNotifications", - path: "/patrol.NativeAutomator/closeNotifications", - type: GRPCCallType.unary - ) - - internal static let closeHeadsUpNotification = GRPCMethodDescriptor( - name: "closeHeadsUpNotification", - path: "/patrol.NativeAutomator/closeHeadsUpNotification", - type: GRPCCallType.unary - ) - - internal static let getNotifications = GRPCMethodDescriptor( - name: "getNotifications", - path: "/patrol.NativeAutomator/getNotifications", - type: GRPCCallType.unary - ) - - internal static let tapOnNotification = GRPCMethodDescriptor( - name: "tapOnNotification", - path: "/patrol.NativeAutomator/tapOnNotification", - type: GRPCCallType.unary - ) - - internal static let isPermissionDialogVisible = GRPCMethodDescriptor( - name: "isPermissionDialogVisible", - path: "/patrol.NativeAutomator/isPermissionDialogVisible", - type: GRPCCallType.unary - ) - - internal static let handlePermissionDialog = GRPCMethodDescriptor( - name: "handlePermissionDialog", - path: "/patrol.NativeAutomator/handlePermissionDialog", - type: GRPCCallType.unary - ) - - internal static let setLocationAccuracy = GRPCMethodDescriptor( - name: "setLocationAccuracy", - path: "/patrol.NativeAutomator/setLocationAccuracy", - type: GRPCCallType.unary - ) - - internal static let debug = GRPCMethodDescriptor( - name: "debug", - path: "/patrol.NativeAutomator/debug", - type: GRPCCallType.unary - ) - - internal static let markPatrolAppServiceReady = GRPCMethodDescriptor( - name: "markPatrolAppServiceReady", - path: "/patrol.NativeAutomator/markPatrolAppServiceReady", - type: GRPCCallType.unary - ) - } -} - -/// To build a server, implement a class that conforms to this protocol. -internal protocol Patrol_PatrolAppServiceProvider: CallHandlerProvider { - var interceptors: Patrol_PatrolAppServiceServerInterceptorFactoryProtocol? { get } - - func listDartTests(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func runDartTest(request: Patrol_RunDartTestRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Patrol_PatrolAppServiceProvider { - internal var serviceName: Substring { - return Patrol_PatrolAppServiceServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "listDartTests": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [], - userFunction: self.listDartTests(request:context:) - ) - - case "runDartTest": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [], - userFunction: self.runDartTest(request:context:) - ) - - default: - return nil - } - } -} - -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_PatrolAppServiceAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_PatrolAppServiceServerInterceptorFactoryProtocol? { get } - - func listDartTests( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_ListDartTestsResponse - - func runDartTest( - request: Patrol_RunDartTestRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_RunDartTestResponse -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_PatrolAppServiceAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_PatrolAppServiceServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Patrol_PatrolAppServiceServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Patrol_PatrolAppServiceServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "listDartTests": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makelistDartTestsInterceptors() ?? [], - wrapping: { try await self.listDartTests(request: $0, context: $1) } - ) - - case "runDartTest": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makerunDartTestInterceptors() ?? [], - wrapping: { try await self.runDartTest(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Patrol_PatrolAppServiceServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'listDartTests'. - /// Defaults to calling `self.makeInterceptors()`. - func makelistDartTestsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'runDartTest'. - /// Defaults to calling `self.makeInterceptors()`. - func makerunDartTestInterceptors() -> [ServerInterceptor] -} - -internal enum Patrol_PatrolAppServiceServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "PatrolAppService", - fullName: "patrol.PatrolAppService", - methods: [ - Patrol_PatrolAppServiceServerMetadata.Methods.listDartTests, - Patrol_PatrolAppServiceServerMetadata.Methods.runDartTest, - ] - ) - - internal enum Methods { - internal static let listDartTests = GRPCMethodDescriptor( - name: "listDartTests", - path: "/patrol.PatrolAppService/listDartTests", - type: GRPCCallType.unary - ) - - internal static let runDartTest = GRPCMethodDescriptor( - name: "runDartTest", - path: "/patrol.PatrolAppService/runDartTest", - type: GRPCCallType.unary - ) - } -} -/// To build a server, implement a class that conforms to this protocol. -internal protocol Patrol_NativeAutomatorProvider: CallHandlerProvider { - var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { get } - - func initialize(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func configure(request: Patrol_ConfigureRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// general - func pressHome(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func pressBack(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func pressRecentApps(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func doublePressRecentApps(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func openApp(request: Patrol_OpenAppRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func openQuickSettings(request: Patrol_OpenQuickSettingsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// general UI interaction - func getNativeViews(request: Patrol_GetNativeViewsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func tap(request: Patrol_TapRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func doubleTap(request: Patrol_TapRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func enterText(request: Patrol_EnterTextRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func swipe(request: Patrol_SwipeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func waitUntilVisible(request: Patrol_WaitUntilVisibleRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// services - func enableAirplaneMode(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableAirplaneMode(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableWiFi(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableWiFi(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableCellular(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableCellular(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableBluetooth(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableBluetooth(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func enableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func disableDarkMode(request: Patrol_DarkModeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// notifications - func openNotifications(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func closeNotifications(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func closeHeadsUpNotification(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - func getNotifications(request: Patrol_GetNotificationsRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func tapOnNotification(request: Patrol_TapOnNotificationRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// permissions - func isPermissionDialogVisible(request: Patrol_PermissionDialogVisibleRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func handlePermissionDialog(request: Patrol_HandlePermissionRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func setLocationAccuracy(request: Patrol_SetLocationAccuracyRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// other - func debug(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture - - /// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - func markPatrolAppServiceReady(request: Patrol_Empty, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Patrol_NativeAutomatorProvider { - internal var serviceName: Substring { - return Patrol_NativeAutomatorServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "initialize": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [], - userFunction: self.initialize(request:context:) - ) - - case "configure": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [], - userFunction: self.configure(request:context:) - ) - - case "pressHome": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [], - userFunction: self.pressHome(request:context:) - ) - - case "pressBack": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressBackInterceptors() ?? [], - userFunction: self.pressBack(request:context:) - ) - - case "pressRecentApps": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [], - userFunction: self.pressRecentApps(request:context:) - ) - - case "doublePressRecentApps": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [], - userFunction: self.doublePressRecentApps(request:context:) - ) - - case "openApp": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [], - userFunction: self.openApp(request:context:) - ) - - case "openQuickSettings": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [], - userFunction: self.openQuickSettings(request:context:) - ) - - case "getNativeViews": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [], - userFunction: self.getNativeViews(request:context:) - ) - - case "tap": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapInterceptors() ?? [], - userFunction: self.tap(request:context:) - ) - - case "doubleTap": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [], - userFunction: self.doubleTap(request:context:) - ) - - case "enterText": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [], - userFunction: self.enterText(request:context:) - ) - - case "swipe": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeswipeInterceptors() ?? [], - userFunction: self.swipe(request:context:) - ) - - case "waitUntilVisible": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [], - userFunction: self.waitUntilVisible(request:context:) - ) - - case "enableAirplaneMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [], - userFunction: self.enableAirplaneMode(request:context:) - ) - - case "disableAirplaneMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [], - userFunction: self.disableAirplaneMode(request:context:) - ) - - case "enableWiFi": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [], - userFunction: self.enableWiFi(request:context:) - ) - - case "disableWiFi": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [], - userFunction: self.disableWiFi(request:context:) - ) - - case "enableCellular": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [], - userFunction: self.enableCellular(request:context:) - ) - - case "disableCellular": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [], - userFunction: self.disableCellular(request:context:) - ) - - case "enableBluetooth": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [], - userFunction: self.enableBluetooth(request:context:) - ) - - case "disableBluetooth": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [], - userFunction: self.disableBluetooth(request:context:) - ) - - case "enableDarkMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], - userFunction: self.enableDarkMode(request:context:) - ) - - case "disableDarkMode": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], - userFunction: self.disableDarkMode(request:context:) - ) - - case "openNotifications": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [], - userFunction: self.openNotifications(request:context:) - ) - - case "closeNotifications": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [], - userFunction: self.closeNotifications(request:context:) - ) - - case "closeHeadsUpNotification": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [], - userFunction: self.closeHeadsUpNotification(request:context:) - ) - - case "getNotifications": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [], - userFunction: self.getNotifications(request:context:) - ) - - case "tapOnNotification": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [], - userFunction: self.tapOnNotification(request:context:) - ) - - case "isPermissionDialogVisible": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [], - userFunction: self.isPermissionDialogVisible(request:context:) - ) - - case "handlePermissionDialog": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [], - userFunction: self.handlePermissionDialog(request:context:) - ) - - case "setLocationAccuracy": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [], - userFunction: self.setLocationAccuracy(request:context:) - ) - - case "debug": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedebugInterceptors() ?? [], - userFunction: self.debug(request:context:) - ) - - case "markPatrolAppServiceReady": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [], - userFunction: self.markPatrolAppServiceReady(request:context:) - ) - - default: - return nil - } - } -} - -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Patrol_NativeAutomatorAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { get } - - func initialize( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func configure( - request: Patrol_ConfigureRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// general - func pressHome( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func pressBack( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func pressRecentApps( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func doublePressRecentApps( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func openApp( - request: Patrol_OpenAppRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func openQuickSettings( - request: Patrol_OpenQuickSettingsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// general UI interaction - func getNativeViews( - request: Patrol_GetNativeViewsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNativeViewsResponse - - func tap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func doubleTap( - request: Patrol_TapRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enterText( - request: Patrol_EnterTextRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func swipe( - request: Patrol_SwipeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func waitUntilVisible( - request: Patrol_WaitUntilVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// services - func enableAirplaneMode( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableAirplaneMode( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableWiFi( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableWiFi( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableCellular( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableCellular( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableBluetooth( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableBluetooth( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func enableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func disableDarkMode( - request: Patrol_DarkModeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// notifications - func openNotifications( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func closeNotifications( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func closeHeadsUpNotification( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func getNotifications( - request: Patrol_GetNotificationsRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_GetNotificationsResponse - - func tapOnNotification( - request: Patrol_TapOnNotificationRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// permissions - func isPermissionDialogVisible( - request: Patrol_PermissionDialogVisibleRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_PermissionDialogVisibleResponse - - func handlePermissionDialog( - request: Patrol_HandlePermissionRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - func setLocationAccuracy( - request: Patrol_SetLocationAccuracyRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// other - func debug( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty - - /// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here - func markPatrolAppServiceReady( - request: Patrol_Empty, - context: GRPCAsyncServerCallContext - ) async throws -> Patrol_Empty -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Patrol_NativeAutomatorAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Patrol_NativeAutomatorServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Patrol_NativeAutomatorServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Patrol_NativeAutomatorServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "initialize": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeinitializeInterceptors() ?? [], - wrapping: { try await self.initialize(request: $0, context: $1) } - ) - - case "configure": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeconfigureInterceptors() ?? [], - wrapping: { try await self.configure(request: $0, context: $1) } - ) - - case "pressHome": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressHomeInterceptors() ?? [], - wrapping: { try await self.pressHome(request: $0, context: $1) } - ) - - case "pressBack": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressBackInterceptors() ?? [], - wrapping: { try await self.pressBack(request: $0, context: $1) } - ) - - case "pressRecentApps": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makepressRecentAppsInterceptors() ?? [], - wrapping: { try await self.pressRecentApps(request: $0, context: $1) } - ) - - case "doublePressRecentApps": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoublePressRecentAppsInterceptors() ?? [], - wrapping: { try await self.doublePressRecentApps(request: $0, context: $1) } - ) - - case "openApp": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenAppInterceptors() ?? [], - wrapping: { try await self.openApp(request: $0, context: $1) } - ) - - case "openQuickSettings": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenQuickSettingsInterceptors() ?? [], - wrapping: { try await self.openQuickSettings(request: $0, context: $1) } - ) - - case "getNativeViews": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNativeViewsInterceptors() ?? [], - wrapping: { try await self.getNativeViews(request: $0, context: $1) } - ) - - case "tap": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapInterceptors() ?? [], - wrapping: { try await self.tap(request: $0, context: $1) } - ) - - case "doubleTap": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedoubleTapInterceptors() ?? [], - wrapping: { try await self.doubleTap(request: $0, context: $1) } - ) - - case "enterText": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenterTextInterceptors() ?? [], - wrapping: { try await self.enterText(request: $0, context: $1) } - ) - - case "swipe": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeswipeInterceptors() ?? [], - wrapping: { try await self.swipe(request: $0, context: $1) } - ) - - case "waitUntilVisible": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makewaitUntilVisibleInterceptors() ?? [], - wrapping: { try await self.waitUntilVisible(request: $0, context: $1) } - ) - - case "enableAirplaneMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableAirplaneModeInterceptors() ?? [], - wrapping: { try await self.enableAirplaneMode(request: $0, context: $1) } - ) - - case "disableAirplaneMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableAirplaneModeInterceptors() ?? [], - wrapping: { try await self.disableAirplaneMode(request: $0, context: $1) } - ) - - case "enableWiFi": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableWiFiInterceptors() ?? [], - wrapping: { try await self.enableWiFi(request: $0, context: $1) } - ) - - case "disableWiFi": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableWiFiInterceptors() ?? [], - wrapping: { try await self.disableWiFi(request: $0, context: $1) } - ) - - case "enableCellular": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableCellularInterceptors() ?? [], - wrapping: { try await self.enableCellular(request: $0, context: $1) } - ) - - case "disableCellular": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableCellularInterceptors() ?? [], - wrapping: { try await self.disableCellular(request: $0, context: $1) } - ) - - case "enableBluetooth": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableBluetoothInterceptors() ?? [], - wrapping: { try await self.enableBluetooth(request: $0, context: $1) } - ) - - case "disableBluetooth": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableBluetoothInterceptors() ?? [], - wrapping: { try await self.disableBluetooth(request: $0, context: $1) } - ) - - case "enableDarkMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeenableDarkModeInterceptors() ?? [], - wrapping: { try await self.enableDarkMode(request: $0, context: $1) } - ) - - case "disableDarkMode": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedisableDarkModeInterceptors() ?? [], - wrapping: { try await self.disableDarkMode(request: $0, context: $1) } - ) - - case "openNotifications": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeopenNotificationsInterceptors() ?? [], - wrapping: { try await self.openNotifications(request: $0, context: $1) } - ) - - case "closeNotifications": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseNotificationsInterceptors() ?? [], - wrapping: { try await self.closeNotifications(request: $0, context: $1) } - ) - - case "closeHeadsUpNotification": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makecloseHeadsUpNotificationInterceptors() ?? [], - wrapping: { try await self.closeHeadsUpNotification(request: $0, context: $1) } - ) - - case "getNotifications": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makegetNotificationsInterceptors() ?? [], - wrapping: { try await self.getNotifications(request: $0, context: $1) } - ) - - case "tapOnNotification": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.maketapOnNotificationInterceptors() ?? [], - wrapping: { try await self.tapOnNotification(request: $0, context: $1) } - ) - - case "isPermissionDialogVisible": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeisPermissionDialogVisibleInterceptors() ?? [], - wrapping: { try await self.isPermissionDialogVisible(request: $0, context: $1) } - ) - - case "handlePermissionDialog": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makehandlePermissionDialogInterceptors() ?? [], - wrapping: { try await self.handlePermissionDialog(request: $0, context: $1) } - ) - - case "setLocationAccuracy": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makesetLocationAccuracyInterceptors() ?? [], - wrapping: { try await self.setLocationAccuracy(request: $0, context: $1) } - ) - - case "debug": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makedebugInterceptors() ?? [], - wrapping: { try await self.debug(request: $0, context: $1) } - ) - - case "markPatrolAppServiceReady": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makemarkPatrolAppServiceReadyInterceptors() ?? [], - wrapping: { try await self.markPatrolAppServiceReady(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Patrol_NativeAutomatorServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'initialize'. - /// Defaults to calling `self.makeInterceptors()`. - func makeinitializeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'configure'. - /// Defaults to calling `self.makeInterceptors()`. - func makeconfigureInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pressHome'. - /// Defaults to calling `self.makeInterceptors()`. - func makepressHomeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pressBack'. - /// Defaults to calling `self.makeInterceptors()`. - func makepressBackInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pressRecentApps'. - /// Defaults to calling `self.makeInterceptors()`. - func makepressRecentAppsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'doublePressRecentApps'. - /// Defaults to calling `self.makeInterceptors()`. - func makedoublePressRecentAppsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'openApp'. - /// Defaults to calling `self.makeInterceptors()`. - func makeopenAppInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'openQuickSettings'. - /// Defaults to calling `self.makeInterceptors()`. - func makeopenQuickSettingsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'getNativeViews'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetNativeViewsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'tap'. - /// Defaults to calling `self.makeInterceptors()`. - func maketapInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'doubleTap'. - /// Defaults to calling `self.makeInterceptors()`. - func makedoubleTapInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enterText'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenterTextInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'swipe'. - /// Defaults to calling `self.makeInterceptors()`. - func makeswipeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'waitUntilVisible'. - /// Defaults to calling `self.makeInterceptors()`. - func makewaitUntilVisibleInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableAirplaneMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableAirplaneModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableAirplaneMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableAirplaneModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableWiFi'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableWiFiInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableWiFi'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableWiFiInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableCellular'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableCellularInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableCellular'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableCellularInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableBluetooth'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableBluetoothInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableBluetooth'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableBluetoothInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'enableDarkMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makeenableDarkModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'disableDarkMode'. - /// Defaults to calling `self.makeInterceptors()`. - func makedisableDarkModeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'openNotifications'. - /// Defaults to calling `self.makeInterceptors()`. - func makeopenNotificationsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'closeNotifications'. - /// Defaults to calling `self.makeInterceptors()`. - func makecloseNotificationsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'closeHeadsUpNotification'. - /// Defaults to calling `self.makeInterceptors()`. - func makecloseHeadsUpNotificationInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'getNotifications'. - /// Defaults to calling `self.makeInterceptors()`. - func makegetNotificationsInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'tapOnNotification'. - /// Defaults to calling `self.makeInterceptors()`. - func maketapOnNotificationInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'isPermissionDialogVisible'. - /// Defaults to calling `self.makeInterceptors()`. - func makeisPermissionDialogVisibleInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'handlePermissionDialog'. - /// Defaults to calling `self.makeInterceptors()`. - func makehandlePermissionDialogInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'setLocationAccuracy'. - /// Defaults to calling `self.makeInterceptors()`. - func makesetLocationAccuracyInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'debug'. - /// Defaults to calling `self.makeInterceptors()`. - func makedebugInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'markPatrolAppServiceReady'. - /// Defaults to calling `self.makeInterceptors()`. - func makemarkPatrolAppServiceReadyInterceptors() -> [ServerInterceptor] -} - -internal enum Patrol_NativeAutomatorServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "NativeAutomator", - fullName: "patrol.NativeAutomator", - methods: [ - Patrol_NativeAutomatorServerMetadata.Methods.initialize, - Patrol_NativeAutomatorServerMetadata.Methods.configure, - Patrol_NativeAutomatorServerMetadata.Methods.pressHome, - Patrol_NativeAutomatorServerMetadata.Methods.pressBack, - Patrol_NativeAutomatorServerMetadata.Methods.pressRecentApps, - Patrol_NativeAutomatorServerMetadata.Methods.doublePressRecentApps, - Patrol_NativeAutomatorServerMetadata.Methods.openApp, - Patrol_NativeAutomatorServerMetadata.Methods.openQuickSettings, - Patrol_NativeAutomatorServerMetadata.Methods.getNativeViews, - Patrol_NativeAutomatorServerMetadata.Methods.tap, - Patrol_NativeAutomatorServerMetadata.Methods.doubleTap, - Patrol_NativeAutomatorServerMetadata.Methods.enterText, - Patrol_NativeAutomatorServerMetadata.Methods.swipe, - Patrol_NativeAutomatorServerMetadata.Methods.waitUntilVisible, - Patrol_NativeAutomatorServerMetadata.Methods.enableAirplaneMode, - Patrol_NativeAutomatorServerMetadata.Methods.disableAirplaneMode, - Patrol_NativeAutomatorServerMetadata.Methods.enableWiFi, - Patrol_NativeAutomatorServerMetadata.Methods.disableWiFi, - Patrol_NativeAutomatorServerMetadata.Methods.enableCellular, - Patrol_NativeAutomatorServerMetadata.Methods.disableCellular, - Patrol_NativeAutomatorServerMetadata.Methods.enableBluetooth, - Patrol_NativeAutomatorServerMetadata.Methods.disableBluetooth, - Patrol_NativeAutomatorServerMetadata.Methods.enableDarkMode, - Patrol_NativeAutomatorServerMetadata.Methods.disableDarkMode, - Patrol_NativeAutomatorServerMetadata.Methods.openNotifications, - Patrol_NativeAutomatorServerMetadata.Methods.closeNotifications, - Patrol_NativeAutomatorServerMetadata.Methods.closeHeadsUpNotification, - Patrol_NativeAutomatorServerMetadata.Methods.getNotifications, - Patrol_NativeAutomatorServerMetadata.Methods.tapOnNotification, - Patrol_NativeAutomatorServerMetadata.Methods.isPermissionDialogVisible, - Patrol_NativeAutomatorServerMetadata.Methods.handlePermissionDialog, - Patrol_NativeAutomatorServerMetadata.Methods.setLocationAccuracy, - Patrol_NativeAutomatorServerMetadata.Methods.debug, - Patrol_NativeAutomatorServerMetadata.Methods.markPatrolAppServiceReady, - ] - ) - - internal enum Methods { - internal static let initialize = GRPCMethodDescriptor( - name: "initialize", - path: "/patrol.NativeAutomator/initialize", - type: GRPCCallType.unary - ) - - internal static let configure = GRPCMethodDescriptor( - name: "configure", - path: "/patrol.NativeAutomator/configure", - type: GRPCCallType.unary - ) - - internal static let pressHome = GRPCMethodDescriptor( - name: "pressHome", - path: "/patrol.NativeAutomator/pressHome", - type: GRPCCallType.unary - ) - - internal static let pressBack = GRPCMethodDescriptor( - name: "pressBack", - path: "/patrol.NativeAutomator/pressBack", - type: GRPCCallType.unary - ) - - internal static let pressRecentApps = GRPCMethodDescriptor( - name: "pressRecentApps", - path: "/patrol.NativeAutomator/pressRecentApps", - type: GRPCCallType.unary - ) - - internal static let doublePressRecentApps = GRPCMethodDescriptor( - name: "doublePressRecentApps", - path: "/patrol.NativeAutomator/doublePressRecentApps", - type: GRPCCallType.unary - ) - - internal static let openApp = GRPCMethodDescriptor( - name: "openApp", - path: "/patrol.NativeAutomator/openApp", - type: GRPCCallType.unary - ) - - internal static let openQuickSettings = GRPCMethodDescriptor( - name: "openQuickSettings", - path: "/patrol.NativeAutomator/openQuickSettings", - type: GRPCCallType.unary - ) - - internal static let getNativeViews = GRPCMethodDescriptor( - name: "getNativeViews", - path: "/patrol.NativeAutomator/getNativeViews", - type: GRPCCallType.unary - ) - - internal static let tap = GRPCMethodDescriptor( - name: "tap", - path: "/patrol.NativeAutomator/tap", - type: GRPCCallType.unary - ) - - internal static let doubleTap = GRPCMethodDescriptor( - name: "doubleTap", - path: "/patrol.NativeAutomator/doubleTap", - type: GRPCCallType.unary - ) - - internal static let enterText = GRPCMethodDescriptor( - name: "enterText", - path: "/patrol.NativeAutomator/enterText", - type: GRPCCallType.unary - ) - - internal static let swipe = GRPCMethodDescriptor( - name: "swipe", - path: "/patrol.NativeAutomator/swipe", - type: GRPCCallType.unary - ) - - internal static let waitUntilVisible = GRPCMethodDescriptor( - name: "waitUntilVisible", - path: "/patrol.NativeAutomator/waitUntilVisible", - type: GRPCCallType.unary - ) - - internal static let enableAirplaneMode = GRPCMethodDescriptor( - name: "enableAirplaneMode", - path: "/patrol.NativeAutomator/enableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let disableAirplaneMode = GRPCMethodDescriptor( - name: "disableAirplaneMode", - path: "/patrol.NativeAutomator/disableAirplaneMode", - type: GRPCCallType.unary - ) - - internal static let enableWiFi = GRPCMethodDescriptor( - name: "enableWiFi", - path: "/patrol.NativeAutomator/enableWiFi", - type: GRPCCallType.unary - ) - - internal static let disableWiFi = GRPCMethodDescriptor( - name: "disableWiFi", - path: "/patrol.NativeAutomator/disableWiFi", - type: GRPCCallType.unary - ) - - internal static let enableCellular = GRPCMethodDescriptor( - name: "enableCellular", - path: "/patrol.NativeAutomator/enableCellular", - type: GRPCCallType.unary - ) - - internal static let disableCellular = GRPCMethodDescriptor( - name: "disableCellular", - path: "/patrol.NativeAutomator/disableCellular", - type: GRPCCallType.unary - ) - - internal static let enableBluetooth = GRPCMethodDescriptor( - name: "enableBluetooth", - path: "/patrol.NativeAutomator/enableBluetooth", - type: GRPCCallType.unary - ) - - internal static let disableBluetooth = GRPCMethodDescriptor( - name: "disableBluetooth", - path: "/patrol.NativeAutomator/disableBluetooth", - type: GRPCCallType.unary - ) - - internal static let enableDarkMode = GRPCMethodDescriptor( - name: "enableDarkMode", - path: "/patrol.NativeAutomator/enableDarkMode", - type: GRPCCallType.unary - ) - - internal static let disableDarkMode = GRPCMethodDescriptor( - name: "disableDarkMode", - path: "/patrol.NativeAutomator/disableDarkMode", - type: GRPCCallType.unary - ) - - internal static let openNotifications = GRPCMethodDescriptor( - name: "openNotifications", - path: "/patrol.NativeAutomator/openNotifications", - type: GRPCCallType.unary - ) - - internal static let closeNotifications = GRPCMethodDescriptor( - name: "closeNotifications", - path: "/patrol.NativeAutomator/closeNotifications", - type: GRPCCallType.unary - ) - - internal static let closeHeadsUpNotification = GRPCMethodDescriptor( - name: "closeHeadsUpNotification", - path: "/patrol.NativeAutomator/closeHeadsUpNotification", - type: GRPCCallType.unary - ) - - internal static let getNotifications = GRPCMethodDescriptor( - name: "getNotifications", - path: "/patrol.NativeAutomator/getNotifications", - type: GRPCCallType.unary - ) - - internal static let tapOnNotification = GRPCMethodDescriptor( - name: "tapOnNotification", - path: "/patrol.NativeAutomator/tapOnNotification", - type: GRPCCallType.unary - ) - - internal static let isPermissionDialogVisible = GRPCMethodDescriptor( - name: "isPermissionDialogVisible", - path: "/patrol.NativeAutomator/isPermissionDialogVisible", - type: GRPCCallType.unary - ) - - internal static let handlePermissionDialog = GRPCMethodDescriptor( - name: "handlePermissionDialog", - path: "/patrol.NativeAutomator/handlePermissionDialog", - type: GRPCCallType.unary - ) - - internal static let setLocationAccuracy = GRPCMethodDescriptor( - name: "setLocationAccuracy", - path: "/patrol.NativeAutomator/setLocationAccuracy", - type: GRPCCallType.unary - ) - - internal static let debug = GRPCMethodDescriptor( - name: "debug", - path: "/patrol.NativeAutomator/debug", - type: GRPCCallType.unary - ) - - internal static let markPatrolAppServiceReady = GRPCMethodDescriptor( - name: "markPatrolAppServiceReady", - path: "/patrol.NativeAutomator/markPatrolAppServiceReady", - type: GRPCCallType.unary - ) - } -} diff --git a/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift b/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift deleted file mode 100644 index eb2b6a280..000000000 --- a/packages/patrol/ios/Classes/AutomatorServer/contracts.pb.swift +++ /dev/null @@ -1,2036 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: contracts.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Patrol_ListDartTestsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var group: Patrol_DartTestGroup { - get {return _group ?? Patrol_DartTestGroup()} - set {_group = newValue} - } - /// Returns true if `group` has been explicitly set. - public var hasGroup: Bool {return self._group != nil} - /// Clears the value of `group`. Subsequent reads from it will return its default value. - public mutating func clearGroup() {self._group = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _group: Patrol_DartTestGroup? = nil -} - -public struct Patrol_DartTestGroup { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var tests: [Patrol_DartTestCase] = [] - - public var groups: [Patrol_DartTestGroup] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_DartTestCase { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_RunDartTestRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_RunDartTestResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Patrol_RunDartTestResponse.Result = .success - - public var details: String { - get {return _details ?? String()} - set {_details = newValue} - } - /// Returns true if `details` has been explicitly set. - public var hasDetails: Bool {return self._details != nil} - /// Clears the value of `details`. Subsequent reads from it will return its default value. - public mutating func clearDetails() {self._details = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum { - public typealias RawValue = Int - case success // = 0 - case skipped // = 1 - case failure // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .success - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .success - case 1: self = .skipped - case 2: self = .failure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .success: return 0 - case .skipped: return 1 - case .failure: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} - - fileprivate var _details: String? = nil -} - -#if swift(>=4.2) - -extension Patrol_RunDartTestResponse.Result: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_RunDartTestResponse.Result] = [ - .success, - .skipped, - .failure, - ] -} - -#endif // swift(>=4.2) - -public struct Patrol_ConfigureRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var findTimeoutMillis: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_OpenAppRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_TapOnNotificationRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var findBy: Patrol_TapOnNotificationRequest.OneOf_FindBy? = nil - - public var index: UInt32 { - get { - if case .index(let v)? = findBy {return v} - return 0 - } - set {findBy = .index(newValue)} - } - - public var selector: Patrol_Selector { - get { - if case .selector(let v)? = findBy {return v} - return Patrol_Selector() - } - set {findBy = .selector(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_FindBy: Equatable { - case index(UInt32) - case selector(Patrol_Selector) - - #if !swift(>=4.1) - public static func ==(lhs: Patrol_TapOnNotificationRequest.OneOf_FindBy, rhs: Patrol_TapOnNotificationRequest.OneOf_FindBy) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.index, .index): return { - guard case .index(let l) = lhs, case .index(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.selector, .selector): return { - guard case .selector(let l) = lhs, case .selector(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - public init() {} -} - -/// We're defining our own Empty instead of using google.protobuf.Empty because -/// the Dart plugin can't easily generate it. -/// -/// See: -/// * https://github.com/google/protobuf.dart/issues/170 -public struct Patrol_Empty { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_OpenQuickSettingsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_DarkModeRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_GetNativeViewsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var selector: Patrol_Selector { - get {return _selector ?? Patrol_Selector()} - set {_selector = newValue} - } - /// Returns true if `selector` has been explicitly set. - public var hasSelector: Bool {return self._selector != nil} - /// Clears the value of `selector`. Subsequent reads from it will return its default value. - public mutating func clearSelector() {self._selector = nil} - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _selector: Patrol_Selector? = nil -} - -public struct Patrol_GetNativeViewsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var nativeViews: [Patrol_NativeView] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_GetNotificationsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_GetNotificationsResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var notifications: [Patrol_Notification] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_TapRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var selector: Patrol_Selector { - get {return _selector ?? Patrol_Selector()} - set {_selector = newValue} - } - /// Returns true if `selector` has been explicitly set. - public var hasSelector: Bool {return self._selector != nil} - /// Clears the value of `selector`. Subsequent reads from it will return its default value. - public mutating func clearSelector() {self._selector = nil} - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _selector: Patrol_Selector? = nil -} - -public struct Patrol_EnterTextRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var data: String = String() - - public var appID: String = String() - - public var findBy: Patrol_EnterTextRequest.OneOf_FindBy? = nil - - public var index: UInt32 { - get { - if case .index(let v)? = findBy {return v} - return 0 - } - set {findBy = .index(newValue)} - } - - public var selector: Patrol_Selector { - get { - if case .selector(let v)? = findBy {return v} - return Patrol_Selector() - } - set {findBy = .selector(newValue)} - } - - public var keyboardBehavior: Patrol_EnterTextRequest.KeyboardBehavior = .showAndDismiss - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_FindBy: Equatable { - case index(UInt32) - case selector(Patrol_Selector) - - #if !swift(>=4.1) - public static func ==(lhs: Patrol_EnterTextRequest.OneOf_FindBy, rhs: Patrol_EnterTextRequest.OneOf_FindBy) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch (lhs, rhs) { - case (.index, .index): return { - guard case .index(let l) = lhs, case .index(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.selector, .selector): return { - guard case .selector(let l) = lhs, case .selector(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - public enum KeyboardBehavior: SwiftProtobuf.Enum { - public typealias RawValue = Int - - /// The default keyboard behavior. - /// - /// Keyboard will be shown when entering text starts, and will be - /// automatically dismissed afterwards. - case showAndDismiss // = 0 - - /// The alternative keyboard behavior. - /// - /// On Android, no keyboard will be shown at all. The text will simply appear - /// inside the TextField. - /// - /// On iOS, the keyboard will not be dismissed after entering text. - case alternative // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .showAndDismiss - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .showAndDismiss - case 1: self = .alternative - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .showAndDismiss: return 0 - case .alternative: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension Patrol_EnterTextRequest.KeyboardBehavior: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_EnterTextRequest.KeyboardBehavior] = [ - .showAndDismiss, - .alternative, - ] -} - -#endif // swift(>=4.2) - -public struct Patrol_SwipeRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var startX: Float = 0 - - public var startY: Float = 0 - - public var endX: Float = 0 - - public var endY: Float = 0 - - public var steps: UInt32 = 0 - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_WaitUntilVisibleRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var selector: Patrol_Selector { - get {return _selector ?? Patrol_Selector()} - set {_selector = newValue} - } - /// Returns true if `selector` has been explicitly set. - public var hasSelector: Bool {return self._selector != nil} - /// Clears the value of `selector`. Subsequent reads from it will return its default value. - public mutating func clearSelector() {self._selector = nil} - - public var appID: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _selector: Patrol_Selector? = nil -} - -public struct Patrol_HandlePermissionRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Patrol_HandlePermissionRequest.Code = .whileUsing - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case whileUsing // = 0 - case onlyThisTime // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .whileUsing - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .whileUsing - case 1: self = .onlyThisTime - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .whileUsing: return 0 - case .onlyThisTime: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension Patrol_HandlePermissionRequest.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_HandlePermissionRequest.Code] = [ - .whileUsing, - .onlyThisTime, - .denied, - ] -} - -#endif // swift(>=4.2) - -public struct Patrol_SetLocationAccuracyRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var locationAccuracy: Patrol_SetLocationAccuracyRequest.LocationAccuracy = .coarse - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum LocationAccuracy: SwiftProtobuf.Enum { - public typealias RawValue = Int - case coarse // = 0 - case fine // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .coarse - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .coarse - case 1: self = .fine - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .coarse: return 0 - case .fine: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [Patrol_SetLocationAccuracyRequest.LocationAccuracy] = [ - .coarse, - .fine, - ] -} - -#endif // swift(>=4.2) - -public struct Patrol_PermissionDialogVisibleRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var timeoutMillis: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_PermissionDialogVisibleResponse { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var visible: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Patrol_Selector { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var text: String { - get {return _text ?? String()} - set {_text = newValue} - } - /// Returns true if `text` has been explicitly set. - public var hasText: Bool {return self._text != nil} - /// Clears the value of `text`. Subsequent reads from it will return its default value. - public mutating func clearText() {self._text = nil} - - public var textStartsWith: String { - get {return _textStartsWith ?? String()} - set {_textStartsWith = newValue} - } - /// Returns true if `textStartsWith` has been explicitly set. - public var hasTextStartsWith: Bool {return self._textStartsWith != nil} - /// Clears the value of `textStartsWith`. Subsequent reads from it will return its default value. - public mutating func clearTextStartsWith() {self._textStartsWith = nil} - - public var textContains: String { - get {return _textContains ?? String()} - set {_textContains = newValue} - } - /// Returns true if `textContains` has been explicitly set. - public var hasTextContains: Bool {return self._textContains != nil} - /// Clears the value of `textContains`. Subsequent reads from it will return its default value. - public mutating func clearTextContains() {self._textContains = nil} - - public var className: String { - get {return _className ?? String()} - set {_className = newValue} - } - /// Returns true if `className` has been explicitly set. - public var hasClassName: Bool {return self._className != nil} - /// Clears the value of `className`. Subsequent reads from it will return its default value. - public mutating func clearClassName() {self._className = nil} - - public var contentDescription: String { - get {return _contentDescription ?? String()} - set {_contentDescription = newValue} - } - /// Returns true if `contentDescription` has been explicitly set. - public var hasContentDescription: Bool {return self._contentDescription != nil} - /// Clears the value of `contentDescription`. Subsequent reads from it will return its default value. - public mutating func clearContentDescription() {self._contentDescription = nil} - - public var contentDescriptionStartsWith: String { - get {return _contentDescriptionStartsWith ?? String()} - set {_contentDescriptionStartsWith = newValue} - } - /// Returns true if `contentDescriptionStartsWith` has been explicitly set. - public var hasContentDescriptionStartsWith: Bool {return self._contentDescriptionStartsWith != nil} - /// Clears the value of `contentDescriptionStartsWith`. Subsequent reads from it will return its default value. - public mutating func clearContentDescriptionStartsWith() {self._contentDescriptionStartsWith = nil} - - public var contentDescriptionContains: String { - get {return _contentDescriptionContains ?? String()} - set {_contentDescriptionContains = newValue} - } - /// Returns true if `contentDescriptionContains` has been explicitly set. - public var hasContentDescriptionContains: Bool {return self._contentDescriptionContains != nil} - /// Clears the value of `contentDescriptionContains`. Subsequent reads from it will return its default value. - public mutating func clearContentDescriptionContains() {self._contentDescriptionContains = nil} - - public var resourceID: String { - get {return _resourceID ?? String()} - set {_resourceID = newValue} - } - /// Returns true if `resourceID` has been explicitly set. - public var hasResourceID: Bool {return self._resourceID != nil} - /// Clears the value of `resourceID`. Subsequent reads from it will return its default value. - public mutating func clearResourceID() {self._resourceID = nil} - - public var instance: UInt32 { - get {return _instance ?? 0} - set {_instance = newValue} - } - /// Returns true if `instance` has been explicitly set. - public var hasInstance: Bool {return self._instance != nil} - /// Clears the value of `instance`. Subsequent reads from it will return its default value. - public mutating func clearInstance() {self._instance = nil} - - public var enabled: Bool { - get {return _enabled ?? false} - set {_enabled = newValue} - } - /// Returns true if `enabled` has been explicitly set. - public var hasEnabled: Bool {return self._enabled != nil} - /// Clears the value of `enabled`. Subsequent reads from it will return its default value. - public mutating func clearEnabled() {self._enabled = nil} - - public var focused: Bool { - get {return _focused ?? false} - set {_focused = newValue} - } - /// Returns true if `focused` has been explicitly set. - public var hasFocused: Bool {return self._focused != nil} - /// Clears the value of `focused`. Subsequent reads from it will return its default value. - public mutating func clearFocused() {self._focused = nil} - - public var pkg: String { - get {return _pkg ?? String()} - set {_pkg = newValue} - } - /// Returns true if `pkg` has been explicitly set. - public var hasPkg: Bool {return self._pkg != nil} - /// Clears the value of `pkg`. Subsequent reads from it will return its default value. - public mutating func clearPkg() {self._pkg = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _text: String? = nil - fileprivate var _textStartsWith: String? = nil - fileprivate var _textContains: String? = nil - fileprivate var _className: String? = nil - fileprivate var _contentDescription: String? = nil - fileprivate var _contentDescriptionStartsWith: String? = nil - fileprivate var _contentDescriptionContains: String? = nil - fileprivate var _resourceID: String? = nil - fileprivate var _instance: UInt32? = nil - fileprivate var _enabled: Bool? = nil - fileprivate var _focused: Bool? = nil - fileprivate var _pkg: String? = nil -} - -/// Represents a native UI control. -/// -/// On Android, this is `android.view.View`. -public struct Patrol_NativeView { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var className: String = String() - - public var text: String = String() - - public var contentDescription: String = String() - - public var focused: Bool = false - - public var enabled: Bool = false - - public var childCount: Int32 = 0 - - public var resourceName: String = String() - - public var applicationPackage: String = String() - - public var children: [Patrol_NativeView] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Represents a notification visible in the notification shade. -public struct Patrol_Notification { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appName: String { - get {return _appName ?? String()} - set {_appName = newValue} - } - /// Returns true if `appName` has been explicitly set. - public var hasAppName: Bool {return self._appName != nil} - /// Clears the value of `appName`. Subsequent reads from it will return its default value. - public mutating func clearAppName() {self._appName = nil} - - public var title: String = String() - - public var content: String = String() - - public var raw: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _appName: String? = nil -} - -public struct Patrol_SubmitTestResultsRequest { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var results: Dictionary = [:] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -#if swift(>=5.5) && canImport(_Concurrency) -extension Patrol_ListDartTestsResponse: @unchecked Sendable {} -extension Patrol_DartTestGroup: @unchecked Sendable {} -extension Patrol_DartTestCase: @unchecked Sendable {} -extension Patrol_RunDartTestRequest: @unchecked Sendable {} -extension Patrol_RunDartTestResponse: @unchecked Sendable {} -extension Patrol_RunDartTestResponse.Result: @unchecked Sendable {} -extension Patrol_ConfigureRequest: @unchecked Sendable {} -extension Patrol_OpenAppRequest: @unchecked Sendable {} -extension Patrol_TapOnNotificationRequest: @unchecked Sendable {} -extension Patrol_TapOnNotificationRequest.OneOf_FindBy: @unchecked Sendable {} -extension Patrol_Empty: @unchecked Sendable {} -extension Patrol_OpenQuickSettingsRequest: @unchecked Sendable {} -extension Patrol_DarkModeRequest: @unchecked Sendable {} -extension Patrol_GetNativeViewsRequest: @unchecked Sendable {} -extension Patrol_GetNativeViewsResponse: @unchecked Sendable {} -extension Patrol_GetNotificationsRequest: @unchecked Sendable {} -extension Patrol_GetNotificationsResponse: @unchecked Sendable {} -extension Patrol_TapRequest: @unchecked Sendable {} -extension Patrol_EnterTextRequest: @unchecked Sendable {} -extension Patrol_EnterTextRequest.OneOf_FindBy: @unchecked Sendable {} -extension Patrol_EnterTextRequest.KeyboardBehavior: @unchecked Sendable {} -extension Patrol_SwipeRequest: @unchecked Sendable {} -extension Patrol_WaitUntilVisibleRequest: @unchecked Sendable {} -extension Patrol_HandlePermissionRequest: @unchecked Sendable {} -extension Patrol_HandlePermissionRequest.Code: @unchecked Sendable {} -extension Patrol_SetLocationAccuracyRequest: @unchecked Sendable {} -extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: @unchecked Sendable {} -extension Patrol_PermissionDialogVisibleRequest: @unchecked Sendable {} -extension Patrol_PermissionDialogVisibleResponse: @unchecked Sendable {} -extension Patrol_Selector: @unchecked Sendable {} -extension Patrol_NativeView: @unchecked Sendable {} -extension Patrol_Notification: @unchecked Sendable {} -extension Patrol_SubmitTestResultsRequest: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "patrol" - -extension Patrol_ListDartTestsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ListDartTestsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "group"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._group) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._group { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_ListDartTestsResponse, rhs: Patrol_ListDartTestsResponse) -> Bool { - if lhs._group != rhs._group {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_DartTestGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DartTestGroup" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "tests"), - 3: .same(proto: "groups"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tests) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.groups) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if !self.tests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.tests, fieldNumber: 2) - } - if !self.groups.isEmpty { - try visitor.visitRepeatedMessageField(value: self.groups, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DartTestGroup, rhs: Patrol_DartTestGroup) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.tests != rhs.tests {return false} - if lhs.groups != rhs.groups {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_DartTestCase: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DartTestCase" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DartTestCase, rhs: Patrol_DartTestCase) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_RunDartTestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RunDartTestRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_RunDartTestRequest, rhs: Patrol_RunDartTestRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_RunDartTestResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RunDartTestResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .same(proto: "details"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularStringField(value: &self._details) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .success { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._details { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_RunDartTestResponse, rhs: Patrol_RunDartTestResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._details != rhs._details {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_RunDartTestResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SUCCESS"), - 1: .same(proto: "SKIPPED"), - 2: .same(proto: "FAILURE"), - ] -} - -extension Patrol_ConfigureRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ConfigureRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "findTimeoutMillis"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.findTimeoutMillis) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.findTimeoutMillis != 0 { - try visitor.visitSingularUInt64Field(value: self.findTimeoutMillis, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_ConfigureRequest, rhs: Patrol_ConfigureRequest) -> Bool { - if lhs.findTimeoutMillis != rhs.findTimeoutMillis {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_OpenAppRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenAppRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_OpenAppRequest, rhs: Patrol_OpenAppRequest) -> Bool { - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_TapOnNotificationRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TapOnNotificationRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "index"), - 2: .same(proto: "selector"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: UInt32? - try decoder.decodeSingularUInt32Field(value: &v) - if let v = v { - if self.findBy != nil {try decoder.handleConflictingOneOf()} - self.findBy = .index(v) - } - }() - case 2: try { - var v: Patrol_Selector? - var hadOneofValue = false - if let current = self.findBy { - hadOneofValue = true - if case .selector(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.findBy = .selector(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.findBy { - case .index?: try { - guard case .index(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) - }() - case .selector?: try { - guard case .selector(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_TapOnNotificationRequest, rhs: Patrol_TapOnNotificationRequest) -> Bool { - if lhs.findBy != rhs.findBy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_Empty: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Empty" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_Empty, rhs: Patrol_Empty) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_OpenQuickSettingsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenQuickSettingsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_OpenQuickSettingsRequest, rhs: Patrol_OpenQuickSettingsRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_DarkModeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DarkModeRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_DarkModeRequest, rhs: Patrol_DarkModeRequest) -> Bool { - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNativeViewsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNativeViewsRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selector"), - 2: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selector) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selector { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNativeViewsRequest, rhs: Patrol_GetNativeViewsRequest) -> Bool { - if lhs._selector != rhs._selector {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNativeViewsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNativeViewsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .same(proto: "nativeViews"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.nativeViews) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.nativeViews.isEmpty { - try visitor.visitRepeatedMessageField(value: self.nativeViews, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNativeViewsResponse, rhs: Patrol_GetNativeViewsResponse) -> Bool { - if lhs.nativeViews != rhs.nativeViews {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNotificationsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNotificationsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNotificationsRequest, rhs: Patrol_GetNotificationsRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_GetNotificationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetNotificationsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 2: .same(proto: "notifications"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.notifications) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.notifications.isEmpty { - try visitor.visitRepeatedMessageField(value: self.notifications, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_GetNotificationsResponse, rhs: Patrol_GetNotificationsResponse) -> Bool { - if lhs.notifications != rhs.notifications {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_TapRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TapRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selector"), - 2: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selector) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selector { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_TapRequest, rhs: Patrol_TapRequest) -> Bool { - if lhs._selector != rhs._selector {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_EnterTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EnterTextRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "data"), - 2: .same(proto: "appId"), - 3: .same(proto: "index"), - 4: .same(proto: "selector"), - 5: .same(proto: "keyboardBehavior"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.data) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - case 3: try { - var v: UInt32? - try decoder.decodeSingularUInt32Field(value: &v) - if let v = v { - if self.findBy != nil {try decoder.handleConflictingOneOf()} - self.findBy = .index(v) - } - }() - case 4: try { - var v: Patrol_Selector? - var hadOneofValue = false - if let current = self.findBy { - hadOneofValue = true - if case .selector(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.findBy = .selector(v) - } - }() - case 5: try { try decoder.decodeSingularEnumField(value: &self.keyboardBehavior) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.data.isEmpty { - try visitor.visitSingularStringField(value: self.data, fieldNumber: 1) - } - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - switch self.findBy { - case .index?: try { - guard case .index(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) - }() - case .selector?: try { - guard case .selector(let v)? = self.findBy else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - if self.keyboardBehavior != .showAndDismiss { - try visitor.visitSingularEnumField(value: self.keyboardBehavior, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_EnterTextRequest, rhs: Patrol_EnterTextRequest) -> Bool { - if lhs.data != rhs.data {return false} - if lhs.appID != rhs.appID {return false} - if lhs.findBy != rhs.findBy {return false} - if lhs.keyboardBehavior != rhs.keyboardBehavior {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_EnterTextRequest.KeyboardBehavior: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SHOW_AND_DISMISS"), - 1: .same(proto: "ALTERNATIVE"), - ] -} - -extension Patrol_SwipeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SwipeRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "startX"), - 2: .same(proto: "startY"), - 3: .same(proto: "endX"), - 4: .same(proto: "endY"), - 5: .same(proto: "steps"), - 6: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularFloatField(value: &self.startX) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.startY) }() - case 3: try { try decoder.decodeSingularFloatField(value: &self.endX) }() - case 4: try { try decoder.decodeSingularFloatField(value: &self.endY) }() - case 5: try { try decoder.decodeSingularUInt32Field(value: &self.steps) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.startX != 0 { - try visitor.visitSingularFloatField(value: self.startX, fieldNumber: 1) - } - if self.startY != 0 { - try visitor.visitSingularFloatField(value: self.startY, fieldNumber: 2) - } - if self.endX != 0 { - try visitor.visitSingularFloatField(value: self.endX, fieldNumber: 3) - } - if self.endY != 0 { - try visitor.visitSingularFloatField(value: self.endY, fieldNumber: 4) - } - if self.steps != 0 { - try visitor.visitSingularUInt32Field(value: self.steps, fieldNumber: 5) - } - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_SwipeRequest, rhs: Patrol_SwipeRequest) -> Bool { - if lhs.startX != rhs.startX {return false} - if lhs.startY != rhs.startY {return false} - if lhs.endX != rhs.endX {return false} - if lhs.endY != rhs.endY {return false} - if lhs.steps != rhs.steps {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_WaitUntilVisibleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".WaitUntilVisibleRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selector"), - 2: .same(proto: "appId"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selector) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selector { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.appID.isEmpty { - try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_WaitUntilVisibleRequest, rhs: Patrol_WaitUntilVisibleRequest) -> Bool { - if lhs._selector != rhs._selector {return false} - if lhs.appID != rhs.appID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_HandlePermissionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".HandlePermissionRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .whileUsing { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_HandlePermissionRequest, rhs: Patrol_HandlePermissionRequest) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_HandlePermissionRequest.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WHILE_USING"), - 1: .same(proto: "ONLY_THIS_TIME"), - 2: .same(proto: "DENIED"), - ] -} - -extension Patrol_SetLocationAccuracyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetLocationAccuracyRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "locationAccuracy"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.locationAccuracy) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.locationAccuracy != .coarse { - try visitor.visitSingularEnumField(value: self.locationAccuracy, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_SetLocationAccuracyRequest, rhs: Patrol_SetLocationAccuracyRequest) -> Bool { - if lhs.locationAccuracy != rhs.locationAccuracy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_SetLocationAccuracyRequest.LocationAccuracy: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "COARSE"), - 1: .same(proto: "FINE"), - ] -} - -extension Patrol_PermissionDialogVisibleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PermissionDialogVisibleRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "timeoutMillis"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.timeoutMillis) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.timeoutMillis != 0 { - try visitor.visitSingularUInt64Field(value: self.timeoutMillis, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_PermissionDialogVisibleRequest, rhs: Patrol_PermissionDialogVisibleRequest) -> Bool { - if lhs.timeoutMillis != rhs.timeoutMillis {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_PermissionDialogVisibleResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PermissionDialogVisibleResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "visible"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.visible) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.visible != false { - try visitor.visitSingularBoolField(value: self.visible, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_PermissionDialogVisibleResponse, rhs: Patrol_PermissionDialogVisibleResponse) -> Bool { - if lhs.visible != rhs.visible {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_Selector: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Selector" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "text"), - 2: .same(proto: "textStartsWith"), - 3: .same(proto: "textContains"), - 4: .same(proto: "className"), - 5: .same(proto: "contentDescription"), - 6: .same(proto: "contentDescriptionStartsWith"), - 7: .same(proto: "contentDescriptionContains"), - 8: .same(proto: "resourceId"), - 9: .same(proto: "instance"), - 10: .same(proto: "enabled"), - 11: .same(proto: "focused"), - 12: .same(proto: "pkg"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self._text) }() - case 2: try { try decoder.decodeSingularStringField(value: &self._textStartsWith) }() - case 3: try { try decoder.decodeSingularStringField(value: &self._textContains) }() - case 4: try { try decoder.decodeSingularStringField(value: &self._className) }() - case 5: try { try decoder.decodeSingularStringField(value: &self._contentDescription) }() - case 6: try { try decoder.decodeSingularStringField(value: &self._contentDescriptionStartsWith) }() - case 7: try { try decoder.decodeSingularStringField(value: &self._contentDescriptionContains) }() - case 8: try { try decoder.decodeSingularStringField(value: &self._resourceID) }() - case 9: try { try decoder.decodeSingularUInt32Field(value: &self._instance) }() - case 10: try { try decoder.decodeSingularBoolField(value: &self._enabled) }() - case 11: try { try decoder.decodeSingularBoolField(value: &self._focused) }() - case 12: try { try decoder.decodeSingularStringField(value: &self._pkg) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._text { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } }() - try { if let v = self._textStartsWith { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } }() - try { if let v = self._textContains { - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - } }() - try { if let v = self._className { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } }() - try { if let v = self._contentDescription { - try visitor.visitSingularStringField(value: v, fieldNumber: 5) - } }() - try { if let v = self._contentDescriptionStartsWith { - try visitor.visitSingularStringField(value: v, fieldNumber: 6) - } }() - try { if let v = self._contentDescriptionContains { - try visitor.visitSingularStringField(value: v, fieldNumber: 7) - } }() - try { if let v = self._resourceID { - try visitor.visitSingularStringField(value: v, fieldNumber: 8) - } }() - try { if let v = self._instance { - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 9) - } }() - try { if let v = self._enabled { - try visitor.visitSingularBoolField(value: v, fieldNumber: 10) - } }() - try { if let v = self._focused { - try visitor.visitSingularBoolField(value: v, fieldNumber: 11) - } }() - try { if let v = self._pkg { - try visitor.visitSingularStringField(value: v, fieldNumber: 12) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_Selector, rhs: Patrol_Selector) -> Bool { - if lhs._text != rhs._text {return false} - if lhs._textStartsWith != rhs._textStartsWith {return false} - if lhs._textContains != rhs._textContains {return false} - if lhs._className != rhs._className {return false} - if lhs._contentDescription != rhs._contentDescription {return false} - if lhs._contentDescriptionStartsWith != rhs._contentDescriptionStartsWith {return false} - if lhs._contentDescriptionContains != rhs._contentDescriptionContains {return false} - if lhs._resourceID != rhs._resourceID {return false} - if lhs._instance != rhs._instance {return false} - if lhs._enabled != rhs._enabled {return false} - if lhs._focused != rhs._focused {return false} - if lhs._pkg != rhs._pkg {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_NativeView: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NativeView" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "className"), - 2: .same(proto: "text"), - 3: .same(proto: "contentDescription"), - 4: .same(proto: "focused"), - 5: .same(proto: "enabled"), - 6: .same(proto: "childCount"), - 7: .same(proto: "resourceName"), - 8: .same(proto: "applicationPackage"), - 9: .same(proto: "children"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.className) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.text) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.contentDescription) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.focused) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.enabled) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self.childCount) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.resourceName) }() - case 8: try { try decoder.decodeSingularStringField(value: &self.applicationPackage) }() - case 9: try { try decoder.decodeRepeatedMessageField(value: &self.children) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.className.isEmpty { - try visitor.visitSingularStringField(value: self.className, fieldNumber: 1) - } - if !self.text.isEmpty { - try visitor.visitSingularStringField(value: self.text, fieldNumber: 2) - } - if !self.contentDescription.isEmpty { - try visitor.visitSingularStringField(value: self.contentDescription, fieldNumber: 3) - } - if self.focused != false { - try visitor.visitSingularBoolField(value: self.focused, fieldNumber: 4) - } - if self.enabled != false { - try visitor.visitSingularBoolField(value: self.enabled, fieldNumber: 5) - } - if self.childCount != 0 { - try visitor.visitSingularInt32Field(value: self.childCount, fieldNumber: 6) - } - if !self.resourceName.isEmpty { - try visitor.visitSingularStringField(value: self.resourceName, fieldNumber: 7) - } - if !self.applicationPackage.isEmpty { - try visitor.visitSingularStringField(value: self.applicationPackage, fieldNumber: 8) - } - if !self.children.isEmpty { - try visitor.visitRepeatedMessageField(value: self.children, fieldNumber: 9) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_NativeView, rhs: Patrol_NativeView) -> Bool { - if lhs.className != rhs.className {return false} - if lhs.text != rhs.text {return false} - if lhs.contentDescription != rhs.contentDescription {return false} - if lhs.focused != rhs.focused {return false} - if lhs.enabled != rhs.enabled {return false} - if lhs.childCount != rhs.childCount {return false} - if lhs.resourceName != rhs.resourceName {return false} - if lhs.applicationPackage != rhs.applicationPackage {return false} - if lhs.children != rhs.children {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_Notification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Notification" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "appName"), - 2: .same(proto: "title"), - 3: .same(proto: "content"), - 4: .same(proto: "raw"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self._appName) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.title) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.content) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.raw) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._appName { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } }() - if !self.title.isEmpty { - try visitor.visitSingularStringField(value: self.title, fieldNumber: 2) - } - if !self.content.isEmpty { - try visitor.visitSingularStringField(value: self.content, fieldNumber: 3) - } - if !self.raw.isEmpty { - try visitor.visitSingularStringField(value: self.raw, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_Notification, rhs: Patrol_Notification) -> Bool { - if lhs._appName != rhs._appName {return false} - if lhs.title != rhs.title {return false} - if lhs.content != rhs.content {return false} - if lhs.raw != rhs.raw {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Patrol_SubmitTestResultsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SubmitTestResultsRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "results"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.results) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.results.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.results, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Patrol_SubmitTestResultsRequest, rhs: Patrol_SubmitTestResultsRequest) -> Bool { - if lhs.results != rhs.results {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift new file mode 100644 index 000000000..d7626cadb --- /dev/null +++ b/packages/patrol/ios/Classes/ObjCPatrolAppServiceClient.swift @@ -0,0 +1,91 @@ +/// Simplified objective-c RunDartTestResponse model that we use in PatrolIntegrationTestRunner.h +@objc public class ObjCRunDartTestResponse: NSObject { + @objc public dynamic let passed: Bool + @objc public dynamic let details: String? + + @objc public init(passed: Bool, details: String?) { + self.passed = passed + self.details = details + } +} + +/// Provides access to Patrol's test services running inside the app under test. +/// +/// The client must do its work off the main thread. Otherwise, a deadlock will quickly appear. +/// That's because the main thread is used by methods in ``Automator``, which perform +/// various UI actions such as tapping, entering text, etc., and they must be called on the main thread. +@objc public class ObjCPatrolAppServiceClient: NSObject { + + private let client: PatrolAppServiceClient + + /// Construct client for accessing PatrolAppService server using the existing channel. + @objc public override init() { + let port = 8082 // TODO: Document this value better + // https://github.com/leancodepl/patrol/issues/1683 + let timeout = TimeInterval(2 * 60 * 60) + + NSLog("PatrolAppServiceClient: created, port: \(port)") + + client = PatrolAppServiceClient(port: port, address: "localhost", timeout: timeout) + } + + @objc public func listDartTests() async throws -> [String] { + NSLog("PatrolAppServiceClient.listDartTests()") + + let response = try await client.listDartTests() + + return response.group.listTestsFlat(parentGroupName: "").map { + $0.name + } + } + + @objc public func runDartTest(name: String) async throws -> ObjCRunDartTestResponse { + // TODO: simple workaround - patrolAppService starts running too slowly. + // We should wait for appReady in the dynamically created test case method, + // before calling runDartTest() (in PATROL_INTEGRATION_TEST_IOS_MACRO) + try await Task.sleep(nanoseconds: UInt64(1 * Double(NSEC_PER_SEC))) + + NSLog("PatrolAppServiceClient.runDartTest(\(name))") + + let request = RunDartTestRequest(name: name) + let result = try await client.runDartTest(request: request) + + return ObjCRunDartTestResponse( + passed: result.result == .success, + details: result.details + ) + } +} + +extension DartGroupEntry { + + func listTestsFlat(parentGroupName: String) -> [DartGroupEntry] { + var tests = [DartGroupEntry]() + + for test in self.entries { + var test = test + + if test.type == GroupEntryType.test { + if parentGroupName.isEmpty { + // This case is invalid, because every test will have at least + // 1 named group - its filename. + + fatalError("Invariant violated: test \(test.name) has no named parent group") + } + + test.name = "\(parentGroupName) \(test.name)" + tests.append(test) + } else if test.type == GroupEntryType.group { + if parentGroupName.isEmpty { + tests.append(contentsOf: test.listTestsFlat(parentGroupName: test.name)) + } else { + tests.append( + contentsOf: test.listTestsFlat(parentGroupName: "\(parentGroupName) \(test.name)") + ) + } + } + } + + return tests + } +} diff --git a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift b/packages/patrol/ios/Classes/PatrolAppServiceClient.swift deleted file mode 100644 index b344b7f79..000000000 --- a/packages/patrol/ios/Classes/PatrolAppServiceClient.swift +++ /dev/null @@ -1,57 +0,0 @@ -import GRPC -import Logging -import NIO - -/// The sole reason for existence of this class is that Swift Protobufs can't be used in Objective-C. -@objc public class RunDartTestResponse: NSObject { - @objc public dynamic let passed: Bool - @objc public dynamic let details: String? - - @objc public init(passed: Bool, details: String?) { - self.passed = passed - self.details = details - } -} - -/// Provides access to Patrol's test services running inside the app under test. -/// -/// The client must do its work off the main thread. Otherwise, a deadlock will quickly appear. -/// That's because the main thread is used by methods in ``Automator``, which perform -/// various UI actions such as tapping, entering text, etc., and they must be called on the main thread. -@objc public class PatrolAppServiceClient: NSObject { - - private let client: Patrol_PatrolAppServiceAsyncClient - - /// Construct client for accessing PatrolAppService server using the existing channel. - @objc public override init() { - let port = 8082 // TODO: Document this value better - NSLog("PatrolAppServiceClient: created, port: \(port)") - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) - let channel = try! GRPCChannelPool.with( - target: .host("localhost", port: port), - transportSecurity: .plaintext, - eventLoopGroup: group - ) - - client = Patrol_PatrolAppServiceAsyncClient(channel: channel) - } - - @objc public func listDartTests() async throws -> [String] { - NSLog("PatrolAppServiceClient.listDartTests()") - let request = Patrol_Empty() - let response = try await client.listDartTests(request) - - return response.group.groups.map { $0.name } - } - - @objc public func runDartTest(name: String) async throws -> RunDartTestResponse { - NSLog("PatrolAppServiceClient.runDartTest(\(name))") - let request = Patrol_RunDartTestRequest.with { $0.name = name } - let result = try await client.runDartTest(request) - - return RunDartTestResponse( - passed: result.result == .success, - details: result.details - ) - } -} diff --git a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h index b5a123da6..3d7fe82c8 100644 --- a/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h +++ b/packages/patrol/ios/Classes/PatrolIntegrationTestRunner.h @@ -9,102 +9,102 @@ // For every Flutter dart test, dynamically generate an Objective-C method mirroring the test results // so it is reported as a native XCTest run result. -#define PATROL_INTEGRATION_TEST_IOS_RUNNER(__test_class) \ - @interface __test_class : XCTestCase \ - @end \ - \ - @implementation __test_class \ - \ - +(NSArray *)testInvocations { \ - /* Start native automation gRPC server */ \ - PatrolServer *server = [[PatrolServer alloc] init]; \ - [server startWithCompletionHandler:^(NSError * err) { \ - NSLog(@"Server loop done, error: %@", err); \ - }]; \ - \ - /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ - __block PatrolAppServiceClient *appServiceClient = [[PatrolAppServiceClient alloc] init]; \ - \ - /* Allow the Local Network permission required by Dart Observatory */ \ - XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ - XCUIElementQuery *systemAlerts = springboard.alerts; \ - if (systemAlerts.buttons[@"Allow"].exists) { \ - [systemAlerts.buttons[@"Allow"] tap]; \ - } \ - \ - /* Run the app for the first time to gather Dart tests */ \ - [[[XCUIApplication alloc] init] launch]; \ - \ - /* Spin the runloop waiting until the app reports that it is ready to report Dart tests */ \ - while (!server.appReady) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ - } \ - \ - __block NSArray *dartTestFiles = NULL; \ - [appServiceClient \ - listDartTestsWithCompletionHandler:^(NSArray *_Nullable dartTests, NSError *_Nullable err) { \ - if (err != NULL) { \ - NSLog(@"listDartTests(): failed, err: %@", err); \ - } \ - \ - dartTestFiles = dartTests; \ - }]; \ - \ - /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ - while (!dartTestFiles) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ - } \ - \ - NSLog(@"Got %lu Dart tests: %@", dartTestFiles.count, dartTestFiles); \ - \ - NSMutableArray *invocations = [[NSMutableArray alloc] init]; \ - \ - /** \ - * Once Dart tests are available, we: \ - * \ - * Step 1. Dynamically add test case methods that request execution of an individual Dart test file. \ - * \ - * Step 2. Create invocations to the generated methods and return them \ - */ \ - \ - for (NSString * dartTestFile in dartTestFiles) { \ - /* Step 1 - dynamically create test cases */ \ - \ - IMP implementation = imp_implementationWithBlock(^(id _self) { \ - [[[XCUIApplication alloc] init] launch]; \ - \ - __block RunDartTestResponse *response = NULL; \ - [appServiceClient runDartTestWithName:dartTestFile \ - completionHandler:^(RunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ - if (err != NULL) { \ - NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTestFile, err); \ - } \ - \ - response = r; \ - }]; \ - \ - /* Wait until Dart test finishes */ \ - while (!response) { \ - [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ - } \ - \ - XCTAssertTrue(response.passed, @"%@", response.details); \ - }); \ - NSString *selectorName = [PatrolUtils createMethodNameFromPatrolGeneratedGroup:dartTestFile]; \ - SEL selector = NSSelectorFromString(selectorName); \ - class_addMethod(self, selector, implementation, "v@:"); \ - \ - /* Step 2 – create invocations to the dynamically created methods */ \ - NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; \ - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; \ - invocation.selector = selector; \ - \ - NSLog(@"RunnerUITests.testInvocations(): selectorName = %@, signature: %@", selectorName, signature); \ - \ - [invocations addObject:invocation]; \ - } \ - \ - return invocations; \ - } \ - \ +#define PATROL_INTEGRATION_TEST_IOS_RUNNER(__test_class) \ + @interface __test_class : XCTestCase \ + @end \ + \ + @implementation __test_class \ + \ + +(NSArray *)testInvocations { \ + /* Start native automation gRPC server */ \ + PatrolServer *server = [[PatrolServer alloc] init]; \ + [server startWithCompletionHandler:^(NSError * err) { \ + NSLog(@"Server loop done, error: %@", err); \ + }]; \ + \ + /* Create a client for PatrolAppService, which lets us list and run Dart tests */ \ + __block ObjCPatrolAppServiceClient *appServiceClient = [[ObjCPatrolAppServiceClient alloc] init]; \ + \ + /* Allow the Local Network permission required by Dart Observatory */ \ + XCUIApplication *springboard = [[XCUIApplication alloc] initWithBundleIdentifier:@"com.apple.springboard"]; \ + XCUIElementQuery *systemAlerts = springboard.alerts; \ + if (systemAlerts.buttons[@"Allow"].exists) { \ + [systemAlerts.buttons[@"Allow"] tap]; \ + } \ + \ + /* Run the app for the first time to gather Dart tests */ \ + [[[XCUIApplication alloc] init] launch]; \ + \ + /* Spin the runloop waiting until the app reports that it is ready to report Dart tests */ \ + while (!server.appReady) { \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + } \ + \ + __block NSArray *dartTests = NULL; \ + [appServiceClient \ + listDartTestsWithCompletionHandler:^(NSArray *_Nullable tests, NSError *_Nullable err) { \ + if (err != NULL) { \ + NSLog(@"listDartTests(): failed, err: %@", err); \ + } \ + \ + dartTests = tests; \ + }]; \ + \ + /* Spin the runloop waiting until the app reports the Dart tests it contains */ \ + while (!dartTests) { \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + } \ + \ + NSLog(@"Got %lu Dart tests: %@", dartTests.count, dartTests); \ + \ + NSMutableArray *invocations = [[NSMutableArray alloc] init]; \ + \ + /** \ + * Once Dart tests are available, we: \ + * \ + * Step 1. Dynamically add test case methods that request execution of an individual Dart test file. \ + * \ + * Step 2. Create invocations to the generated methods and return them \ + */ \ + \ + for (NSString * dartTest in dartTests) { \ + /* Step 1 - dynamically create test cases */ \ + \ + IMP implementation = imp_implementationWithBlock(^(id _self) { \ + [[[XCUIApplication alloc] init] launch]; \ + \ + __block ObjCRunDartTestResponse *response = NULL; \ + [appServiceClient runDartTestWithName:dartTest \ + completionHandler:^(ObjCRunDartTestResponse *_Nullable r, NSError *_Nullable err) { \ + if (err != NULL) { \ + NSLog(@"runDartTestWithName(%@): failed, err: %@", dartTest, err); \ + } \ + \ + response = r; \ + }]; \ + \ + /* Wait until Dart test finishes */ \ + while (!response) { \ + [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0]]; \ + } \ + \ + XCTAssertTrue(response.passed, @"%@", response.details); \ + }); \ + NSString *selectorName = [PatrolUtils createMethodNameFromPatrolGeneratedGroup:dartTest]; \ + SEL selector = NSSelectorFromString(selectorName); \ + class_addMethod(self, selector, implementation, "v@:"); \ + \ + /* Step 2 – create invocations to the dynamically created methods */ \ + NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; \ + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; \ + invocation.selector = selector; \ + \ + NSLog(@"RunnerUITests.testInvocations(): selectorName = %@, signature: %@", selectorName, signature); \ + \ + [invocations addObject:invocation]; \ + } \ + \ + return invocations; \ + } \ + \ @end\ diff --git a/packages/patrol/ios/Classes/PatrolUtils.h b/packages/patrol/ios/Classes/PatrolUtils.h index 76c93ba18..2ae389146 100644 --- a/packages/patrol/ios/Classes/PatrolUtils.h +++ b/packages/patrol/ios/Classes/PatrolUtils.h @@ -6,6 +6,8 @@ NS_ASSUME_NONNULL_BEGIN /// Converts test group names in Dart (generated by Patrol CLI) into a valid Objective-C method name. + (NSString *)createMethodNameFromPatrolGeneratedGroup:(NSString *)dartTestGroup; ++ (NSString *)convertFirstPart:(NSString *)filePath; ++ (NSString *)convertSecondPart:(NSString *)filePath; @end NS_ASSUME_NONNULL_END diff --git a/packages/patrol/ios/Classes/PatrolUtils.m b/packages/patrol/ios/Classes/PatrolUtils.m index 5dc802099..6e778dc36 100644 --- a/packages/patrol/ios/Classes/PatrolUtils.m +++ b/packages/patrol/ios/Classes/PatrolUtils.m @@ -6,10 +6,36 @@ @implementation PatrolUtils + (NSString *)createMethodNameFromPatrolGeneratedGroup:(NSString *)dartGroupName { - NSMutableString *temp = [NSMutableString stringWithString:dartGroupName]; + // Let's assume dartGroupName is "examples.example_test completes main flow". + // It consists of two parts. + // + // The first part, "examples.example_test", reflects the location of the Dart + // test file in the filesystem at integration_test/examples/example_test. + // For the first part of this name to be a valid Objective-C identifier, we convert + // it to "examples_exampleTest" + // + // The second part, "completes main flow" is the name of the test. For it to be a + // valid Objective-C identifier, we convert it to "completesMainFlow". + // + // Then both parts are concatenated together with a "___", resulting in + // "examples_exampleTest___completesMainFlow" + NSArray *parts = [[self class] splitIntoParts:dartGroupName]; + + NSString *firstPart = [[self class] convertFirstPart:parts[0]]; + NSString *secondPart = [[self class] convertSecondPart:parts[1]]; + + NSString *result = @""; + result = [result stringByAppendingString:firstPart]; + result = [result stringByAppendingString:@"___"]; + result = [result stringByAppendingString:secondPart]; + + return result; +} + ++ (NSString *)convertFirstPart:(NSString *)filePath { // Split the string by dot - NSArray *components = [[temp componentsSeparatedByString:@"."] mutableCopy]; + NSArray *components = [[filePath componentsSeparatedByString:@"."] mutableCopy]; // Convert the filename from snake_case to camelCase NSMutableString *fileName = [components.lastObject mutableCopy]; @@ -23,14 +49,52 @@ + (NSString *)createMethodNameFromPatrolGeneratedGroup:(NSString *)dartGroupName [fileName appendString:camelCaseWord]; } - NSMutableArray *pathComponents = - [[components subarrayWithRange:NSMakeRange(0, components.count - 1)] mutableCopy]; + NSRange range = NSMakeRange(0, components.count - 1); + NSMutableArray *pathComponents = [[components subarrayWithRange:range] mutableCopy]; if (pathComponents.count > 0) { NSString *path = [pathComponents componentsJoinedByString:@"_"]; - return [NSString stringWithFormat:@"%@_%@", path, fileName]; - } else { - return fileName; + [fileName setString:[NSString stringWithFormat:@"%@_%@", path, fileName]]; + } + + return fileName; +} + ++ (NSString *)convertSecondPart:(NSString *)testName { + // Convert the filename from "space delimeted words" to camelCasedWords + // NSString.capitalizedString could be used here as well. + + NSArray *words = [testName componentsSeparatedByString:@" "]; + NSMutableString *capitalizedTestName = [words.firstObject mutableCopy]; + [capitalizedTestName setString:words[0]]; + for (NSUInteger i = 1; i < words.count; i++) { + NSString *word = words[i]; + NSString *firstLetter = [[word substringToIndex:1] capitalizedString]; + NSString *restOfWord = [word substringFromIndex:1]; + NSString *camelCaseWord = [firstLetter stringByAppendingString:restOfWord]; + [capitalizedTestName appendString:camelCaseWord]; } + + // Objective-C method names must be alphanumeric. + NSMutableCharacterSet *allowedCharacters = [NSMutableCharacterSet alphanumericCharacterSet]; // invertedSet + [allowedCharacters addCharactersInString:@"_"]; + NSCharacterSet *disallowedCharacters = allowedCharacters.invertedSet; + + // Remove disallowed characters. + NSString *filteredTestName = + [[capitalizedTestName componentsSeparatedByCharactersInSet:disallowedCharacters] componentsJoinedByString:@""]; + return filteredTestName; +} + ++ (NSArray *)splitIntoParts:(NSString *)testName { + // The first space in the original dartGroupName is a good separator for the 2 parts. + NSArray *parts = [[testName componentsSeparatedByString:@" "] mutableCopy]; + NSString *firstPart = parts[0]; + NSString *secondPart = [[parts subarrayWithRange:NSMakeRange(1, parts.count - 1)] componentsJoinedByString:@" "]; + + NSMutableArray *result = [[NSMutableArray alloc] init]; + [result addObject:firstPart]; + [result addObject:secondPart]; + return result; } @end diff --git a/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift b/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift index 2b6d2eb94..c07ab9da1 100644 --- a/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift +++ b/packages/patrol/ios/Classes/SwiftPatrolPlugin.swift @@ -1,5 +1,4 @@ import Flutter -import GRPC import UIKit let kChannelName = "pl.leancode.patrol/main" diff --git a/packages/patrol/ios/patrol.podspec b/packages/patrol/ios/patrol.podspec index 90edb6d8b..15af13f7c 100644 --- a/packages/patrol/ios/patrol.podspec +++ b/packages/patrol/ios/patrol.podspec @@ -23,7 +23,6 @@ Runs tests that use flutter_test and patrol APIs as native iOS integration tests # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - - s.dependency 'gRPC-Swift', '~> 1.8.0' # This is the last version published on CocoaPods. - # Newer ones are only available on SPM. + + s.dependency 'Telegraph', '~> 0.30.0' end diff --git a/packages/patrol/lib/src/binding.dart b/packages/patrol/lib/src/binding.dart index c8ec6fb30..85328c4e7 100644 --- a/packages/patrol/lib/src/binding.dart +++ b/packages/patrol/lib/src/binding.dart @@ -1,17 +1,10 @@ -// We allow for using properties of IntegrationTestWidgetsFlutterBinding, which -// are marked as @visibleForTesting but we need them (we could write our own, -// but we're lazy and prefer to use theirs). - import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/common.dart'; import 'package:integration_test/integration_test.dart'; import 'package:patrol/patrol.dart'; -// ignore: implementation_imports, depend_on_referenced_packages -import 'package:test_api/src/backend/invoker.dart'; -// ignore: implementation_imports, depend_on_referenced_packages -import 'package:test_api/src/backend/live_test.dart'; +import 'package:patrol/src/global_state.dart' as global_state; import 'constants.dart' as constants; @@ -45,11 +38,10 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { PatrolBinding() { final oldTestExceptionReporter = reportTestException; reportTestException = (details, testDescription) { - final currentDartTestFile = _currentDartTestFile; - if (currentDartTestFile != null) { + final currentDartTest = _currentDartTest; + if (currentDartTest != null) { assert(!constants.hotRestartEnabled); - _testResults[currentDartTestFile] = - Failure(testDescription, '$details'); + _testResults[currentDartTest] = Failure(testDescription, '$details'); } oldTestExceptionReporter(details, testDescription); }; @@ -60,7 +52,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { return; } - _currentDartTestFile = Invoker.current!.liveTest.parentGroupName; + _currentDartTest = global_state.currentTestFullName; }); tearDown(() async { @@ -69,7 +61,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { return; } - final testName = Invoker.current!.liveTest.individualName; + final testName = global_state.currentTestIndividualName; final isTestExplorer = testName == 'patrol_test_explorer'; if (isTestExplorer) { return; @@ -79,21 +71,28 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { ); } - final invoker = Invoker.current!; - final nameOfRequestedTest = await patrolAppService.testExecutionRequested; - if (nameOfRequestedTest == _currentDartTestFile) { - final passed = invoker.liveTest.state.result.isPassing; + + if (nameOfRequestedTest == _currentDartTest) { + logger( + 'finished test $_currentDartTest. Will report its status back to the native side', + ); + + final passed = global_state.isCurrentTestPassing; logger( - 'tearDown(): test "$testName" in group "$_currentDartTestFile", passed: $passed', + 'tearDown(): test "$testName" in group "$_currentDartTest", passed: $passed', ); await patrolAppService.markDartTestAsCompleted( - dartFileName: _currentDartTestFile!, + dartFileName: _currentDartTest!, passed: passed, - details: _testResults[_currentDartTestFile!] is Failure - ? (_testResults[_currentDartTestFile!] as Failure?)?.details + details: _testResults[_currentDartTest!] is Failure + ? (_testResults[_currentDartTest!] as Failure?)?.details : null, ); + } else { + logger( + 'finished test $_currentDartTest, but it was not requested, so its status will not be reported back to the native side', + ); } }); } @@ -127,7 +126,7 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { static PatrolBinding get instance => BindingBase.checkInstance(_instance); static PatrolBinding? _instance; - String? _currentDartTestFile; + String? _currentDartTest; /// Keys are the test descriptions, and values are either [_success] or /// a [Failure]. @@ -164,8 +163,8 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { @override void attachRootWidget(Widget rootWidget) { assert( - (_currentDartTestFile != null) != (constants.hotRestartEnabled), - '_currentDartTestFile can be null if and only if Hot Restart is enabled', + (_currentDartTest != null) != (constants.hotRestartEnabled), + '_currentDartTest can be null if and only if Hot Restart is enabled', ); const testLabelEnabled = bool.fromEnvironment('PATROL_TEST_LABEL_ENABLED'); @@ -184,10 +183,12 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { top: MediaQueryData.fromWindow(window).padding.top + 4, left: 4, ), - child: Text( - _currentDartTestFile!, - textDirection: TextDirection.ltr, - style: const TextStyle(color: Colors.red), + child: IgnorePointer( + child: Text( + _currentDartTest!, + textDirection: TextDirection.ltr, + style: const TextStyle(color: Colors.red), + ), ), ), ), @@ -197,10 +198,3 @@ class PatrolBinding extends IntegrationTestWidgetsFlutterBinding { } } } - -extension on LiveTest { - /// Get the direct parent group of the currently running test. - /// - /// The group's name is the name of the Dart test file the test is defined in. - String get parentGroupName => groups.last.name; -} diff --git a/packages/patrol/lib/src/common.dart b/packages/patrol/lib/src/common.dart index 71d101390..f6df39cb1 100644 --- a/packages/patrol/lib/src/common.dart +++ b/packages/patrol/lib/src/common.dart @@ -1,5 +1,3 @@ -// ignore_for_file: invalid_use_of_internal_member, implementation_imports - import 'dart:io' as io; import 'package:flutter/foundation.dart'; @@ -7,12 +5,13 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; -import 'package:patrol/src/native/contracts/contracts.pb.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/global_state.dart' as global_state; +import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:patrol/src/native/native.dart'; import 'package:patrol_finders/patrol_finders.dart' as finders; +// ignore: implementation_imports import 'package:test_api/src/backend/group.dart'; -import 'package:test_api/src/backend/invoker.dart'; +// ignore: implementation_imports import 'package:test_api/src/backend/test.dart'; import 'constants.dart' as constants; @@ -116,9 +115,8 @@ void patrolTest( // "integration_test/examples" directory, we assume that the name of the // immediate parent group is "examples.example_test". - final parentGroupName = Invoker.current!.liveTest.groups.last.name; final requestedToExecute = await patrolBinding.patrolAppService - .waitForExecutionRequest(parentGroupName); + .waitForExecutionRequest(global_state.currentTestFullName); if (!requestedToExecute) { return; @@ -161,24 +159,98 @@ void patrolTest( ); } -/// Creates a DartTestGroup by visiting the subgroups of [topLevelGroup]. +/// Creates a DartGroupEntry by visiting the subgroups of [parentGroup]. +/// +/// The initial [parentGroup] is the implicit, unnamed top-level [Group] present +/// in every test case. @internal -DartTestGroup createDartTestGroup( - Group topLevelGroup, { - String prefix = '', +DartGroupEntry createDartTestGroup( + Group parentGroup, { + String name = '', + int level = 0, + int maxTestCaseLength = global_state.maxTestLength, }) { - final groupName = topLevelGroup.name.replaceFirst(prefix, '').trim(); - final group = DartTestGroup(name: groupName); + final groupDTO = DartGroupEntry( + name: name, + type: GroupEntryType.group, + entries: [], + ); - for (final entry in topLevelGroup.entries) { - if (entry is Group) { - group.groups.add(DartTestGroup(name: entry.name)); + for (final entry in parentGroup.entries) { + // Trim names of current groups + + var name = entry.name; + if (parentGroup.name.isNotEmpty) { + // Assume that parentGroupName fits maxTestCaseLength + // Assume that after cropping, test names are different. + + if (name.length > maxTestCaseLength) { + name = name.substring(0, maxTestCaseLength); + } + + name = deduplicateGroupEntryName(parentGroup.name, name); } - if (entry is Test && entry.name != 'patrol_test_explorer') { - throw StateError('Expected group, got test: ${entry.name}'); + if (entry is Group) { + groupDTO.entries.add( + createDartTestGroup( + entry, + name: name, + level: level + 1, + maxTestCaseLength: maxTestCaseLength, + ), + ); + } else if (entry is Test) { + if (entry.name == 'patrol_test_explorer') { + // throw StateError('Expected group, got test: ${entry.name}'); + // Ignore the bogus test that is used to discover the test structure. + continue; + } + + if (level < 1) { + throw StateError('Test is not allowed to be defined at level $level'); + } + + groupDTO.entries.add( + DartGroupEntry(name: name, type: GroupEntryType.test, entries: []), + ); + } else { + // This should really never happen, because Group and Test are the only + // subclasses of GroupEntry. + throw StateError('invalid state'); } } - return group; + return groupDTO; +} + +/// Allows for retrieving the name of a GroupEntry by stripping the names of all ancestor groups. +/// +/// Example: +/// parentName = 'example_test myGroup' +/// currentName = 'example_test myGroup myTest' +/// should return 'myTest' +@internal +String deduplicateGroupEntryName(String parentName, String currentName) { + return currentName.substring( + parentName.length + 1, + currentName.length, + ); +} + +/// Recursively prints the structure of the test suite. +@internal +void printGroupStructure(DartGroupEntry group, {int indentation = 0}) { + final indent = ' ' * indentation; + debugPrint("$indent-- group: '${group.name}'"); + + for (final entry in group.entries) { + if (entry.type == GroupEntryType.test) { + debugPrint("$indent -- test: '${entry.name}'"); + } else { + for (final subgroup in entry.entries) { + printGroupStructure(subgroup, indentation: indentation + 5); + } + } + } } diff --git a/packages/patrol/lib/src/global_state.dart b/packages/patrol/lib/src/global_state.dart new file mode 100644 index 000000000..318574d3e --- /dev/null +++ b/packages/patrol/lib/src/global_state.dart @@ -0,0 +1,35 @@ +// ignore: implementation_imports +import 'package:test_api/src/backend/invoker.dart'; + +/// Maximum test case length for ATO, after transformations. +/// +/// See https://github.com/leancodepl/patrol/issues/1725 +const maxTestLength = 190; + +/// This file wraps the [Invoker] API, which is internal to package:test. We +/// want to minimize the usage of internal APIs to a minimum. + +/// Returns the full name of the current test (names of all ancestor groups + +/// name of the current test). +String get currentTestFullName { + final invoker = Invoker.current!; + + final parentGroupName = invoker.liveTest.groups.last.name; + final testName = invoker.liveTest.individualName; + + var nameCandidate = '$parentGroupName $testName'; + if (nameCandidate.length > 190) { + nameCandidate = nameCandidate.substring(0, 190); + } + return nameCandidate; +} + +/// Returns the individual name of the current test. Omits all ancestor groups. +String get currentTestIndividualName { + return Invoker.current!.liveTest.individualName; +} + +/// Returns whether the current test is passing. +bool get isCurrentTestPassing { + return Invoker.current!.liveTest.state.result.isPassing; +} diff --git a/packages/patrol/lib/src/native/contracts/contracts.dart b/packages/patrol/lib/src/native/contracts/contracts.dart new file mode 100644 index 000000000..27fb69c01 --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/contracts.dart @@ -0,0 +1,605 @@ +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'contracts.g.dart'; + +enum GroupEntryType { + @JsonValue('group') + group, + @JsonValue('test') + test +} + +enum RunDartTestResponseResult { + @JsonValue('success') + success, + @JsonValue('skipped') + skipped, + @JsonValue('failure') + failure +} + +enum KeyboardBehavior { + @JsonValue('showAndDismiss') + showAndDismiss, + @JsonValue('alternative') + alternative +} + +enum HandlePermissionRequestCode { + @JsonValue('whileUsing') + whileUsing, + @JsonValue('onlyThisTime') + onlyThisTime, + @JsonValue('denied') + denied +} + +enum SetLocationAccuracyRequestLocationAccuracy { + @JsonValue('coarse') + coarse, + @JsonValue('fine') + fine +} + +@JsonSerializable() +class DartGroupEntry with EquatableMixin { + DartGroupEntry({ + required this.name, + required this.type, + required this.entries, + }); + + factory DartGroupEntry.fromJson(Map json) => + _$DartGroupEntryFromJson(json); + + final String name; + final GroupEntryType type; + final List entries; + + Map toJson() => _$DartGroupEntryToJson(this); + + @override + List get props => [ + name, + type, + entries, + ]; +} + +@JsonSerializable() +class ListDartTestsResponse with EquatableMixin { + ListDartTestsResponse({ + required this.group, + }); + + factory ListDartTestsResponse.fromJson(Map json) => + _$ListDartTestsResponseFromJson(json); + + final DartGroupEntry group; + + Map toJson() => _$ListDartTestsResponseToJson(this); + + @override + List get props => [ + group, + ]; +} + +@JsonSerializable() +class RunDartTestRequest with EquatableMixin { + RunDartTestRequest({ + required this.name, + }); + + factory RunDartTestRequest.fromJson(Map json) => + _$RunDartTestRequestFromJson(json); + + final String name; + + Map toJson() => _$RunDartTestRequestToJson(this); + + @override + List get props => [ + name, + ]; +} + +@JsonSerializable() +class RunDartTestResponse with EquatableMixin { + RunDartTestResponse({ + required this.result, + this.details, + }); + + factory RunDartTestResponse.fromJson(Map json) => + _$RunDartTestResponseFromJson(json); + + final RunDartTestResponseResult result; + final String? details; + + Map toJson() => _$RunDartTestResponseToJson(this); + + @override + List get props => [ + result, + details, + ]; +} + +@JsonSerializable() +class ConfigureRequest with EquatableMixin { + ConfigureRequest({ + required this.findTimeoutMillis, + }); + + factory ConfigureRequest.fromJson(Map json) => + _$ConfigureRequestFromJson(json); + + final int findTimeoutMillis; + + Map toJson() => _$ConfigureRequestToJson(this); + + @override + List get props => [ + findTimeoutMillis, + ]; +} + +@JsonSerializable() +class OpenAppRequest with EquatableMixin { + OpenAppRequest({ + required this.appId, + }); + + factory OpenAppRequest.fromJson(Map json) => + _$OpenAppRequestFromJson(json); + + final String appId; + + Map toJson() => _$OpenAppRequestToJson(this); + + @override + List get props => [ + appId, + ]; +} + +@JsonSerializable() +class OpenQuickSettingsRequest with EquatableMixin { + OpenQuickSettingsRequest(); + + factory OpenQuickSettingsRequest.fromJson(Map json) => + _$OpenQuickSettingsRequestFromJson(json); + + Map toJson() => _$OpenQuickSettingsRequestToJson(this); + + @override + List get props => const []; +} + +@JsonSerializable() +class Selector with EquatableMixin { + Selector({ + this.text, + this.textStartsWith, + this.textContains, + this.className, + this.contentDescription, + this.contentDescriptionStartsWith, + this.contentDescriptionContains, + this.resourceId, + this.instance, + this.enabled, + this.focused, + this.pkg, + }); + + factory Selector.fromJson(Map json) => + _$SelectorFromJson(json); + + final String? text; + final String? textStartsWith; + final String? textContains; + final String? className; + final String? contentDescription; + final String? contentDescriptionStartsWith; + final String? contentDescriptionContains; + final String? resourceId; + final int? instance; + final bool? enabled; + final bool? focused; + final String? pkg; + + Map toJson() => _$SelectorToJson(this); + + @override + List get props => [ + text, + textStartsWith, + textContains, + className, + contentDescription, + contentDescriptionStartsWith, + contentDescriptionContains, + resourceId, + instance, + enabled, + focused, + pkg, + ]; +} + +@JsonSerializable() +class GetNativeViewsRequest with EquatableMixin { + GetNativeViewsRequest({ + required this.selector, + required this.appId, + }); + + factory GetNativeViewsRequest.fromJson(Map json) => + _$GetNativeViewsRequestFromJson(json); + + final Selector selector; + final String appId; + + Map toJson() => _$GetNativeViewsRequestToJson(this); + + @override + List get props => [ + selector, + appId, + ]; +} + +@JsonSerializable() +class NativeView with EquatableMixin { + NativeView({ + this.className, + this.text, + this.contentDescription, + required this.focused, + required this.enabled, + this.childCount, + this.resourceName, + this.applicationPackage, + required this.children, + }); + + factory NativeView.fromJson(Map json) => + _$NativeViewFromJson(json); + + final String? className; + final String? text; + final String? contentDescription; + final bool focused; + final bool enabled; + final int? childCount; + final String? resourceName; + final String? applicationPackage; + final List children; + + Map toJson() => _$NativeViewToJson(this); + + @override + List get props => [ + className, + text, + contentDescription, + focused, + enabled, + childCount, + resourceName, + applicationPackage, + children, + ]; +} + +@JsonSerializable() +class GetNativeViewsResponse with EquatableMixin { + GetNativeViewsResponse({ + required this.nativeViews, + }); + + factory GetNativeViewsResponse.fromJson(Map json) => + _$GetNativeViewsResponseFromJson(json); + + final List nativeViews; + + Map toJson() => _$GetNativeViewsResponseToJson(this); + + @override + List get props => [ + nativeViews, + ]; +} + +@JsonSerializable() +class TapRequest with EquatableMixin { + TapRequest({ + required this.selector, + required this.appId, + }); + + factory TapRequest.fromJson(Map json) => + _$TapRequestFromJson(json); + + final Selector selector; + final String appId; + + Map toJson() => _$TapRequestToJson(this); + + @override + List get props => [ + selector, + appId, + ]; +} + +@JsonSerializable() +class EnterTextRequest with EquatableMixin { + EnterTextRequest({ + required this.data, + required this.appId, + this.index, + this.selector, + required this.keyboardBehavior, + }); + + factory EnterTextRequest.fromJson(Map json) => + _$EnterTextRequestFromJson(json); + + final String data; + final String appId; + final int? index; + final Selector? selector; + final KeyboardBehavior keyboardBehavior; + + Map toJson() => _$EnterTextRequestToJson(this); + + @override + List get props => [ + data, + appId, + index, + selector, + keyboardBehavior, + ]; +} + +@JsonSerializable() +class SwipeRequest with EquatableMixin { + SwipeRequest({ + required this.startX, + required this.startY, + required this.endX, + required this.endY, + required this.steps, + }); + + factory SwipeRequest.fromJson(Map json) => + _$SwipeRequestFromJson(json); + + final double startX; + final double startY; + final double endX; + final double endY; + final int steps; + + Map toJson() => _$SwipeRequestToJson(this); + + @override + List get props => [ + startX, + startY, + endX, + endY, + steps, + ]; +} + +@JsonSerializable() +class WaitUntilVisibleRequest with EquatableMixin { + WaitUntilVisibleRequest({ + required this.selector, + required this.appId, + }); + + factory WaitUntilVisibleRequest.fromJson(Map json) => + _$WaitUntilVisibleRequestFromJson(json); + + final Selector selector; + final String appId; + + Map toJson() => _$WaitUntilVisibleRequestToJson(this); + + @override + List get props => [ + selector, + appId, + ]; +} + +@JsonSerializable() +class DarkModeRequest with EquatableMixin { + DarkModeRequest({ + required this.appId, + }); + + factory DarkModeRequest.fromJson(Map json) => + _$DarkModeRequestFromJson(json); + + final String appId; + + Map toJson() => _$DarkModeRequestToJson(this); + + @override + List get props => [ + appId, + ]; +} + +@JsonSerializable() +class Notification with EquatableMixin { + Notification({ + this.appName, + required this.title, + required this.content, + this.raw, + }); + + factory Notification.fromJson(Map json) => + _$NotificationFromJson(json); + + final String? appName; + final String title; + final String content; + final String? raw; + + Map toJson() => _$NotificationToJson(this); + + @override + List get props => [ + appName, + title, + content, + raw, + ]; +} + +@JsonSerializable() +class GetNotificationsResponse with EquatableMixin { + GetNotificationsResponse({ + required this.notifications, + }); + + factory GetNotificationsResponse.fromJson(Map json) => + _$GetNotificationsResponseFromJson(json); + + final List notifications; + + Map toJson() => _$GetNotificationsResponseToJson(this); + + @override + List get props => [ + notifications, + ]; +} + +@JsonSerializable() +class GetNotificationsRequest with EquatableMixin { + GetNotificationsRequest(); + + factory GetNotificationsRequest.fromJson(Map json) => + _$GetNotificationsRequestFromJson(json); + + Map toJson() => _$GetNotificationsRequestToJson(this); + + @override + List get props => const []; +} + +@JsonSerializable() +class TapOnNotificationRequest with EquatableMixin { + TapOnNotificationRequest({ + this.index, + this.selector, + }); + + factory TapOnNotificationRequest.fromJson(Map json) => + _$TapOnNotificationRequestFromJson(json); + + final int? index; + final Selector? selector; + + Map toJson() => _$TapOnNotificationRequestToJson(this); + + @override + List get props => [ + index, + selector, + ]; +} + +@JsonSerializable() +class PermissionDialogVisibleResponse with EquatableMixin { + PermissionDialogVisibleResponse({ + required this.visible, + }); + + factory PermissionDialogVisibleResponse.fromJson(Map json) => + _$PermissionDialogVisibleResponseFromJson(json); + + final bool visible; + + Map toJson() => + _$PermissionDialogVisibleResponseToJson(this); + + @override + List get props => [ + visible, + ]; +} + +@JsonSerializable() +class PermissionDialogVisibleRequest with EquatableMixin { + PermissionDialogVisibleRequest({ + required this.timeoutMillis, + }); + + factory PermissionDialogVisibleRequest.fromJson(Map json) => + _$PermissionDialogVisibleRequestFromJson(json); + + final int timeoutMillis; + + Map toJson() => _$PermissionDialogVisibleRequestToJson(this); + + @override + List get props => [ + timeoutMillis, + ]; +} + +@JsonSerializable() +class HandlePermissionRequest with EquatableMixin { + HandlePermissionRequest({ + required this.code, + }); + + factory HandlePermissionRequest.fromJson(Map json) => + _$HandlePermissionRequestFromJson(json); + + final HandlePermissionRequestCode code; + + Map toJson() => _$HandlePermissionRequestToJson(this); + + @override + List get props => [ + code, + ]; +} + +@JsonSerializable() +class SetLocationAccuracyRequest with EquatableMixin { + SetLocationAccuracyRequest({ + required this.locationAccuracy, + }); + + factory SetLocationAccuracyRequest.fromJson(Map json) => + _$SetLocationAccuracyRequestFromJson(json); + + final SetLocationAccuracyRequestLocationAccuracy locationAccuracy; + + Map toJson() => _$SetLocationAccuracyRequestToJson(this); + + @override + List get props => [ + locationAccuracy, + ]; +} diff --git a/packages/patrol/lib/src/native/contracts/contracts.g.dart b/packages/patrol/lib/src/native/contracts/contracts.g.dart new file mode 100644 index 000000000..02a6c767f --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/contracts.g.dart @@ -0,0 +1,376 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'contracts.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +DartGroupEntry _$DartGroupEntryFromJson(Map json) => + DartGroupEntry( + name: json['name'] as String, + type: $enumDecode(_$GroupEntryTypeEnumMap, json['type']), + entries: (json['entries'] as List) + .map((e) => DartGroupEntry.fromJson(e as Map)) + .toList(), + ); + +Map _$DartGroupEntryToJson(DartGroupEntry instance) => + { + 'name': instance.name, + 'type': _$GroupEntryTypeEnumMap[instance.type]!, + 'entries': instance.entries, + }; + +const _$GroupEntryTypeEnumMap = { + GroupEntryType.group: 'group', + GroupEntryType.test: 'test', +}; + +ListDartTestsResponse _$ListDartTestsResponseFromJson( + Map json) => + ListDartTestsResponse( + group: DartGroupEntry.fromJson(json['group'] as Map), + ); + +Map _$ListDartTestsResponseToJson( + ListDartTestsResponse instance) => + { + 'group': instance.group, + }; + +RunDartTestRequest _$RunDartTestRequestFromJson(Map json) => + RunDartTestRequest( + name: json['name'] as String, + ); + +Map _$RunDartTestRequestToJson(RunDartTestRequest instance) => + { + 'name': instance.name, + }; + +RunDartTestResponse _$RunDartTestResponseFromJson(Map json) => + RunDartTestResponse( + result: $enumDecode(_$RunDartTestResponseResultEnumMap, json['result']), + details: json['details'] as String?, + ); + +Map _$RunDartTestResponseToJson( + RunDartTestResponse instance) => + { + 'result': _$RunDartTestResponseResultEnumMap[instance.result]!, + 'details': instance.details, + }; + +const _$RunDartTestResponseResultEnumMap = { + RunDartTestResponseResult.success: 'success', + RunDartTestResponseResult.skipped: 'skipped', + RunDartTestResponseResult.failure: 'failure', +}; + +ConfigureRequest _$ConfigureRequestFromJson(Map json) => + ConfigureRequest( + findTimeoutMillis: json['findTimeoutMillis'] as int, + ); + +Map _$ConfigureRequestToJson(ConfigureRequest instance) => + { + 'findTimeoutMillis': instance.findTimeoutMillis, + }; + +OpenAppRequest _$OpenAppRequestFromJson(Map json) => + OpenAppRequest( + appId: json['appId'] as String, + ); + +Map _$OpenAppRequestToJson(OpenAppRequest instance) => + { + 'appId': instance.appId, + }; + +OpenQuickSettingsRequest _$OpenQuickSettingsRequestFromJson( + Map json) => + OpenQuickSettingsRequest(); + +Map _$OpenQuickSettingsRequestToJson( + OpenQuickSettingsRequest instance) => + {}; + +Selector _$SelectorFromJson(Map json) => Selector( + text: json['text'] as String?, + textStartsWith: json['textStartsWith'] as String?, + textContains: json['textContains'] as String?, + className: json['className'] as String?, + contentDescription: json['contentDescription'] as String?, + contentDescriptionStartsWith: + json['contentDescriptionStartsWith'] as String?, + contentDescriptionContains: json['contentDescriptionContains'] as String?, + resourceId: json['resourceId'] as String?, + instance: json['instance'] as int?, + enabled: json['enabled'] as bool?, + focused: json['focused'] as bool?, + pkg: json['pkg'] as String?, + ); + +Map _$SelectorToJson(Selector instance) => { + 'text': instance.text, + 'textStartsWith': instance.textStartsWith, + 'textContains': instance.textContains, + 'className': instance.className, + 'contentDescription': instance.contentDescription, + 'contentDescriptionStartsWith': instance.contentDescriptionStartsWith, + 'contentDescriptionContains': instance.contentDescriptionContains, + 'resourceId': instance.resourceId, + 'instance': instance.instance, + 'enabled': instance.enabled, + 'focused': instance.focused, + 'pkg': instance.pkg, + }; + +GetNativeViewsRequest _$GetNativeViewsRequestFromJson( + Map json) => + GetNativeViewsRequest( + selector: Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String, + ); + +Map _$GetNativeViewsRequestToJson( + GetNativeViewsRequest instance) => + { + 'selector': instance.selector, + 'appId': instance.appId, + }; + +NativeView _$NativeViewFromJson(Map json) => NativeView( + className: json['className'] as String?, + text: json['text'] as String?, + contentDescription: json['contentDescription'] as String?, + focused: json['focused'] as bool, + enabled: json['enabled'] as bool, + childCount: json['childCount'] as int?, + resourceName: json['resourceName'] as String?, + applicationPackage: json['applicationPackage'] as String?, + children: (json['children'] as List) + .map((e) => NativeView.fromJson(e as Map)) + .toList(), + ); + +Map _$NativeViewToJson(NativeView instance) => + { + 'className': instance.className, + 'text': instance.text, + 'contentDescription': instance.contentDescription, + 'focused': instance.focused, + 'enabled': instance.enabled, + 'childCount': instance.childCount, + 'resourceName': instance.resourceName, + 'applicationPackage': instance.applicationPackage, + 'children': instance.children, + }; + +GetNativeViewsResponse _$GetNativeViewsResponseFromJson( + Map json) => + GetNativeViewsResponse( + nativeViews: (json['nativeViews'] as List) + .map((e) => NativeView.fromJson(e as Map)) + .toList(), + ); + +Map _$GetNativeViewsResponseToJson( + GetNativeViewsResponse instance) => + { + 'nativeViews': instance.nativeViews, + }; + +TapRequest _$TapRequestFromJson(Map json) => TapRequest( + selector: Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String, + ); + +Map _$TapRequestToJson(TapRequest instance) => + { + 'selector': instance.selector, + 'appId': instance.appId, + }; + +EnterTextRequest _$EnterTextRequestFromJson(Map json) => + EnterTextRequest( + data: json['data'] as String, + appId: json['appId'] as String, + index: json['index'] as int?, + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + keyboardBehavior: + $enumDecode(_$KeyboardBehaviorEnumMap, json['keyboardBehavior']), + ); + +Map _$EnterTextRequestToJson(EnterTextRequest instance) => + { + 'data': instance.data, + 'appId': instance.appId, + 'index': instance.index, + 'selector': instance.selector, + 'keyboardBehavior': _$KeyboardBehaviorEnumMap[instance.keyboardBehavior]!, + }; + +const _$KeyboardBehaviorEnumMap = { + KeyboardBehavior.showAndDismiss: 'showAndDismiss', + KeyboardBehavior.alternative: 'alternative', +}; + +SwipeRequest _$SwipeRequestFromJson(Map json) => SwipeRequest( + startX: (json['startX'] as num).toDouble(), + startY: (json['startY'] as num).toDouble(), + endX: (json['endX'] as num).toDouble(), + endY: (json['endY'] as num).toDouble(), + steps: json['steps'] as int, + ); + +Map _$SwipeRequestToJson(SwipeRequest instance) => + { + 'startX': instance.startX, + 'startY': instance.startY, + 'endX': instance.endX, + 'endY': instance.endY, + 'steps': instance.steps, + }; + +WaitUntilVisibleRequest _$WaitUntilVisibleRequestFromJson( + Map json) => + WaitUntilVisibleRequest( + selector: Selector.fromJson(json['selector'] as Map), + appId: json['appId'] as String, + ); + +Map _$WaitUntilVisibleRequestToJson( + WaitUntilVisibleRequest instance) => + { + 'selector': instance.selector, + 'appId': instance.appId, + }; + +DarkModeRequest _$DarkModeRequestFromJson(Map json) => + DarkModeRequest( + appId: json['appId'] as String, + ); + +Map _$DarkModeRequestToJson(DarkModeRequest instance) => + { + 'appId': instance.appId, + }; + +Notification _$NotificationFromJson(Map json) => Notification( + appName: json['appName'] as String?, + title: json['title'] as String, + content: json['content'] as String, + raw: json['raw'] as String?, + ); + +Map _$NotificationToJson(Notification instance) => + { + 'appName': instance.appName, + 'title': instance.title, + 'content': instance.content, + 'raw': instance.raw, + }; + +GetNotificationsResponse _$GetNotificationsResponseFromJson( + Map json) => + GetNotificationsResponse( + notifications: (json['notifications'] as List) + .map((e) => Notification.fromJson(e as Map)) + .toList(), + ); + +Map _$GetNotificationsResponseToJson( + GetNotificationsResponse instance) => + { + 'notifications': instance.notifications, + }; + +GetNotificationsRequest _$GetNotificationsRequestFromJson( + Map json) => + GetNotificationsRequest(); + +Map _$GetNotificationsRequestToJson( + GetNotificationsRequest instance) => + {}; + +TapOnNotificationRequest _$TapOnNotificationRequestFromJson( + Map json) => + TapOnNotificationRequest( + index: json['index'] as int?, + selector: json['selector'] == null + ? null + : Selector.fromJson(json['selector'] as Map), + ); + +Map _$TapOnNotificationRequestToJson( + TapOnNotificationRequest instance) => + { + 'index': instance.index, + 'selector': instance.selector, + }; + +PermissionDialogVisibleResponse _$PermissionDialogVisibleResponseFromJson( + Map json) => + PermissionDialogVisibleResponse( + visible: json['visible'] as bool, + ); + +Map _$PermissionDialogVisibleResponseToJson( + PermissionDialogVisibleResponse instance) => + { + 'visible': instance.visible, + }; + +PermissionDialogVisibleRequest _$PermissionDialogVisibleRequestFromJson( + Map json) => + PermissionDialogVisibleRequest( + timeoutMillis: json['timeoutMillis'] as int, + ); + +Map _$PermissionDialogVisibleRequestToJson( + PermissionDialogVisibleRequest instance) => + { + 'timeoutMillis': instance.timeoutMillis, + }; + +HandlePermissionRequest _$HandlePermissionRequestFromJson( + Map json) => + HandlePermissionRequest( + code: $enumDecode(_$HandlePermissionRequestCodeEnumMap, json['code']), + ); + +Map _$HandlePermissionRequestToJson( + HandlePermissionRequest instance) => + { + 'code': _$HandlePermissionRequestCodeEnumMap[instance.code]!, + }; + +const _$HandlePermissionRequestCodeEnumMap = { + HandlePermissionRequestCode.whileUsing: 'whileUsing', + HandlePermissionRequestCode.onlyThisTime: 'onlyThisTime', + HandlePermissionRequestCode.denied: 'denied', +}; + +SetLocationAccuracyRequest _$SetLocationAccuracyRequestFromJson( + Map json) => + SetLocationAccuracyRequest( + locationAccuracy: $enumDecode( + _$SetLocationAccuracyRequestLocationAccuracyEnumMap, + json['locationAccuracy']), + ); + +Map _$SetLocationAccuracyRequestToJson( + SetLocationAccuracyRequest instance) => + { + 'locationAccuracy': _$SetLocationAccuracyRequestLocationAccuracyEnumMap[ + instance.locationAccuracy]!, + }; + +const _$SetLocationAccuracyRequestLocationAccuracyEnumMap = { + SetLocationAccuracyRequestLocationAccuracy.coarse: 'coarse', + SetLocationAccuracyRequestLocationAccuracy.fine: 'fine', +}; diff --git a/packages/patrol/lib/src/native/contracts/contracts.pb.dart b/packages/patrol/lib/src/native/contracts/contracts.pb.dart deleted file mode 100644 index 46006cdef..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pb.dart +++ /dev/null @@ -1,2637 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; - -import 'package:fixnum/fixnum.dart' as $fixnum; -import 'package:protobuf/protobuf.dart' as $pb; - -import 'contracts.pbenum.dart'; - -export 'contracts.pbenum.dart'; - -class ListDartTestsResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'ListDartTestsResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'group', - subBuilder: DartTestGroup.create) - ..hasRequiredFields = false; - - ListDartTestsResponse._() : super(); - factory ListDartTestsResponse({ - DartTestGroup? group, - }) { - final _result = create(); - if (group != null) { - _result.group = group; - } - return _result; - } - factory ListDartTestsResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ListDartTestsResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ListDartTestsResponse clone() => - ListDartTestsResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ListDartTestsResponse copyWith( - void Function(ListDartTestsResponse) updates) => - super.copyWith((message) => updates(message as ListDartTestsResponse)) - as ListDartTestsResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ListDartTestsResponse create() => ListDartTestsResponse._(); - ListDartTestsResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ListDartTestsResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static ListDartTestsResponse? _defaultInstance; - - @$pb.TagNumber(1) - DartTestGroup get group => $_getN(0); - @$pb.TagNumber(1) - set group(DartTestGroup v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasGroup() => $_has(0); - @$pb.TagNumber(1) - void clearGroup() => clearField(1); - @$pb.TagNumber(1) - DartTestGroup ensureGroup() => $_ensure(0); -} - -class DartTestGroup extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DartTestGroup', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..pc( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'tests', - $pb.PbFieldType.PM, - subBuilder: DartTestCase.create) - ..pc( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'groups', - $pb.PbFieldType.PM, - subBuilder: DartTestGroup.create) - ..hasRequiredFields = false; - - DartTestGroup._() : super(); - factory DartTestGroup({ - $core.String? name, - $core.Iterable? tests, - $core.Iterable? groups, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - if (tests != null) { - _result.tests.addAll(tests); - } - if (groups != null) { - _result.groups.addAll(groups); - } - return _result; - } - factory DartTestGroup.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DartTestGroup.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DartTestGroup clone() => DartTestGroup()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DartTestGroup copyWith(void Function(DartTestGroup) updates) => - super.copyWith((message) => updates(message as DartTestGroup)) - as DartTestGroup; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DartTestGroup create() => DartTestGroup._(); - DartTestGroup createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DartTestGroup getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DartTestGroup? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); - - @$pb.TagNumber(2) - $core.List get tests => $_getList(1); - - @$pb.TagNumber(3) - $core.List get groups => $_getList(2); -} - -class DartTestCase extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DartTestCase', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..hasRequiredFields = false; - - DartTestCase._() : super(); - factory DartTestCase({ - $core.String? name, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - return _result; - } - factory DartTestCase.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DartTestCase.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DartTestCase clone() => DartTestCase()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DartTestCase copyWith(void Function(DartTestCase) updates) => - super.copyWith((message) => updates(message as DartTestCase)) - as DartTestCase; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DartTestCase create() => DartTestCase._(); - DartTestCase createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DartTestCase getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DartTestCase? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); -} - -class RunDartTestRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'RunDartTestRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'name') - ..hasRequiredFields = false; - - RunDartTestRequest._() : super(); - factory RunDartTestRequest({ - $core.String? name, - }) { - final _result = create(); - if (name != null) { - _result.name = name; - } - return _result; - } - factory RunDartTestRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory RunDartTestRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RunDartTestRequest clone() => RunDartTestRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RunDartTestRequest copyWith(void Function(RunDartTestRequest) updates) => - super.copyWith((message) => updates(message as RunDartTestRequest)) - as RunDartTestRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RunDartTestRequest create() => RunDartTestRequest._(); - RunDartTestRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RunDartTestRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RunDartTestRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get name => $_getSZ(0); - @$pb.TagNumber(1) - set name($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasName() => $_has(0); - @$pb.TagNumber(1) - void clearName() => clearField(1); -} - -class RunDartTestResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'RunDartTestResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'result', - $pb.PbFieldType.OE, - defaultOrMaker: RunDartTestResponse_Result.SUCCESS, - valueOf: RunDartTestResponse_Result.valueOf, - enumValues: RunDartTestResponse_Result.values) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'details') - ..hasRequiredFields = false; - - RunDartTestResponse._() : super(); - factory RunDartTestResponse({ - RunDartTestResponse_Result? result, - $core.String? details, - }) { - final _result = create(); - if (result != null) { - _result.result = result; - } - if (details != null) { - _result.details = details; - } - return _result; - } - factory RunDartTestResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory RunDartTestResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - RunDartTestResponse clone() => RunDartTestResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RunDartTestResponse copyWith(void Function(RunDartTestResponse) updates) => - super.copyWith((message) => updates(message as RunDartTestResponse)) - as RunDartTestResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static RunDartTestResponse create() => RunDartTestResponse._(); - RunDartTestResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static RunDartTestResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RunDartTestResponse? _defaultInstance; - - @$pb.TagNumber(1) - RunDartTestResponse_Result get result => $_getN(0); - @$pb.TagNumber(1) - set result(RunDartTestResponse_Result v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasResult() => $_has(0); - @$pb.TagNumber(1) - void clearResult() => clearField(1); - - @$pb.TagNumber(2) - $core.String get details => $_getSZ(1); - @$pb.TagNumber(2) - set details($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasDetails() => $_has(1); - @$pb.TagNumber(2) - void clearDetails() => clearField(2); -} - -class ConfigureRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'ConfigureRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..a<$fixnum.Int64>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'findTimeoutMillis', - $pb.PbFieldType.OU6, - protoName: 'findTimeoutMillis', - defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false; - - ConfigureRequest._() : super(); - factory ConfigureRequest({ - $fixnum.Int64? findTimeoutMillis, - }) { - final _result = create(); - if (findTimeoutMillis != null) { - _result.findTimeoutMillis = findTimeoutMillis; - } - return _result; - } - factory ConfigureRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory ConfigureRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ConfigureRequest clone() => ConfigureRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ConfigureRequest copyWith(void Function(ConfigureRequest) updates) => - super.copyWith((message) => updates(message as ConfigureRequest)) - as ConfigureRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ConfigureRequest create() => ConfigureRequest._(); - ConfigureRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ConfigureRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static ConfigureRequest? _defaultInstance; - - @$pb.TagNumber(1) - $fixnum.Int64 get findTimeoutMillis => $_getI64(0); - @$pb.TagNumber(1) - set findTimeoutMillis($fixnum.Int64 v) { - $_setInt64(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasFindTimeoutMillis() => $_has(0); - @$pb.TagNumber(1) - void clearFindTimeoutMillis() => clearField(1); -} - -class OpenAppRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'OpenAppRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - OpenAppRequest._() : super(); - factory OpenAppRequest({ - $core.String? appId, - }) { - final _result = create(); - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory OpenAppRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory OpenAppRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OpenAppRequest clone() => OpenAppRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OpenAppRequest copyWith(void Function(OpenAppRequest) updates) => - super.copyWith((message) => updates(message as OpenAppRequest)) - as OpenAppRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OpenAppRequest create() => OpenAppRequest._(); - OpenAppRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OpenAppRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static OpenAppRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get appId => $_getSZ(0); - @$pb.TagNumber(1) - set appId($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasAppId() => $_has(0); - @$pb.TagNumber(1) - void clearAppId() => clearField(1); -} - -enum TapOnNotificationRequest_FindBy { index_, selector, notSet } - -class TapOnNotificationRequest extends $pb.GeneratedMessage { - static const $core.Map<$core.int, TapOnNotificationRequest_FindBy> - _TapOnNotificationRequest_FindByByTag = { - 1: TapOnNotificationRequest_FindBy.index_, - 2: TapOnNotificationRequest_FindBy.selector, - 0: TapOnNotificationRequest_FindBy.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'TapOnNotificationRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..oo(0, [1, 2]) - ..a<$core.int>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'index', - $pb.PbFieldType.OU3) - ..aOM( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..hasRequiredFields = false; - - TapOnNotificationRequest._() : super(); - factory TapOnNotificationRequest({ - $core.int? index, - Selector? selector, - }) { - final _result = create(); - if (index != null) { - _result.index = index; - } - if (selector != null) { - _result.selector = selector; - } - return _result; - } - factory TapOnNotificationRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory TapOnNotificationRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TapOnNotificationRequest clone() => - TapOnNotificationRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TapOnNotificationRequest copyWith( - void Function(TapOnNotificationRequest) updates) => - super.copyWith((message) => updates(message as TapOnNotificationRequest)) - as TapOnNotificationRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TapOnNotificationRequest create() => TapOnNotificationRequest._(); - TapOnNotificationRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TapOnNotificationRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static TapOnNotificationRequest? _defaultInstance; - - TapOnNotificationRequest_FindBy whichFindBy() => - _TapOnNotificationRequest_FindByByTag[$_whichOneof(0)]!; - void clearFindBy() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.int get index => $_getIZ(0); - @$pb.TagNumber(1) - set index($core.int v) { - $_setUnsignedInt32(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasIndex() => $_has(0); - @$pb.TagNumber(1) - void clearIndex() => clearField(1); - - @$pb.TagNumber(2) - Selector get selector => $_getN(1); - @$pb.TagNumber(2) - set selector(Selector v) { - setField(2, v); - } - - @$pb.TagNumber(2) - $core.bool hasSelector() => $_has(1); - @$pb.TagNumber(2) - void clearSelector() => clearField(2); - @$pb.TagNumber(2) - Selector ensureSelector() => $_ensure(1); -} - -class Empty extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Empty', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..hasRequiredFields = false; - - Empty._() : super(); - factory Empty() => create(); - factory Empty.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Empty.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Empty clone() => Empty()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Empty copyWith(void Function(Empty) updates) => - super.copyWith((message) => updates(message as Empty)) - as Empty; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Empty create() => Empty._(); - Empty createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Empty getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Empty? _defaultInstance; -} - -class OpenQuickSettingsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'OpenQuickSettingsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..hasRequiredFields = false; - - OpenQuickSettingsRequest._() : super(); - factory OpenQuickSettingsRequest() => create(); - factory OpenQuickSettingsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory OpenQuickSettingsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - OpenQuickSettingsRequest clone() => - OpenQuickSettingsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - OpenQuickSettingsRequest copyWith( - void Function(OpenQuickSettingsRequest) updates) => - super.copyWith((message) => updates(message as OpenQuickSettingsRequest)) - as OpenQuickSettingsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static OpenQuickSettingsRequest create() => OpenQuickSettingsRequest._(); - OpenQuickSettingsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static OpenQuickSettingsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static OpenQuickSettingsRequest? _defaultInstance; -} - -class DarkModeRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'DarkModeRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - DarkModeRequest._() : super(); - factory DarkModeRequest({ - $core.String? appId, - }) { - final _result = create(); - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory DarkModeRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory DarkModeRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DarkModeRequest clone() => DarkModeRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DarkModeRequest copyWith(void Function(DarkModeRequest) updates) => - super.copyWith((message) => updates(message as DarkModeRequest)) - as DarkModeRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static DarkModeRequest create() => DarkModeRequest._(); - DarkModeRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static DarkModeRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static DarkModeRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get appId => $_getSZ(0); - @$pb.TagNumber(1) - set appId($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasAppId() => $_has(0); - @$pb.TagNumber(1) - void clearAppId() => clearField(1); -} - -class GetNativeViewsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNativeViewsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - GetNativeViewsRequest._() : super(); - factory GetNativeViewsRequest({ - Selector? selector, - $core.String? appId, - }) { - final _result = create(); - if (selector != null) { - _result.selector = selector; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory GetNativeViewsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNativeViewsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNativeViewsRequest clone() => - GetNativeViewsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNativeViewsRequest copyWith( - void Function(GetNativeViewsRequest) updates) => - super.copyWith((message) => updates(message as GetNativeViewsRequest)) - as GetNativeViewsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNativeViewsRequest create() => GetNativeViewsRequest._(); - GetNativeViewsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNativeViewsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNativeViewsRequest? _defaultInstance; - - @$pb.TagNumber(1) - Selector get selector => $_getN(0); - @$pb.TagNumber(1) - set selector(Selector v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasSelector() => $_has(0); - @$pb.TagNumber(1) - void clearSelector() => clearField(1); - @$pb.TagNumber(1) - Selector ensureSelector() => $_ensure(0); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); -} - -class GetNativeViewsResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNativeViewsResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..pc( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'nativeViews', - $pb.PbFieldType.PM, - protoName: 'nativeViews', - subBuilder: NativeView.create) - ..hasRequiredFields = false; - - GetNativeViewsResponse._() : super(); - factory GetNativeViewsResponse({ - $core.Iterable? nativeViews, - }) { - final _result = create(); - if (nativeViews != null) { - _result.nativeViews.addAll(nativeViews); - } - return _result; - } - factory GetNativeViewsResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNativeViewsResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNativeViewsResponse clone() => - GetNativeViewsResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNativeViewsResponse copyWith( - void Function(GetNativeViewsResponse) updates) => - super.copyWith((message) => updates(message as GetNativeViewsResponse)) - as GetNativeViewsResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNativeViewsResponse create() => GetNativeViewsResponse._(); - GetNativeViewsResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNativeViewsResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNativeViewsResponse? _defaultInstance; - - @$pb.TagNumber(2) - $core.List get nativeViews => $_getList(0); -} - -class GetNotificationsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNotificationsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..hasRequiredFields = false; - - GetNotificationsRequest._() : super(); - factory GetNotificationsRequest() => create(); - factory GetNotificationsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNotificationsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNotificationsRequest clone() => - GetNotificationsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNotificationsRequest copyWith( - void Function(GetNotificationsRequest) updates) => - super.copyWith((message) => updates(message as GetNotificationsRequest)) - as GetNotificationsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNotificationsRequest create() => GetNotificationsRequest._(); - GetNotificationsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNotificationsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNotificationsRequest? _defaultInstance; -} - -class GetNotificationsResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'GetNotificationsResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..pc( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'notifications', - $pb.PbFieldType.PM, - subBuilder: Notification.create) - ..hasRequiredFields = false; - - GetNotificationsResponse._() : super(); - factory GetNotificationsResponse({ - $core.Iterable? notifications, - }) { - final _result = create(); - if (notifications != null) { - _result.notifications.addAll(notifications); - } - return _result; - } - factory GetNotificationsResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory GetNotificationsResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - GetNotificationsResponse clone() => - GetNotificationsResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - GetNotificationsResponse copyWith( - void Function(GetNotificationsResponse) updates) => - super.copyWith((message) => updates(message as GetNotificationsResponse)) - as GetNotificationsResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static GetNotificationsResponse create() => GetNotificationsResponse._(); - GetNotificationsResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static GetNotificationsResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static GetNotificationsResponse? _defaultInstance; - - @$pb.TagNumber(2) - $core.List get notifications => $_getList(0); -} - -class TapRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'TapRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - TapRequest._() : super(); - factory TapRequest({ - Selector? selector, - $core.String? appId, - }) { - final _result = create(); - if (selector != null) { - _result.selector = selector; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory TapRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory TapRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - TapRequest clone() => TapRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - TapRequest copyWith(void Function(TapRequest) updates) => - super.copyWith((message) => updates(message as TapRequest)) - as TapRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static TapRequest create() => TapRequest._(); - TapRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static TapRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static TapRequest? _defaultInstance; - - @$pb.TagNumber(1) - Selector get selector => $_getN(0); - @$pb.TagNumber(1) - set selector(Selector v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasSelector() => $_has(0); - @$pb.TagNumber(1) - void clearSelector() => clearField(1); - @$pb.TagNumber(1) - Selector ensureSelector() => $_ensure(0); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); -} - -enum EnterTextRequest_FindBy { index_, selector, notSet } - -class EnterTextRequest extends $pb.GeneratedMessage { - static const $core.Map<$core.int, EnterTextRequest_FindBy> - _EnterTextRequest_FindByByTag = { - 3: EnterTextRequest_FindBy.index_, - 4: EnterTextRequest_FindBy.selector, - 0: EnterTextRequest_FindBy.notSet - }; - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'EnterTextRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..oo(0, [3, 4]) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'data') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..a<$core.int>( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'index', - $pb.PbFieldType.OU3) - ..aOM( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..e( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'keyboardBehavior', - $pb.PbFieldType.OE, - protoName: 'keyboardBehavior', - defaultOrMaker: EnterTextRequest_KeyboardBehavior.SHOW_AND_DISMISS, - valueOf: EnterTextRequest_KeyboardBehavior.valueOf, - enumValues: EnterTextRequest_KeyboardBehavior.values) - ..hasRequiredFields = false; - - EnterTextRequest._() : super(); - factory EnterTextRequest({ - $core.String? data, - $core.String? appId, - $core.int? index, - Selector? selector, - EnterTextRequest_KeyboardBehavior? keyboardBehavior, - }) { - final _result = create(); - if (data != null) { - _result.data = data; - } - if (appId != null) { - _result.appId = appId; - } - if (index != null) { - _result.index = index; - } - if (selector != null) { - _result.selector = selector; - } - if (keyboardBehavior != null) { - _result.keyboardBehavior = keyboardBehavior; - } - return _result; - } - factory EnterTextRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory EnterTextRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - EnterTextRequest clone() => EnterTextRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - EnterTextRequest copyWith(void Function(EnterTextRequest) updates) => - super.copyWith((message) => updates(message as EnterTextRequest)) - as EnterTextRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static EnterTextRequest create() => EnterTextRequest._(); - EnterTextRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static EnterTextRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static EnterTextRequest? _defaultInstance; - - EnterTextRequest_FindBy whichFindBy() => - _EnterTextRequest_FindByByTag[$_whichOneof(0)]!; - void clearFindBy() => clearField($_whichOneof(0)); - - @$pb.TagNumber(1) - $core.String get data => $_getSZ(0); - @$pb.TagNumber(1) - set data($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasData() => $_has(0); - @$pb.TagNumber(1) - void clearData() => clearField(1); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); - - @$pb.TagNumber(3) - $core.int get index => $_getIZ(2); - @$pb.TagNumber(3) - set index($core.int v) { - $_setUnsignedInt32(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasIndex() => $_has(2); - @$pb.TagNumber(3) - void clearIndex() => clearField(3); - - @$pb.TagNumber(4) - Selector get selector => $_getN(3); - @$pb.TagNumber(4) - set selector(Selector v) { - setField(4, v); - } - - @$pb.TagNumber(4) - $core.bool hasSelector() => $_has(3); - @$pb.TagNumber(4) - void clearSelector() => clearField(4); - @$pb.TagNumber(4) - Selector ensureSelector() => $_ensure(3); - - @$pb.TagNumber(5) - EnterTextRequest_KeyboardBehavior get keyboardBehavior => $_getN(4); - @$pb.TagNumber(5) - set keyboardBehavior(EnterTextRequest_KeyboardBehavior v) { - setField(5, v); - } - - @$pb.TagNumber(5) - $core.bool hasKeyboardBehavior() => $_has(4); - @$pb.TagNumber(5) - void clearKeyboardBehavior() => clearField(5); -} - -class SwipeRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'SwipeRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..a<$core.double>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'startX', - $pb.PbFieldType.OF, - protoName: 'startX') - ..a<$core.double>( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'startY', - $pb.PbFieldType.OF, - protoName: 'startY') - ..a<$core.double>( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'endX', - $pb.PbFieldType.OF, - protoName: 'endX') - ..a<$core.double>( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'endY', - $pb.PbFieldType.OF, - protoName: 'endY') - ..a<$core.int>( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'steps', - $pb.PbFieldType.OU3) - ..aOS( - 6, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - SwipeRequest._() : super(); - factory SwipeRequest({ - $core.double? startX, - $core.double? startY, - $core.double? endX, - $core.double? endY, - $core.int? steps, - $core.String? appId, - }) { - final _result = create(); - if (startX != null) { - _result.startX = startX; - } - if (startY != null) { - _result.startY = startY; - } - if (endX != null) { - _result.endX = endX; - } - if (endY != null) { - _result.endY = endY; - } - if (steps != null) { - _result.steps = steps; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory SwipeRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory SwipeRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SwipeRequest clone() => SwipeRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SwipeRequest copyWith(void Function(SwipeRequest) updates) => - super.copyWith((message) => updates(message as SwipeRequest)) - as SwipeRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static SwipeRequest create() => SwipeRequest._(); - SwipeRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static SwipeRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static SwipeRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.double get startX => $_getN(0); - @$pb.TagNumber(1) - set startX($core.double v) { - $_setFloat(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasStartX() => $_has(0); - @$pb.TagNumber(1) - void clearStartX() => clearField(1); - - @$pb.TagNumber(2) - $core.double get startY => $_getN(1); - @$pb.TagNumber(2) - set startY($core.double v) { - $_setFloat(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasStartY() => $_has(1); - @$pb.TagNumber(2) - void clearStartY() => clearField(2); - - @$pb.TagNumber(3) - $core.double get endX => $_getN(2); - @$pb.TagNumber(3) - set endX($core.double v) { - $_setFloat(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasEndX() => $_has(2); - @$pb.TagNumber(3) - void clearEndX() => clearField(3); - - @$pb.TagNumber(4) - $core.double get endY => $_getN(3); - @$pb.TagNumber(4) - set endY($core.double v) { - $_setFloat(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasEndY() => $_has(3); - @$pb.TagNumber(4) - void clearEndY() => clearField(4); - - @$pb.TagNumber(5) - $core.int get steps => $_getIZ(4); - @$pb.TagNumber(5) - set steps($core.int v) { - $_setUnsignedInt32(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasSteps() => $_has(4); - @$pb.TagNumber(5) - void clearSteps() => clearField(5); - - @$pb.TagNumber(6) - $core.String get appId => $_getSZ(5); - @$pb.TagNumber(6) - set appId($core.String v) { - $_setString(5, v); - } - - @$pb.TagNumber(6) - $core.bool hasAppId() => $_has(5); - @$pb.TagNumber(6) - void clearAppId() => clearField(6); -} - -class WaitUntilVisibleRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'WaitUntilVisibleRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOM( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'selector', - subBuilder: Selector.create) - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appId', - protoName: 'appId') - ..hasRequiredFields = false; - - WaitUntilVisibleRequest._() : super(); - factory WaitUntilVisibleRequest({ - Selector? selector, - $core.String? appId, - }) { - final _result = create(); - if (selector != null) { - _result.selector = selector; - } - if (appId != null) { - _result.appId = appId; - } - return _result; - } - factory WaitUntilVisibleRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory WaitUntilVisibleRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - WaitUntilVisibleRequest clone() => - WaitUntilVisibleRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - WaitUntilVisibleRequest copyWith( - void Function(WaitUntilVisibleRequest) updates) => - super.copyWith((message) => updates(message as WaitUntilVisibleRequest)) - as WaitUntilVisibleRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static WaitUntilVisibleRequest create() => WaitUntilVisibleRequest._(); - WaitUntilVisibleRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static WaitUntilVisibleRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static WaitUntilVisibleRequest? _defaultInstance; - - @$pb.TagNumber(1) - Selector get selector => $_getN(0); - @$pb.TagNumber(1) - set selector(Selector v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasSelector() => $_has(0); - @$pb.TagNumber(1) - void clearSelector() => clearField(1); - @$pb.TagNumber(1) - Selector ensureSelector() => $_ensure(0); - - @$pb.TagNumber(2) - $core.String get appId => $_getSZ(1); - @$pb.TagNumber(2) - set appId($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasAppId() => $_has(1); - @$pb.TagNumber(2) - void clearAppId() => clearField(2); -} - -class HandlePermissionRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'HandlePermissionRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'code', - $pb.PbFieldType.OE, - defaultOrMaker: HandlePermissionRequest_Code.WHILE_USING, - valueOf: HandlePermissionRequest_Code.valueOf, - enumValues: HandlePermissionRequest_Code.values) - ..hasRequiredFields = false; - - HandlePermissionRequest._() : super(); - factory HandlePermissionRequest({ - HandlePermissionRequest_Code? code, - }) { - final _result = create(); - if (code != null) { - _result.code = code; - } - return _result; - } - factory HandlePermissionRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory HandlePermissionRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - HandlePermissionRequest clone() => - HandlePermissionRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - HandlePermissionRequest copyWith( - void Function(HandlePermissionRequest) updates) => - super.copyWith((message) => updates(message as HandlePermissionRequest)) - as HandlePermissionRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static HandlePermissionRequest create() => HandlePermissionRequest._(); - HandlePermissionRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static HandlePermissionRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static HandlePermissionRequest? _defaultInstance; - - @$pb.TagNumber(1) - HandlePermissionRequest_Code get code => $_getN(0); - @$pb.TagNumber(1) - set code(HandlePermissionRequest_Code v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasCode() => $_has(0); - @$pb.TagNumber(1) - void clearCode() => clearField(1); -} - -class SetLocationAccuracyRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'SetLocationAccuracyRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..e( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'locationAccuracy', - $pb.PbFieldType.OE, - protoName: 'locationAccuracy', - defaultOrMaker: SetLocationAccuracyRequest_LocationAccuracy.COARSE, - valueOf: SetLocationAccuracyRequest_LocationAccuracy.valueOf, - enumValues: SetLocationAccuracyRequest_LocationAccuracy.values) - ..hasRequiredFields = false; - - SetLocationAccuracyRequest._() : super(); - factory SetLocationAccuracyRequest({ - SetLocationAccuracyRequest_LocationAccuracy? locationAccuracy, - }) { - final _result = create(); - if (locationAccuracy != null) { - _result.locationAccuracy = locationAccuracy; - } - return _result; - } - factory SetLocationAccuracyRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory SetLocationAccuracyRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SetLocationAccuracyRequest clone() => - SetLocationAccuracyRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SetLocationAccuracyRequest copyWith( - void Function(SetLocationAccuracyRequest) updates) => - super.copyWith( - (message) => updates(message as SetLocationAccuracyRequest)) - as SetLocationAccuracyRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static SetLocationAccuracyRequest create() => SetLocationAccuracyRequest._(); - SetLocationAccuracyRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static SetLocationAccuracyRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static SetLocationAccuracyRequest? _defaultInstance; - - @$pb.TagNumber(1) - SetLocationAccuracyRequest_LocationAccuracy get locationAccuracy => $_getN(0); - @$pb.TagNumber(1) - set locationAccuracy(SetLocationAccuracyRequest_LocationAccuracy v) { - setField(1, v); - } - - @$pb.TagNumber(1) - $core.bool hasLocationAccuracy() => $_has(0); - @$pb.TagNumber(1) - void clearLocationAccuracy() => clearField(1); -} - -class PermissionDialogVisibleRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'PermissionDialogVisibleRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..a<$fixnum.Int64>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'timeoutMillis', - $pb.PbFieldType.OU6, - protoName: 'timeoutMillis', - defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false; - - PermissionDialogVisibleRequest._() : super(); - factory PermissionDialogVisibleRequest({ - $fixnum.Int64? timeoutMillis, - }) { - final _result = create(); - if (timeoutMillis != null) { - _result.timeoutMillis = timeoutMillis; - } - return _result; - } - factory PermissionDialogVisibleRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory PermissionDialogVisibleRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleRequest clone() => - PermissionDialogVisibleRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleRequest copyWith( - void Function(PermissionDialogVisibleRequest) updates) => - super.copyWith( - (message) => updates(message as PermissionDialogVisibleRequest)) - as PermissionDialogVisibleRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleRequest create() => - PermissionDialogVisibleRequest._(); - PermissionDialogVisibleRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static PermissionDialogVisibleRequest? _defaultInstance; - - @$pb.TagNumber(1) - $fixnum.Int64 get timeoutMillis => $_getI64(0); - @$pb.TagNumber(1) - set timeoutMillis($fixnum.Int64 v) { - $_setInt64(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasTimeoutMillis() => $_has(0); - @$pb.TagNumber(1) - void clearTimeoutMillis() => clearField(1); -} - -class PermissionDialogVisibleResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'PermissionDialogVisibleResponse', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOB( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'visible') - ..hasRequiredFields = false; - - PermissionDialogVisibleResponse._() : super(); - factory PermissionDialogVisibleResponse({ - $core.bool? visible, - }) { - final _result = create(); - if (visible != null) { - _result.visible = visible; - } - return _result; - } - factory PermissionDialogVisibleResponse.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory PermissionDialogVisibleResponse.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleResponse clone() => - PermissionDialogVisibleResponse()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PermissionDialogVisibleResponse copyWith( - void Function(PermissionDialogVisibleResponse) updates) => - super.copyWith( - (message) => updates(message as PermissionDialogVisibleResponse)) - as PermissionDialogVisibleResponse; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleResponse create() => - PermissionDialogVisibleResponse._(); - PermissionDialogVisibleResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static PermissionDialogVisibleResponse getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor( - create); - static PermissionDialogVisibleResponse? _defaultInstance; - - @$pb.TagNumber(1) - $core.bool get visible => $_getBF(0); - @$pb.TagNumber(1) - set visible($core.bool v) { - $_setBool(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasVisible() => $_has(0); - @$pb.TagNumber(1) - void clearVisible() => clearField(1); -} - -class Selector extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Selector', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'text') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'textStartsWith', - protoName: 'textStartsWith') - ..aOS( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'textContains', - protoName: 'textContains') - ..aOS( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'className', - protoName: 'className') - ..aOS( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescription', - protoName: 'contentDescription') - ..aOS( - 6, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescriptionStartsWith', - protoName: 'contentDescriptionStartsWith') - ..aOS( - 7, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescriptionContains', - protoName: 'contentDescriptionContains') - ..aOS( - 8, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'resourceId', - protoName: 'resourceId') - ..a<$core.int>( - 9, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'instance', - $pb.PbFieldType.OU3) - ..aOB( - 10, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'enabled') - ..aOB( - 11, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'focused') - ..aOS( - 12, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'pkg') - ..hasRequiredFields = false; - - Selector._() : super(); - factory Selector({ - $core.String? text, - $core.String? textStartsWith, - $core.String? textContains, - $core.String? className, - $core.String? contentDescription, - $core.String? contentDescriptionStartsWith, - $core.String? contentDescriptionContains, - $core.String? resourceId, - $core.int? instance, - $core.bool? enabled, - $core.bool? focused, - $core.String? pkg, - }) { - final _result = create(); - if (text != null) { - _result.text = text; - } - if (textStartsWith != null) { - _result.textStartsWith = textStartsWith; - } - if (textContains != null) { - _result.textContains = textContains; - } - if (className != null) { - _result.className = className; - } - if (contentDescription != null) { - _result.contentDescription = contentDescription; - } - if (contentDescriptionStartsWith != null) { - _result.contentDescriptionStartsWith = contentDescriptionStartsWith; - } - if (contentDescriptionContains != null) { - _result.contentDescriptionContains = contentDescriptionContains; - } - if (resourceId != null) { - _result.resourceId = resourceId; - } - if (instance != null) { - _result.instance = instance; - } - if (enabled != null) { - _result.enabled = enabled; - } - if (focused != null) { - _result.focused = focused; - } - if (pkg != null) { - _result.pkg = pkg; - } - return _result; - } - factory Selector.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Selector.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Selector clone() => Selector()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Selector copyWith(void Function(Selector) updates) => - super.copyWith((message) => updates(message as Selector)) - as Selector; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Selector create() => Selector._(); - Selector createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Selector getDefault() => - _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static Selector? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get text => $_getSZ(0); - @$pb.TagNumber(1) - set text($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasText() => $_has(0); - @$pb.TagNumber(1) - void clearText() => clearField(1); - - @$pb.TagNumber(2) - $core.String get textStartsWith => $_getSZ(1); - @$pb.TagNumber(2) - set textStartsWith($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasTextStartsWith() => $_has(1); - @$pb.TagNumber(2) - void clearTextStartsWith() => clearField(2); - - @$pb.TagNumber(3) - $core.String get textContains => $_getSZ(2); - @$pb.TagNumber(3) - set textContains($core.String v) { - $_setString(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasTextContains() => $_has(2); - @$pb.TagNumber(3) - void clearTextContains() => clearField(3); - - @$pb.TagNumber(4) - $core.String get className => $_getSZ(3); - @$pb.TagNumber(4) - set className($core.String v) { - $_setString(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasClassName() => $_has(3); - @$pb.TagNumber(4) - void clearClassName() => clearField(4); - - @$pb.TagNumber(5) - $core.String get contentDescription => $_getSZ(4); - @$pb.TagNumber(5) - set contentDescription($core.String v) { - $_setString(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasContentDescription() => $_has(4); - @$pb.TagNumber(5) - void clearContentDescription() => clearField(5); - - @$pb.TagNumber(6) - $core.String get contentDescriptionStartsWith => $_getSZ(5); - @$pb.TagNumber(6) - set contentDescriptionStartsWith($core.String v) { - $_setString(5, v); - } - - @$pb.TagNumber(6) - $core.bool hasContentDescriptionStartsWith() => $_has(5); - @$pb.TagNumber(6) - void clearContentDescriptionStartsWith() => clearField(6); - - @$pb.TagNumber(7) - $core.String get contentDescriptionContains => $_getSZ(6); - @$pb.TagNumber(7) - set contentDescriptionContains($core.String v) { - $_setString(6, v); - } - - @$pb.TagNumber(7) - $core.bool hasContentDescriptionContains() => $_has(6); - @$pb.TagNumber(7) - void clearContentDescriptionContains() => clearField(7); - - @$pb.TagNumber(8) - $core.String get resourceId => $_getSZ(7); - @$pb.TagNumber(8) - set resourceId($core.String v) { - $_setString(7, v); - } - - @$pb.TagNumber(8) - $core.bool hasResourceId() => $_has(7); - @$pb.TagNumber(8) - void clearResourceId() => clearField(8); - - @$pb.TagNumber(9) - $core.int get instance => $_getIZ(8); - @$pb.TagNumber(9) - set instance($core.int v) { - $_setUnsignedInt32(8, v); - } - - @$pb.TagNumber(9) - $core.bool hasInstance() => $_has(8); - @$pb.TagNumber(9) - void clearInstance() => clearField(9); - - @$pb.TagNumber(10) - $core.bool get enabled => $_getBF(9); - @$pb.TagNumber(10) - set enabled($core.bool v) { - $_setBool(9, v); - } - - @$pb.TagNumber(10) - $core.bool hasEnabled() => $_has(9); - @$pb.TagNumber(10) - void clearEnabled() => clearField(10); - - @$pb.TagNumber(11) - $core.bool get focused => $_getBF(10); - @$pb.TagNumber(11) - set focused($core.bool v) { - $_setBool(10, v); - } - - @$pb.TagNumber(11) - $core.bool hasFocused() => $_has(10); - @$pb.TagNumber(11) - void clearFocused() => clearField(11); - - @$pb.TagNumber(12) - $core.String get pkg => $_getSZ(11); - @$pb.TagNumber(12) - set pkg($core.String v) { - $_setString(11, v); - } - - @$pb.TagNumber(12) - $core.bool hasPkg() => $_has(11); - @$pb.TagNumber(12) - void clearPkg() => clearField(12); -} - -class NativeView extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'NativeView', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'className', - protoName: 'className') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'text') - ..aOS( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'contentDescription', - protoName: 'contentDescription') - ..aOB( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'focused') - ..aOB( - 5, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'enabled') - ..a<$core.int>( - 6, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'childCount', - $pb.PbFieldType.O3, - protoName: 'childCount') - ..aOS( - 7, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'resourceName', - protoName: 'resourceName') - ..aOS( - 8, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'applicationPackage', - protoName: 'applicationPackage') - ..pc( - 9, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'children', - $pb.PbFieldType.PM, - subBuilder: NativeView.create) - ..hasRequiredFields = false; - - NativeView._() : super(); - factory NativeView({ - $core.String? className, - $core.String? text, - $core.String? contentDescription, - $core.bool? focused, - $core.bool? enabled, - $core.int? childCount, - $core.String? resourceName, - $core.String? applicationPackage, - $core.Iterable? children, - }) { - final _result = create(); - if (className != null) { - _result.className = className; - } - if (text != null) { - _result.text = text; - } - if (contentDescription != null) { - _result.contentDescription = contentDescription; - } - if (focused != null) { - _result.focused = focused; - } - if (enabled != null) { - _result.enabled = enabled; - } - if (childCount != null) { - _result.childCount = childCount; - } - if (resourceName != null) { - _result.resourceName = resourceName; - } - if (applicationPackage != null) { - _result.applicationPackage = applicationPackage; - } - if (children != null) { - _result.children.addAll(children); - } - return _result; - } - factory NativeView.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory NativeView.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - NativeView clone() => NativeView()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - NativeView copyWith(void Function(NativeView) updates) => - super.copyWith((message) => updates(message as NativeView)) - as NativeView; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static NativeView create() => NativeView._(); - NativeView createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static NativeView getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static NativeView? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get className => $_getSZ(0); - @$pb.TagNumber(1) - set className($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasClassName() => $_has(0); - @$pb.TagNumber(1) - void clearClassName() => clearField(1); - - @$pb.TagNumber(2) - $core.String get text => $_getSZ(1); - @$pb.TagNumber(2) - set text($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasText() => $_has(1); - @$pb.TagNumber(2) - void clearText() => clearField(2); - - @$pb.TagNumber(3) - $core.String get contentDescription => $_getSZ(2); - @$pb.TagNumber(3) - set contentDescription($core.String v) { - $_setString(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasContentDescription() => $_has(2); - @$pb.TagNumber(3) - void clearContentDescription() => clearField(3); - - @$pb.TagNumber(4) - $core.bool get focused => $_getBF(3); - @$pb.TagNumber(4) - set focused($core.bool v) { - $_setBool(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasFocused() => $_has(3); - @$pb.TagNumber(4) - void clearFocused() => clearField(4); - - @$pb.TagNumber(5) - $core.bool get enabled => $_getBF(4); - @$pb.TagNumber(5) - set enabled($core.bool v) { - $_setBool(4, v); - } - - @$pb.TagNumber(5) - $core.bool hasEnabled() => $_has(4); - @$pb.TagNumber(5) - void clearEnabled() => clearField(5); - - @$pb.TagNumber(6) - $core.int get childCount => $_getIZ(5); - @$pb.TagNumber(6) - set childCount($core.int v) { - $_setSignedInt32(5, v); - } - - @$pb.TagNumber(6) - $core.bool hasChildCount() => $_has(5); - @$pb.TagNumber(6) - void clearChildCount() => clearField(6); - - @$pb.TagNumber(7) - $core.String get resourceName => $_getSZ(6); - @$pb.TagNumber(7) - set resourceName($core.String v) { - $_setString(6, v); - } - - @$pb.TagNumber(7) - $core.bool hasResourceName() => $_has(6); - @$pb.TagNumber(7) - void clearResourceName() => clearField(7); - - @$pb.TagNumber(8) - $core.String get applicationPackage => $_getSZ(7); - @$pb.TagNumber(8) - set applicationPackage($core.String v) { - $_setString(7, v); - } - - @$pb.TagNumber(8) - $core.bool hasApplicationPackage() => $_has(7); - @$pb.TagNumber(8) - void clearApplicationPackage() => clearField(8); - - @$pb.TagNumber(9) - $core.List get children => $_getList(8); -} - -class Notification extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'Notification', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..aOS( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'appName', - protoName: 'appName') - ..aOS( - 2, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'title') - ..aOS( - 3, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'content') - ..aOS( - 4, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'raw') - ..hasRequiredFields = false; - - Notification._() : super(); - factory Notification({ - $core.String? appName, - $core.String? title, - $core.String? content, - $core.String? raw, - }) { - final _result = create(); - if (appName != null) { - _result.appName = appName; - } - if (title != null) { - _result.title = title; - } - if (content != null) { - _result.content = content; - } - if (raw != null) { - _result.raw = raw; - } - return _result; - } - factory Notification.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory Notification.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - Notification clone() => Notification()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Notification copyWith(void Function(Notification) updates) => - super.copyWith((message) => updates(message as Notification)) - as Notification; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static Notification create() => Notification._(); - Notification createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static Notification getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static Notification? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get appName => $_getSZ(0); - @$pb.TagNumber(1) - set appName($core.String v) { - $_setString(0, v); - } - - @$pb.TagNumber(1) - $core.bool hasAppName() => $_has(0); - @$pb.TagNumber(1) - void clearAppName() => clearField(1); - - @$pb.TagNumber(2) - $core.String get title => $_getSZ(1); - @$pb.TagNumber(2) - set title($core.String v) { - $_setString(1, v); - } - - @$pb.TagNumber(2) - $core.bool hasTitle() => $_has(1); - @$pb.TagNumber(2) - void clearTitle() => clearField(2); - - @$pb.TagNumber(3) - $core.String get content => $_getSZ(2); - @$pb.TagNumber(3) - set content($core.String v) { - $_setString(2, v); - } - - @$pb.TagNumber(3) - $core.bool hasContent() => $_has(2); - @$pb.TagNumber(3) - void clearContent() => clearField(3); - - @$pb.TagNumber(4) - $core.String get raw => $_getSZ(3); - @$pb.TagNumber(4) - set raw($core.String v) { - $_setString(3, v); - } - - @$pb.TagNumber(4) - $core.bool hasRaw() => $_has(3); - @$pb.TagNumber(4) - void clearRaw() => clearField(4); -} - -class SubmitTestResultsRequest extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'SubmitTestResultsRequest', - package: const $pb.PackageName( - const $core.bool.fromEnvironment('protobuf.omit_message_names') - ? '' - : 'patrol'), - createEmptyInstance: create) - ..m<$core.String, $core.String>( - 1, - const $core.bool.fromEnvironment('protobuf.omit_field_names') - ? '' - : 'results', - entryClassName: 'SubmitTestResultsRequest.ResultsEntry', - keyFieldType: $pb.PbFieldType.OS, - valueFieldType: $pb.PbFieldType.OS, - packageName: const $pb.PackageName('patrol')) - ..hasRequiredFields = false; - - SubmitTestResultsRequest._() : super(); - factory SubmitTestResultsRequest({ - $core.Map<$core.String, $core.String>? results, - }) { - final _result = create(); - if (results != null) { - _result.results.addAll(results); - } - return _result; - } - factory SubmitTestResultsRequest.fromBuffer($core.List<$core.int> i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromBuffer(i, r); - factory SubmitTestResultsRequest.fromJson($core.String i, - [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => - create()..mergeFromJson(i, r); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SubmitTestResultsRequest clone() => - SubmitTestResultsRequest()..mergeFromMessage(this); - @$core.Deprecated('Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SubmitTestResultsRequest copyWith( - void Function(SubmitTestResultsRequest) updates) => - super.copyWith((message) => updates(message as SubmitTestResultsRequest)) - as SubmitTestResultsRequest; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static SubmitTestResultsRequest create() => SubmitTestResultsRequest._(); - SubmitTestResultsRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); - @$core.pragma('dart2js:noInline') - static SubmitTestResultsRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static SubmitTestResultsRequest? _defaultInstance; - - @$pb.TagNumber(1) - $core.Map<$core.String, $core.String> get results => $_getMap(0); -} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart b/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart deleted file mode 100644 index 463f042de..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pbenum.dart +++ /dev/null @@ -1,141 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -// ignore_for_file: UNDEFINED_SHOWN_NAME -import 'dart:core' as $core; -import 'package:protobuf/protobuf.dart' as $pb; - -class RunDartTestResponse_Result extends $pb.ProtobufEnum { - static const RunDartTestResponse_Result SUCCESS = - RunDartTestResponse_Result._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'SUCCESS'); - static const RunDartTestResponse_Result SKIPPED = - RunDartTestResponse_Result._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'SKIPPED'); - static const RunDartTestResponse_Result FAILURE = - RunDartTestResponse_Result._( - 2, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'FAILURE'); - - static const $core.List values = - [ - SUCCESS, - SKIPPED, - FAILURE, - ]; - - static final $core.Map<$core.int, RunDartTestResponse_Result> _byValue = - $pb.ProtobufEnum.initByValue(values); - static RunDartTestResponse_Result? valueOf($core.int value) => - _byValue[value]; - - const RunDartTestResponse_Result._($core.int v, $core.String n) : super(v, n); -} - -class EnterTextRequest_KeyboardBehavior extends $pb.ProtobufEnum { - static const EnterTextRequest_KeyboardBehavior SHOW_AND_DISMISS = - EnterTextRequest_KeyboardBehavior._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'SHOW_AND_DISMISS'); - static const EnterTextRequest_KeyboardBehavior ALTERNATIVE = - EnterTextRequest_KeyboardBehavior._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'ALTERNATIVE'); - - static const $core.List values = - [ - SHOW_AND_DISMISS, - ALTERNATIVE, - ]; - - static final $core.Map<$core.int, EnterTextRequest_KeyboardBehavior> - _byValue = $pb.ProtobufEnum.initByValue(values); - static EnterTextRequest_KeyboardBehavior? valueOf($core.int value) => - _byValue[value]; - - const EnterTextRequest_KeyboardBehavior._($core.int v, $core.String n) - : super(v, n); -} - -class HandlePermissionRequest_Code extends $pb.ProtobufEnum { - static const HandlePermissionRequest_Code WHILE_USING = - HandlePermissionRequest_Code._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'WHILE_USING'); - static const HandlePermissionRequest_Code ONLY_THIS_TIME = - HandlePermissionRequest_Code._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'ONLY_THIS_TIME'); - static const HandlePermissionRequest_Code DENIED = - HandlePermissionRequest_Code._( - 2, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'DENIED'); - - static const $core.List values = - [ - WHILE_USING, - ONLY_THIS_TIME, - DENIED, - ]; - - static final $core.Map<$core.int, HandlePermissionRequest_Code> _byValue = - $pb.ProtobufEnum.initByValue(values); - static HandlePermissionRequest_Code? valueOf($core.int value) => - _byValue[value]; - - const HandlePermissionRequest_Code._($core.int v, $core.String n) - : super(v, n); -} - -class SetLocationAccuracyRequest_LocationAccuracy extends $pb.ProtobufEnum { - static const SetLocationAccuracyRequest_LocationAccuracy COARSE = - SetLocationAccuracyRequest_LocationAccuracy._( - 0, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'COARSE'); - static const SetLocationAccuracyRequest_LocationAccuracy FINE = - SetLocationAccuracyRequest_LocationAccuracy._( - 1, - const $core.bool.fromEnvironment('protobuf.omit_enum_names') - ? '' - : 'FINE'); - - static const $core.List values = - [ - COARSE, - FINE, - ]; - - static final $core.Map<$core.int, SetLocationAccuracyRequest_LocationAccuracy> - _byValue = $pb.ProtobufEnum.initByValue(values); - static SetLocationAccuracyRequest_LocationAccuracy? valueOf( - $core.int value) => - _byValue[value]; - - const SetLocationAccuracyRequest_LocationAccuracy._( - $core.int v, $core.String n) - : super(v, n); -} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart b/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart deleted file mode 100644 index 390d0f1b8..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pbgrpc.dart +++ /dev/null @@ -1,916 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:async' as $async; - -import 'dart:core' as $core; - -import 'package:grpc/service_api.dart' as $grpc; -import 'contracts.pb.dart' as $0; -export 'contracts.pb.dart'; - -class PatrolAppServiceClient extends $grpc.Client { - static final _$listDartTests = - $grpc.ClientMethod<$0.Empty, $0.ListDartTestsResponse>( - '/patrol.PatrolAppService/listDartTests', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.ListDartTestsResponse.fromBuffer(value)); - static final _$runDartTest = - $grpc.ClientMethod<$0.RunDartTestRequest, $0.RunDartTestResponse>( - '/patrol.PatrolAppService/runDartTest', - ($0.RunDartTestRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.RunDartTestResponse.fromBuffer(value)); - - PatrolAppServiceClient($grpc.ClientChannel channel, - {$grpc.CallOptions? options, - $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - - $grpc.ResponseFuture<$0.ListDartTestsResponse> listDartTests($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$listDartTests, request, options: options); - } - - $grpc.ResponseFuture<$0.RunDartTestResponse> runDartTest( - $0.RunDartTestRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$runDartTest, request, options: options); - } -} - -abstract class PatrolAppServiceBase extends $grpc.Service { - $core.String get $name => 'patrol.PatrolAppService'; - - PatrolAppServiceBase() { - $addMethod($grpc.ServiceMethod<$0.Empty, $0.ListDartTestsResponse>( - 'listDartTests', - listDartTests_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.ListDartTestsResponse value) => value.writeToBuffer())); - $addMethod( - $grpc.ServiceMethod<$0.RunDartTestRequest, $0.RunDartTestResponse>( - 'runDartTest', - runDartTest_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.RunDartTestRequest.fromBuffer(value), - ($0.RunDartTestResponse value) => value.writeToBuffer())); - } - - $async.Future<$0.ListDartTestsResponse> listDartTests_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return listDartTests(call, await request); - } - - $async.Future<$0.RunDartTestResponse> runDartTest_Pre($grpc.ServiceCall call, - $async.Future<$0.RunDartTestRequest> request) async { - return runDartTest(call, await request); - } - - $async.Future<$0.ListDartTestsResponse> listDartTests( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.RunDartTestResponse> runDartTest( - $grpc.ServiceCall call, $0.RunDartTestRequest request); -} - -class NativeAutomatorClient extends $grpc.Client { - static final _$initialize = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/initialize', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$configure = $grpc.ClientMethod<$0.ConfigureRequest, $0.Empty>( - '/patrol.NativeAutomator/configure', - ($0.ConfigureRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$pressHome = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/pressHome', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$pressBack = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/pressBack', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$pressRecentApps = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/pressRecentApps', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$doublePressRecentApps = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/doublePressRecentApps', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$openApp = $grpc.ClientMethod<$0.OpenAppRequest, $0.Empty>( - '/patrol.NativeAutomator/openApp', - ($0.OpenAppRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$openQuickSettings = - $grpc.ClientMethod<$0.OpenQuickSettingsRequest, $0.Empty>( - '/patrol.NativeAutomator/openQuickSettings', - ($0.OpenQuickSettingsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$getNativeViews = - $grpc.ClientMethod<$0.GetNativeViewsRequest, $0.GetNativeViewsResponse>( - '/patrol.NativeAutomator/getNativeViews', - ($0.GetNativeViewsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetNativeViewsResponse.fromBuffer(value)); - static final _$tap = $grpc.ClientMethod<$0.TapRequest, $0.Empty>( - '/patrol.NativeAutomator/tap', - ($0.TapRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$doubleTap = $grpc.ClientMethod<$0.TapRequest, $0.Empty>( - '/patrol.NativeAutomator/doubleTap', - ($0.TapRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enterText = $grpc.ClientMethod<$0.EnterTextRequest, $0.Empty>( - '/patrol.NativeAutomator/enterText', - ($0.EnterTextRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$swipe = $grpc.ClientMethod<$0.SwipeRequest, $0.Empty>( - '/patrol.NativeAutomator/swipe', - ($0.SwipeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$waitUntilVisible = - $grpc.ClientMethod<$0.WaitUntilVisibleRequest, $0.Empty>( - '/patrol.NativeAutomator/waitUntilVisible', - ($0.WaitUntilVisibleRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableAirplaneMode = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableAirplaneMode', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableAirplaneMode = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableAirplaneMode', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableWiFi = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableWiFi', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableWiFi = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableWiFi', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableCellular = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableCellular', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableCellular = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableCellular', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableBluetooth = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/enableBluetooth', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableBluetooth = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/disableBluetooth', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$enableDarkMode = - $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( - '/patrol.NativeAutomator/enableDarkMode', - ($0.DarkModeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$disableDarkMode = - $grpc.ClientMethod<$0.DarkModeRequest, $0.Empty>( - '/patrol.NativeAutomator/disableDarkMode', - ($0.DarkModeRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$openNotifications = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/openNotifications', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$closeNotifications = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/closeNotifications', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$closeHeadsUpNotification = - $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/closeHeadsUpNotification', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$getNotifications = $grpc.ClientMethod< - $0.GetNotificationsRequest, $0.GetNotificationsResponse>( - '/patrol.NativeAutomator/getNotifications', - ($0.GetNotificationsRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.GetNotificationsResponse.fromBuffer(value)); - static final _$tapOnNotification = - $grpc.ClientMethod<$0.TapOnNotificationRequest, $0.Empty>( - '/patrol.NativeAutomator/tapOnNotification', - ($0.TapOnNotificationRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$isPermissionDialogVisible = $grpc.ClientMethod< - $0.PermissionDialogVisibleRequest, - $0.PermissionDialogVisibleResponse>( - '/patrol.NativeAutomator/isPermissionDialogVisible', - ($0.PermissionDialogVisibleRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => - $0.PermissionDialogVisibleResponse.fromBuffer(value)); - static final _$handlePermissionDialog = - $grpc.ClientMethod<$0.HandlePermissionRequest, $0.Empty>( - '/patrol.NativeAutomator/handlePermissionDialog', - ($0.HandlePermissionRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$setLocationAccuracy = - $grpc.ClientMethod<$0.SetLocationAccuracyRequest, $0.Empty>( - '/patrol.NativeAutomator/setLocationAccuracy', - ($0.SetLocationAccuracyRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$debug = $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/debug', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - static final _$markPatrolAppServiceReady = - $grpc.ClientMethod<$0.Empty, $0.Empty>( - '/patrol.NativeAutomator/markPatrolAppServiceReady', - ($0.Empty value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value)); - - NativeAutomatorClient($grpc.ClientChannel channel, - {$grpc.CallOptions? options, - $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, interceptors: interceptors); - - $grpc.ResponseFuture<$0.Empty> initialize($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$initialize, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> configure($0.ConfigureRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$configure, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> pressHome($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$pressHome, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> pressBack($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$pressBack, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> pressRecentApps($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$pressRecentApps, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> doublePressRecentApps($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$doublePressRecentApps, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> openApp($0.OpenAppRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$openApp, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> openQuickSettings( - $0.OpenQuickSettingsRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$openQuickSettings, request, options: options); - } - - $grpc.ResponseFuture<$0.GetNativeViewsResponse> getNativeViews( - $0.GetNativeViewsRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getNativeViews, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> tap($0.TapRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$tap, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> doubleTap($0.TapRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$doubleTap, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enterText($0.EnterTextRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enterText, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> swipe($0.SwipeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$swipe, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> waitUntilVisible( - $0.WaitUntilVisibleRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$waitUntilVisible, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableAirplaneMode($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableAirplaneMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableAirplaneMode($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableAirplaneMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableWiFi($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableWiFi, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableWiFi($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableWiFi, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableCellular($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableCellular, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableCellular($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableCellular, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableBluetooth($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableBluetooth, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableBluetooth($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableBluetooth, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> enableDarkMode($0.DarkModeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$enableDarkMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> disableDarkMode($0.DarkModeRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$disableDarkMode, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> openNotifications($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$openNotifications, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> closeNotifications($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$closeNotifications, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> closeHeadsUpNotification($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$closeHeadsUpNotification, request, - options: options); - } - - $grpc.ResponseFuture<$0.GetNotificationsResponse> getNotifications( - $0.GetNotificationsRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$getNotifications, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> tapOnNotification( - $0.TapOnNotificationRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$tapOnNotification, request, options: options); - } - - $grpc.ResponseFuture<$0.PermissionDialogVisibleResponse> - isPermissionDialogVisible($0.PermissionDialogVisibleRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$isPermissionDialogVisible, request, - options: options); - } - - $grpc.ResponseFuture<$0.Empty> handlePermissionDialog( - $0.HandlePermissionRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$handlePermissionDialog, request, - options: options); - } - - $grpc.ResponseFuture<$0.Empty> setLocationAccuracy( - $0.SetLocationAccuracyRequest request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$setLocationAccuracy, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> debug($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$debug, request, options: options); - } - - $grpc.ResponseFuture<$0.Empty> markPatrolAppServiceReady($0.Empty request, - {$grpc.CallOptions? options}) { - return $createUnaryCall(_$markPatrolAppServiceReady, request, - options: options); - } -} - -abstract class NativeAutomatorServiceBase extends $grpc.Service { - $core.String get $name => 'patrol.NativeAutomator'; - - NativeAutomatorServiceBase() { - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'initialize', - initialize_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.ConfigureRequest, $0.Empty>( - 'configure', - configure_Pre, - false, - false, - ($core.List<$core.int> value) => $0.ConfigureRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'pressHome', - pressHome_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'pressBack', - pressBack_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'pressRecentApps', - pressRecentApps_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'doublePressRecentApps', - doublePressRecentApps_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.OpenAppRequest, $0.Empty>( - 'openApp', - openApp_Pre, - false, - false, - ($core.List<$core.int> value) => $0.OpenAppRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.OpenQuickSettingsRequest, $0.Empty>( - 'openQuickSettings', - openQuickSettings_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.OpenQuickSettingsRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetNativeViewsRequest, - $0.GetNativeViewsResponse>( - 'getNativeViews', - getNativeViews_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetNativeViewsRequest.fromBuffer(value), - ($0.GetNativeViewsResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.TapRequest, $0.Empty>( - 'tap', - tap_Pre, - false, - false, - ($core.List<$core.int> value) => $0.TapRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.TapRequest, $0.Empty>( - 'doubleTap', - doubleTap_Pre, - false, - false, - ($core.List<$core.int> value) => $0.TapRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.EnterTextRequest, $0.Empty>( - 'enterText', - enterText_Pre, - false, - false, - ($core.List<$core.int> value) => $0.EnterTextRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.SwipeRequest, $0.Empty>( - 'swipe', - swipe_Pre, - false, - false, - ($core.List<$core.int> value) => $0.SwipeRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.WaitUntilVisibleRequest, $0.Empty>( - 'waitUntilVisible', - waitUntilVisible_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.WaitUntilVisibleRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableAirplaneMode', - enableAirplaneMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableAirplaneMode', - disableAirplaneMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableWiFi', - enableWiFi_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableWiFi', - disableWiFi_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableCellular', - enableCellular_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableCellular', - disableCellular_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'enableBluetooth', - enableBluetooth_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'disableBluetooth', - disableBluetooth_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( - 'enableDarkMode', - enableDarkMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.DarkModeRequest, $0.Empty>( - 'disableDarkMode', - disableDarkMode_Pre, - false, - false, - ($core.List<$core.int> value) => $0.DarkModeRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'openNotifications', - openNotifications_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'closeNotifications', - closeNotifications_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'closeHeadsUpNotification', - closeHeadsUpNotification_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.GetNotificationsRequest, - $0.GetNotificationsResponse>( - 'getNotifications', - getNotifications_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.GetNotificationsRequest.fromBuffer(value), - ($0.GetNotificationsResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.TapOnNotificationRequest, $0.Empty>( - 'tapOnNotification', - tapOnNotification_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.TapOnNotificationRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.PermissionDialogVisibleRequest, - $0.PermissionDialogVisibleResponse>( - 'isPermissionDialogVisible', - isPermissionDialogVisible_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.PermissionDialogVisibleRequest.fromBuffer(value), - ($0.PermissionDialogVisibleResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.HandlePermissionRequest, $0.Empty>( - 'handlePermissionDialog', - handlePermissionDialog_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.HandlePermissionRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.SetLocationAccuracyRequest, $0.Empty>( - 'setLocationAccuracy', - setLocationAccuracy_Pre, - false, - false, - ($core.List<$core.int> value) => - $0.SetLocationAccuracyRequest.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'debug', - debug_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.Empty, $0.Empty>( - 'markPatrolAppServiceReady', - markPatrolAppServiceReady_Pre, - false, - false, - ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), - ($0.Empty value) => value.writeToBuffer())); - } - - $async.Future<$0.Empty> initialize_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return initialize(call, await request); - } - - $async.Future<$0.Empty> configure_Pre($grpc.ServiceCall call, - $async.Future<$0.ConfigureRequest> request) async { - return configure(call, await request); - } - - $async.Future<$0.Empty> pressHome_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return pressHome(call, await request); - } - - $async.Future<$0.Empty> pressBack_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return pressBack(call, await request); - } - - $async.Future<$0.Empty> pressRecentApps_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return pressRecentApps(call, await request); - } - - $async.Future<$0.Empty> doublePressRecentApps_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return doublePressRecentApps(call, await request); - } - - $async.Future<$0.Empty> openApp_Pre( - $grpc.ServiceCall call, $async.Future<$0.OpenAppRequest> request) async { - return openApp(call, await request); - } - - $async.Future<$0.Empty> openQuickSettings_Pre($grpc.ServiceCall call, - $async.Future<$0.OpenQuickSettingsRequest> request) async { - return openQuickSettings(call, await request); - } - - $async.Future<$0.GetNativeViewsResponse> getNativeViews_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetNativeViewsRequest> request) async { - return getNativeViews(call, await request); - } - - $async.Future<$0.Empty> tap_Pre( - $grpc.ServiceCall call, $async.Future<$0.TapRequest> request) async { - return tap(call, await request); - } - - $async.Future<$0.Empty> doubleTap_Pre( - $grpc.ServiceCall call, $async.Future<$0.TapRequest> request) async { - return doubleTap(call, await request); - } - - $async.Future<$0.Empty> enterText_Pre($grpc.ServiceCall call, - $async.Future<$0.EnterTextRequest> request) async { - return enterText(call, await request); - } - - $async.Future<$0.Empty> swipe_Pre( - $grpc.ServiceCall call, $async.Future<$0.SwipeRequest> request) async { - return swipe(call, await request); - } - - $async.Future<$0.Empty> waitUntilVisible_Pre($grpc.ServiceCall call, - $async.Future<$0.WaitUntilVisibleRequest> request) async { - return waitUntilVisible(call, await request); - } - - $async.Future<$0.Empty> enableAirplaneMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableAirplaneMode(call, await request); - } - - $async.Future<$0.Empty> disableAirplaneMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableAirplaneMode(call, await request); - } - - $async.Future<$0.Empty> enableWiFi_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableWiFi(call, await request); - } - - $async.Future<$0.Empty> disableWiFi_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableWiFi(call, await request); - } - - $async.Future<$0.Empty> enableCellular_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableCellular(call, await request); - } - - $async.Future<$0.Empty> disableCellular_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableCellular(call, await request); - } - - $async.Future<$0.Empty> enableBluetooth_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return enableBluetooth(call, await request); - } - - $async.Future<$0.Empty> disableBluetooth_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return disableBluetooth(call, await request); - } - - $async.Future<$0.Empty> enableDarkMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { - return enableDarkMode(call, await request); - } - - $async.Future<$0.Empty> disableDarkMode_Pre( - $grpc.ServiceCall call, $async.Future<$0.DarkModeRequest> request) async { - return disableDarkMode(call, await request); - } - - $async.Future<$0.Empty> openNotifications_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return openNotifications(call, await request); - } - - $async.Future<$0.Empty> closeNotifications_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return closeNotifications(call, await request); - } - - $async.Future<$0.Empty> closeHeadsUpNotification_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return closeHeadsUpNotification(call, await request); - } - - $async.Future<$0.GetNotificationsResponse> getNotifications_Pre( - $grpc.ServiceCall call, - $async.Future<$0.GetNotificationsRequest> request) async { - return getNotifications(call, await request); - } - - $async.Future<$0.Empty> tapOnNotification_Pre($grpc.ServiceCall call, - $async.Future<$0.TapOnNotificationRequest> request) async { - return tapOnNotification(call, await request); - } - - $async.Future<$0.PermissionDialogVisibleResponse> - isPermissionDialogVisible_Pre($grpc.ServiceCall call, - $async.Future<$0.PermissionDialogVisibleRequest> request) async { - return isPermissionDialogVisible(call, await request); - } - - $async.Future<$0.Empty> handlePermissionDialog_Pre($grpc.ServiceCall call, - $async.Future<$0.HandlePermissionRequest> request) async { - return handlePermissionDialog(call, await request); - } - - $async.Future<$0.Empty> setLocationAccuracy_Pre($grpc.ServiceCall call, - $async.Future<$0.SetLocationAccuracyRequest> request) async { - return setLocationAccuracy(call, await request); - } - - $async.Future<$0.Empty> debug_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return debug(call, await request); - } - - $async.Future<$0.Empty> markPatrolAppServiceReady_Pre( - $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { - return markPatrolAppServiceReady(call, await request); - } - - $async.Future<$0.Empty> initialize($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> configure( - $grpc.ServiceCall call, $0.ConfigureRequest request); - $async.Future<$0.Empty> pressHome($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> pressBack($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> pressRecentApps( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> doublePressRecentApps( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> openApp( - $grpc.ServiceCall call, $0.OpenAppRequest request); - $async.Future<$0.Empty> openQuickSettings( - $grpc.ServiceCall call, $0.OpenQuickSettingsRequest request); - $async.Future<$0.GetNativeViewsResponse> getNativeViews( - $grpc.ServiceCall call, $0.GetNativeViewsRequest request); - $async.Future<$0.Empty> tap($grpc.ServiceCall call, $0.TapRequest request); - $async.Future<$0.Empty> doubleTap( - $grpc.ServiceCall call, $0.TapRequest request); - $async.Future<$0.Empty> enterText( - $grpc.ServiceCall call, $0.EnterTextRequest request); - $async.Future<$0.Empty> swipe( - $grpc.ServiceCall call, $0.SwipeRequest request); - $async.Future<$0.Empty> waitUntilVisible( - $grpc.ServiceCall call, $0.WaitUntilVisibleRequest request); - $async.Future<$0.Empty> enableAirplaneMode( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableAirplaneMode( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableWiFi($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableWiFi($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableCellular( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableCellular( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableBluetooth( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> disableBluetooth( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> enableDarkMode( - $grpc.ServiceCall call, $0.DarkModeRequest request); - $async.Future<$0.Empty> disableDarkMode( - $grpc.ServiceCall call, $0.DarkModeRequest request); - $async.Future<$0.Empty> openNotifications( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> closeNotifications( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> closeHeadsUpNotification( - $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.GetNotificationsResponse> getNotifications( - $grpc.ServiceCall call, $0.GetNotificationsRequest request); - $async.Future<$0.Empty> tapOnNotification( - $grpc.ServiceCall call, $0.TapOnNotificationRequest request); - $async.Future<$0.PermissionDialogVisibleResponse> isPermissionDialogVisible( - $grpc.ServiceCall call, $0.PermissionDialogVisibleRequest request); - $async.Future<$0.Empty> handlePermissionDialog( - $grpc.ServiceCall call, $0.HandlePermissionRequest request); - $async.Future<$0.Empty> setLocationAccuracy( - $grpc.ServiceCall call, $0.SetLocationAccuracyRequest request); - $async.Future<$0.Empty> debug($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.Empty> markPatrolAppServiceReady( - $grpc.ServiceCall call, $0.Empty request); -} diff --git a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart b/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart deleted file mode 100644 index f9e2e9434..000000000 --- a/packages/patrol/lib/src/native/contracts/contracts.pbjson.dart +++ /dev/null @@ -1,669 +0,0 @@ -/// -// Generated code. Do not modify. -// source: contracts.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name - -import 'dart:core' as $core; -import 'dart:convert' as $convert; -import 'dart:typed_data' as $typed_data; - -@$core.Deprecated('Use listDartTestsResponseDescriptor instead') -const ListDartTestsResponse$json = const { - '1': 'ListDartTestsResponse', - '2': const [ - const { - '1': 'group', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.DartTestGroup', - '10': 'group' - }, - ], -}; - -/// Descriptor for `ListDartTestsResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List listDartTestsResponseDescriptor = $convert.base64Decode( - 'ChVMaXN0RGFydFRlc3RzUmVzcG9uc2USKwoFZ3JvdXAYASABKAsyFS5wYXRyb2wuRGFydFRlc3RHcm91cFIFZ3JvdXA='); -@$core.Deprecated('Use dartTestGroupDescriptor instead') -const DartTestGroup$json = const { - '1': 'DartTestGroup', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - const { - '1': 'tests', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.DartTestCase', - '10': 'tests' - }, - const { - '1': 'groups', - '3': 3, - '4': 3, - '5': 11, - '6': '.patrol.DartTestGroup', - '10': 'groups' - }, - ], -}; - -/// Descriptor for `DartTestGroup`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List dartTestGroupDescriptor = $convert.base64Decode( - 'Cg1EYXJ0VGVzdEdyb3VwEhIKBG5hbWUYASABKAlSBG5hbWUSKgoFdGVzdHMYAiADKAsyFC5wYXRyb2wuRGFydFRlc3RDYXNlUgV0ZXN0cxItCgZncm91cHMYAyADKAsyFS5wYXRyb2wuRGFydFRlc3RHcm91cFIGZ3JvdXBz'); -@$core.Deprecated('Use dartTestCaseDescriptor instead') -const DartTestCase$json = const { - '1': 'DartTestCase', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - ], -}; - -/// Descriptor for `DartTestCase`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List dartTestCaseDescriptor = - $convert.base64Decode('CgxEYXJ0VGVzdENhc2USEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); -@$core.Deprecated('Use runDartTestRequestDescriptor instead') -const RunDartTestRequest$json = const { - '1': 'RunDartTestRequest', - '2': const [ - const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, - ], -}; - -/// Descriptor for `RunDartTestRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List runDartTestRequestDescriptor = $convert - .base64Decode('ChJSdW5EYXJ0VGVzdFJlcXVlc3QSEgoEbmFtZRgBIAEoCVIEbmFtZQ=='); -@$core.Deprecated('Use runDartTestResponseDescriptor instead') -const RunDartTestResponse$json = const { - '1': 'RunDartTestResponse', - '2': const [ - const { - '1': 'result', - '3': 1, - '4': 1, - '5': 14, - '6': '.patrol.RunDartTestResponse.Result', - '10': 'result' - }, - const { - '1': 'details', - '3': 2, - '4': 1, - '5': 9, - '9': 0, - '10': 'details', - '17': true - }, - ], - '4': const [RunDartTestResponse_Result$json], - '8': const [ - const {'1': '_details'}, - ], -}; - -@$core.Deprecated('Use runDartTestResponseDescriptor instead') -const RunDartTestResponse_Result$json = const { - '1': 'Result', - '2': const [ - const {'1': 'SUCCESS', '2': 0}, - const {'1': 'SKIPPED', '2': 1}, - const {'1': 'FAILURE', '2': 2}, - ], -}; - -/// Descriptor for `RunDartTestResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List runDartTestResponseDescriptor = $convert.base64Decode( - 'ChNSdW5EYXJ0VGVzdFJlc3BvbnNlEjoKBnJlc3VsdBgBIAEoDjIiLnBhdHJvbC5SdW5EYXJ0VGVzdFJlc3BvbnNlLlJlc3VsdFIGcmVzdWx0Eh0KB2RldGFpbHMYAiABKAlIAFIHZGV0YWlsc4gBASIvCgZSZXN1bHQSCwoHU1VDQ0VTUxAAEgsKB1NLSVBQRUQQARILCgdGQUlMVVJFEAJCCgoIX2RldGFpbHM='); -@$core.Deprecated('Use configureRequestDescriptor instead') -const ConfigureRequest$json = const { - '1': 'ConfigureRequest', - '2': const [ - const { - '1': 'findTimeoutMillis', - '3': 1, - '4': 1, - '5': 4, - '10': 'findTimeoutMillis' - }, - ], -}; - -/// Descriptor for `ConfigureRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List configureRequestDescriptor = $convert.base64Decode( - 'ChBDb25maWd1cmVSZXF1ZXN0EiwKEWZpbmRUaW1lb3V0TWlsbGlzGAEgASgEUhFmaW5kVGltZW91dE1pbGxpcw=='); -@$core.Deprecated('Use openAppRequestDescriptor instead') -const OpenAppRequest$json = const { - '1': 'OpenAppRequest', - '2': const [ - const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `OpenAppRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List openAppRequestDescriptor = $convert - .base64Decode('Cg5PcGVuQXBwUmVxdWVzdBIUCgVhcHBJZBgBIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use tapOnNotificationRequestDescriptor instead') -const TapOnNotificationRequest$json = const { - '1': 'TapOnNotificationRequest', - '2': const [ - const {'1': 'index', '3': 1, '4': 1, '5': 13, '9': 0, '10': 'index'}, - const { - '1': 'selector', - '3': 2, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '9': 0, - '10': 'selector' - }, - ], - '8': const [ - const {'1': 'findBy'}, - ], -}; - -/// Descriptor for `TapOnNotificationRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List tapOnNotificationRequestDescriptor = - $convert.base64Decode( - 'ChhUYXBPbk5vdGlmaWNhdGlvblJlcXVlc3QSFgoFaW5kZXgYASABKA1IAFIFaW5kZXgSLgoIc2VsZWN0b3IYAiABKAsyEC5wYXRyb2wuU2VsZWN0b3JIAFIIc2VsZWN0b3JCCAoGZmluZEJ5'); -@$core.Deprecated('Use emptyDescriptor instead') -const Empty$json = const { - '1': 'Empty', -}; - -/// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List emptyDescriptor = - $convert.base64Decode('CgVFbXB0eQ=='); -@$core.Deprecated('Use openQuickSettingsRequestDescriptor instead') -const OpenQuickSettingsRequest$json = const { - '1': 'OpenQuickSettingsRequest', -}; - -/// Descriptor for `OpenQuickSettingsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List openQuickSettingsRequestDescriptor = - $convert.base64Decode('ChhPcGVuUXVpY2tTZXR0aW5nc1JlcXVlc3Q='); -@$core.Deprecated('Use darkModeRequestDescriptor instead') -const DarkModeRequest$json = const { - '1': 'DarkModeRequest', - '2': const [ - const {'1': 'appId', '3': 1, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `DarkModeRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List darkModeRequestDescriptor = $convert - .base64Decode('Cg9EYXJrTW9kZVJlcXVlc3QSFAoFYXBwSWQYASABKAlSBWFwcElk'); -@$core.Deprecated('Use getNativeViewsRequestDescriptor instead') -const GetNativeViewsRequest$json = const { - '1': 'GetNativeViewsRequest', - '2': const [ - const { - '1': 'selector', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '10': 'selector' - }, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `GetNativeViewsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNativeViewsRequestDescriptor = $convert.base64Decode( - 'ChVHZXROYXRpdmVWaWV3c1JlcXVlc3QSLAoIc2VsZWN0b3IYASABKAsyEC5wYXRyb2wuU2VsZWN0b3JSCHNlbGVjdG9yEhQKBWFwcElkGAIgASgJUgVhcHBJZA=='); -@$core.Deprecated('Use getNativeViewsResponseDescriptor instead') -const GetNativeViewsResponse$json = const { - '1': 'GetNativeViewsResponse', - '2': const [ - const { - '1': 'nativeViews', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.NativeView', - '10': 'nativeViews' - }, - ], -}; - -/// Descriptor for `GetNativeViewsResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNativeViewsResponseDescriptor = - $convert.base64Decode( - 'ChZHZXROYXRpdmVWaWV3c1Jlc3BvbnNlEjQKC25hdGl2ZVZpZXdzGAIgAygLMhIucGF0cm9sLk5hdGl2ZVZpZXdSC25hdGl2ZVZpZXdz'); -@$core.Deprecated('Use getNotificationsRequestDescriptor instead') -const GetNotificationsRequest$json = const { - '1': 'GetNotificationsRequest', -}; - -/// Descriptor for `GetNotificationsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNotificationsRequestDescriptor = - $convert.base64Decode('ChdHZXROb3RpZmljYXRpb25zUmVxdWVzdA=='); -@$core.Deprecated('Use getNotificationsResponseDescriptor instead') -const GetNotificationsResponse$json = const { - '1': 'GetNotificationsResponse', - '2': const [ - const { - '1': 'notifications', - '3': 2, - '4': 3, - '5': 11, - '6': '.patrol.Notification', - '10': 'notifications' - }, - ], -}; - -/// Descriptor for `GetNotificationsResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List getNotificationsResponseDescriptor = - $convert.base64Decode( - 'ChhHZXROb3RpZmljYXRpb25zUmVzcG9uc2USOgoNbm90aWZpY2F0aW9ucxgCIAMoCzIULnBhdHJvbC5Ob3RpZmljYXRpb25SDW5vdGlmaWNhdGlvbnM='); -@$core.Deprecated('Use tapRequestDescriptor instead') -const TapRequest$json = const { - '1': 'TapRequest', - '2': const [ - const { - '1': 'selector', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '10': 'selector' - }, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `TapRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List tapRequestDescriptor = $convert.base64Decode( - 'CgpUYXBSZXF1ZXN0EiwKCHNlbGVjdG9yGAEgASgLMhAucGF0cm9sLlNlbGVjdG9yUghzZWxlY3RvchIUCgVhcHBJZBgCIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use enterTextRequestDescriptor instead') -const EnterTextRequest$json = const { - '1': 'EnterTextRequest', - '2': const [ - const {'1': 'data', '3': 1, '4': 1, '5': 9, '10': 'data'}, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - const {'1': 'index', '3': 3, '4': 1, '5': 13, '9': 0, '10': 'index'}, - const { - '1': 'selector', - '3': 4, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '9': 0, - '10': 'selector' - }, - const { - '1': 'keyboardBehavior', - '3': 5, - '4': 1, - '5': 14, - '6': '.patrol.EnterTextRequest.KeyboardBehavior', - '10': 'keyboardBehavior' - }, - ], - '4': const [EnterTextRequest_KeyboardBehavior$json], - '8': const [ - const {'1': 'findBy'}, - ], -}; - -@$core.Deprecated('Use enterTextRequestDescriptor instead') -const EnterTextRequest_KeyboardBehavior$json = const { - '1': 'KeyboardBehavior', - '2': const [ - const {'1': 'SHOW_AND_DISMISS', '2': 0}, - const {'1': 'ALTERNATIVE', '2': 1}, - ], -}; - -/// Descriptor for `EnterTextRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List enterTextRequestDescriptor = $convert.base64Decode( - 'ChBFbnRlclRleHRSZXF1ZXN0EhIKBGRhdGEYASABKAlSBGRhdGESFAoFYXBwSWQYAiABKAlSBWFwcElkEhYKBWluZGV4GAMgASgNSABSBWluZGV4Ei4KCHNlbGVjdG9yGAQgASgLMhAucGF0cm9sLlNlbGVjdG9ySABSCHNlbGVjdG9yElUKEGtleWJvYXJkQmVoYXZpb3IYBSABKA4yKS5wYXRyb2wuRW50ZXJUZXh0UmVxdWVzdC5LZXlib2FyZEJlaGF2aW9yUhBrZXlib2FyZEJlaGF2aW9yIjkKEEtleWJvYXJkQmVoYXZpb3ISFAoQU0hPV19BTkRfRElTTUlTUxAAEg8KC0FMVEVSTkFUSVZFEAFCCAoGZmluZEJ5'); -@$core.Deprecated('Use swipeRequestDescriptor instead') -const SwipeRequest$json = const { - '1': 'SwipeRequest', - '2': const [ - const {'1': 'startX', '3': 1, '4': 1, '5': 2, '10': 'startX'}, - const {'1': 'startY', '3': 2, '4': 1, '5': 2, '10': 'startY'}, - const {'1': 'endX', '3': 3, '4': 1, '5': 2, '10': 'endX'}, - const {'1': 'endY', '3': 4, '4': 1, '5': 2, '10': 'endY'}, - const {'1': 'steps', '3': 5, '4': 1, '5': 13, '10': 'steps'}, - const {'1': 'appId', '3': 6, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `SwipeRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List swipeRequestDescriptor = $convert.base64Decode( - 'CgxTd2lwZVJlcXVlc3QSFgoGc3RhcnRYGAEgASgCUgZzdGFydFgSFgoGc3RhcnRZGAIgASgCUgZzdGFydFkSEgoEZW5kWBgDIAEoAlIEZW5kWBISCgRlbmRZGAQgASgCUgRlbmRZEhQKBXN0ZXBzGAUgASgNUgVzdGVwcxIUCgVhcHBJZBgGIAEoCVIFYXBwSWQ='); -@$core.Deprecated('Use waitUntilVisibleRequestDescriptor instead') -const WaitUntilVisibleRequest$json = const { - '1': 'WaitUntilVisibleRequest', - '2': const [ - const { - '1': 'selector', - '3': 1, - '4': 1, - '5': 11, - '6': '.patrol.Selector', - '10': 'selector' - }, - const {'1': 'appId', '3': 2, '4': 1, '5': 9, '10': 'appId'}, - ], -}; - -/// Descriptor for `WaitUntilVisibleRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List waitUntilVisibleRequestDescriptor = - $convert.base64Decode( - 'ChdXYWl0VW50aWxWaXNpYmxlUmVxdWVzdBIsCghzZWxlY3RvchgBIAEoCzIQLnBhdHJvbC5TZWxlY3RvclIIc2VsZWN0b3ISFAoFYXBwSWQYAiABKAlSBWFwcElk'); -@$core.Deprecated('Use handlePermissionRequestDescriptor instead') -const HandlePermissionRequest$json = const { - '1': 'HandlePermissionRequest', - '2': const [ - const { - '1': 'code', - '3': 1, - '4': 1, - '5': 14, - '6': '.patrol.HandlePermissionRequest.Code', - '10': 'code' - }, - ], - '4': const [HandlePermissionRequest_Code$json], -}; - -@$core.Deprecated('Use handlePermissionRequestDescriptor instead') -const HandlePermissionRequest_Code$json = const { - '1': 'Code', - '2': const [ - const {'1': 'WHILE_USING', '2': 0}, - const {'1': 'ONLY_THIS_TIME', '2': 1}, - const {'1': 'DENIED', '2': 2}, - ], -}; - -/// Descriptor for `HandlePermissionRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List handlePermissionRequestDescriptor = - $convert.base64Decode( - 'ChdIYW5kbGVQZXJtaXNzaW9uUmVxdWVzdBI4CgRjb2RlGAEgASgOMiQucGF0cm9sLkhhbmRsZVBlcm1pc3Npb25SZXF1ZXN0LkNvZGVSBGNvZGUiNwoEQ29kZRIPCgtXSElMRV9VU0lORxAAEhIKDk9OTFlfVEhJU19USU1FEAESCgoGREVOSUVEEAI='); -@$core.Deprecated('Use setLocationAccuracyRequestDescriptor instead') -const SetLocationAccuracyRequest$json = const { - '1': 'SetLocationAccuracyRequest', - '2': const [ - const { - '1': 'locationAccuracy', - '3': 1, - '4': 1, - '5': 14, - '6': '.patrol.SetLocationAccuracyRequest.LocationAccuracy', - '10': 'locationAccuracy' - }, - ], - '4': const [SetLocationAccuracyRequest_LocationAccuracy$json], -}; - -@$core.Deprecated('Use setLocationAccuracyRequestDescriptor instead') -const SetLocationAccuracyRequest_LocationAccuracy$json = const { - '1': 'LocationAccuracy', - '2': const [ - const {'1': 'COARSE', '2': 0}, - const {'1': 'FINE', '2': 1}, - ], -}; - -/// Descriptor for `SetLocationAccuracyRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List setLocationAccuracyRequestDescriptor = - $convert.base64Decode( - 'ChpTZXRMb2NhdGlvbkFjY3VyYWN5UmVxdWVzdBJfChBsb2NhdGlvbkFjY3VyYWN5GAEgASgOMjMucGF0cm9sLlNldExvY2F0aW9uQWNjdXJhY3lSZXF1ZXN0LkxvY2F0aW9uQWNjdXJhY3lSEGxvY2F0aW9uQWNjdXJhY3kiKAoQTG9jYXRpb25BY2N1cmFjeRIKCgZDT0FSU0UQABIICgRGSU5FEAE='); -@$core.Deprecated('Use permissionDialogVisibleRequestDescriptor instead') -const PermissionDialogVisibleRequest$json = const { - '1': 'PermissionDialogVisibleRequest', - '2': const [ - const {'1': 'timeoutMillis', '3': 1, '4': 1, '5': 4, '10': 'timeoutMillis'}, - ], -}; - -/// Descriptor for `PermissionDialogVisibleRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List permissionDialogVisibleRequestDescriptor = - $convert.base64Decode( - 'Ch5QZXJtaXNzaW9uRGlhbG9nVmlzaWJsZVJlcXVlc3QSJAoNdGltZW91dE1pbGxpcxgBIAEoBFINdGltZW91dE1pbGxpcw=='); -@$core.Deprecated('Use permissionDialogVisibleResponseDescriptor instead') -const PermissionDialogVisibleResponse$json = const { - '1': 'PermissionDialogVisibleResponse', - '2': const [ - const {'1': 'visible', '3': 1, '4': 1, '5': 8, '10': 'visible'}, - ], -}; - -/// Descriptor for `PermissionDialogVisibleResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List permissionDialogVisibleResponseDescriptor = - $convert.base64Decode( - 'Ch9QZXJtaXNzaW9uRGlhbG9nVmlzaWJsZVJlc3BvbnNlEhgKB3Zpc2libGUYASABKAhSB3Zpc2libGU='); -@$core.Deprecated('Use selectorDescriptor instead') -const Selector$json = const { - '1': 'Selector', - '2': const [ - const { - '1': 'text', - '3': 1, - '4': 1, - '5': 9, - '9': 0, - '10': 'text', - '17': true - }, - const { - '1': 'textStartsWith', - '3': 2, - '4': 1, - '5': 9, - '9': 1, - '10': 'textStartsWith', - '17': true - }, - const { - '1': 'textContains', - '3': 3, - '4': 1, - '5': 9, - '9': 2, - '10': 'textContains', - '17': true - }, - const { - '1': 'className', - '3': 4, - '4': 1, - '5': 9, - '9': 3, - '10': 'className', - '17': true - }, - const { - '1': 'contentDescription', - '3': 5, - '4': 1, - '5': 9, - '9': 4, - '10': 'contentDescription', - '17': true - }, - const { - '1': 'contentDescriptionStartsWith', - '3': 6, - '4': 1, - '5': 9, - '9': 5, - '10': 'contentDescriptionStartsWith', - '17': true - }, - const { - '1': 'contentDescriptionContains', - '3': 7, - '4': 1, - '5': 9, - '9': 6, - '10': 'contentDescriptionContains', - '17': true - }, - const { - '1': 'resourceId', - '3': 8, - '4': 1, - '5': 9, - '9': 7, - '10': 'resourceId', - '17': true - }, - const { - '1': 'instance', - '3': 9, - '4': 1, - '5': 13, - '9': 8, - '10': 'instance', - '17': true - }, - const { - '1': 'enabled', - '3': 10, - '4': 1, - '5': 8, - '9': 9, - '10': 'enabled', - '17': true - }, - const { - '1': 'focused', - '3': 11, - '4': 1, - '5': 8, - '9': 10, - '10': 'focused', - '17': true - }, - const { - '1': 'pkg', - '3': 12, - '4': 1, - '5': 9, - '9': 11, - '10': 'pkg', - '17': true - }, - ], - '8': const [ - const {'1': '_text'}, - const {'1': '_textStartsWith'}, - const {'1': '_textContains'}, - const {'1': '_className'}, - const {'1': '_contentDescription'}, - const {'1': '_contentDescriptionStartsWith'}, - const {'1': '_contentDescriptionContains'}, - const {'1': '_resourceId'}, - const {'1': '_instance'}, - const {'1': '_enabled'}, - const {'1': '_focused'}, - const {'1': '_pkg'}, - ], -}; - -/// Descriptor for `Selector`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List selectorDescriptor = $convert.base64Decode( - 'CghTZWxlY3RvchIXCgR0ZXh0GAEgASgJSABSBHRleHSIAQESKwoOdGV4dFN0YXJ0c1dpdGgYAiABKAlIAVIOdGV4dFN0YXJ0c1dpdGiIAQESJwoMdGV4dENvbnRhaW5zGAMgASgJSAJSDHRleHRDb250YWluc4gBARIhCgljbGFzc05hbWUYBCABKAlIA1IJY2xhc3NOYW1liAEBEjMKEmNvbnRlbnREZXNjcmlwdGlvbhgFIAEoCUgEUhJjb250ZW50RGVzY3JpcHRpb26IAQESRwocY29udGVudERlc2NyaXB0aW9uU3RhcnRzV2l0aBgGIAEoCUgFUhxjb250ZW50RGVzY3JpcHRpb25TdGFydHNXaXRoiAEBEkMKGmNvbnRlbnREZXNjcmlwdGlvbkNvbnRhaW5zGAcgASgJSAZSGmNvbnRlbnREZXNjcmlwdGlvbkNvbnRhaW5ziAEBEiMKCnJlc291cmNlSWQYCCABKAlIB1IKcmVzb3VyY2VJZIgBARIfCghpbnN0YW5jZRgJIAEoDUgIUghpbnN0YW5jZYgBARIdCgdlbmFibGVkGAogASgISAlSB2VuYWJsZWSIAQESHQoHZm9jdXNlZBgLIAEoCEgKUgdmb2N1c2VkiAEBEhUKA3BrZxgMIAEoCUgLUgNwa2eIAQFCBwoFX3RleHRCEQoPX3RleHRTdGFydHNXaXRoQg8KDV90ZXh0Q29udGFpbnNCDAoKX2NsYXNzTmFtZUIVChNfY29udGVudERlc2NyaXB0aW9uQh8KHV9jb250ZW50RGVzY3JpcHRpb25TdGFydHNXaXRoQh0KG19jb250ZW50RGVzY3JpcHRpb25Db250YWluc0INCgtfcmVzb3VyY2VJZEILCglfaW5zdGFuY2VCCgoIX2VuYWJsZWRCCgoIX2ZvY3VzZWRCBgoEX3BrZw=='); -@$core.Deprecated('Use nativeViewDescriptor instead') -const NativeView$json = const { - '1': 'NativeView', - '2': const [ - const {'1': 'className', '3': 1, '4': 1, '5': 9, '10': 'className'}, - const {'1': 'text', '3': 2, '4': 1, '5': 9, '10': 'text'}, - const { - '1': 'contentDescription', - '3': 3, - '4': 1, - '5': 9, - '10': 'contentDescription' - }, - const {'1': 'focused', '3': 4, '4': 1, '5': 8, '10': 'focused'}, - const {'1': 'enabled', '3': 5, '4': 1, '5': 8, '10': 'enabled'}, - const {'1': 'childCount', '3': 6, '4': 1, '5': 5, '10': 'childCount'}, - const {'1': 'resourceName', '3': 7, '4': 1, '5': 9, '10': 'resourceName'}, - const { - '1': 'applicationPackage', - '3': 8, - '4': 1, - '5': 9, - '10': 'applicationPackage' - }, - const { - '1': 'children', - '3': 9, - '4': 3, - '5': 11, - '6': '.patrol.NativeView', - '10': 'children' - }, - ], -}; - -/// Descriptor for `NativeView`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List nativeViewDescriptor = $convert.base64Decode( - 'CgpOYXRpdmVWaWV3EhwKCWNsYXNzTmFtZRgBIAEoCVIJY2xhc3NOYW1lEhIKBHRleHQYAiABKAlSBHRleHQSLgoSY29udGVudERlc2NyaXB0aW9uGAMgASgJUhJjb250ZW50RGVzY3JpcHRpb24SGAoHZm9jdXNlZBgEIAEoCFIHZm9jdXNlZBIYCgdlbmFibGVkGAUgASgIUgdlbmFibGVkEh4KCmNoaWxkQ291bnQYBiABKAVSCmNoaWxkQ291bnQSIgoMcmVzb3VyY2VOYW1lGAcgASgJUgxyZXNvdXJjZU5hbWUSLgoSYXBwbGljYXRpb25QYWNrYWdlGAggASgJUhJhcHBsaWNhdGlvblBhY2thZ2USLgoIY2hpbGRyZW4YCSADKAsyEi5wYXRyb2wuTmF0aXZlVmlld1IIY2hpbGRyZW4='); -@$core.Deprecated('Use notificationDescriptor instead') -const Notification$json = const { - '1': 'Notification', - '2': const [ - const { - '1': 'appName', - '3': 1, - '4': 1, - '5': 9, - '9': 0, - '10': 'appName', - '17': true - }, - const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'}, - const {'1': 'content', '3': 3, '4': 1, '5': 9, '10': 'content'}, - const {'1': 'raw', '3': 4, '4': 1, '5': 9, '10': 'raw'}, - ], - '8': const [ - const {'1': '_appName'}, - ], -}; - -/// Descriptor for `Notification`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List notificationDescriptor = $convert.base64Decode( - 'CgxOb3RpZmljYXRpb24SHQoHYXBwTmFtZRgBIAEoCUgAUgdhcHBOYW1liAEBEhQKBXRpdGxlGAIgASgJUgV0aXRsZRIYCgdjb250ZW50GAMgASgJUgdjb250ZW50EhAKA3JhdxgEIAEoCVIDcmF3QgoKCF9hcHBOYW1l'); -@$core.Deprecated('Use submitTestResultsRequestDescriptor instead') -const SubmitTestResultsRequest$json = const { - '1': 'SubmitTestResultsRequest', - '2': const [ - const { - '1': 'results', - '3': 1, - '4': 3, - '5': 11, - '6': '.patrol.SubmitTestResultsRequest.ResultsEntry', - '10': 'results' - }, - ], - '3': const [SubmitTestResultsRequest_ResultsEntry$json], -}; - -@$core.Deprecated('Use submitTestResultsRequestDescriptor instead') -const SubmitTestResultsRequest_ResultsEntry$json = const { - '1': 'ResultsEntry', - '2': const [ - const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, - const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, - ], - '7': const {'7': true}, -}; - -/// Descriptor for `SubmitTestResultsRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List submitTestResultsRequestDescriptor = - $convert.base64Decode( - 'ChhTdWJtaXRUZXN0UmVzdWx0c1JlcXVlc3QSRwoHcmVzdWx0cxgBIAMoCzItLnBhdHJvbC5TdWJtaXRUZXN0UmVzdWx0c1JlcXVlc3QuUmVzdWx0c0VudHJ5UgdyZXN1bHRzGjoKDFJlc3VsdHNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB'); diff --git a/packages/patrol/lib/src/native/contracts/native_automator_client.dart b/packages/patrol/lib/src/native/contracts/native_automator_client.dart new file mode 100644 index 000000000..ae1c10d6a --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/native_automator_client.dart @@ -0,0 +1,317 @@ +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; + +import 'contracts.dart'; + +class NativeAutomatorClientException implements Exception { + NativeAutomatorClientException(this.statusCode, this.responseBody); + + final String responseBody; + final int statusCode; + + @override + String toString() { + return 'Invalid response: $statusCode $responseBody'; + } +} + +class NativeAutomatorClient { + NativeAutomatorClient( + this._client, + this._apiUri, { + Duration timeout = const Duration(seconds: 30), + }) : _timeout = timeout, + _headers = { + 'Connection': 'keep-alive', + 'Keep-Alive': 'timeout=${timeout.inSeconds}', + }; + + final Duration _timeout; + final http.Client _client; + final Uri _apiUri; + final Map _headers; + + Future initialize() { + return _sendRequest( + 'initialize', + ); + } + + Future configure( + ConfigureRequest request, + ) { + return _sendRequest( + 'configure', + request.toJson(), + ); + } + + Future pressHome() { + return _sendRequest( + 'pressHome', + ); + } + + Future pressBack() { + return _sendRequest( + 'pressBack', + ); + } + + Future pressRecentApps() { + return _sendRequest( + 'pressRecentApps', + ); + } + + Future doublePressRecentApps() { + return _sendRequest( + 'doublePressRecentApps', + ); + } + + Future openApp( + OpenAppRequest request, + ) { + return _sendRequest( + 'openApp', + request.toJson(), + ); + } + + Future openQuickSettings( + OpenQuickSettingsRequest request, + ) { + return _sendRequest( + 'openQuickSettings', + request.toJson(), + ); + } + + Future getNativeViews( + GetNativeViewsRequest request, + ) async { + final json = await _sendRequest( + 'getNativeViews', + request.toJson(), + ); + return GetNativeViewsResponse.fromJson(json); + } + + Future tap( + TapRequest request, + ) { + return _sendRequest( + 'tap', + request.toJson(), + ); + } + + Future doubleTap( + TapRequest request, + ) { + return _sendRequest( + 'doubleTap', + request.toJson(), + ); + } + + Future enterText( + EnterTextRequest request, + ) { + return _sendRequest( + 'enterText', + request.toJson(), + ); + } + + Future swipe( + SwipeRequest request, + ) { + return _sendRequest( + 'swipe', + request.toJson(), + ); + } + + Future waitUntilVisible( + WaitUntilVisibleRequest request, + ) { + return _sendRequest( + 'waitUntilVisible', + request.toJson(), + ); + } + + Future enableAirplaneMode() { + return _sendRequest( + 'enableAirplaneMode', + ); + } + + Future disableAirplaneMode() { + return _sendRequest( + 'disableAirplaneMode', + ); + } + + Future enableWiFi() { + return _sendRequest( + 'enableWiFi', + ); + } + + Future disableWiFi() { + return _sendRequest( + 'disableWiFi', + ); + } + + Future enableCellular() { + return _sendRequest( + 'enableCellular', + ); + } + + Future disableCellular() { + return _sendRequest( + 'disableCellular', + ); + } + + Future enableBluetooth() { + return _sendRequest( + 'enableBluetooth', + ); + } + + Future disableBluetooth() { + return _sendRequest( + 'disableBluetooth', + ); + } + + Future enableDarkMode( + DarkModeRequest request, + ) { + return _sendRequest( + 'enableDarkMode', + request.toJson(), + ); + } + + Future disableDarkMode( + DarkModeRequest request, + ) { + return _sendRequest( + 'disableDarkMode', + request.toJson(), + ); + } + + Future openNotifications() { + return _sendRequest( + 'openNotifications', + ); + } + + Future closeNotifications() { + return _sendRequest( + 'closeNotifications', + ); + } + + Future closeHeadsUpNotification() { + return _sendRequest( + 'closeHeadsUpNotification', + ); + } + + Future getNotifications( + GetNotificationsRequest request, + ) async { + final json = await _sendRequest( + 'getNotifications', + request.toJson(), + ); + return GetNotificationsResponse.fromJson(json); + } + + Future tapOnNotification( + TapOnNotificationRequest request, + ) { + return _sendRequest( + 'tapOnNotification', + request.toJson(), + ); + } + + Future isPermissionDialogVisible( + PermissionDialogVisibleRequest request, + ) async { + final json = await _sendRequest( + 'isPermissionDialogVisible', + request.toJson(), + ); + return PermissionDialogVisibleResponse.fromJson(json); + } + + Future handlePermissionDialog( + HandlePermissionRequest request, + ) { + return _sendRequest( + 'handlePermissionDialog', + request.toJson(), + ); + } + + Future setLocationAccuracy( + SetLocationAccuracyRequest request, + ) { + return _sendRequest( + 'setLocationAccuracy', + request.toJson(), + ); + } + + Future debug() { + return _sendRequest( + 'debug', + ); + } + + Future markPatrolAppServiceReady() { + return _sendRequest( + 'markPatrolAppServiceReady', + ); + } + + Future> _sendRequest( + String requestName, [ + Map? request, + ]) async { + final response = await _client + .post( + _apiUri.resolve(requestName), + body: jsonEncode(request), + headers: _headers, + ) + .timeout(_timeout); + + if (response.statusCode != 200) { + throw NativeAutomatorClientException(response.statusCode, response.body); + } + + return response.body.isNotEmpty + ? jsonDecode(response.body) as Map + : {}; + } +} diff --git a/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart new file mode 100644 index 000000000..dca57118d --- /dev/null +++ b/packages/patrol/lib/src/native/contracts/patrol_app_service_server.dart @@ -0,0 +1,38 @@ +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:shelf/shelf.dart'; + +import 'contracts.dart'; + +abstract class PatrolAppServiceServer { + FutureOr handle(Request request) async { + if ('listDartTests' == request.url.path) { + final result = await listDartTests(); + + final body = jsonEncode(result.toJson()); + return Response.ok(body); + } else if ('runDartTest' == request.url.path) { + final stringContent = await request.readAsString(utf8); + final json = jsonDecode(stringContent); + final requestObj = + RunDartTestRequest.fromJson(json as Map); + + final result = await runDartTest(requestObj); + + final body = jsonEncode(result.toJson()); + return Response.ok(body); + } else { + return Response.notFound('Request ${request.url} not found'); + } + } + + Future listDartTests(); + Future runDartTest(RunDartTestRequest request); +} diff --git a/packages/patrol/lib/src/native/native.dart b/packages/patrol/lib/src/native/native.dart index d88a1ed4f..39c38b38d 100644 --- a/packages/patrol/lib/src/native/native.dart +++ b/packages/patrol/lib/src/native/native.dart @@ -1,4 +1,3 @@ -export 'contracts/contracts.pbgrpc.dart' - show NativeView, Notification, Selector; +export 'contracts/contracts.dart' show NativeView, Notification, Selector; export 'native_automator.dart'; export 'patrol_app_service.dart'; diff --git a/packages/patrol/lib/src/native/native_automator.dart b/packages/patrol/lib/src/native/native_automator.dart index 2d4d209c7..cde6bfaf5 100644 --- a/packages/patrol/lib/src/native/native_automator.dart +++ b/packages/patrol/lib/src/native/native_automator.dart @@ -1,12 +1,13 @@ import 'dart:io' as io; -import 'package:fixnum/fixnum.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:grpc/grpc.dart'; +import 'package:http/http.dart' as http; import 'package:integration_test/integration_test.dart'; import 'package:meta/meta.dart'; import 'package:patrol/src/binding.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; +import 'package:patrol/src/native/contracts/contracts.dart' as contracts; +import 'package:patrol/src/native/contracts/native_automator_client.dart'; /// Thrown when a native action fails. class PatrolActionException implements Exception { @@ -51,12 +52,12 @@ enum KeyboardBehavior { } extension on KeyboardBehavior { - EnterTextRequest_KeyboardBehavior get toProtoEnum { + contracts.KeyboardBehavior get toContractsEnum { switch (this) { case KeyboardBehavior.showAndDismiss: - return EnterTextRequest_KeyboardBehavior.SHOW_AND_DISMISS; + return contracts.KeyboardBehavior.showAndDismiss; case KeyboardBehavior.alternative: - return EnterTextRequest_KeyboardBehavior.ALTERNATIVE; + return contracts.KeyboardBehavior.alternative; } } } @@ -195,17 +196,10 @@ class NativeAutomator { // _config.logger('Android package name: ${_config.packageName}'); // _config.logger('iOS bundle identifier: ${_config.bundleId}'); - final channel = ClientChannel( - _config.host, - port: int.parse(_config.port), - options: const ChannelOptions( - credentials: ChannelCredentials.insecure(), - ), - ); - _client = NativeAutomatorClient( - channel, - options: CallOptions(timeout: _config.connectionTimeout), + http.Client(), + Uri.http('${_config.host}:${_config.port}'), + timeout: _config.connectionTimeout, ); } @@ -230,10 +224,10 @@ class NativeAutomator { final result = await request(); _config.logger('$name() succeeded'); return result; - } on GrpcError catch (err) { + } on NativeAutomatorClientException catch (err) { _config.logger('$name() failed'); - final log = 'GrpcError: ' - '$name() failed with code ${err.codeName} (${err.message})'; + final log = 'NativeAutomatorClientException: ' + '$name() failed with $err'; throw PatrolActionException(log); } catch (err) { _config.logger('$name() failed'); @@ -251,10 +245,7 @@ class NativeAutomator { /// See also: /// * https://github.com/flutter/flutter/issues/129231 Future initialize() async { - await _wrapRequest( - 'initialize', - () => _client.initialize(Empty()), - ); + await _wrapRequest('initialize', _client.initialize); } /// Configures the native automator. @@ -270,7 +261,7 @@ class NativeAutomator { 'configure', () => _client.configure( ConfigureRequest( - findTimeoutMillis: Int64(_config.findTimeout.inMilliseconds), + findTimeoutMillis: _config.findTimeout.inMilliseconds, ), ), ); @@ -300,7 +291,7 @@ class NativeAutomator { /// * , /// which is used on Android. Future pressBack() async { - await _wrapRequest('pressBack', () => _client.pressBack(Empty())); + await _wrapRequest('pressBack', _client.pressBack); } /// Presses the home button. @@ -312,7 +303,7 @@ class NativeAutomator { /// * , /// which is used on iOS Future pressHome() async { - await _wrapRequest('pressHome', () => _client.pressHome(Empty())); + await _wrapRequest('pressHome', _client.pressHome); } /// Opens the app specified by [appId]. If [appId] is null, then the app under @@ -332,18 +323,12 @@ class NativeAutomator { /// * , /// which is used on Android Future pressRecentApps() async { - await _wrapRequest( - 'pressRecentApps', - () => _client.pressRecentApps(Empty()), - ); + await _wrapRequest('pressRecentApps', _client.pressRecentApps); } /// Double presses the recent apps button. Future pressDoubleRecentApps() async { - await _wrapRequest( - 'pressDoubleRecentApps', - () => _client.doublePressRecentApps(Empty()), - ); + await _wrapRequest('pressDoubleRecentApps', _client.doublePressRecentApps); } /// Opens the notification shade. @@ -352,20 +337,14 @@ class NativeAutomator { /// * , /// which is used on Android Future openNotifications() async { - await _wrapRequest( - 'openNotifications', - () => _client.openNotifications(Empty()), - ); + await _wrapRequest('openNotifications', _client.openNotifications); } /// Closes the notification shade. /// /// It must be visible, otherwise the behavior is undefined. Future closeNotifications() async { - await _wrapRequest( - 'closeNotifications', - () => _client.closeNotifications(Empty()), - ); + await _wrapRequest('closeNotifications', _client.closeNotifications); } /// Opens the quick settings shade on Android and Control Center on iOS. @@ -417,7 +396,7 @@ class NativeAutomator { Future closeHeadsUpNotification() async { await _wrapRequest( 'closeHeadsUpNotification', - () => _client.closeHeadsUpNotification(Empty()), + _client.closeHeadsUpNotification, ); } @@ -476,66 +455,42 @@ class NativeAutomator { /// Enables airplane mode. Future enableAirplaneMode() async { - await _wrapRequest( - 'enableAirplaneMode', - () => _client.enableAirplaneMode(Empty()), - ); + await _wrapRequest('enableAirplaneMode', _client.enableAirplaneMode); } /// Enables airplane mode. Future disableAirplaneMode() async { - await _wrapRequest( - 'disableAirplaneMode', - () => _client.disableAirplaneMode(Empty()), - ); + await _wrapRequest('disableAirplaneMode', _client.disableAirplaneMode); } /// Enables cellular (aka mobile data connection). Future enableCellular() async { - await _wrapRequest( - 'enableCellular', - () => _client.enableCellular(Empty()), - ); + await _wrapRequest('enableCellular', _client.enableCellular); } /// Disables cellular (aka mobile data connection). Future disableCellular() { - return _wrapRequest( - 'disableCellular', - () => _client.disableCellular(Empty()), - ); + return _wrapRequest('disableCellular', _client.disableCellular); } /// Enables Wi-Fi. Future enableWifi() async { - await _wrapRequest( - 'enableWifi', - () => _client.enableWiFi(Empty()), - ); + await _wrapRequest('enableWifi', _client.enableWiFi); } /// Disables Wi-Fi. Future disableWifi() async { - await _wrapRequest( - 'disableWifi', - () => _client.disableWiFi(Empty()), - ); + await _wrapRequest('disableWifi', _client.disableWiFi); } /// Enables bluetooth. Future enableBluetooth() async { - await _wrapRequest( - 'enableBluetooth', - () => _client.enableBluetooth(Empty()), - ); + await _wrapRequest('enableBluetooth', _client.enableBluetooth); } /// Disables bluetooth. Future disableBluetooth() async { - await _wrapRequest( - 'disableBluetooth', - () => _client.disableBluetooth(Empty()), - ); + await _wrapRequest('disableBluetooth', _client.disableBluetooth); } /// Taps on the native view specified by [selector]. @@ -593,7 +548,7 @@ class NativeAutomator { appId: appId ?? resolvedAppId, selector: selector, keyboardBehavior: - (keyboardBehavior ?? _config.keyboardBehavior).toProtoEnum, + (keyboardBehavior ?? _config.keyboardBehavior).toContractsEnum, ), ), ); @@ -627,7 +582,7 @@ class NativeAutomator { appId: appId ?? resolvedAppId, index: index, keyboardBehavior: - (keyboardBehavior ?? _config.keyboardBehavior).toProtoEnum, + (keyboardBehavior ?? _config.keyboardBehavior).toContractsEnum, ), ), ); @@ -701,7 +656,7 @@ class NativeAutomator { 'isPermissionDialogVisible', () => _client.isPermissionDialogVisible( PermissionDialogVisibleRequest( - timeoutMillis: Int64(timeout.inMilliseconds), + timeoutMillis: timeout.inMilliseconds, ), ), ); @@ -726,7 +681,7 @@ class NativeAutomator { await _wrapRequest( 'grantPermissionWhenInUse', () => _client.handlePermissionDialog( - HandlePermissionRequest(code: HandlePermissionRequest_Code.WHILE_USING), + HandlePermissionRequest(code: HandlePermissionRequestCode.whileUsing), ), ); } @@ -756,7 +711,7 @@ class NativeAutomator { 'grantPermissionOnlyThisTime', () => _client.handlePermissionDialog( HandlePermissionRequest( - code: HandlePermissionRequest_Code.ONLY_THIS_TIME, + code: HandlePermissionRequestCode.onlyThisTime, ), ), ); @@ -779,7 +734,7 @@ class NativeAutomator { await _wrapRequest( 'denyPermission', () => _client.handlePermissionDialog( - HandlePermissionRequest(code: HandlePermissionRequest_Code.DENIED), + HandlePermissionRequest(code: HandlePermissionRequestCode.denied), ), ); } @@ -793,7 +748,7 @@ class NativeAutomator { 'selectCoarseLocation', () => _client.setLocationAccuracy( SetLocationAccuracyRequest( - locationAccuracy: SetLocationAccuracyRequest_LocationAccuracy.COARSE, + locationAccuracy: SetLocationAccuracyRequestLocationAccuracy.coarse, ), ), ); @@ -808,7 +763,7 @@ class NativeAutomator { 'selectFineLocation', () => _client.setLocationAccuracy( SetLocationAccuracyRequest( - locationAccuracy: SetLocationAccuracyRequest_LocationAccuracy.FINE, + locationAccuracy: SetLocationAccuracyRequestLocationAccuracy.fine, ), ), ); @@ -820,7 +775,7 @@ class NativeAutomator { Future markPatrolAppServiceReady() async { await _wrapRequest( 'markPatrolAppServiceReady', - () => _client.markPatrolAppServiceReady(Empty()), + _client.markPatrolAppServiceReady, ); } } diff --git a/packages/patrol/lib/src/native/patrol_app_service.dart b/packages/patrol/lib/src/native/patrol_app_service.dart index 2e0e7855e..a4aa6699e 100644 --- a/packages/patrol/lib/src/native/patrol_app_service.dart +++ b/packages/patrol/lib/src/native/patrol_app_service.dart @@ -1,13 +1,19 @@ // ignore_for_file: avoid_print + // TODO: Use a logger instead of print import 'dart:async'; -import 'dart:io' as io; +import 'dart:io'; + +import 'package:patrol/src/common.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; +import 'package:patrol/src/native/contracts/patrol_app_service_server.dart'; -import 'package:grpc/grpc.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:shelf/shelf.dart' as shelf; +import 'package:shelf/shelf_io.dart' as shelf_io; const _port = 8082; +const _idleTimeout = Duration(hours: 2); class _TestExecutionResult { const _TestExecutionResult({required this.passed, required this.details}); @@ -18,26 +24,37 @@ class _TestExecutionResult { /// Starts the gRPC server that runs the [PatrolAppService]. Future runAppService(PatrolAppService service) async { - final services = [service]; - final interceptors = []; - final codecRegistry = CodecRegistry(); + final pipeline = const shelf.Pipeline() + .addMiddleware(shelf.logRequests()) + .addHandler(service.handle); + + final server = await shelf_io.serve( + pipeline, + InternetAddress.anyIPv4, + _port, + poweredByHeader: null, + ); + + server.idleTimeout = _idleTimeout; - final server = Server(services, interceptors, codecRegistry); - await server.serve(address: io.InternetAddress.anyIPv4, port: _port); - print('PatrolAppService started on port $_port'); + final address = server.address; + + print( + 'PatrolAppService started, address: ${address.address}, host: ${address.host}, port: ${server.port}', + ); } /// Implements a stateful gRPC service for querying and executing Dart tests. /// /// This is an internal class and you don't want to use it. It's public so that /// the generated code can access it. -class PatrolAppService extends PatrolAppServiceBase { +class PatrolAppService extends PatrolAppServiceServer { /// Creates a new [PatrolAppService]. PatrolAppService({required this.topLevelDartTestGroup}); /// The ambient test group that wraps all the other groups and tests in the /// bundled Dart test file. - final DartTestGroup topLevelDartTestGroup; + final DartGroupEntry topLevelDartTestGroup; /// A completer that completes with the name of the Dart test file that was /// requested to execute by the native side. @@ -84,48 +101,44 @@ class PatrolAppService extends PatrolAppServiceBase { ); } - /// Returns when the native side requests execution of a Dart test file. + /// Returns when the native side requests execution of a Dart test. If the + /// native side requsted execution of [dartTest], returns true. Otherwise + /// returns false. /// - /// The native side requests execution by RPC-ing [runDartTest] and providing - /// name of a Dart test file. + /// It's used inside of [patrolTest] to halt execution of test body until + /// [runDartTest] is called. /// - /// Returns true if the native side requsted execution of [dartTestFile]. - /// Returns false otherwise. - Future waitForExecutionRequest(String dartTestFile) async { - print('PatrolAppService: registered "$dartTestFile"'); + /// The native side requests execution by RPC-ing [runDartTest] and providing + /// name of a Dart test that it wants to currently execute [dartTest]. + Future waitForExecutionRequest(String dartTest) async { + print('PatrolAppService: registered "$dartTest"'); - final requestedDartTestFile = await testExecutionRequested; - if (requestedDartTestFile != dartTestFile) { - // If the requested Dart test file is not the one we're waiting for now, - // it means that dartTestFile was already executed. Return false so that - // callers can skip the already executed test. + final requestedDartTest = await testExecutionRequested; + if (requestedDartTest != dartTest) { + // If the requested Dart test is not the one we're waiting for now, it + // means that dartTest was already executed. Return false so that callers + // can skip the already executed test. print( - 'PatrolAppService: registered test "$dartTestFile" was not matched by requested test "$requestedDartTestFile"', + 'PatrolAppService: registered test "$dartTest" was not matched by requested test "$requestedDartTest"', ); return false; } - print('PatrolAppService: requested execution of test "$dartTestFile"'); + print('PatrolAppService: requested execution of test "$dartTest"'); return true; } @override - Future listDartTests( - ServiceCall call, - Empty request, - ) async { + Future listDartTests() async { print('PatrolAppService.listDartTests() called'); return ListDartTestsResponse(group: topLevelDartTestGroup); } @override - Future runDartTest( - ServiceCall call, - RunDartTestRequest request, - ) async { + Future runDartTest(RunDartTestRequest request) async { assert(_testExecutionCompleted.isCompleted == false); // patrolTest() always calls this method. @@ -135,8 +148,8 @@ class PatrolAppService extends PatrolAppServiceBase { final testExecutionResult = await testExecutionCompleted; return RunDartTestResponse( result: testExecutionResult.passed - ? RunDartTestResponse_Result.SUCCESS - : RunDartTestResponse_Result.FAILURE, + ? RunDartTestResponseResult.success + : RunDartTestResponseResult.failure, details: testExecutionResult.details, ); } diff --git a/packages/patrol/pubspec.yaml b/packages/patrol/pubspec.yaml index b7f083f52..0d1a0a489 100644 --- a/packages/patrol/pubspec.yaml +++ b/packages/patrol/pubspec.yaml @@ -2,7 +2,7 @@ name: patrol description: > Powerful Flutter-native UI testing framework overcoming limitations of existing Flutter testing tools. Ready for action! -version: 2.2.5 +version: 2.3.0-dev.4 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues @@ -12,22 +12,25 @@ environment: flutter: '>=3.3.0' dependencies: + equatable: ^2.0.3 fixnum: ^1.0.1 flutter: sdk: flutter flutter_test: sdk: flutter - grpc: ^3.1.0 + http: '>=0.13.5 <2.0.0' integration_test: sdk: flutter + json_annotation: ^4.6.0 meta: ^1.7.0 path: ^1.8.2 patrol_finders: ^1.0.0 - protobuf: ^2.1.0 + shelf: ^1.4.1 test_api: '>=0.4.0 <0.7.0' dev_dependencies: build_runner: ^2.3.3 + json_serializable: ^6.3.2 leancode_lint: ^3.0.0 flutter: diff --git a/packages/patrol/test/internals_test.dart b/packages/patrol/test/internals_test.dart index 44700dc07..a7cc8bf1f 100644 --- a/packages/patrol/test/internals_test.dart +++ b/packages/patrol/test/internals_test.dart @@ -1,14 +1,15 @@ // ignore_for_file: invalid_use_of_internal_member, depend_on_referenced_packages, implementation_imports import 'package:flutter_test/flutter_test.dart'; -import 'package:patrol/src/common.dart' show createDartTestGroup; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/common.dart' + show createDartTestGroup, deduplicateGroupEntryName; +import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:test_api/src/backend/group.dart'; -import 'package:test_api/src/backend/invoker.dart'; +import 'package:test_api/src/backend/invoker.dart' show LocalTest; import 'package:test_api/src/backend/metadata.dart'; void main() { group('createDartTestGroup()', () { - test('fails if a test is defined', () { + test('fails if a test is defined at top-level', () { // given final topLevelGroup = Group.root([ LocalTest('patrol_test_explorer', Metadata.empty, () {}), @@ -19,7 +20,7 @@ void main() { ]); // when - DartTestGroup callback() => createDartTestGroup(topLevelGroup); + DartGroupEntry callback() => createDartTestGroup(topLevelGroup); // then expect( @@ -27,29 +28,27 @@ void main() { throwsA(isA()), ); }); - test('takes only groups into account', () { + + test('smoke test 1', () { // given final topLevelGroup = Group.root([ LocalTest('patrol_test_explorer', Metadata.empty, () {}), Group( - 'permissions.permissions_location_test', + 'example_test', [ - LocalTest( - 'permissions.permissions_location_test accepts location permission', - Metadata.empty, - () {}, - ), + Group('example_test alpha', [ + _localTest('example_test alpha first'), + _localTest('example_test alpha second'), + ]), + Group('example_test bravo', [ + _localTest('example_test bravo first'), + _localTest('example_test bravo second'), + ]), ], ), - Group('permissions.permissions_many_test', [ - LocalTest( - 'permissions.permissions_many_test grants various permissions', - Metadata.empty, - () {}, - ), - ]), - Group('example_test', [ - LocalTest('example_test some example test', Metadata.empty, () {}), + Group('open_app_test', [ + _localTest('open_app_test open maps'), + _localTest('open_app_test open browser'), ]), ]); @@ -59,15 +58,173 @@ void main() { // then expect( dartTestGroup, - DartTestGroup( - name: '', - groups: [ - DartTestGroup(name: 'permissions.permissions_location_test'), - DartTestGroup(name: 'permissions.permissions_many_test'), - DartTestGroup(name: 'example_test'), + equals( + DartGroupEntry( + name: '', + type: GroupEntryType.group, + entries: [ + DartGroupEntry( + name: 'example_test', + type: GroupEntryType.group, + entries: [ + DartGroupEntry( + name: 'alpha', + type: GroupEntryType.group, + entries: [ + _testEntry('first'), + _testEntry('second'), + ], + ), + DartGroupEntry( + name: 'bravo', + type: GroupEntryType.group, + entries: [ + _testEntry('first'), + _testEntry('second'), + ], + ), + ], + ), + DartGroupEntry( + name: 'open_app_test', + type: GroupEntryType.group, + entries: [ + _testEntry('open maps'), + _testEntry('open browser'), + ], + ), + ], + ), + ), + ); + }); + + test('smoke test 2', () { + // given + final topLevelGroup = Group.root([ + LocalTest('patrol_test_explorer', Metadata.empty, () {}), + Group( + 'example_test', + [ + _localTest('example_test alpha'), + Group('example_test bravo', [ + _localTest('example_test bravo first'), + _localTest('example_test bravo second'), + ]), + _localTest('example_test charlie'), + Group('example_test delta', [ + _localTest('example_test delta first'), + _localTest('example_test delta second'), + ]), + _localTest('example_test echo'), ], ), + ]); + + // when + final dartTestGroup = createDartTestGroup(topLevelGroup); + + // then + expect( + dartTestGroup, + equals( + DartGroupEntry( + name: '', + type: GroupEntryType.group, + entries: [ + DartGroupEntry( + name: 'example_test', + type: GroupEntryType.group, + entries: [ + _testEntry('alpha'), + DartGroupEntry( + name: 'bravo', + type: GroupEntryType.group, + entries: [ + _testEntry('first'), + _testEntry('second'), + ], + ), + _testEntry('charlie'), + DartGroupEntry( + name: 'delta', + type: GroupEntryType.group, + entries: [ + _testEntry('first'), + _testEntry('second'), + ], + ), + _testEntry('echo'), + ], + ), + ], + ), + ), ); }); + + test('smoke test 3 (long test names)', () { + // given + final topLevelGroup = Group.root([ + LocalTest('patrol_test_explorer', Metadata.empty, () {}), + Group( + 'example_test', + [ + _localTest('example_test alpha'), // 18 chars + _localTest('example_test zielony kocyk'), // 26 chars, 6 too many + ], + ), + ]); + + // when + final dartTestGroup = createDartTestGroup( + topLevelGroup, + maxTestCaseLength: 20, + ); + + // then + expect( + dartTestGroup, + equals( + DartGroupEntry( + name: '', + type: GroupEntryType.group, + entries: [ + DartGroupEntry( + name: 'example_test', + type: GroupEntryType.group, + entries: [ + _testEntry('alpha'), + _testEntry('zielony'), + ], + ), + ], + ), + ), + ); + }); + }); + + group('deduplicateGroupEntryName()', () { + test('deduplicates group entry names', () { + // given + const parentEntryName = 'example_test example_test.dart alpha'; + const currentEntryName = 'example_test example_test.dart alpha first'; + + // when + final result = deduplicateGroupEntryName( + parentEntryName, + currentEntryName, + ); + + // then + expect(result, equals('first')); + }); }); } + +LocalTest _localTest(String name) => LocalTest(name, Metadata.empty, () {}); + +DartGroupEntry _testEntry(String name) { + return DartGroupEntry(name: name, type: GroupEntryType.test, entries: []); +} diff --git a/packages/patrol_cli/CHANGELOG.md b/packages/patrol_cli/CHANGELOG.md index fe160a533..ad38ead48 100644 --- a/packages/patrol_cli/CHANGELOG.md +++ b/packages/patrol_cli/CHANGELOG.md @@ -1,3 +1,15 @@ +## 2.2.0-dev.2 + +- Adjust generated `test_bundle.dart` to not depend on gRPC contracts (#1681) + +This version requires version 2.3.0-dev.2 of `patrol` package. + +## 2.2.0-dev.1 + +- Add support for `group()` (#1634) + +This version requires version 2.3.0-dev.1 of `patrol` package. + ## 2.1.5 - Remove notice about migrating to Patrol 2.0 (#1738) diff --git a/packages/patrol_cli/lib/src/base/constants.dart b/packages/patrol_cli/lib/src/base/constants.dart index 978738189..b5b7326df 100644 --- a/packages/patrol_cli/lib/src/base/constants.dart +++ b/packages/patrol_cli/lib/src/base/constants.dart @@ -1,2 +1,2 @@ /// Version of Patrol CLI. Must be kept in sync with pubspec.yaml. -const version = '2.1.5'; +const version = '2.2.0-dev.2'; diff --git a/packages/patrol_cli/lib/src/test_bundler.dart b/packages/patrol_cli/lib/src/test_bundler.dart index c4c45ff17..4b2c489d9 100644 --- a/packages/patrol_cli/lib/src/test_bundler.dart +++ b/packages/patrol_cli/lib/src/test_bundler.dart @@ -28,7 +28,7 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:patrol/patrol.dart'; -import 'package:patrol/src/native/contracts/contracts.pbgrpc.dart'; +import 'package:patrol/src/native/contracts/contracts.dart'; import 'package:test_api/src/backend/invoker.dart'; // START: GENERATED TEST IMPORTS @@ -71,7 +71,7 @@ Future main() async { final nativeAutomator = NativeAutomator(config: NativeAutomatorConfig()); await nativeAutomator.initialize(); final binding = PatrolBinding.ensureInitialized(); - final testExplorationCompleter = Completer(); + final testExplorationCompleter = Completer(); // A special test to expore the hierarchy of groups and tests. This is a hack // around https://github.com/dart-lang/test/issues/1998. @@ -79,9 +79,13 @@ Future main() async { // This test must be the first to run. If not, the native side likely won't // receive any tests, and everything will fall apart. test('patrol_test_explorer', () { + // Maybe somewhat counterintuitively, this callback runs *after* the calls + // to group() below. final topLevelGroup = Invoker.current!.liveTest.groups.first; final dartTestGroup = createDartTestGroup(topLevelGroup); testExplorationCompleter.complete(dartTestGroup); + print('patrol_test_explorer: obtained Dart-side test hierarchy:'); + printGroupStructure(dartTestGroup); }); // START: GENERATED TEST GROUPS diff --git a/packages/patrol_cli/pubspec.yaml b/packages/patrol_cli/pubspec.yaml index 91e963c43..b93926aba 100644 --- a/packages/patrol_cli/pubspec.yaml +++ b/packages/patrol_cli/pubspec.yaml @@ -1,7 +1,7 @@ name: patrol_cli description: > Command-line tool for Patrol, a powerful Flutter-native UI testing framework. -version: 2.1.5 # Must be kept in sync with constants.dart +version: 2.2.0-dev.2 # Must be kept in sync with constants.dart homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol issue_tracker: https://github.com/leancodepl/patrol/issues diff --git a/packages/patrol_gen/LICENSE b/packages/patrol_gen/LICENSE new file mode 100644 index 000000000..7a6914410 --- /dev/null +++ b/packages/patrol_gen/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 LeanCode Sp. z o.o. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/patrol_gen/analysis_options.yaml b/packages/patrol_gen/analysis_options.yaml new file mode 100644 index 000000000..2bdc49a2f --- /dev/null +++ b/packages/patrol_gen/analysis_options.yaml @@ -0,0 +1,9 @@ +include: package:leancode_lint/analysis_options_package.yaml + +linter: + rules: + public_member_api_docs: false + +analyzer: + exclude: + - lib/**/*.g.dart diff --git a/packages/patrol_gen/bin/main.dart b/packages/patrol_gen/bin/main.dart new file mode 100644 index 000000000..63b831fa1 --- /dev/null +++ b/packages/patrol_gen/bin/main.dart @@ -0,0 +1,23 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/patrol_gen.dart'; +import 'package:patrol_gen/src/utils.dart'; + +Future main(List args) { + return PatrolGen().run( + PatrolGenConfig( + schemaFilename: normalizePath(args[0]), + dartConfig: DartConfig( + outputDirectory: normalizePath(args[1]), + ), + iosConfig: IOSConfig( + outputDirectory: normalizePath(args[2]), + ), + androidConfig: AndroidConfig( + outputDirectory: normalizePath(args[3]), + package: args[4], + ), + ), + ); +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_config.dart b/packages/patrol_gen/lib/src/generators/android/android_config.dart new file mode 100644 index 000000000..c30f50fb6 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_config.dart @@ -0,0 +1,17 @@ +import 'package:path/path.dart' as path; + +class AndroidConfig { + AndroidConfig({ + required this.outputDirectory, + required this.package, + }) : contractsFilename = path.join(outputDirectory, 'Contracts.kt'); + + final String package; + final String outputDirectory; + final String contractsFilename; + + String clientFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Client.kt'); + String serverFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Server.kt'); +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart new file mode 100644 index 000000000..d18a113a0 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_contracts_generator.dart @@ -0,0 +1,99 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; +import 'package:patrol_gen/src/utils.dart'; + +class AndroidContractsGenerator { + OutputFile generate(Schema schema, AndroidConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..writeln('class Contracts {'); + + for (final enumDefinition in schema.enums) { + buffer.writeln(_createEnum(enumDefinition)); + } + for (final messageDefintion in schema.messages) { + buffer.writeln(_createMessage(messageDefintion)); + } + + buffer.writeln('}'); + + return OutputFile( + filename: config.contractsFilename, + content: buffer.toString(), + ); + } + + String _contentPrefix(AndroidConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package ${config.package}; + +import kotlinx.serialization.Serializable + +'''; + } + + String _createMessage(Message message) { + final fields = message.fields.map((e) { + final optional = e.isOptional ? '? = null' : ''; + return e.isList + ? ' val ${e.name}: List<${_transformType(e.type)}>$optional' + : ' val ${e.name}: ${_transformType(e.type)}$optional'; + }).join(',\n'); + + final dataKeyword = fields.isNotEmpty ? 'data ' : ''; + + final optionalFields = message.fields.where((e) => e.isOptional).toList(); + + var optionalFieldUtils = optionalFields.map(_optionalFieldUtil).join('\n'); + if (optionalFields.isNotEmpty) { + optionalFieldUtils = ''' +{ +$optionalFieldUtils + }'''; + } + + return ''' + @Serializable + ${dataKeyword}class ${message.name} ( +$fields + )$optionalFieldUtils +'''; + } + + String _optionalFieldUtil(MessageField field) { + return ''' + fun has${field.name.capitalize()}(): Boolean { + return ${field.name} != null + }'''; + } + + String _createEnum(Enum enumDefinition) { + final cases = enumDefinition.fields.map((e) => ' $e,').join('\n'); + + return ''' + @Serializable + enum class ${enumDefinition.name} { +$cases + } +'''; + } + + String _transformType(String type) { + switch (type) { + case 'int': + return 'Long'; + case 'double': + return 'Double'; + case 'bool': + return 'Boolean'; + default: + return type; + } + } +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_generator.dart new file mode 100644 index 000000000..9a9a25f74 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_generator.dart @@ -0,0 +1,28 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/android/android_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/android/android_http4k_client_generator.dart'; +import 'package:patrol_gen/src/generators/android/android_http4k_server_generator.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidGenerator { + List generate(Schema schema, AndroidConfig config) { + final result = [ + AndroidContractsGenerator().generate(schema, config), + ]; + + final serverGenerator = AndroidHttp4kServerGenerator(); + final clientGenerator = AndroidHttp4kClientGenerator(); + + for (final service in schema.services) { + if (service.android.needsServer) { + result.add(serverGenerator.generate(service, config)); + } + if (service.android.needsClient) { + result.add(clientGenerator.generate(service, config)); + } + } + + return result; + } +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart new file mode 100644 index 000000000..2ecf09a90 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_client_generator.dart @@ -0,0 +1,114 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidHttp4kClientGenerator { + OutputFile generate(Service service, AndroidConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..writeln(_generateClientClass(service)) + ..writeln() + ..writeln(_generateExceptionClass(service)); + + return OutputFile( + filename: config.clientFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(AndroidConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package ${config.package}; + +import com.squareup.okhttp.MediaType +import com.squareup.okhttp.OkHttpClient +import com.squareup.okhttp.Request +import com.squareup.okhttp.RequestBody +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import java.util.concurrent.TimeUnit + +'''; + } + + String _generateClientClass(Service service) { + const url = r'"http://$address:$port/"'; + final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + const throwException = + r'throw PatrolAppServiceClientException("Invalid response ${response.code()}, ${response?.body()?.string()}")'; + + const urlWithPath = r'"$serverUrl$path"'; + + return ''' +class ${service.name}Client(address: String, port: Int, private val timeout: Long, private val timeUnit: TimeUnit) { + +$endpoints + + private fun performRequest(path: String, requestBody: String? = null): String { + val endpoint = $urlWithPath + + val client = OkHttpClient().apply { + setConnectTimeout(timeout, timeUnit) + setReadTimeout(timeout, timeUnit) + setWriteTimeout(timeout, timeUnit) + } + + val request = Request.Builder() + .url(endpoint) + .also { + if (requestBody != null) { + it.post(RequestBody.create(jsonMediaType, requestBody)) + } + } + .build() + + val response = client.newCall(request).execute() + if (response.code() != 200) { + $throwException + } + + return response.body().string() + } + + val serverUrl = $url + + private val json = Json { ignoreUnknownKeys = true } + + private val jsonMediaType = MediaType.parse("application/json; charset=utf-8") +}'''; + } + + String _createEndpoint(Endpoint endpoint) { + final parameterDef = endpoint.request != null + ? 'request: Contracts.${endpoint.request!.name}' + : ''; + final returnDef = endpoint.response != null + ? ': Contracts.${endpoint.response!.name}' + : ''; + + final serializeParameter = + endpoint.request != null ? ', json.encodeToString(request)' : ''; + + final body = endpoint.response != null + ? ''' + val response = performRequest("${endpoint.name}"$serializeParameter) + return json.decodeFromString(response)''' + : ''' + return performRequest("${endpoint.name}"$serializeParameter)'''; + + return ''' + fun ${endpoint.name}($parameterDef)$returnDef { +$body + }'''; + } + + String _generateExceptionClass(Service service) { + return ''' +class ${service.name}ClientException(message: String) : Exception(message)'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart b/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart new file mode 100644 index 000000000..20277c235 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/android/android_http4k_server_generator.dart @@ -0,0 +1,88 @@ +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class AndroidHttp4kServerGenerator { + OutputFile generate(Service service, AndroidConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..writeln(_createServerClass(service)); + + return OutputFile( + filename: config.serverFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(AndroidConfig config) { + return ''' +/// +// Generated code. Do not modify. +// source: schema.dart +// + +package ${config.package}; + +import org.http4k.core.Response +import org.http4k.core.Method.POST +import org.http4k.routing.bind +import org.http4k.core.Status.Companion.OK +import org.http4k.routing.routes +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +'''; + } + + String _createServerClass(Service service) { + final handlers = _generateHandlers(service); + final routes = _generateRoutes(service); + + return ''' +abstract class ${service.name}Server { +$handlers + + val router = routes( +$routes + ) + + private val json = Json { ignoreUnknownKeys = true } +} +'''; + } + + String _generateRoutes(Service service) { + return service.endpoints.map((e) { + final requestDeserialization = e.request != null + ? ''' + + val body = json.decodeFromString(it.bodyString())''' + : ''; + final requestArg = e.request != null ? 'body' : ''; + + final responseSerialization = + e.response != null ? '.body(json.encodeToString(response))' : ''; + + final responseVariable = e.response != null ? 'val response = ' : ''; + + return ''' + "${e.name}" bind POST to {$requestDeserialization + $responseVariable${e.name}($requestArg) + Response(OK)$responseSerialization + }'''; + }).join(',\n'); + } + + String _generateHandlers(Service service) { + return service.endpoints.map((endpoint) { + final response = endpoint.response != null + ? ': Contracts.${endpoint.response!.name}' + : ''; + final request = endpoint.request != null + ? 'request: Contracts.${endpoint.request!.name}' + : ''; + + return ' abstract fun ${endpoint.name}($request)$response'; + }).join('\n'); + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_config.dart b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart new file mode 100644 index 000000000..5720e2143 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_config.dart @@ -0,0 +1,23 @@ +import 'package:path/path.dart' as path; + +class DartConfig { + DartConfig({ + required this.outputDirectory, + }) : contractsFilename = path.join(outputDirectory, 'contracts.dart'); + + final String outputDirectory; + final String contractsFilename; + + String serviceFileName(String serviceName) => + path.join(outputDirectory, '${_fileName(serviceName)}_server.dart'); + + String clientFileName(String serviceName) => + path.join(outputDirectory, '${_fileName(serviceName)}_client.dart'); + + String _fileName(String pascalCaseName) { + final beforeCapitalLetter = RegExp('(?=[A-Z])'); + + final parts = pascalCaseName.split(beforeCapitalLetter); + return parts.map((e) => e.toLowerCase()).join('_'); + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart new file mode 100644 index 000000000..7a467ea6b --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_contracts_generator.dart @@ -0,0 +1,97 @@ +import 'package:dart_style/dart_style.dart'; +import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class DartContractsGenerator { + OutputFile generate(Schema schema, DartConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + for (final enumDefinition in schema.enums) { + buffer.writeln(_createEnum(enumDefinition)); + } + for (final messageDefintion in schema.messages) { + buffer.writeln(_createMessage(messageDefintion)); + } + + final content = DartFormatter().format(buffer.toString()); + + return OutputFile(filename: config.contractsFilename, content: content); + } + + String _contentPrefix(DartConfig config) { + return ''' +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part '${path.basenameWithoutExtension(config.contractsFilename)}.g.dart'; + +'''; + } + + String _createEnum(Enum enumDefinition) { + final fieldsContent = enumDefinition.fields.map((e) { + return ''' +@JsonValue('$e') +$e'''; + }).join(',\n'); + + return ''' +enum ${enumDefinition.name} { + $fieldsContent +} +'''; + } + + String? _createMessage(Message message) { + final fieldsContent = message.fields + .map( + (f) => f.isList + ? 'final List<${f.type}>${f.isOptional ? '?' : ''} ${f.name};' + : 'final ${f.type}${f.isOptional ? '?' : ''} ${f.name};', + ) + .join('\n'); + + final propsGetter = _createPropsGetter(message); + + var constructorParameters = message.fields + .map((e) => '${e.isOptional ? '' : 'required'} this.${e.name},') + .join(); + + constructorParameters = + message.fields.isEmpty ? '' : '{$constructorParameters}'; + + return ''' +@JsonSerializable() +class ${message.name} with EquatableMixin { + ${message.name}($constructorParameters); + + factory ${message.name}.fromJson(Map json) => _\$${message.name}FromJson(json); + + $fieldsContent + + Map toJson() => _\$${message.name}ToJson(this); + + $propsGetter +} +'''; + } + + String _createPropsGetter(Message message) { + final properties = message.fields.map((e) => e.name).join(','); + final propertiesContent = + properties.isEmpty ? 'const []' : '[$properties,]'; + + return ''' + @override + List get props => $propertiesContent; +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart new file mode 100644 index 000000000..ce48c3926 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_generator.dart @@ -0,0 +1,28 @@ +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/dart/dart_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/dart/dart_http_client_generator.dart'; +import 'package:patrol_gen/src/generators/dart/dart_shelf_server_generator.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class DartGenerator { + List generate(Schema schema, DartConfig config) { + final result = [ + DartContractsGenerator().generate(schema, config), + ]; + + final serverGenerator = DartShelfServerGenerator(); + final clientGenerator = DartHttpClientGenerator(); + + for (final service in schema.services) { + if (service.dart.needsServer) { + result.add(serverGenerator.generate(service, config)); + } + if (service.dart.needsClient) { + result.add(clientGenerator.generate(service, config)); + } + } + + return result; + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart new file mode 100644 index 000000000..5e7f9fdf2 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_http_client_generator.dart @@ -0,0 +1,120 @@ +import 'package:dart_style/dart_style.dart'; +import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class DartHttpClientGenerator { + OutputFile generate(Service service, DartConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_generateExceptionClass(service)) + ..write(_generateClientClass(service)); + + return OutputFile( + filename: config.clientFileName(service.name), + content: DartFormatter().format(buffer.toString()), + ); + } + + String _contentPrefix(DartConfig config) { + return ''' +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:http/http.dart' as http; + +import '${path.basename(config.contractsFilename)}'; +'''; + } + + String _generateClientClass(Service service) { + final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + + const headers = r''' +_headers = { + 'Connection': 'keep-alive', + 'Keep-Alive': 'timeout=${timeout.inSeconds}', +}'''; + + return ''' +class ${service.name}Client { + ${service.name}Client( + this._client, + this._apiUri, { + Duration timeout = const Duration(seconds: 30), + }) : _timeout = timeout, $headers; + + final Duration _timeout; + final http.Client _client; + final Uri _apiUri; + final Map _headers; + +$endpoints + + Future> _sendRequest( + String requestName, [ + Map? request, + ]) async { + final response = await _client + .post(_apiUri.resolve(requestName), body: jsonEncode(request), headers: _headers,) + .timeout(_timeout); + + if (response.statusCode != 200) { + throw NativeAutomatorClientException(response.statusCode, response.body); + } + + return response.body.isNotEmpty + ? jsonDecode(response.body) as Map + : {}; + } +} +'''; + } + + String _createEndpoint(Endpoint endpoint) { + final returnType = endpoint.response?.name ?? 'void'; + final parameter = + endpoint.request != null ? '${endpoint.request!.name} request,' : ''; + final jsonRequest = endpoint.request != null ? 'request.toJson(),' : ''; + final asyncKeyword = endpoint.response != null ? ' async ' : ''; + + final sendRequest = endpoint.response != null + ? ''' +final json = await _sendRequest('${endpoint.name}', $jsonRequest); +return ${endpoint.response!.name}.fromJson(json); +''' + : ''' +return _sendRequest('${endpoint.name}', $jsonRequest);'''; + + return ''' +Future<$returnType> ${endpoint.name}($parameter) $asyncKeyword { + $sendRequest +} +'''; + } + + String _generateExceptionClass(Service service) { + const toStringMethod = r''' +@override + String toString() { + return 'Invalid response: $statusCode $responseBody'; + }'''; + + return ''' +class ${service.name}ClientException implements Exception { + ${service.name}ClientException(this.statusCode, this.responseBody); + + final String responseBody; + final int statusCode; + + $toStringMethod +}'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart new file mode 100644 index 000000000..a4a06da53 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/dart/dart_shelf_server_generator.dart @@ -0,0 +1,110 @@ +import 'package:dart_style/dart_style.dart'; +import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class DartShelfServerGenerator { + OutputFile generate(Service service, DartConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + final handlerCalls = _generateHandlerCalls(service); + final handlers = _generateHandlers(service); + + buffer.write(_createServerClass(service, handlerCalls, handlers)); + + return OutputFile( + filename: config.serviceFileName(service.name), + content: DartFormatter().format(buffer.toString()), + ); + } + + String _contentPrefix(DartConfig config) { + return ''' +// +// Generated code. Do not modify. +// source: schema.dart +// +// ignore_for_file: public_member_api_docs + +import 'dart:async'; +import 'dart:convert'; + +import 'package:shelf/shelf.dart'; + +import '${path.basename(config.contractsFilename)}'; +'''; + } + + String _generateHandlerCalls(Service service) { + return service.endpoints.map((e) { + var requestDeserialization = ''; + var responseSerialization = ''; + + if (e.request != null) { + requestDeserialization = ''' +final stringContent = await request.readAsString(utf8); +final json = jsonDecode(stringContent); +final requestObj = ${e.request!.name}.fromJson(json as Map); +'''; + } + + final handlerCall = e.request != null + ? 'final result = await ${e.name}(requestObj);' + : 'final result = await ${e.name}();'; + + if (e.response != null) { + responseSerialization = ''' +final body = jsonEncode(result.toJson()); +return Response.ok(body);'''; + } + + final elseKeyword = e == service.endpoints.first ? '' : 'else'; + + return ''' +$elseKeyword if ('${e.name}' == request.url.path){ + +$requestDeserialization + +$handlerCall + +$responseSerialization +}'''; + }).join('\n'); + } + + String _generateHandlers(Service service) { + return service.endpoints.map((endpoint) { + final result = endpoint.response?.name ?? 'void'; + final request = + endpoint.request != null ? '${endpoint.request!.name} request' : ''; + + return 'Future<$result> ${endpoint.name}($request);'; + }).join('\n'); + } + + String _createServerClass( + Service service, + String handlerCalls, + String handlers, + ) { + var notFoundRespone = + r"return Response.notFound('Request ${request.url} not found');"; + if (service.endpoints.isNotEmpty) { + notFoundRespone = 'else { $notFoundRespone }'; + } + + return ''' +abstract class ${service.name}Server { + FutureOr handle(Request request) async { + +$handlerCalls + +$notFoundRespone + } + +$handlers +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_config.dart b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart new file mode 100644 index 000000000..79c7f2c17 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_config.dart @@ -0,0 +1,15 @@ +import 'package:path/path.dart' as path; + +class IOSConfig { + IOSConfig({ + required this.outputDirectory, + }) : contractsFilename = path.join(outputDirectory, 'Contracts.swift'); + + final String outputDirectory; + final String contractsFilename; + + String clientFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Client.swift'); + String serverFileName(String serviceName) => + path.join(outputDirectory, '${serviceName}Server.swift'); +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart new file mode 100644 index 000000000..d6288532d --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_contracts_generator.dart @@ -0,0 +1,71 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSContractsGenerator { + OutputFile generate(Schema schema, IOSConfig config) { + final buffer = StringBuffer()..write(_contentPrefix(config)); + + for (final enumDefinition in schema.enums) { + buffer.writeln(_createEnum(enumDefinition)); + } + for (final messageDefintion in schema.messages) { + buffer.writeln(_createMessage(messageDefintion)); + } + + return OutputFile( + filename: config.contractsFilename, + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +'''; + } + + String _createMessage(Message message) { + final fields = message.fields.map((e) { + final optional = e.isOptional ? '?' : ''; + return e.isList + ? ' var ${e.name}: [${_transformType(e.type)}]$optional' + : ' var ${e.name}: ${_transformType(e.type)}$optional'; + }).join('\n'); + + return ''' +struct ${message.name}: Codable { +$fields +} +'''; + } + + String _createEnum(Enum enumDefinition) { + final cases = enumDefinition.fields.map((e) => ' case $e').join('\n'); + + return ''' +enum ${enumDefinition.name}: String, Codable { +$cases +} +'''; + } + + String _transformType(String type) { + switch (type) { + case 'int': + return 'Int'; + case 'double': + return 'Double'; + case 'bool': + return 'Bool'; + default: + return type; + } + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart new file mode 100644 index 000000000..7d6e7a67c --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_flying_fox_server_generator.dart @@ -0,0 +1,126 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSFlyingFoxServerGenerator { + OutputFile generate(Service service, IOSConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_generateServerProtocol(service)) + ..writeln() + ..write(_generateHandlers(service)) + ..writeln() + ..write(_generateSetupRoutes(service)) + ..writeln() + ..write(_generateUtils()); + + return OutputFile( + filename: config.serverFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +import FlyingFox + +'''; + } + + String _generateServerProtocol(Service service) { + final endpoints = service.endpoints.map(_generateProtocolMethod).join('\n'); + + return ''' +protocol ${service.name}Server { +$endpoints +} +'''; + } + + String _generateProtocolMethod(Endpoint endpoint) { + final request = + endpoint.request != null ? 'request: ${endpoint.request!.name}' : ''; + final response = + endpoint.response != null ? ' -> ${endpoint.response!.name}' : ''; + return ' func ${endpoint.name}($request) async throws$response'; + } + + String _generateHandlers(Service service) { + final handlers = service.endpoints.map(_generateHandler).join('\n\n'); + return ''' +extension ${service.name}Server { +$handlers +} +'''; + } + + String _generateHandler(Endpoint endpoint) { + final requestArg = endpoint.request != null + ? ''' + + let requestArg = try await JSONDecoder().decode(${endpoint.request!.name}.self, from: request.bodyData)''' + : ''; + + final responseVariable = endpoint.response != null ? 'let response = ' : ''; + final response = endpoint.response != null + ? ''' + let body = try JSONEncoder().encode(response) + return HTTPResponse(statusCode: .ok, body: body)''' + : ' return HTTPResponse(statusCode: .ok)'; + + return ''' + private func ${endpoint.name}Handler(request: HTTPRequest) async throws -> HTTPResponse {$requestArg + ${responseVariable}try await ${endpoint.name}(${requestArg.isNotEmpty ? 'request: requestArg' : ''}) +$response + }'''; + } + + String _generateSetupRoutes(Service service) { + final routes = service.endpoints.map(_generateRoute).join('\n'); + + return ''' +extension ${service.name}Server { + func setupRoutes(server: HTTPServer) async { +$routes + } +} +'''; + } + + String _generateRoute(Endpoint endpoint) { + return ''' + await server.appendRoute("/${endpoint.name}") { request in + return await handleRequest( + request: request, + handler: ${endpoint.name}Handler) + }'''; + } + + String _generateUtils() { + // https://forums.swift.org/t/using-async-functions-from-synchronous-functions-and-breaking-all-the-rules/59782 + return ''' +extension NativeAutomatorServer { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) async -> HTTPResponse { + do { + return try await handler(request) + } catch let err { + return HTTPResponse(statusCode: .badRequest, headers: [:], body: err.localizedDescription.utf8Data) + } + } +} + +extension String { + var utf8Data: Data { + return data(using: .utf8)! + } +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart new file mode 100644 index 000000000..00443d4dd --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_generator.dart @@ -0,0 +1,28 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/ios/ios_contracts_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_telegraph_server_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_url_session_client_generator.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSGenerator { + List generate(Schema schema, IOSConfig config) { + final result = [ + IOSContractsGenerator().generate(schema, config), + ]; + + final serverGenerator = IOSTelegraphServerGenerator(); + final clientGenerator = IOSURLSessionClientGenerator(); + + for (final service in schema.services) { + if (service.ios.needsServer) { + result.add(serverGenerator.generate(service, config)); + } + if (service.ios.needsClient) { + result.add(clientGenerator.generate(service, config)); + } + } + + return result; + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart new file mode 100644 index 000000000..a51ef770b --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_telegraph_server_generator.dart @@ -0,0 +1,142 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSTelegraphServerGenerator { + OutputFile generate(Service service, IOSConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_generateServerProtocol(service)) + ..writeln() + ..write(_generateHandlers(service)) + ..writeln() + ..write(_generateSetupRoutes(service)) + ..writeln() + ..write(_generateUtils()); + + return OutputFile( + filename: config.serverFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +import Telegraph + +'''; + } + + String _generateServerProtocol(Service service) { + final endpoints = service.endpoints.map(_generateProtocolMethod).join('\n'); + + return ''' +protocol ${service.name}Server { +$endpoints +} +'''; + } + + String _generateProtocolMethod(Endpoint endpoint) { + final request = + endpoint.request != null ? 'request: ${endpoint.request!.name}' : ''; + final response = + endpoint.response != null ? ' -> ${endpoint.response!.name}' : ''; + return ' func ${endpoint.name}($request) async throws$response'; + } + + String _generateHandlers(Service service) { + final handlers = service.endpoints.map(_generateHandler).join('\n\n'); + return ''' +extension ${service.name}Server { +$handlers +} +'''; + } + + String _generateHandler(Endpoint endpoint) { + final requestArg = endpoint.request != null + ? ''' + + let requestArg = try JSONDecoder().decode(${endpoint.request!.name}.self, from: request.body)''' + : ''; + + final responseVariable = endpoint.response != null ? 'let response = ' : ''; + final response = endpoint.response != null + ? ''' + let body = try JSONEncoder().encode(response) + return HTTPResponse(.ok, body: body)''' + : ' return HTTPResponse(.ok)'; + + return ''' + private func ${endpoint.name}Handler(request: HTTPRequest) async throws -> HTTPResponse {$requestArg + ${responseVariable}try await ${endpoint.name}(${requestArg.isNotEmpty ? 'request: requestArg' : ''}) +$response + }'''; + } + + String _generateSetupRoutes(Service service) { + final routes = service.endpoints.map(_generateRoute).join('\n'); + + return ''' +extension ${service.name}Server { + func setupRoutes(server: Server) { +$routes + } +} +'''; + } + + String _generateRoute(Endpoint endpoint) { + return ''' + server.route(.POST, "${endpoint.name}") { + request in handleRequest( + request: request, + handler: ${endpoint.name}Handler) + }'''; + } + + String _generateUtils() { + // https://forums.swift.org/t/using-async-functions-from-synchronous-functions-and-breaking-all-the-rules/59782 + return ''' +fileprivate class Box { + var result: Result? = nil +} + +extension NativeAutomatorServer { + private func handleRequest(request: HTTPRequest, handler: @escaping (HTTPRequest) async throws -> HTTPResponse) -> HTTPResponse { + do { + return try unsafeWait { + return try await handler(request) + } + } catch let err { + return HTTPResponse(.badRequest, headers: [:], error: err) + } + } + + private func unsafeWait(_ f: @escaping () async throws -> ResultType) throws -> ResultType { + let box = Box() + let sema = DispatchSemaphore(value: 0) + Task { + do { + let val = try await f() + box.result = .success(val) + } catch { + box.result = .failure(error) + } + sema.signal() + } + sema.wait() + return try box.result!.get() + } +} +'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart new file mode 100644 index 000000000..7d0c8cabb --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/ios/ios_url_session_client_generator.dart @@ -0,0 +1,91 @@ +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/output_file.dart'; +import 'package:patrol_gen/src/schema.dart'; + +class IOSURLSessionClientGenerator { + OutputFile generate(Service service, IOSConfig config) { + final buffer = StringBuffer() + ..write(_contentPrefix(config)) + ..write(_createClass(service)); + + return OutputFile( + filename: config.clientFileName(service.name), + content: buffer.toString(), + ); + } + + String _contentPrefix(IOSConfig config) { + return ''' +/// +// swift-format-ignore-file +// +// Generated code. Do not modify. +// source: schema.dart +// + +'''; + } + + String _createClass(Service service) { + final endpoints = service.endpoints.map(_createEndpoint).join('\n\n'); + + const url = r'http://\(address):\(port)/\(requestName)'; + + const throwException = + r'throw PatrolError.internal("Invalid response: \(response) \(data)")'; + + return ''' +class ${service.name}Client { + private let port: Int + private let address: String + private let timeout: TimeInterval + + init(port: Int, address: String, timeout: TimeInterval) { + self.port = port + self.address = address + self.timeout = timeout + } + +$endpoints + + private func performRequest(requestName: String, body: Data? = nil) async throws -> TResult { + let url = URL(string: "$url")! + + let urlconfig = URLSessionConfiguration.default + urlconfig.timeoutIntervalForRequest = timeout + urlconfig.timeoutIntervalForResource = timeout + + var request = URLRequest(url: url) + request.httpMethod = "POST" + request.httpBody = body + request.timeoutInterval = timeout + + let (data, response) = try await URLSession(configuration: urlconfig).data(for: request) + guard (response as? HTTPURLResponse)?.statusCode == 200 else { + $throwException + } + + return try JSONDecoder().decode(TResult.self, from: data) + } +} +'''; + } + + String _createEndpoint(Endpoint endpoint) { + final parameterDef = + endpoint.request != null ? 'request: ${endpoint.request!.name}' : ''; + final returnDef = + endpoint.response != null ? '-> ${endpoint.response!.name}' : ''; + + final bodyCode = endpoint.request != null + ? '\n let body = try JSONEncoder().encode(request)' + : ''; + + final bodyArgument = bodyCode.isNotEmpty ? ', body: body' : ''; + + return ''' + func ${endpoint.name}($parameterDef) async throws $returnDef {$bodyCode + return try await performRequest(requestName: "${endpoint.name}"$bodyArgument) + }'''; + } +} diff --git a/packages/patrol_gen/lib/src/generators/output_file.dart b/packages/patrol_gen/lib/src/generators/output_file.dart new file mode 100644 index 000000000..84d9666c0 --- /dev/null +++ b/packages/patrol_gen/lib/src/generators/output_file.dart @@ -0,0 +1,6 @@ +class OutputFile { + const OutputFile({required this.filename, required this.content}); + + final String filename; + final String content; +} diff --git a/packages/patrol_gen/lib/src/patrol_gen.dart b/packages/patrol_gen/lib/src/patrol_gen.dart new file mode 100644 index 000000000..27b1b9295 --- /dev/null +++ b/packages/patrol_gen/lib/src/patrol_gen.dart @@ -0,0 +1,38 @@ +import 'dart:io'; + +import 'package:patrol_gen/src/generators/android/android_config.dart'; +import 'package:patrol_gen/src/generators/android/android_generator.dart'; +import 'package:patrol_gen/src/generators/dart/dart_config.dart'; +import 'package:patrol_gen/src/generators/dart/dart_generator.dart'; +import 'package:patrol_gen/src/generators/ios/ios_config.dart'; +import 'package:patrol_gen/src/generators/ios/ios_generator.dart'; +import 'package:patrol_gen/src/resolve_schema.dart'; + +class PatrolGenConfig { + const PatrolGenConfig({ + required this.schemaFilename, + required this.dartConfig, + required this.iosConfig, + required this.androidConfig, + }); + + final AndroidConfig androidConfig; + final IOSConfig iosConfig; + final DartConfig dartConfig; + final String schemaFilename; +} + +class PatrolGen { + Future run(PatrolGenConfig config) async { + final schema = await resolveSchema(config.schemaFilename); + + final files = DartGenerator().generate(schema, config.dartConfig) + ..addAll(IOSGenerator().generate(schema, config.iosConfig)) + ..addAll(AndroidGenerator().generate(schema, config.androidConfig)); + + for (final outputFile in files) { + await File(outputFile.filename) + .writeAsString(outputFile.content, flush: true); + } + } +} diff --git a/packages/patrol_gen/lib/src/resolve_schema.dart b/packages/patrol_gen/lib/src/resolve_schema.dart new file mode 100644 index 000000000..ad1b515c0 --- /dev/null +++ b/packages/patrol_gen/lib/src/resolve_schema.dart @@ -0,0 +1,130 @@ +import 'package:analyzer/dart/analysis/results.dart'; +import 'package:analyzer/dart/analysis/utilities.dart'; +import 'package:analyzer/dart/ast/ast.dart'; +import 'package:path/path.dart' as path; +import 'package:patrol_gen/src/schema.dart'; + +Future resolveSchema(String schemaPath) async { + final file = path.normalize(path.absolute(schemaPath)); + final result = await resolveFile2(path: file); + + final enums = []; + final messages = []; + final classServices = []; + + if (result is ResolvedUnitResult) { + for (final declaration in result.unit.declarations) { + if (declaration is EnumDeclaration) { + enums.add( + Enum( + declaration.name.lexeme, + declaration.constants.map((e) => e.name.lexeme).toList(), + ), + ); + } else if (declaration is ClassDeclaration) { + if (declaration.abstractKeyword != null) { + classServices.add(declaration); + } else { + messages.add(_createMessage(declaration)); + } + } + } + } + + return Schema( + enums, + messages, + classServices.map((e) => _createService(e, messages)).toList(), + ); +} + +Service _createService(ClassDeclaration declaration, List messages) { + final genericTypes = declaration.typeParameters?.typeParameters + .map((e) => e.name.lexeme) + .toSet() ?? + {}; + + final iosGenConfig = ServiceGenConfig( + needsClient: genericTypes.contains('IOSClient'), + needsServer: genericTypes.contains('IOSServer'), + ); + + final dartGenConfig = ServiceGenConfig( + needsClient: genericTypes.contains('DartClient'), + needsServer: genericTypes.contains('DartServer'), + ); + + final androidGenConfig = ServiceGenConfig( + needsClient: genericTypes.contains('AndroidClient'), + needsServer: genericTypes.contains('AndroidServer'), + ); + + return Service( + declaration.name.lexeme, + iosGenConfig, + dartGenConfig, + androidGenConfig, + declaration.members.whereType().map((method) { + final returnType = method.returnType; + if (returnType is NamedType) { + final responseMessage = returnType.name2.lexeme == 'void' + ? null + : messages.firstWhere((msg) => msg.name == returnType.name2.lexeme); + + Message? requestMessage; + if (method.parameters!.parameters.isNotEmpty) { + final parameter = method.parameters!.parameters.first; + if (parameter is SimpleFormalParameter) { + final parameterTypeName = + (parameter.type! as NamedType).name2.lexeme; + + requestMessage = + messages.firstWhere((msg) => msg.name == parameterTypeName); + } else { + throw UnsupportedError('unsupported parameter $parameter'); + } + } + + return Endpoint(responseMessage, requestMessage, method.name.lexeme); + } else { + throw UnsupportedError('unsupported return type $returnType'); + } + }).toList(), + ); +} + +Message _createMessage(ClassDeclaration declaration) { + return Message( + declaration.name.lexeme, + declaration.members + .whereType() + .map((e) => e.fields) + .whereType() + .map((e) { + final type = e.type; + if (type is NamedType) { + final isOptional = type.question != null; + final fieldName = e.variables.first.name.lexeme; + + if (type.type?.isDartCoreList ?? false) { + final genericType = type.typeArguments!.arguments.first as NamedType; + return MessageField( + isOptional: isOptional, + name: fieldName, + type: genericType.name2.lexeme, + isList: true, + ); + } else { + return MessageField( + isOptional: isOptional, + name: fieldName, + type: type.name2.lexeme, + isList: false, + ); + } + } else { + throw UnsupportedError('unsupported type $type'); + } + }).toList(), + ); +} diff --git a/packages/patrol_gen/lib/src/schema.dart b/packages/patrol_gen/lib/src/schema.dart new file mode 100644 index 000000000..7d40d3179 --- /dev/null +++ b/packages/patrol_gen/lib/src/schema.dart @@ -0,0 +1,63 @@ +class Enum { + const Enum(this.name, this.fields); + + final String name; + final List fields; +} + +class MessageField { + const MessageField({ + required this.name, + required this.type, + required this.isOptional, + required this.isList, + }); + + final bool isOptional; + final bool isList; + final String name; + final String type; +} + +class Message { + const Message(this.name, this.fields); + + final String name; + final List fields; +} + +class Endpoint { + const Endpoint(this.response, this.request, this.name); + + final Message? response; + final Message? request; + final String name; +} + +class ServiceGenConfig { + const ServiceGenConfig({ + required this.needsClient, + required this.needsServer, + }); + + final bool needsClient; + final bool needsServer; +} + +class Service { + const Service(this.name, this.ios, this.dart, this.android, this.endpoints); + + final List endpoints; + final String name; + final ServiceGenConfig ios; + final ServiceGenConfig dart; + final ServiceGenConfig android; +} + +class Schema { + const Schema(this.enums, this.messages, this.services); + + final List enums; + final List messages; + final List services; +} diff --git a/packages/patrol_gen/lib/src/utils.dart b/packages/patrol_gen/lib/src/utils.dart new file mode 100644 index 000000000..606ce3065 --- /dev/null +++ b/packages/patrol_gen/lib/src/utils.dart @@ -0,0 +1,9 @@ +import 'package:path/path.dart' as p; + +String normalizePath(String path) => p.normalize(p.absolute(path)); + +extension StringExtension on String { + String capitalize() { + return '${this[0].toUpperCase()}${substring(1)}'; + } +} diff --git a/packages/patrol_gen/pubspec.lock b/packages/patrol_gen/pubspec.lock new file mode 100644 index 000000000..a7f24b26e --- /dev/null +++ b/packages/patrol_gen/pubspec.lock @@ -0,0 +1,189 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" + source: hosted + version: "64.0.0" + analyzer: + dependency: "direct main" + description: + name: analyzer + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + dart_style: + dependency: "direct main" + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter_lints: + dependency: transitive + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + leancode_lint: + dependency: "direct dev" + description: + name: leancode_lint + sha256: "7351ee2eebd94944880d4d58ac56a3f2fa0fbde3372f73337b3b8f734905078a" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + meta: + dependency: "direct main" + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: "direct main" + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.0 <4.0.0" diff --git a/packages/patrol_gen/pubspec.yaml b/packages/patrol_gen/pubspec.yaml new file mode 100644 index 000000000..363972ed6 --- /dev/null +++ b/packages/patrol_gen/pubspec.yaml @@ -0,0 +1,20 @@ +name: patrol_gen +description: > + Generate contracts for all languages +version: 0.0.1 +publish_to: none +homepage: https://patrol.leancode.co +repository: https://github.com/leancodepl/patrol +issue_tracker: https://github.com/leancodepl/patrol/issues + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + analyzer: ^6.1.0 + dart_style: ^2.3.2 + meta: ^1.7.0 + path: ^1.8.2 + +dev_dependencies: + leancode_lint: ^3.0.0 diff --git a/schema.dart b/schema.dart new file mode 100644 index 000000000..d117a8707 --- /dev/null +++ b/schema.dart @@ -0,0 +1,218 @@ +/// Schema supports: +// - enum definition +// - late type name - required field definition +// - type? name - optional field definition +// - abstract class - service definition where we define: +// - ResponseModel endpointName(RequestModel) - endpoint definition (void = no response) +// - Generic types (IOSServer, IOSClient, AndroidServer, AndroidClient, DartServer, DartClient) +// control where we need clients and servers + +class DartGroupEntry { + late String name; + late GroupEntryType type; + late List entries; +} + +enum GroupEntryType { group, test } + +class ListDartTestsResponse { + late DartGroupEntry group; +} + +enum RunDartTestResponseResult { + success, + skipped, + failure, +} + +class RunDartTestRequest { + late String name; +} + +class RunDartTestResponse { + late RunDartTestResponseResult result; + String? details; +} + +abstract class PatrolAppService { + ListDartTestsResponse listDartTests(); + RunDartTestResponse runDartTest(RunDartTestRequest request); +} + +class ConfigureRequest { + late int findTimeoutMillis; +} + +class OpenAppRequest { + late String appId; +} + +class OpenQuickSettingsRequest {} + +class Selector { + String? text; + String? textStartsWith; + String? textContains; + String? className; + String? contentDescription; + String? contentDescriptionStartsWith; + String? contentDescriptionContains; + String? resourceId; + int? instance; + bool? enabled; + bool? focused; + String? pkg; +} + +class GetNativeViewsRequest { + late Selector selector; + late String appId; +} + +class NativeView { + String? className; + String? text; + String? contentDescription; + late bool focused; + late bool enabled; + int? childCount; + String? resourceName; + String? applicationPackage; + late List children; +} + +class GetNativeViewsResponse { + late List nativeViews; +} + +class TapRequest { + late Selector selector; + late String appId; +} + +enum KeyboardBehavior { + showAndDismiss, + alternative, +} + +class EnterTextRequest { + late String data; + late String appId; + int? index; + Selector? selector; + late KeyboardBehavior keyboardBehavior; +} + +class SwipeRequest { + late double startX; + late double startY; + late double endX; + late double endY; + late int steps; +} + +class WaitUntilVisibleRequest { + late Selector selector; + late String appId; +} + +class DarkModeRequest { + late String appId; +} + +class Notification { + String? appName; + late String title; + late String content; + String? raw; +} + +class GetNotificationsResponse { + late List notifications; +} + +class GetNotificationsRequest {} + +class TapOnNotificationRequest { + int? index; + Selector? selector; +} + +class PermissionDialogVisibleResponse { + late bool visible; +} + +class PermissionDialogVisibleRequest { + late int timeoutMillis; +} + +enum HandlePermissionRequestCode { + whileUsing, + onlyThisTime, + denied, +} + +class HandlePermissionRequest { + late HandlePermissionRequestCode code; +} + +enum SetLocationAccuracyRequestLocationAccuracy { + coarse, + fine, +} + +class SetLocationAccuracyRequest { + late SetLocationAccuracyRequestLocationAccuracy locationAccuracy; +} + +abstract class NativeAutomator { + void initialize(); + void configure(ConfigureRequest request); + +// general + void pressHome(); + void pressBack(); + void pressRecentApps(); + void doublePressRecentApps(); + void openApp(OpenAppRequest request); + void openQuickSettings(OpenQuickSettingsRequest request); + +// general UI interaction + GetNativeViewsResponse getNativeViews(GetNativeViewsRequest request); + void tap(TapRequest request); + void doubleTap(TapRequest request); + void enterText(EnterTextRequest request); + void swipe(SwipeRequest request); + void waitUntilVisible(WaitUntilVisibleRequest request); + +// services + void enableAirplaneMode(); + void disableAirplaneMode(); + void enableWiFi(); + void disableWiFi(); + void enableCellular(); + void disableCellular(); + void enableBluetooth(); + void disableBluetooth(); + void enableDarkMode(DarkModeRequest request); + void disableDarkMode(DarkModeRequest request); + +// notifications + void openNotifications(); + void closeNotifications(); + void closeHeadsUpNotification(); + GetNotificationsResponse getNotifications(GetNotificationsRequest request); + void tapOnNotification(TapOnNotificationRequest request); + +// permissions + PermissionDialogVisibleResponse isPermissionDialogVisible( + PermissionDialogVisibleRequest request); + void handlePermissionDialog(HandlePermissionRequest request); + void setLocationAccuracy(SetLocationAccuracyRequest request); + +// other + void debug(); + +// TODO(bartekpacia): Move this RPC into a new PatrolNativeTestService service because it doesn't fit here + void markPatrolAppServiceReady(); +}